summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2012-09-13 14:40:27 +0200
committerAndreas Gruenbacher <agruen@linbit.com>2012-09-13 16:31:25 +0200
commitdc3cdeebca6639aac25a7d87dea816a03ed345da (patch)
treec3b6c7483291bebbd33cbb4cfa9d39dc6670e920
parent474bb7d3331e18e76c04c112fb458632e4a56be6 (diff)
downloadpatch-dc3cdeebca6639aac25a7d87dea816a03ed345da.tar.gz
Do not pass file type in mode of open(..., O_CREAT, mode)
* src/patch.c (main): Strip file type off of create mode for temporary output files: some systems don't ignore the file type; we want to create a regular file even when patching a symlink.
-rw-r--r--src/patch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/patch.c b/src/patch.c
index febfd42..1c6fb4b 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -297,7 +297,8 @@ main (int argc, char **argv)
tmpoutst.st_size = -1;
outfd = make_tempfile (&TMPOUTNAME, 'o', outname,
- O_WRONLY | binary_transput, instat.st_mode);
+ O_WRONLY | binary_transput,
+ instat.st_mode & S_IRWXUGO);
TMPOUTNAME_needs_removal = 1;
if (diff_type == ED_DIFF) {
outstate.zero_output = false;