diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2010-05-03 12:20:00 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2010-05-03 12:20:00 +0200 |
commit | 76aa1070c87e463ae4ea781dd5e0b1709c577d04 (patch) | |
tree | 9f1fc91c52d3d5e1b6a5204985a6ec4f28039ef0 | |
parent | 0e952c6d344223b3bdd988f1978137fbcc450ef6 (diff) | |
download | patch-76aa1070c87e463ae4ea781dd5e0b1709c577d04.tar.gz |
Do not try to set file permissions of symlinks
* src/pch.c (fetchmode): Document that the "diff --git" format does
not store file permissions of symlinks.
* src/util.c (set_file_attributes): Since we don't have symlink file
permissions, don't try to set them even on systems where we could.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/pch.c | 4 | ||||
-rw-r--r-- | src/util.c | 5 |
3 files changed, 13 insertions, 1 deletions
@@ -1,5 +1,10 @@ 2009-05-02 Andreas Gruenbacher <agruen@suse.de> + * src/pch.c (fetchmode): Document that the "diff --git" format does + not store file permissions of symlinks. + * src/util.c (set_file_attributes): Since we don't have symlink file + permissions, don't try to set them even on systems where we could. + * tests/symlinks: Improve the backup file tests. 2009-05-02 Andreas Gruenbacher <agruen@suse.de> @@ -335,6 +335,10 @@ fetchmode (char const *str) if (*s != '\n') mode = 0; + /* NOTE: The "diff --git" format always sets the file mode permission + bits of symlinks to 0. (On Linux, symlinks actually always have + 0777 permissions, so this is not even consistent.) */ + return mode; } @@ -173,7 +173,10 @@ set_file_attributes (char const *to, enum file_attributes attr, { if (! mode) mode = st->st_mode; -#ifdef HAVE_LCHMOD +#if 0 && defined HAVE_LCHMOD + /* The "diff --git" format does not store the file permissions of + symlinks, so don't try to set symlink file permissions even on + systems where we could. */ if (lchmod (to, mode)) #else if (! S_ISLNK (mode) && chmod (to, mode) != 0) |