In message <19990404132114.c77...@nuxi.com> "David O'Brien" writes:
: I can't duplicate this problem.  Just to be sure... you aren't using
: -DNOCLEAN, -O2 or anything like that, right?
: 
: Would it be possible for you to take the March 31st CURRENT snapshot, do
: a fresh CVSup/cvs checkout and try a build?

I already have mkstemps in my tree.  I had imported it from OpenBSD a
while ago, but hadn't committed it.  I'll do that now, as well as
remove the mktemp.c from the offending makefile.  It works w/o it and
eliminates an XXX comment.

So you shouldn't be able to reproduce this in a clean tree. :-)

Warner

P.S.  here's what I have in my tree that I'll commit soon.

Index: mktemp.c
===================================================================
RCS file: /home/imp/FreeBSD/CVS/src/lib/libc/stdio/mktemp.c,v
retrieving revision 1.12
diff -d -u -r1.12 mktemp.c
--- mktemp.c    1998/10/20 15:33:21     1.12
+++ mktemp.c    1999/04/04 19:31:50
@@ -50,29 +50,39 @@
 
 char *_mktemp __P((char *));
 
-static int _gettemp __P((char *, int *, int));
+static int _gettemp __P((char *, int *, int, int));
 
 int
+mkstemps(path, slen)
+       char *path;
+       int slen;
+{
+       int fd;
+
+       return (_gettemp(path, &fd, 0, slen) ? fd : -1);
+}
+
+int
 mkstemp(path)
        char *path;
 {
        int fd;
 
-       return (_gettemp(path, &fd, 0) ? fd : -1);
+       return (_gettemp(path, &fd, 0, 0) ? fd : -1);
 }
 
 char *
 mkdtemp(path)
        char *path;
 {
-       return(_gettemp(path, (int *)NULL, 1) ? path : (char *)NULL);
+       return(_gettemp(path, (int *)NULL, 1, 0) ? path : (char *)NULL);
 }
 
 char *
 _mktemp(path)
        char *path;
 {
-       return(_gettemp(path, (int *)NULL, 0) ? path : (char *)NULL);
+       return(_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL);
 }
 
 #ifdef UNSAFE_WARN
@@ -88,12 +98,13 @@
 }
 
 static int
-_gettemp(path, doopen, domkdir)
+_gettemp(path, doopen, domkdir, slen)
        char *path;
        register int *doopen;
        int domkdir;
+       int slen;
 {
-       register char *start, *trv;
+       register char *start, *trv, *suffp;
        struct stat sbuf;
        int pid, rval;
 
@@ -105,7 +116,13 @@
        pid = getpid();
        for (trv = path; *trv; ++trv)
                ;
+       trv -= slen;
+       suffp = trv;
        --trv;
+       if (trv < path) {
+               errno = EINVAL;
+               return (0);
+       }
        while (*trv == 'X' && pid != 0) {
                *trv-- = (pid % 10) + '0';
                pid /= 10;


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to