bug-cfengine
[Top][All Lists]
Advanced

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

Re: [2.1.0p1] filedir.c:CheckCopiedFile() code weirdness


From: Mark . Burgess
Subject: Re: [2.1.0p1] filedir.c:CheckCopiedFile() code weirdness
Date: Sun, 11 Jan 2004 14:18:40 +0100 (MET)

This patch is still wrong -- but I have fixed the problem, I believe
in 2.1.1
M

On 17 Dec, address@hidden wrote:
> Earlier I wrote:
>> Not a confirmed bug but rather a request for clarification.
> 
> I am now convinced that even explicit mode= specifications in copy:
> ought to be relative to the source file, not to the destination.
> This is because CopyReg() lacks an independent mechanism to set the
> file ownership and permissions to something sensible.
> 
> A patch follows. Note that it only makes a difference for explicit,
> relative mode= specifications. If the mode was missing
> (plus==0,minus==0) or absolute (plus == ~minus), the outcome will be
> left unchanged by this patch.
> 
> --- orig/src/filedir.c
> +++ mod/src/filedir.c
> @@ -852,16 +852,10 @@
>  
>  Debug("CheckCopiedFile(%s)\n",file); 
>  
> -if ((plus == 0) && (minus == 0))
> -    {
> -    newplus = sstat->st_mode & 07777 | plus;
> -    newminus = ~(sstat->st_mode & 07777 & ~minus) & 07777;
> -    
> CheckExistingFile(file,newplus,newminus,fixall,uidlist,gidlist,dstat,NULL,acl_aliases);
> -    }
> - else
> -    {
> -    
> CheckExistingFile(file,plus,minus,fixall,uidlist,gidlist,dstat,NULL,acl_aliases);
> -    }
> +newplus = sstat->st_mode & 07777 | plus;
> +newminus = ~(sstat->st_mode & 07777 & ~minus) & 07777;
> +CheckExistingFile(file,newplus,newminus,fixall,uidlist,gidlist,dstat,NULL,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]