← Commit list

2b7515ae8e

Viktor Szakats
Viktor Szakats
2025-11-24
SUCCESS Duration: 152s

Subject

tftpd: fix/tidy up `open()` mode flags

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 →

tests/server/tftpd.c+9 -1
@@ -445,7 +445,15 @@ static ssize_t write_behind(struct testcase *test, int convert)
if(!test->ofile) {
char outfile[256];
snprintf(outfile, sizeof(outfile), "%s/upload.%ld", logdir, test->testno);
- test->ofile = open(outfile, O_CREAT|O_RDWR|CURL_O_BINARY, 0777);
+ test->ofile = open(outfile, O_CREAT | O_RDWR | CURL_O_BINARY,
+#ifdef _WIN32
+ S_IREAD | S_IWRITE
+#else
+ S_IRUSR | S_IWUSR | S_IXUSR |
+ S_IRGRP | S_IWGRP | S_IXGRP |
+ S_IROTH | S_IWOTH | S_IXOTH
+#endif
+ );
if(test->ofile == -1) {
logmsg("Could not create and/or open file %s for upload!", outfile);
return -1; /* failure! */