httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: [PATCH] locating mutex lockfile
Date Sat, 28 Jun 1997 18:40:18 GMT
Randy Terbush wrote:
> 
> 
> This was my original patch pre-1.2. If it looks like an acceptable 
> solution, I'll remake it against the current sources.
> 

We'll also need it for FLOCK as well...

>   
> !     ap_snprintf(lock_fname, (sizeof(lock_fname)-1), "%s", pid_fname);
> !     lock_fname[(rind(lock_fname, '/')) + 1] = '\0';
> !     strcat(lock_fname, "htlock.XXXXXX\0");
> !     
>       if (mktemp(lock_fname) == NULL || lock_fname[0] == '\0')
>       {
>   	fprintf (stderr, "Cannot assign name to lock file!\n");
> ***************
> *** 254,261 ****
>   {
>       char lock_fname[256];
>   
> !     strncpy(lock_fname, "/usr/tmp/htlock.XXXXXX", sizeof(lock_fname)-1);
> !     lock_fname[sizeof(lock_fname)-1] = '\0';
>       
>       if (mktemp(lock_fname) == NULL || lock_fname[0] == '\0')
>       {
> - --- 251,259 ----
>   {
>       char lock_fname[256];
>   
> !     ap_snprintf(lock_fname, (sizeof(lock_fname)-1), "%s", pid_fname);
> !     lock_fname[(rind(lock_fname, '/')) + 1] = '\0';
> !     strcat(lock_fname, "htlock.XXXXXX\0");
>       


Oh yeah... Wouldn't it be best to use something like server_root_relative()
to make sure ?

-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
            "Look at me! I'm wearing a cardboard belt!"

Mime
View raw message