aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_namespace/namespace.init
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 19:05:18 -0800
committerSteve Langasek <vorlon@debian.org>2019-01-08 21:26:02 -0800
commit2fab298d986f0dec0f655884083c78d4cd0a08ff (patch)
tree3fb48879b8a0f0a14518fb6963febe68218e21b0 /modules/pam_namespace/namespace.init
parentbd01c7eaabdecde8fbf697b17d70e3596aeaf83f (diff)
parentaa0448336a79d85579464f023ac87675be60abfc (diff)
downloadpam-2fab298d986f0dec0f655884083c78d4cd0a08ff.tar.gz
pam-2fab298d986f0dec0f655884083c78d4cd0a08ff.tar.bz2
pam-2fab298d986f0dec0f655884083c78d4cd0a08ff.zip
merge upstream version 1.1.1
Diffstat (limited to 'modules/pam_namespace/namespace.init')
-rwxr-xr-xmodules/pam_namespace/namespace.init3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/pam_namespace/namespace.init b/modules/pam_namespace/namespace.init
index 424c6d0c..9898bf3a 100755
--- a/modules/pam_namespace/namespace.init
+++ b/modules/pam_namespace/namespace.init
@@ -15,7 +15,8 @@ if [ "$3" = 1 ]; then
gid=$(echo "$passwd" | cut -f4 -d":")
cp -rT /etc/skel "$homedir"
chown -R "$user":"$gid" "$homedir"
- mode=$(awk '/^UMASK/{gsub("#.*$", "", $2); printf "%o", and(0777,compl(strtonum("0" $2))); exit}' /etc/login.defs)
+ mask=$(awk '/^UMASK/{gsub("#.*$", "", $2); print $2; exit}' /etc/login.defs)
+ mode=$(printf "%o" $((0777 & ~$mask)))
chmod ${mode:-700} "$homedir"
[ -x /sbin/restorecon ] && /sbin/restorecon -R "$homedir"
fi