← Commit list

e111a1640

Ari Sundholm
Ari Sundholm
2016-01-13
SUCCESS Duration: 194s

Subject

truncate: always set mode when opening file to avoid fortify errors

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 →

coreutils/truncate.c+1 -1
@@ -64,7 +64,7 @@ int truncate_main(int argc UNUSED_PARAM, char **argv)
argv += optind;
while (*argv) {
- int fd = open(*argv, flags);
+ int fd = open(*argv, flags, 0666);
if (fd < 0) {
if (errno != ENOENT || !(opts & OPT_NOCREATE)) {
bb_perror_msg("%s: open", *argv);