Sudoedit umask confusion
asymptosis <[email protected]> Thu, 12 Sep 2019 05:39:27 +1000
| Newsgroups | gmane.comp.tools.sudo.user |
|---|---|
| Message-ID | <20190911193927.GA1355224@sleipnir> |
Hi all, My regular user account has a restrictive umask (077). When I create files with sudoedit or `sudo -e`, it is usually config files under /etc, and so I want those files to have 0644 permissions. To enforce this, I have the following stanza in /etc/sudoers: Defaults umask_override Defaults umask=0022 This works correctly for regular sudo commands, for example: $ sudo touch /etc/my-cool-config.conf $ ls -l /etc/my-cool-config.conf -rw-r--r-- 1 root root 0 Sep 12 05:06 /etc/my-cool-config.conf However, sudoedit keeps inheriting 077: $ sudoedit /etc/some-other-config.conf $ ls -l /etc/some-other-config.conf -rw------- 1 root root 0 Sep 12 05:08 /etc/some-other-config.conf Cringing, I tried `sudo $EDITOR` instead of sudoedit. It does behave in the way I would prefer: $ sudo rm /etc/some-other-config.conf $ sudo vim /etc/some-other-config.conf $ ls -l /etc/some-other-config.conf -rw-r--r-- 1 root root 0 Sep 12 05:28 /etc/some-other-config.conf I've tested this on both Arch Linux and Void Linux. I've also tried varying the editor. It is the same behaviour whether using vim, vi or nano. A web search did not find anyone who had similar problems in the past. Is it working as designed? Is there a way to make sudoedit use a more permissive umask, consistent with my sudoers config? ____________________________________________________________ sudo-users mailing list <[email protected]> For list information, options, or to unsubscribe, visit: https://www.sudo.ws/mailman/listinfo/sudo-users