Please consider the following patch for inclusion. On Win32, you cannot delete 
an open file (the delete will fail), so in this case we should do the 
close(fd) first, and then the unlink(tmp).

I understand that ssl_unix.c is not meant to be compiled on Win32, but the 
Microsoft SSL implementation schannel.dll is buggy, and having the option to 
choose OpenSSL on Win32 is nice. At least that's what we do.

This bug was found and fixed by Peter Boos.
Regards,
Wolfgang Spraul

Index: src/osdep/unix/ssl_unix.c
===================================================================
RCS file: /cvsroot/srclib/imports/imap/src/osdep/unix/ssl_unix.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 ssl_unix.c
--- src/osdep/unix/ssl_unix.c   16 Jul 2002 20:48:40 -0000      1.1.1.1
+++ src/osdep/unix/ssl_unix.c   31 Aug 2002 18:59:05 -0000
@@ -92,10 +92,10 @@
       if ((fd = open (tmpnam (tmp),O_WRONLY|O_CREAT,0600)) < 0)
        i = (unsigned long) tmp;
       else {
-       unlink (tmp);           /* don't need the file */
        fstat (fd,&sbuf);       /* get information about the file */
        i = sbuf.st_ino;        /* remember its inode */
-       close (fd);             /* or its descriptor */
+       close (fd);             /* don't need the descriptor */
+       unlink (tmp);           /* or the file */
       }
                                /* not great but it'll have to do */
       sprintf (tmp + strlen (tmp),"%.80s%lx%lx%lx",

--
-----------------------------------------------------------------
 For information about this mailing list, and its archives, see:
 http://www.washington.edu/imap/imap-list.html
-----------------------------------------------------------------

Reply via email to