Ondřej Vašík wrote: > Jim Meyering wrote: >> Ondřej Vašík wrote: >> > Pádraig Brady wrote: >> >> Yes I agree that the change is required. >> >> I've tweaked it so that the geteuid() syscall is only called >> >> if readonly files. Also I removed the error message on chmod failure >> >> as the user will still get an error message _if_ the copy_xattr fails. >> >> Also I ran it through indent and did s/write access rights/write access/. >> >> I'll push it soon if there are no objections. >> > >> > Thanks for word tweaks and other patch-amending. I spotted one error - >> > initial value of access_changed was not changed to false when you >> > changed the name and logic from access_unchanged (fixed by attached >> > patch). >> >> Thanks, Ondřej! >> Can you contrive a test that would expose that? > > I'm not sure if this is useful - as this boolean is just saving chmod > call for the case, that the chmod was not necessary. So even the > Pádraig's patch works, but for files with write access there is one > unnecessary chmod call. Adding test would probably mean strace usage, so > if such test is really required, I would prefer to have that test > separate.
Indeed. Testing for an excess chmod call would not be worthwhile. Thanks.
