summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt
diff options
context:
space:
mode:
authorSimon Rettberg2018-03-13 11:01:10 +0100
committerSimon Rettberg2018-03-13 11:01:10 +0100
commit25afaf25a3728ee58daccf8cbaa01c94efcb1c5e (patch)
tree017049fe2a68c40b5caa43de975eb560f42eaaf7 /core/modules/run-virt/data/opt
parent[pam-slx-plug] Fix typo (krb5.conf) (diff)
downloadmltk-25afaf25a3728ee58daccf8cbaa01c94efcb1c5e.tar.gz
mltk-25afaf25a3728ee58daccf8cbaa01c94efcb1c5e.tar.xz
mltk-25afaf25a3728ee58daccf8cbaa01c94efcb1c5e.zip
[run-virt] Copy user's kerberos ticket to virtual floppy
Diffstat (limited to 'core/modules/run-virt/data/opt')
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc17
1 files changed, 12 insertions, 5 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc
index c7f30072..706cae62 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc
@@ -92,9 +92,9 @@ setup_virtual_floppy() {
if [[ "$( tr '[A-Z]' '[a-z]' <<< ${VM_OS_TYPE})" = *windows* ]]; then
cmd=(tr / '\\')
fi
- < $NETSHARES "${cmd[@]}" >> "${SHARES}"
- # replace the tag for the username, if present
- sed -i 's/%loginuser%/'"${USER}"'/g' "${SHARES}"
+ # replace the tag for the username, if present; the variable expansion escapes all ':' in $USER
+ sed -i "s:%loginuser%:${USER//:/\\:}:g" "${NETSHARES}"
+ < "${NETSHARES}" "${cmd[@]}" >> "${SHARES}"
fi
fi
@@ -133,8 +133,15 @@ setup_virtual_floppy() {
EOF
# Copy all them there filez into floppy image
- mcopy -i "${SLX_FLOPPY_IMG}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" "${SHARES}" "::/"
- mcopy -i "${SLX_FLOPPY_IMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/"
+ mcopy -i "${SLX_FLOPPY_IMG}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" "${SHARES}" "${VMCHOOSER_DIR}/data/openslx.exe" "::/"
+ # If we have a kerberos ticket, copy that one too (TODO: Copy keytab too?)
+ if [ -n "$KRB5CCNAME" ]; then
+ kf=${KRB5CCNAME#FILE:}
+ kf=${kf#file:}
+ if [ -n "$kf" ] && [ -f "$kf" ]; then
+ mcopy -i "${SLX_FLOPPY_IMG}" "$kf" "::/krb5user.key"
+ fi
+ fi
# Copy guest configuration (with added information) config.xml to be accessed
# via virtual floppy
mcopy -i "${SLX_FLOPPY_IMG}" "$XML_FILE" "::/config.xml"