First, why can't I do this?
% id -un me % ls -l -rw-rw-r--+ bob bob 100 today foo % chmod +x foo chmod: changing permissions of `foo': Operation not permitted % getfacl foo # file: foo # owner: bob # group: bob user::rw- user:me:rwx user:bob:rwx group::rwx mask::rw- other::r--
I do have the ability, but
chmod just doesn't want to do it. This works, for example:
% cp foo bar % mv bar foo % chmod +x foo (success!)
With the additional side effect that the file owner is now
me. (Which is file.) Is this really the shortest way to accomplish this?
(The slightly shorter version,
% cp foo foo
to take ownership also doesn't work. If I absolutely can't
chmod a file I don't own, is there a way to "take ownership" that doesn't involve a complete I/O of the file?)