diff -ur fileutils-4.1-1/src/copy.c fileutils-4.1-1a/src/copy.c --- fileutils-4.1-1/src/copy.c Fri Jun 15 15:20:08 2001 +++ fileutils-4.1-1a/src/copy.c Sat May 11 17:50:11 2002 @@ -37,12 +37,22 @@ #include "quote.h" #include "same.h" +#if defined(__CYGWIN__) +#define DO_CHOWN(Chown, File, New_uid, New_gid) \ + (Chown (File, New_uid, New_gid) \ + /* On cygwin, SYSTEM has uid = 18 and we treat that as \ + root. Also, cygwin returns EACCES when non-"root" \ + attempts to chown ... */ \ + && ((errno != EPERM && errno != EINVAL && errno != EACCES) || \ + x->myeuid == 18)) +#else #define DO_CHOWN(Chown, File, New_uid, New_gid) \ (Chown (File, New_uid, New_gid) \ /* If non-root uses -p, it's ok if we can't preserve ownership. \ But root probably wants to know, e.g. if NFS disallows it, \ or if the target system doesn't support file ownership. */ \ && ((errno != EPERM && errno != EINVAL) || x->myeuid == 0)) +#endif #define SAME_OWNER(A, B) ((A).st_uid == (B).st_uid) #define SAME_GROUP(A, B) ((A).st_gid == (B).st_gid)