X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffchownat.c;h=65ced30b5ba3de6449be2efd19acfde5116efe61;hb=7ef6c64e210ac0979d7e8ac69bc5b5208c2405ab;hp=00126acf0910993e2690f0aac92ee0db9cf832e8;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/lib/fchownat.c b/lib/fchownat.c index 00126acf0..65ced30b5 100644 --- a/lib/fchownat.c +++ b/lib/fchownat.c @@ -4,7 +4,7 @@ when the buggy fchownat-with-AT_SYMLINK_NOFOLLOW operates on a symlink, it mistakenly affects the symlink referent, rather than the symlink itself. - Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2009-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,15 +66,15 @@ static int local_lchownat (int fd, char const *file, uid_t owner, gid_t group); -# define AT_FUNC_NAME local_lchownat -# define AT_FUNC_F1 lchown -# define AT_FUNC_POST_FILE_PARAM_DECLS , uid_t owner, gid_t group -# define AT_FUNC_POST_FILE_ARGS , owner, group -# include "at-func.c" -# undef AT_FUNC_NAME -# undef AT_FUNC_F1 -# undef AT_FUNC_POST_FILE_PARAM_DECLS -# undef AT_FUNC_POST_FILE_ARGS +# define AT_FUNC_NAME local_lchownat +# define AT_FUNC_F1 lchown +# define AT_FUNC_POST_FILE_PARAM_DECLS , uid_t owner, gid_t group +# define AT_FUNC_POST_FILE_ARGS , owner, group +# include "at-func.c" +# undef AT_FUNC_NAME +# undef AT_FUNC_F1 +# undef AT_FUNC_POST_FILE_PARAM_DECLS +# undef AT_FUNC_POST_FILE_ARGS # endif @@ -88,6 +88,13 @@ rpl_fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag) if (flag == AT_SYMLINK_NOFOLLOW) return local_lchownat (fd, file, owner, group); # endif +# if FCHOWNAT_EMPTY_FILENAME_BUG + if (file[0] == '\0') + { + errno = ENOENT; + return -1; + } +# endif # if CHOWN_TRAILING_SLASH_BUG { size_t len = strlen (file);