Re: UPG and the default umask
On 2010-05-19, Aaron Toponce <firstname.lastname@example.org> wrote:
> I suggested this, which I don't think is complex. However, what you have
> suggested should work just fine.
> if [ "$(id -un)" =3D "$(id -gn)" ] && [ "$UID" -gt 99 ]; then
> umask 0002
> umask 0022
id -n might cause network accesses, if NSS is configured to do so. Is there
a precedent in profile for this? (I don't see any, just id -u which calls
> The logic is simple, IMO: if the group name and the user name match,
> it's UPG. If UPG and it is not a system user, then set the umask to
> 0002. Otherwise, set to 0022.
When I do "newgrp <group>" it's still UPG and the umask should still be
2, no? This check would change my umask.
> I don't know if that logic will match any additional cases (unless user
> accounts are created under ID 1000), however, so we should be good with
> your simpler logic on just matching the UID.