openbsd-ports/news/tin/patches/patch-ab
1998-09-08 05:43:35 +00:00

26 lines
699 B
Plaintext

--- src/auth.c.~1~ Mon Sep 7 21:52:28 1998
+++ src/auth.c Mon Sep 7 21:54:15 1998
@@ -64,17 +64,20 @@
(void) sscanf (authcmd, "%*d.%*d.%d", &cookiefd);
if (cookiefd == -1) {
+ int fdfd;
char tempfile[BUFSIZ];
sprintf (tempfile, "%stin_AXXXXXX", TMPDIR);
- if (!mktemp (tempfile)) {
+ fdfd = mkstemp(tempfile);
+ if (fdfd == -1) {
error_message (txt_cannot_create_uniq_name);
#ifdef DEBUG
debug_nntp ("authorization", txt_cannot_create_uniq_name);
#endif /* DEBUG */
return FALSE;
} else {
- if ((fp = fopen (tempfile, "w+")) != (FILE *) 0) {
+ fp = fdopen (fdfd, "w+");
+ if (fp) {
cookiefd = fileno (fp);
(void) unlink (tempfile);
} else {