Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix umask comments #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
# The following incantation allows easy group modification of files.
# See here: http://en.wikipedia.org/wiki/Umask
#
# umask 002 allows only you to write (but the group to read) any new
# umask 022 allows only you to write (but the group to read) any new
# files that you create.
#
# umask 022 allows both you and the group to write to any new files
# umask 002 allows both you and the group to write to any new files
# which you make.
#
# In general we want umask 022 on the server and umask 002 on local
# In general we want umask 002 on the server and umask 022 on local
# machines.
#
# The command 'id' gives the info we need to distinguish these cases.
Expand All @@ -63,11 +63,11 @@
#
# So: if the group name is the same as the username OR the user id is not

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be changed. On my local machine, neither of the two conditions is true.

# greater than 99 (i.e. not root or a privileged user), then we are on a
# local machine (check for yourself), so we set umask 002.
# local machine (check for yourself), so we set umask 022.
#
# Conversely, if the default group name is *different* from the username

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be “if the default group name is the same as the username”

# AND the user id is greater than 99, we're on the server, and set umask
# 022 for easy collaborative editing.
# 002 for easy collaborative editing.
if [ "`id -gn`" == "`id -un`" -a `id -u` -gt 99 ]; then
umask 002
else
Expand Down