aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-13 09:09:07 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-13 09:09:07 +0100
commit5799248976c1227663c4c9b7758e64dee3d5185b (patch)
tree5cfdd50b3937efec6142f1e88e82d155f28e834b
parent6331cf059ccfdf35f4e5a505cbae885094cc41b0 (diff)
downloadbusybox-w32-5799248976c1227663c4c9b7758e64dee3d5185b.tar.gz
busybox-w32-5799248976c1227663c4c9b7758e64dee3d5185b.tar.bz2
busybox-w32-5799248976c1227663c4c9b7758e64dee3d5185b.zip
sed: on output file, set not only mode, but owner too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/sed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/sed.c b/editors/sed.c
index cc609c3f6..c1ee7502a 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1340,10 +1340,10 @@ int sed_main(int argc UNUSED_PARAM, char **argv)
1340 bb_perror_msg_and_die("can't create temp file %s", G.outname); 1340 bb_perror_msg_and_die("can't create temp file %s", G.outname);
1341 G.nonstdout = fdopen(nonstdoutfd, "w"); 1341 G.nonstdout = fdopen(nonstdoutfd, "w");
1342 1342
1343 /* Set permissions of output file */ 1343 /* Set permissions/owner of output file */
1344
1345 fstat(fileno(file), &statbuf); 1344 fstat(fileno(file), &statbuf);
1346 fchmod(nonstdoutfd, statbuf.st_mode); 1345 fchmod(nonstdoutfd, statbuf.st_mode);
1346 fchown(nonstdoutfd, statbuf.st_uid, statbuf.st_gid);
1347 add_input_file(file); 1347 add_input_file(file);
1348 process_files(); 1348 process_files();
1349 fclose(G.nonstdout); 1349 fclose(G.nonstdout);