Umask resulting of USERGROUPS_ENAB is ignored with sudo/kdesudo
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
- By default, /etc/login.defs has configured "USERGROUPS_
# If USERGROUPS_ENAB is set to "yes", that will modify this UMASK default value
# for private user groups, i. e. the uid is the same as gid, and username is
# the same as the primary group name: for these, the user permissions will be
# used as group permissions, e. g. 022 will become 002.
- This should cause any newly created files by those users to be writable by the group. However, this usergroups behavior is ignored when the shell of the user is launched via sudo (or kdesudo) and the default UMASK is used instead. This results in the files NOT being writable by the group.
Reproducing it using Kubuntu12.10 amd64:
- Within a rootshell, create a user account with the following command:
useradd --create-home --shell /bin/bash --user-group testuser
- Still as root, do
sudo -u testuser -i
- Within the shell of the testuser, do
touch testfile
ll
- You will see that the file is NOT writable for the group.
- If you use "su - testuser" instead of sudo, the umask WILL be correct.
- The same issue applies to kdesudo.
Status changed to 'Confirmed' because the bug affects multiple users.