summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimon Rettberg2016-03-04 16:25:59 +0100
committerSimon Rettberg2016-03-04 16:25:59 +0100
commit89e1f7912959ec9338022057dc8ee58c200c91c2 (patch)
treeb14f4f5e8788fc395d3d93ba4cd96d50579b3609 /server
parent[run-virt] Add pw passing and share mounting mechanism for win vms (diff)
downloadtm-scripts-89e1f7912959ec9338022057dc8ee58c200c91c2.tar.gz
tm-scripts-89e1f7912959ec9338022057dc8ee58c200c91c2.tar.xz
tm-scripts-89e1f7912959ec9338022057dc8ee58c200c91c2.zip
[run-virt/vmware] Mount home directory in windows (first working version)
Diffstat (limited to 'server')
-rw-r--r--server/modules/auth-freiburg/opt/openslx/scripts/pam_script_mount_persistent8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/modules/auth-freiburg/opt/openslx/scripts/pam_script_mount_persistent b/server/modules/auth-freiburg/opt/openslx/scripts/pam_script_mount_persistent
index d6a6d02c..0f19764e 100644
--- a/server/modules/auth-freiburg/opt/openslx/scripts/pam_script_mount_persistent
+++ b/server/modules/auth-freiburg/opt/openslx/scripts/pam_script_mount_persistent
@@ -20,6 +20,8 @@ if ! grep -q "^${PAM_USER}:" "/etc/passwd"; then
CIFS_VOLUME=$(cat /tmp/ldapsearch.${PAM_USER} | grep rufHomepath | cut -d" " -f2 | tr '\\' '/')
if [ ! -z "${CIFS_VOLUME}" ]; then
+ # For passing back to pam auth script
+ PERSISTENT_NETPATH="$CIFS_VOLUME"
# now we can mount the home directory!
MOUNT_OPTS="-t cifs -o uid=${USER_UID},gid=${USER_GID},forceuid,forcegid,file_mode=0700,dir_mode=0700,nobrl,noacl"
export USER="${PAM_USER}"
@@ -41,8 +43,8 @@ if ! grep -q "^${PAM_USER}:" "/etc/passwd"; then
elif kill -9 "${MOUNT_PID}" 2>/dev/null; then
slxlog "pam-freiburg-cifs" "Mount of '${CIFS_VOLUME}' to '${PERSISTENT_HOME_DIR}' timed out. (Args: ${MOUNT_OPTS})" "$MOUNT_OUTPUT"
else
- PERSISTENT_OK=yes
- fi
+ PERSISTENT_OK=yes
+ fi
( sleep 2; rm -f -- "$MOUNT_OUTPUT" ) &
else
slxlog "pam-freiburg-ldap-cifs-volume" "LDAP server did not provide 'rufHomepath'. Aborting mount for ${PAM_USER}."
@@ -94,6 +96,8 @@ if ! grep -q "^${PAM_USER}:" "/etc/passwd"; then
elif kill -9 "${MOUNT_PID}" 2>/dev/null; then
slxlog "pam-freiburg-krb" "Mount of '${FILESERVER}:${VOLUME}' to '${PERSISTENT_HOME_DIR}' timed out. (Args: ${MOUNT_OPTS})" "$MOUNT_OUTPUT"
else
+ # Override, cifs didn't work, maybe windows has the nfs client installed :>
+ PERSISTENT_NETPATH="${FILESERVER}:${VOLUME}"
PERSISTENT_OK=yes
fi
( sleep 2; rm -f -- "$MOUNT_OUTPUT" ) &