Re: [PATCH] remove usage of tmpnam() in ssl_unix.c

Bjoern Voigt <[email protected]>
Newsgroups gmane.mail.imap.uw.c-client
Message-ID <[email protected]>
I see the problem, that the existing "tmpnam" usage may result in an 
endless loop. This unlikely case can occur for instance if /tmp is 
read-only for any reason or 100% full.

src/osdep/unix/ssl_unix.c:

      while ((fd = open (tmpnam (tmp),O_WRONLY|O_CREAT|O_EXCL,0600)) < 0)
        sleep (1);

I think, "errno" of "open" should be considered. The next iteration of 
the while-loop is only usefull, if the path already exists 
(errno=EEXIST: pathname already exists and O_CREAT and O_EXCL were used).

Björn
_______________________________________________
Imap-uw mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.