Group permissions not working correctly in Gutsy Gibbon

Bug #162958 reported by Wulfie
8
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Undecided
Unassigned
linux-source-2.6.22 (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

group permissions not working quite right.

To reproduce this problem is fairly simple. Create a group "mygroup" and add your user to that group. Then perform:

$ touch specialfile
$ sudo chown root:mygroup specialfile
$ sudo chmod g+rwxs specialfile
$ ls -l specialfile
-rw-rwsr-- 1 root cedega 0 2007-11-15 10:56 specialfile

Now we can use python to show the issue:

$ python
Python 2.4.3 (#2, Oct 6 2006, 07:52:30)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> fp = file( "specialfile", "w+" )
>>>

When performing the fp = line I receive the error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 1] Operation not permitted: 'specialfile'

Using older versions of Ubuntu does not hit this exception and we have not had any reports of problems with other distributions.

Cheers

Revision history for this message
Koen (koen-beek) wrote :

I've tried what you suggested and have the same error

I added the user to the mygroup group by using the System->Administration->Users and Groups menu

I have however noticed that the id command does not list mygroup as one of the groups I am part of
and that a adduser command just after that reports that I'm already in the group

koen@koen-desktop:~$ id
uid=1000(koen) gid=1000(koen) groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),104(scanner),108(lpadmin),110(admin),115(netdev),117(powerdev),1000(koen)
koen@koen-desktop:~$ sudo adduser koen mygroup
The user `koen' is already a member of `mygroup'.

   Koen

Revision history for this message
Koen (koen-beek) wrote :

I just found out that I needed to log out and back in to get updated groups.
I still get the error you're getting

Revision history for this message
Koen (koen-beek) wrote :

echo xx >> specialfile works
cat specialfile works
> specialfile works (but removes the setguid bit)

Revision history for this message
Koen (koen-beek) wrote :

once set setguid is gone the python script works

Revision history for this message
Koen (koen-beek) wrote :

Hi,

  a correction from my previous comment : > specailfiel is not possible while a setgid is active on the file, the setgid bit is removed by a >> command

log :

$ sudo chmod g+rwxs specialfile; ls -l | grep -v total
-rw-rwsr-- 1 root mygroup 0 2007-11-17 19:45 specialfile
$ > specialfile; ls -l | grep -v total
bash: specialfile: Operation not permitted
-rw-rwsr-- 1 root mygroup 0 2007-11-17 19:45 specialfile
$ cat specialfile; ls -l | grep -v total
-rw-rwsr-- 1 root mygroup 0 2007-11-17 19:45 specialfile
$ echo "x" >> specialfile; ls -l | grep -v total
-rw-rwxr-- 1 root mygroup 2 2007-11-17 19:47 specialfile
$ > specialfile; ls -l | grep -v total
-rw-rwxr-- 1 root mygroup 0 2007-11-17 19:48 specialfile

I don't know enough about unix permissions to know whether this is normal or not

  Koen

Revision history for this message
Koen (koen-beek) wrote :

Hi,

  I can confirm that > specialfile was allowed in linux kernel 2.6.15 (Ubuntu Dapper LTS)

  so, a change in security measures in the kernel or a bug ??

   Koen

Revision history for this message
Brian Murray (brian-murray) wrote :

I am assigning this bug to the 'ubuntu-kernel-team' per their bug policy. For future reference you can learn more about their bug policy at https://wiki.ubuntu.com/KernelTeamBugPolicies .

Changed in linux-source-2.6.22:
assignee: nobody → ubuntu-kernel-team
Revision history for this message
Jon Seidel (jseidel-edpci) wrote :

FYI... In case it helps, I have confirmed the same issue in Feisty Fawn: 7.04...jon

Revision history for this message
Launchpad Janitor (janitor) wrote : This bug is now reported against the 'linux' package

Beginning with the Hardy Heron 8.04 development cycle, all open Ubuntu kernel bugs need to be reported against the "linux" kernel package. We are automatically migrating this bug to the new "linux" package. However, development has already began for the upcoming Intrepid Ibex 8.10 release. It would be helpful if you could test the upcoming release and verify if this is still an issue - http://www.ubuntu.com/testing . If the issue still exists, please update this report by changing the Status of the "linux" task from "Incomplete" to "New". We appreciate your patience and understanding as we make this transition. Thanks!

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would appreciate it if you could please test this newer 2.6.27 Ubuntu kernel. There are one of two ways you should be able to test:

1) If you are comfortable installing packages on your own, the linux-image-2.6.27-* package is currently available for you to install and test.

--or--

2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4. Please watch http://www.ubuntu.com/testing for Alpha5 to be announced. You should then be able to test via a LiveCD.

Please let us know immediately if this newer 2.6.27 kernel resolves the bug reported here or if the issue remains. More importantly, please open a new bug report for each new bug/regression introduced by the 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please specifically note if the issue does or does not appear in the 2.6.26 kernel. Thanks again, we really appreicate your help and feedback.

Revision history for this message
Launchpad Janitor (janitor) wrote : Kernel team bugs

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

Revision history for this message
Przemek K. (azrael) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The version of Ubuntu that you were using has reached its End Of Life. Please test the latest Ubuntu version (9.10) and report a new bug if necessary.
https://help.ubuntu.com/community/ReportingBugs

Changed in linux (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.