Umask resulting of USERGROUPS_ENAB is ignored with sudo/kdesudo

Bug #1093396 reported by xor
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

- By default, /etc/login.defs has configured "USERGROUPS_ENABLE=yes". The part where you configure the UMASK in login.defs explains what this does to the UMASK:
    # 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.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sudo (Ubuntu):
status: New → Confirmed
Revision history for this message
Carl (isopropyl) wrote :
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.