← Commit list

579924897

Denys Vlasenko
Denys Vlasenko
2009-11-13
FAILED Duration: 28s

Subject

sed: on output file, set not only mode, but owner too

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/sed.c+2 -2
@@ -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);