openbsd-ports/mail/nmh/patches/patch-ab
kevlo e6a3c04669 - Upgrade to 1.0.3 and fix the security problem.
- Mark unbroken.
- Update the MASTER_SITES.
2000-03-08 05:11:35 +00:00

30 lines
653 B
Plaintext

--- sbr/m_scratch.c.orig Sat Jan 29 10:52:43 2000
+++ sbr/m_scratch.c Tue Feb 29 17:58:33 2000
@@ -15,16 +15,20 @@
static char buffer[BUFSIZ], tmpfil[BUFSIZ];
snprintf (tmpfil, sizeof(tmpfil), "%sXXXXXX", template);
-/*
- Mkstemp work postponed until later -Doug
#ifdef HAVE_MKSTEMP
- mkstemp (tmpfil);
+ {
+ int fd;
+
+ fd = mkstemp (tmpfil);
+ if (fd == -1)
+ return 0;
+ close (fd);
+ unlink (tmpfil);
+ }
#else
-*/
mktemp (tmpfil);
-/*
#endif
-*/
+
/* nasty - this really means: if there is no '/' in the path */
if ((cp = r1bindex (file, '/')) == file)
strncpy (buffer, tmpfil, sizeof(buffer));