summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2009-08-31 22:09:44 +0000
committerSteve Langasek <vorlon@debian.org>2009-08-31 22:09:44 +0000
commitde99a00248cdd5d41994056ccc1815a8f1e779b6 (patch)
treed36c11007c556009cf5687f2264e846d6538f7bf
parentc326192f751de1cf5340892fc943c4e8f456568d (diff)
Relevant BUGIDs: Debian bug #518908
Purpose of commit: portability Commit summary: --------------- 2009-08-31 Steve Langasek <vorlon@debian.org> * modules/pam_namespace/namespace.init: make this portable to POSIX awk, instead of using GNU awk extensions.
-rw-r--r--ChangeLog5
-rwxr-xr-xmodules/pam_namespace/namespace.init3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 791cd0a2..bdb3d77d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-31 Steve Langasek <vorlon@debian.org>
+
+ * modules/pam_namespace/namespace.init: make this portable to POSIX
+ awk, instead of using GNU awk extensions.
+
2009-08-25 Steve Langasek <vorlon@debian.org>
* modules/pam_sepermit/pam_sepermit.8.xml: fix up one reference
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