summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-20 18:00:11 +0200
committerSimon Rettberg2016-05-20 18:00:11 +0200
commit6317b8320d90bbdf3834ba210202abff7b6a3844 (patch)
tree44b16e5667acd94dcc7031f1e2f6023494a3ddfb
parent[ldap/ad] Add pam line for bwidm auth (diff)
downloadtmlite-bwlp-6317b8320d90bbdf3834ba210202abff7b6a3844.tar.gz
tmlite-bwlp-6317b8320d90bbdf3834ba210202abff7b6a3844.tar.xz
tmlite-bwlp-6317b8320d90bbdf3834ba210202abff7b6a3844.zip
[ad] Mount-cifs: Try different mount options (smb3 etc)
-rw-r--r--data/ad/mountscript22
1 files changed, 10 insertions, 12 deletions
diff --git a/data/ad/mountscript b/data/ad/mountscript
index 95048af..d7ae209 100644
--- a/data/ad/mountscript
+++ b/data/ad/mountscript
@@ -39,26 +39,24 @@ if ! grep -q "^${PAM_USER}:" "/etc/passwd"; then
fi
if [ -n "${VOLUME}" ]; then
- MOUNT_OPTS="-v -t cifs -o uid=${USER_UID},gid=${USER_GID},forceuid,forcegid,sec=ntlm,nounix,file_mode=0700,dir_mode=0700"
- SIGNAL="/tmp/signal.${RANDOM}.${RANDOM}.${PAM_USER}.${RANDOM}"
export USER="${REAL_ACCOUNT}"
export PASSWD="${PAM_AUTHTOK}"
- ( mount ${MOUNT_OPTS} "${VOLUME}" "${PERSISTENT_HOME_DIR}" > "${RESULT}" 2>&1 || touch "${SIGNAL}" ) &
- MOUNT_PID=$!
- for COUNTER in 1 2 4 4; do
- kill -0 "${MOUNT_PID}" 2>/dev/null || break
- sleep "${COUNTER}"
+ echo '' > "${RESULT}"
+ for opt in "vers=1.0,sec=ntlm" "vers=3.0,sec=ntlm" "vers=1.0,sec=ntlmv2" "vers=3.0,sec=ntlmv2"; do
+ MOUNT_OPTS="-v -t cifs -o uid=${USER_UID},gid=${USER_GID},forceuid,forcegid,${opt},nounix,file_mode=0700,dir_mode=0700"
+ /opt/openslx/bin/timeout -t 8 -s 9 /opt/openslx/bin/timeout -t 7 -s 15 mount ${MOUNT_OPTS} "${VOLUME}" "${PERSISTENT_HOME_DIR}" >> "${RESULT}" 2>&1
+ RETVAL=$?
+ [ "$RETVAL" = "0" ] && break
done
- if [ -e "${SIGNAL}" ]; then
- slxlog "pam-ad-mount" "Mount of '${VOLUME}' to '${PERSISTENT_HOME_DIR}' failed. (Args: ${MOUNT_OPTS})" "${RESULT}"
- WAIT=1
- rm -f -- "${SIGNAL}"
- elif kill -9 "${MOUNT_PID}" 2>/dev/null; then
+ if [ "$RETVAL" = "124" ] || [ "$RETVAL" = "137" ] || [ "$RETVAL" = "143" ]; then
slxlog "pam-ad-mount" "Mount of '${VOLUME}' to '${PERSISTENT_HOME_DIR}' timed out. (Args: ${MOUNT_OPTS})" "${RESULT}"
WAIT=1
+ elif [ "$RETVAL" != "0" ]; then
+ slxlog "pam-ad-mount" "Mount of '${VOLUME}' to '${PERSISTENT_HOME_DIR}' failed. (Exit code: ${RETVAL}, Args: ${MOUNT_OPTS})" "${RESULT}"
+ WAIT=1
else
PERSISTENT_OK=yes
chmod -R u+rwX "${PERSISTENT_HOME_DIR}" 2>/dev/null