[git commit master 1/1] add a comment about sed and suid bits
Denys Vlasenko
vda.linux at googlemail.com
Fri Jun 18 00:12:56 UTC 2010
commit: http://git.busybox.net/busybox/commit/?id=3b727ccb70d288b30d3af5d7964e703bc47b33fb
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
editors/sed.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/editors/sed.c b/editors/sed.c
index a5ef400..28f0c73 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1365,6 +1365,8 @@ int sed_main(int argc UNUSED_PARAM, char **argv)
/* Set permissions/owner of output file */
fstat(fileno(file), &statbuf);
+ /* chmod'ing AFTER chown would preserve suid/sgid bits,
+ * but GNU sed 4.2.1 does not preserve them either */
fchmod(nonstdoutfd, statbuf.st_mode);
fchown(nonstdoutfd, statbuf.st_uid, statbuf.st_gid);
add_input_file(file);
--
1.7.1
More information about the busybox-cvs
mailing list