[Unison-hackers] Need fix for chmod problem
Dale R. Worley
dworley at pingtel.com
Fri Sep 30 17:33:52 EDT 2005
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
More information about the Unison-hackers
mailing list