[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. debian/0.11-2-g0600527
Andreas B. Mundt
andi at debian.org
Wed May 22 22:18:45 UTC 2013
The following commit has been merged in the master branch:
commit 0600527f83621ba2a09fd3346ea23f2fe5884f77
Author: Andreas B. Mundt <andi at debian.org>
Date: Thu May 23 00:06:23 2013 +0200
Create off-line home directories on first login. Cosmetics.
The user can now copy data to his off-line home directory already on
the first login.
diff --git a/fai/config/scripts/ROAMING/10-home_nfs4_krb5 b/fai/config/scripts/ROAMING/10-home_nfs4_krb5
index 019b283..9b6b6d3 100755
--- a/fai/config/scripts/ROAMING/10-home_nfs4_krb5
+++ b/fai/config/scripts/ROAMING/10-home_nfs4_krb5
@@ -6,19 +6,26 @@ FILE=${target}/usr/share/libpam-script/pam_script_auth
ainsl /etc/default/nfs-common 'RPCGSSDOPTS="-n"'
ainsl /etc/pam.d/common-auth 'auth optional pam_script.so'
-ainsl /etc/pam.d/common-session 'session required pam_mkhomedir.so skel=/etc/skel umask=0027'
cat > $FILE <<EOF
#!/bin/sh
#
set -e
FILE=/tmp/krb5cc_roaming
+HOMEDIR=/home/\$PAM_USER
-if [ \$PAM_USER = "root" ] || [ -e /etc/krb5.keytab ] || [ -e \$FILE ] ; then
+if [ \$PAM_USER = "root" ] ; then
+ exit 0
+elif [ ! -d \$HOMEDIR ] ; then
+ cp -pR /etc/skel \$HOMEDIR
+ chmod 750 \$HOMEDIR
+ chown -R \$PAM_USER:\$PAM_USER \$HOMEDIR
+ echo "Successfully created off-line home directory '\$HOMEDIR' for user '\$PAM_USER'."
+elif [ -e /etc/krb5.keytab ] || [ -e \$FILE ] ; then
exit 0
fi
-
-cp -v /tmp/krb5cc_* \$FILE
+ID=\$(id -u \$PAM_USER)
+cp -v /tmp/krb5cc_\${ID}_* \$FILE
/etc/init.d/autofs restart > /dev/null
exit 0
diff --git a/fai/config/scripts/ROAMING/20-sssd_fstab b/fai/config/scripts/ROAMING/20-sssd_fstab
index 9f4e26f..26ba69d 100755
--- a/fai/config/scripts/ROAMING/20-sssd_fstab
+++ b/fai/config/scripts/ROAMING/20-sssd_fstab
@@ -7,8 +7,10 @@ fcopy -m root,root,0600 /etc/sssd/sssd.conf
HOMEDIRS='/lan/mainserver/home0'
## Make sure the home directories are accessible:
-umask 022
-mkdir -p $target/$HOMEDIRS
+if [ "$FAI_ACTION" == "install" ] || [ "$CONVERT" == "true" ] ; then
+ umask 022
+ mkdir -p $target/$HOMEDIRS
+fi
## Bind mount the home directories to /home for offline use,
## when the local files are hidden by the NFS mount:
--
Debian-LAN development and packaging
More information about the debian-lan-devel
mailing list