On Mon, 11 Aug 2008, Lee Lundrigan wrote: > Hi everyone, > > I am trying to build the c-client but I am unsure if the build failed or > was successful. > > Somethings you would like to know: > OS: CentOS 5.2 (final) > PAM, OpenSSL all installed > Asterisk Build :) > > The first time I built the c-client there were a lot of warnings so I > went into "src/osep/unix/ssl_unix.c" > and changed line #101 FROM: > if (stat ("/dev/urandom",&sbuf)) { > while ((fd = open (tmpnam (tmp),O_WRONLY|O_CREAT|O_EXCL,0600)) < 0) > > TO: > if (stat ("/dev/urandom",&sbuf)) { > while ((fd = open (mkstemp (tmp),O_WRONLY|O_CREAT|O_EXCL,0600)) < 0) > > I was getting the error: > /home/laszlo/src/imap-2007b/c-client/osdep.c:337: warning: the use of > `tmpnam' is dangerous, better use `mkstemp' > > The warnings went away but I had the same output: > Building bundled tools... [snip..] > `cat ../c-client/CCTYPE` -I../c-client `cat ../c-client/CFLAGS` -c -o > tmail.o tmail.c > `cat ../c-client/CCTYPE` -I../c-client `cat ../c-client/CFLAGS` -c -o > tquota.o tquota.c > `cat ../c-client/CCTYPE` -I../c-client `cat ../c-client/CFLAGS` -o tmail > tmail.o tquota.o ../c-client/c-client.a `cat ../c-client/LDFLAGS` > make[2]: Leaving directory `/home/laszlo/src/imap-2007b/tmail' > make[1]: Leaving directory `/home/laszlo/src/imap-2007b' > > > Did I make the c-client? > > Thanks in advance, > Lee Lundrigan
Lee, Suggestion, do not make changes to other people's code unless you have some understanding of coding yourself. Literally following that compiler "suggestion" produced broken code which would fail if you had actually needed that particular routine. "mkstemp" is -NOT- a drop-in replacement for "tmpnam". That "suggestion" would be logically equivalent to the statement: Warning a 'power saw' is dangerous, better use a 'cordless drill' Yes, a 'power saw' is dangerous, but in the hands of a skilled crafsman can be safely used and get the job done. The person who wrote that original code has over 2 decades of experience and knows what he was doing. Lucky for you, your system has '/dev/urandom' so that block of code would not be called and your defective replacement induced bug would not have been triggered. The "make" ran to completion with out throwing errors, so yes, you did make the c-client. -- Dave Funk University of Iowa <dbfunk (at) engineering.uiowa.edu> College of Engineering 319/335-5751 FAX: 319/384-0549 1256 Seamans Center Sys_admin/Postmaster/cell_admin Iowa City, IA 52242-1527 #include <std_disclaimer.h> Better is not better, 'standard' is better. B{ _______________________________________________ Imap-uw mailing list Imap-uw@u.washington.edu http://mailman2.u.washington.edu/mailman/listinfo/imap-uw