From de99a00248cdd5d41994056ccc1815a8f1e779b6 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 31 Aug 2009 22:09:44 +0000 Subject: Relevant BUGIDs: Debian bug #518908 Purpose of commit: portability Commit summary: --------------- 2009-08-31 Steve Langasek * modules/pam_namespace/namespace.init: make this portable to POSIX awk, instead of using GNU awk extensions. --- modules/pam_namespace/namespace.init | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/pam_namespace/namespace.init') 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 -- cgit v1.2.3