diff options
author | Jim Meyering <meyering@redhat.com> | 2008-03-31 13:40:54 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-03-31 13:46:34 +0200 |
commit | f433c3835fa7faadaff73526ce429b1140bdbc5e (patch) | |
tree | 566ab5a6b02fc403f15fbeccaa6da7cbe4dafbea /src | |
parent | 0d34887fe9912b65c1223cfefcaa9bf71c89b40c (diff) | |
download | coreutils-f433c3835fa7faadaff73526ce429b1140bdbc5e.tar.xz |
"rm -r DIR" would mistakenly prompt about very long names
* src/remove.c (write_protected_non_symlink): Return 0(-1) when
euidaccess_stat pronounces a writable(not-writable) file, not -1(0).
* tests/rm/deep-2: New file. Test for the above-fixed bug.
* tests/rm/Makefile.am (TESTS): Add deep-2.
Discovered while reviewing this change:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13071
Diffstat (limited to 'src')
-rw-r--r-- | src/remove.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/remove.c b/src/remove.c index 9c6dc9ee2..7ba1e38ef 100644 --- a/src/remove.c +++ b/src/remove.c @@ -799,7 +799,7 @@ write_protected_non_symlink (int fd_cwd, = obstack_object_size (&ds->dir_stack) + strlen (file); if (MIN (PATH_MAX, 8192) <= file_name_len) - return - euidaccess_stat (buf, W_OK); + return euidaccess_stat (buf, W_OK) ? 0 : -1; if (euidaccess (xfull_filename (ds, file), W_OK) == 0) return 0; if (errno == EACCES) |