X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnu%2Ffchownat.c;h=6892fd03d1948399cc037a782e22777ba60bb5e0;hb=1a44d77d50f4fb37c0410eed04b82303624ea2ec;hp=87c54937a5dd9f96f9657f4033780bc5690355ce;hpb=dda6367c9eac71da8f2ab1c60b3df60f19ce4755;p=debian%2Ftar diff --git a/gnu/fchownat.c b/gnu/fchownat.c index 87c54937..6892fd03 100644 --- a/gnu/fchownat.c +++ b/gnu/fchownat.c @@ -6,7 +6,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-2011 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 @@ -68,15 +68,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 @@ -90,6 +90,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);