bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch 2.1.0p1] RecursiveImage(): don't use result of failed stat()


From: Mark . Burgess
Subject: Re: [patch 2.1.0p1] RecursiveImage(): don't use result of failed stat()
Date: Sun, 11 Jan 2004 13:05:23 +0100 (MET)

Patch checked and applied
M

On 13 Dec, address@hidden wrote:
> The following patch against cfengine 2.1.0p1 corrects a bug whereby an
> undefined value (of deststatbuf) would be passed to CheckCopiedFile()
> under certain circumstances, resulting in unpredictable directory
> permissions.
> 
> --- orig/src/image.c
> +++ mod/src/image.c
> @@ -214,6 +214,12 @@
>        if (stat(newto,&deststatbuf) == -1)
>        {
>        mkdir(newto,statbuf.st_mode);
> +      if (stat(newto,&deststatbuf) == -1)
> +         {
> +         snprintf(OUTPUT,bufsize*2,"Can't stat %s\n",newto);
> +         CfLog(cferror,OUTPUT,"stat");
> +         continue;
> +         }
>        }
>  
>        
> CheckCopiedFile(newto,ip->plus,ip->minus,fixall,ip->uid,ip->gid,&deststatbuf,&statbuf,NULL,ip->acl_aliases);
> 
> 
> 
> 
> _______________________________________________
> Bug-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-cfengine



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  address@hidden
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

[Prev in Thread] Current Thread [Next in Thread]