aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-06-18 02:12:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-06-18 02:12:56 +0200
commit3b727ccb70d288b30d3af5d7964e703bc47b33fb (patch)
tree413540d0264cecffcc6a6a306953c910958118b5
parentd86b4c3907a78ab8785bcd6342ca233d0fe23ed0 (diff)
downloadbusybox-w32-3b727ccb70d288b30d3af5d7964e703bc47b33fb.tar.gz
busybox-w32-3b727ccb70d288b30d3af5d7964e703bc47b33fb.tar.bz2
busybox-w32-3b727ccb70d288b30d3af5d7964e703bc47b33fb.zip
add a comment about sed and suid bits
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/sed.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/editors/sed.c b/editors/sed.c
index a5ef400fc..28f0c7318 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1365,6 +1365,8 @@ int sed_main(int argc UNUSED_PARAM, char **argv)
1365 1365
1366 /* Set permissions/owner of output file */ 1366 /* Set permissions/owner of output file */
1367 fstat(fileno(file), &statbuf); 1367 fstat(fileno(file), &statbuf);
1368 /* chmod'ing AFTER chown would preserve suid/sgid bits,
1369 * but GNU sed 4.2.1 does not preserve them either */
1368 fchmod(nonstdoutfd, statbuf.st_mode); 1370 fchmod(nonstdoutfd, statbuf.st_mode);
1369 fchown(nonstdoutfd, statbuf.st_uid, statbuf.st_gid); 1371 fchown(nonstdoutfd, statbuf.st_uid, statbuf.st_gid);
1370 add_input_file(file); 1372 add_input_file(file);