Re: [Module::Build] Re: Preserving files' executable bits, once more (was: r5891 - in Module-Build/t
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2006-05-03 04:11:24
|
On Apr 25, 2006, at 7:36 AM, Ken Williams wrote: > > On Apr 23, 2006, at 12:13 PM, Julian Mehnle wrote: > >> >> So apparently -x always returns true for root, and (mode & 0100) for >> non-root. >> >> Also: >> >> | $ sudo -u julian ./f--x------ >> | $ sudo -u julian ./f--------x >> | sudo: unable to execute ./f--------x: Permission denied >> | $ sudo ./f--x------ >> | $ sudo ./f--------x >> | $ >> >> If a file really is 0445 (0455), then I think it is reasonably >> safe to >> assume that either ug-x (u-x) was _deliberately_ set or that o+x >> (go+x) >> was _accidentally_ set, and that therefore "not x" should be >> assumed. IOW, >> it should be reasonably safe to consider the user x bit >> authoritative. >> >> Thus Module::Build should use -x for the executable check. >> However since >> root (e.g. during `Build install`) always sees files as "x" if >> _any_ x bit >> is set, M::B would have to emulate -x's non-root behavior: >> >> my $mode = 0444 | ( (stat($file))[2] & 0100 ? 0111 : 0 ); > > > Well, the 0100 mask isn't quite right I think, because the user > might not be the owner. In this special case perhaps we can count > on the user being the owner of files in blib/ though, I'm not > sure. Certainly it would be true on *nix. > > The point about root & -x is certainly true, I hadn't thought about > that. We'll have to fix that. I've committed this to the repo, thanks for the research. -Ken |