Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

[Already solved by OP: See answer.]

I had some code running on an old version of Ubuntu (Karmic Koala). Machine was rebuilt to Ubuntu 11.10, and now my code falls over.

It is doing the equivalent of this to change a file's group ownership to another group which I'm in:

$ touch /tmp/new_file
$ ls -la /tmp/new_file
-rw-rw-r-- 1 me mygroup 0 Nov 20 15:39 /tmp/new_file
$ chown :anothergroup /tmp/new_file
chown: changing group of `/tmp/new_file': Operation not permitted

Why can't I change the group ownership of a file that I own? I thought that was allowed. I am missing something.

This account is a member of both groups.

More info:

$ umask
0002
$ chgrp anothergroup /tmp/new_file
chgrp: changing group of `/tmp/new_file': Operation not permitted
$ sudo chown :anothergroup /tmp/new_file # Works fine.
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

D'oh!

This account is a member of both groups.

Yes, but I had only just been added as a member, and hadn't re-logged in yet, so the change hadn't yet propagated to the shell.

Sigh.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.