On Thu, 2007-03-29 at 23:46 +0200, Henri Gomez wrote: > Good thanks I don't like mktemp(): +++ BUGS Never use mktemp(). Some implementations follow 4.3BSD and replace XXXXXX by the current process ID and a single letter, so that at most 26 different names can be returned. Since on the one hand the names are easy to guess, and on the other hand there is a race between test- ing whether the name exists and opening the file, every use of mktemp() is a security risk. The race is avoided by mkstemp(3).
+++ Why no changing it to mkstemp so that Henri could use the APR call? Cheers Jean-Frederic > > 2007/3/29, Mladen Turk <[EMAIL PROTECTED]>: > > Henri Gomez wrote: > > > While rebuild trunk from mod_jk I got an error on iSeries about > > > missing mktemp in iSeries. > > > > > > if (!jk_shmem.lockname) { > > > > #ifnedef WHATEVER > > > > > if (shm_lock_reopen) { > > > int i; > > > jk_shmem.fd_lock = -1; > > > mode_t mask = umask(0); > > > for (i = 0; i < 8; i++) { > > > strcpy(flkname, "/tmp/jkshmlock.XXXXXX"); > > > if (mktemp(flkname)) { > > > jk_shmem.fd_lock = open(flkname, > > > O_RDWR|O_CREAT|O_TRUNC, 0666); > > > if (jk_shmem.fd_lock >= 0) > > > break; > > > } > > > } > > > umask(mask); > > > } > > > > > > > #endif > > > > > > The shm_lock_reopen is compile time anyhow. > > > > Regards, > > Mladen > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]