diff options
| author | Jim Meyering <jim@meyering.net> | 2007-09-07 10:37:08 +0200 |
|---|---|---|
| committer | Jim Meyering <jim@meyering.net> | 2007-09-07 10:45:22 +0200 |
| commit | 500eccdbe4d55b0cbf48cf264aa4232abd7c23df (patch) | |
| tree | 5a08a351c3b6615f77d39c9946e99d7583106215 /src/chmod.c | |
| parent | Add a test: demonstrate that chmod ignores a dangling symlink (diff) | |
| download | coreutils-500eccdbe4d55b0cbf48cf264aa4232abd7c23df.tar.gz coreutils-500eccdbe4d55b0cbf48cf264aa4232abd7c23df.zip | |
chmod: don't ignore a dangling symlink
* NEWS: Mention the bug fix.
* src/chmod.c (process_file): Handle the case of FTS_SLNONE,
i.e., give a diagnostic saying we cannot operate on such a file.
* tests/chmod/thru-dangling: Compare new stderr output with expected.
Diffstat (limited to 'src/chmod.c')
| -rw-r--r-- | src/chmod.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/chmod.c b/src/chmod.c index a67055420..a22e5c127 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -1,5 +1,5 @@ /* chmod -- change permission modes of files - Copyright (C) 89, 90, 91, 1995-2006 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2007 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 @@ -220,6 +220,11 @@ process_file (FTS *fts, FTSENT *ent) ok = false; break; + case FTS_SLNONE: + error (0, 0, _("cannot operate on dangling symlink %s"), + quote (file_full_name)); + ok = false; + default: break; } |
