[Unison-hackers] Need fix for chmod problem

Benjamin Pierce bcpierce at cis.upenn.edu
Tue Oct 4 09:50:29 EDT 2005


I agree that the code in question looks wrong as it stands, and I've  
made this change in the developer sources.

Trevor, Jerome -- do you agree?

     - Benjamin

On Oct 1, 2005, at 12:33 AM, Dale R. Worley wrote:

> I've gotten stuck in a situation where I really need to suppress any
> attempt by Unison to change the permissions of files.
>
> (One of the directories is on an SMB share mounted on a Linux system.
> chmod calls on that filesystem fail, and there is no "quiet" option to
> prevent them from returning errors.)
>
> I don't know ML, but Unison is really clean code, so I think I know  
> what
> needs to be done.  In props.ml at lines 166 et seq. is the function:
>
> let set fspath path kind (fp, mask) =
>   if mask <> 0 || kind <> `Update then
>     Util.convertUnixErrorsToTransient
>     "setting permissions"
>       (fun () ->
>         let abspath = Fspath.concatToString fspath path in
>         debug
>           (fun() ->
>             Util.msg "Setting permissions for %s to %s (%s)\n"
>               abspath (toString (fileperm2perm fp))
>               (Printf.sprintf "%o/%o" fp mask));
>         Unix.chmod abspath fp)
>
> I think that the second line is incorrect, in that if mask is 0,  
> but the
> kind of operation is not Update (and specifically, if it is the  
> creation
> of a file), the code will still attempt to chmod the file.  Instead,
> that 'if' clause should be:
>
>   if mask <> 0 then
>
> Do you developers agree with me?
>
> Thanks, as this is a real problem here,
>
> Dale
>
>
> _______________________________________________
> Unison-hackers mailing list
> Unison-hackers at lists.seas.upenn.edu
> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers
>



More information about the Unison-hackers mailing list