Looking at m4/chown.m4, the test for defining CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE uses the wrong sense, since ac_cv_func_chown_works is yes iff not cross-compiling and chown(f,-1,-1) didn't change the struct stat owners. Furthermore, in lib/chown.c, when this C macro is defined, the code violates POSIX by not returning -1 on failure.
One potential issue not solved by this patch is whether rpl_chown should use getuid/getgid rather than stat. Another potential issue is that when cross-compiling, AC_FUNC_CHOWN defaults to no, but gl_FUNC_CHOWN_FOLLOWS_SYMLINK defaults to yes, meaning that rpl_chown will be active, and will try to call chown. Are there any systems targetted by gnulib that don't even have a chown(2)? (This is not an issue on native compiles, since if chown doesn't exist, gl_FUNC_CHOWN_FOLLOWS_SYMLINK will be no, and rpl_chown then falls back on fchown which is properly stubbed). lib/ChangeLog: 2005-05-17 Eric Blake <[EMAIL PROTECTED]> (tiny change) * chown.c (rpl_chown): Return -1 on failure. m4/ChangeLog: 2005-05-17 Eric Blake <[EMAIL PROTECTED]> (tiny change) * chown.m4 (gl_FUNC_CHOWN): Correct sense of test for honoring IDs of -1. -- Eric Blake
gnulib.patch
Description: Binary data
_______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib