SF.net SVN: mahogany: [7307] trunk/M/lib/imap/src/osdep/unix/ssl_unix.c

[email protected] Sun, 29 Jul 2007 17:46:29 -0700
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
Revision: 7307
          http://mahogany.svn.sourceforge.net/mahogany/?rev=7307&view=rev
Author:   vadz
Date:     2007-07-29 17:46:29 -0700 (Sun, 29 Jul 2007)

Log Message:
-----------
use mkstemp() rather than tmpnam() just to get rid of Linux ld warnings about the latter being unsafe (although it is here...)

Modified Paths:
--------------
    trunk/M/lib/imap/src/osdep/unix/ssl_unix.c

Modified: trunk/M/lib/imap/src/osdep/unix/ssl_unix.c
===================================================================
--- trunk/M/lib/imap/src/osdep/unix/ssl_unix.c	2007-07-29 15:27:13 UTC (rev 7306)
+++ trunk/M/lib/imap/src/osdep/unix/ssl_unix.c	2007-07-30 00:46:29 UTC (rev 7307)
@@ -96,8 +96,8 @@
     struct stat sbuf;
 				/* if system doesn't have /dev/urandom */
     if (stat ("/dev/urandom",&sbuf)) {
-      while ((fd = open (tmpnam (tmp),O_WRONLY|O_CREAT|O_EXCL,0600)) < 0)
-	sleep (1);
+      strcpy(tmp, "ccXXXXXX");
+      fd = mkstemp(tmp);
       unlink (tmp);		/* don't need the file */
       fstat (fd,&sbuf);		/* get information about the file */
       close (fd);		/* flush descriptor */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/