projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6331cf0
)
sed: on output file, set not only mode, but owner too
author
Denys Vlasenko
<vda.linux@googlemail.com>
Fri, 13 Nov 2009 08:09:07 +0000
(09:09 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Fri, 13 Nov 2009 08:09:07 +0000
(09:09 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/sed.c
patch
|
blob
|
history
diff --git
a/editors/sed.c
b/editors/sed.c
index cc609c3f6809f0b1fb916dcc32e4ea526b81b845..c1ee7502a2dd11dd1df4654d7ee07c9f5e3beb2c 100644
(file)
--- a/
editors/sed.c
+++ b/
editors/sed.c
@@
-1340,10
+1340,10
@@
int sed_main(int argc UNUSED_PARAM, char **argv)
bb_perror_msg_and_die("can't create temp file %s", G.outname);
G.nonstdout = fdopen(nonstdoutfd, "w");
- /* Set permissions of output file */
-
+ /* Set permissions/owner of output file */
fstat(fileno(file), &statbuf);
fchmod(nonstdoutfd, statbuf.st_mode);
+ fchown(nonstdoutfd, statbuf.st_uid, statbuf.st_gid);
add_input_file(file);
process_files();
fclose(G.nonstdout);