Skip to content

Commit

Permalink
6 random bits in the temp filename really should be enough (= 62^6 co…
Browse files Browse the repository at this point in the history
…mbinations)

Committed from host : Bola
  • Loading branch information
RJVB committed Sep 26, 2016
1 parent d3cdfaf commit f7883b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions afsctool.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ void compressFile(const char *inFile, struct stat *inFileInfo, struct folder_inf
// add the processor ID for the unlikely case that 2 threads try to backup a file with the same name
// at the same time, and mkstemps() somehow generates the same temp. name. I've seen it generate EEXIST
// errors which suggest that might indeed happen.
bkNameLen = asprintf(&backupName, "/tmp/afsctbk.%d.XXXXXXXXXX.%s", currentParallelProcesorID(worker), inname);
bkNameLen = asprintf(&backupName, "/tmp/afsctbk.%d.XXXXXX.%s", currentParallelProcesorID(worker), inname);
#else
bkNameLen = asprintf(&backupName, "/tmp/afsctbk.XXXXXXXXXX.%s", inname);
bkNameLen = asprintf(&backupName, "/tmp/afsctbk.XXXXXX.%s", inname);
#endif
}
if (!infile || bkNameLen < 0)
Expand Down

0 comments on commit f7883b5

Please sign in to comment.