]
)
+AC_MSG_CHECKING([if lchown exists])
+AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <unistd.h>
+ ], [
+ lchown("", -1, -1);
+ ], [
+ AC_DEFINE(HAVE_LCHOWN, 1, [defined when LCHOWN exists])
+ AC_MSG_RESULT([yes])
+ ], [
+ AC_MSG_RESULT([no])
+ ]
+)
+
AC_ARG_ENABLE(tbz2tool,
AC_HELP_STRING([--enable-tbz2tool],[build tbz2tool, tool for creating binpkgs (default yes)]),
[case "${enableval}" in
trg, strerror(errno));
return(-1);
}
- if (lchown(trg, s.st_uid, s.st_gid) != 0) {
+ if (chown(trg, s.st_uid, s.st_gid) != 0) {
fprintf(stderr, "failed to set ownership of %s: %s\n",
trg, strerror(errno));
return(-1);
src, strerror(errno));
return(-1);
}
+#ifdef HAVE_LCHOWN
if (lchown(trg, s.st_uid, s.st_gid) != 0) {
fprintf(stderr, "failed to set ownership of %s: %s\n",
trg, strerror(errno));
return(-1);
}
+#endif
}
/* restore modified path */
trg, strerror(errno));
return(-1);
}
- if (lchown(trg, s.st_uid, s.st_gid) != 0) {
+ if (chown(trg, s.st_uid, s.st_gid) != 0) {
fprintf(stderr, "failed to set ownership of %s: %s\n",
trg, strerror(errno));
return(-1);