aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_namespace/namespace.init
diff options
context:
space:
mode:
authorSam Hartman <hartmans@debian.org>2024-12-02 09:55:34 -0700
committerSam Hartman <hartmans@debian.org>2024-12-02 09:55:34 -0700
commit7c9fb6472dcfae34ddbf4fbc9ecfafae2cf173c3 (patch)
treeb04aa8c3b2354427cbba730ccc832249f7244985 /modules/pam_namespace/namespace.init
parente9aa2ef52a423a3a33299bf7e8715eb5bd76ea67 (diff)
parentea980d991196df67cdd56b3f65d210b73218d08a (diff)
downloadpam-7c9fb6472dcfae34ddbf4fbc9ecfafae2cf173c3.tar.gz
pam-7c9fb6472dcfae34ddbf4fbc9ecfafae2cf173c3.tar.bz2
pam-7c9fb6472dcfae34ddbf4fbc9ecfafae2cf173c3.zip
New upstream version 1.7.0
Diffstat (limited to 'modules/pam_namespace/namespace.init')
-rwxr-xr-xmodules/pam_namespace/namespace.init2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pam_namespace/namespace.init b/modules/pam_namespace/namespace.init
index d9053a13..1a6b6243 100755
--- a/modules/pam_namespace/namespace.init
+++ b/modules/pam_namespace/namespace.init
@@ -15,7 +15,7 @@ if [ "$3" = 1 ]; then
gid=$(echo "$passwd" | cut -f4 -d":")
cp -rT /etc/skel "$homedir"
chown -R "$user":"$gid" "$homedir"
- mask=$(awk '/^UMASK/{gsub("#.*$", "", $2); print $2; exit}' /etc/login.defs)
+ mask=$(sed -E -n 's/^UMASK[[:space:]]+([^#[:space:]]+).*/\1/p' /etc/login.defs)
mode=$(printf "%o" $((0777 & ~mask)))
chmod ${mode:-700} "$homedir"
[ -x /sbin/restorecon ] && /sbin/restorecon -R "$homedir"