6d27725c2b
bug fix, security fixes, Y2K fixes.
21 lines
846 B
Plaintext
21 lines
846 B
Plaintext
$OpenBSD: patch-indxbib_indxbib_cc,v 1.1 2000/04/20 22:40:42 espie Exp $
|
|
--- indxbib/indxbib.cc.orig Fri Apr 21 00:26:10 2000
|
|
+++ indxbib/indxbib.cc Fri Apr 21 00:27:44 2000
|
|
@@ -222,12 +222,11 @@ int main(int argc, char **argv)
|
|
else {
|
|
temp_index_file = strsave(TEMP_INDEX_TEMPLATE);
|
|
}
|
|
- if (!mktemp(temp_index_file) || !temp_index_file[0])
|
|
+ int fd = mkstemp(temp_index_file);
|
|
+ if (fd == -1 || !temp_index_file[0])
|
|
fatal("cannot create file name for temporary file");
|
|
- catch_fatal_signals();
|
|
- int fd = creat(temp_index_file, S_IRUSR|S_IRGRP|S_IROTH);
|
|
- if (fd < 0)
|
|
- fatal("can't create temporary index file: %1", strerror(errno));
|
|
+ if (fchmod(fd, S_IRUSR|S_IRGRP|S_IROTH) < 0)
|
|
+ fatal("cannot change permissions for temporary file");
|
|
indxfp = fdopen(fd, "w");
|
|
if (indxfp == 0)
|
|
fatal("fdopen failed");
|