From acd892c44dea80442d8e704bc6cb19ed74bd48e9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 28 Nov 2017 16:46:35 +0100 Subject: Rename various scripts, so that they have 'arctica-greeter' in their file name (and not just 'arctica'). --- Makefile.am | 10 +- arctica-greeter-guest-account-script.in | 231 +++++++++++++++++++++ arctica-greeter-guest-session-auto.sh | 68 ++++++ arctica-greeter-guest-session-setup.sh | 33 +++ arctica-guest-account-script.sh.in | 231 --------------------- arctica-guest-session-auto.sh | 68 ------ arctica-guest-session-setup.sh | 33 --- data/50-arctica-greeter-guest-wrapper.conf.in | 2 + data/50-arctica-guest-wrapper.conf.in | 2 - data/Makefile.am | 12 +- data/arctica-greeter-guest-account-script.1 | 27 +++ ...rctica-greeter-guest-session-startup.desktop.in | 5 + data/arctica-guest-session-startup.desktop.in | 5 - debian/arctica-greeter-guest-session.install | 10 +- debian/copyright | 10 +- po/POTFILES.in | 4 +- 16 files changed, 389 insertions(+), 362 deletions(-) create mode 100755 arctica-greeter-guest-account-script.in create mode 100755 arctica-greeter-guest-session-auto.sh create mode 100755 arctica-greeter-guest-session-setup.sh delete mode 100755 arctica-guest-account-script.sh.in delete mode 100755 arctica-guest-session-auto.sh delete mode 100755 arctica-guest-session-setup.sh create mode 100644 data/50-arctica-greeter-guest-wrapper.conf.in delete mode 100644 data/50-arctica-guest-wrapper.conf.in create mode 100644 data/arctica-greeter-guest-account-script.1 create mode 100644 data/arctica-greeter-guest-session-startup.desktop.in delete mode 100644 data/arctica-guest-session-startup.desktop.in diff --git a/Makefile.am b/Makefile.am index 9c08fa5..7ba4009 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,14 +2,14 @@ SUBDIRS = src data po tests -arctica-guest-account-script: arctica-guest-account-script.sh.in +arctica-greeter-guest-account-script: arctica-greeter-guest-account-script.in $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ -sbin_SCRIPTS = arctica-guest-account-script +sbin_SCRIPTS = arctica-greeter-guest-account-script pkglibexec_SCRIPTS = lightdm-arctica-greeter-session \ - arctica-guest-session-auto.sh \ - arctica-guest-session-setup.sh \ + arctica-greeter-guest-session-auto.sh \ + arctica-greeter-guest-session-setup.sh \ arctica-greeter-set-keyboard-layout EXTRA_DIST = \ @@ -19,7 +19,7 @@ EXTRA_DIST = \ DISTCLEANFILES = \ Makefile.in \ aclocal.m4 \ - arctica-guest-account-script \ + arctica-greeter-guest-account-script \ compile \ configure \ config.h.in \ diff --git a/arctica-greeter-guest-account-script.in b/arctica-greeter-guest-account-script.in new file mode 100755 index 0000000..5c0786d --- /dev/null +++ b/arctica-greeter-guest-account-script.in @@ -0,0 +1,231 @@ +#!/bin/sh -e +# (C) 2008 Canonical Ltd. +# Author: Martin Pitt +# License: GPL v2 or later +# modified by David D Lowe and Thomas Detoux +# +# Setup user and temporary home directory for guest session. +# If this succeeds, this script needs to print the username as the last line to +# stdout. + +. gettext.sh + +export TEXTDOMAINDIR=/usr/share/locale +export TEXTDOMAIN=arctica-greeter + +# set the system wide locale for gettext calls +if [ -f /etc/default/locale ]; then + . /etc/default/locale + LANGUAGE= + export LANG LANGUAGE +fi + +is_system_user () +{ + UID_MIN=$(cat /etc/login.defs | grep UID_MIN | awk '{print $2}') + SYS_UID_MIN=$(cat /etc/login.defs | grep SYS_UID_MIN | awk '{print $2}') + SYS_UID_MAX=$(cat /etc/login.defs | grep SYS_UID_MAX | awk '{print $2}') + + SYS_UID_MIN=${SYS_UID_MIN:-101} + SYS_UID_MAX=${SYS_UID_MAX:-$(( UID_MIN - 1 ))} + + [ ${1} -ge ${SYS_UID_MIN} ] && [ ${1} -le ${SYS_UID_MAX} ] +} + +add_account () +{ + temp_home=$(mktemp -td guest-XXXXXX) + GUEST_HOME=$(echo ${temp_home} | tr '[:upper:]' '[:lower:]') + GUEST_USER=${GUEST_HOME#/tmp/} + if [ "${GUEST_HOME}" != "${temp_home}" ]; then + mkdir "${GUEST_HOME}" || { + echo "Failed to create ${GUEST_USER}'s home directory (${GUEST_HOME})" + exit 1 + } + rmdir "${temp_home}" + fi + + # if ${GUEST_USER} already exists, it must be a locked system account with no existing + # home directory + if PWSTAT=$(passwd -S ${GUEST_USER}) 2>/dev/null; then + if [ $(echo ${PWSTAT} | cut -f2 -d' ') != L ]; then + echo "User account ${GUEST_USER} already exists and is not locked" + exit 1 + fi + + PWENT=$(getent passwd ${GUEST_USER}) || { + echo "getent passwd ${GUEST_USER} failed" + exit 1 + } + + GUEST_UID=$(echo ${PWENT} | cut -f3 -d:) + + if ! is_system_user ${GUEST_UID}; then + echo "Account ${GUEST_USER} is not a system user" + exit 1 + fi + + GUEST_HOME=$(echo ${PWENT} | cut -f6 -d:) + + if [ ${GUEST_HOME} != / ] && [ ${GUEST_HOME#/tmp} = ${GUEST_HOME} ] && [ -d ${GUEST_HOME} ]; then + echo "Home directory of ${GUEST_USER} already exists" + exit 1 + fi + else + # does not exist, so create it + useradd --system --home-dir ${GUEST_HOME} --comment $(eval_gettext "Guest") --user-group --shell /bin/bash ${GUEST_USER} || { + rm -rf ${GUEST_HOME} + exit 1 + } + fi + + dist_gs=/usr/share/arctica-greeter/guest-session + site_gs=/etc/arctica-greeter/guest-session + + # create temporary home directory + mount -t tmpfs -o mode=700,uid=${GUEST_USER} none ${GUEST_HOME} || { + rm -rf ${GUEST_HOME} + exit 1 + } + + if [ -d ${site_gs}/skel ] && [ "$(ls -A ${site_gs}/skel)" ]; then + # Only perform union-mounting if BindFS is available + if [ -x /usr/bin/bindfs ]; then + bindfs_mount=true + + # Try OverlayFS first + if modinfo -n overlay >/dev/null 2>&1; then + mkdir ${GUEST_HOME}/upper ${GUEST_HOME}/work + chown ${GUEST_USER}:${GUEST_USER} ${GUEST_HOME}/upper ${GUEST_HOME}/work + + mount -t overlay -o lowerdir=${dist_gs}/skel:${site_gs}/skel,upperdir=${GUEST_HOME}/upper,workdir=${GUEST_HOME}/work overlay ${GUEST_HOME} || { + umount ${GUEST_HOME} + rm -rf ${GUEST_HOME} + exit 1 + } + # If OverlayFS is not available, try AuFS + elif [ -x /sbin/mount.aufs ]; then + mount -t aufs -o br=${GUEST_HOME}:${dist_gs}/skel:${site_gs}/skel none ${GUEST_HOME} || { + umount ${GUEST_HOME} + rm -rf ${GUEST_HOME} + exit 1 + } + # If none of them is available, fall back to copy over + else + cp -rT ${site_gs}/skel/ ${GUEST_HOME} + cp -rT ${dist_gs}/skel/ ${GUEST_HOME} + chown -R ${GUEST_USER}:${GUEST_USER} ${GUEST_HOME} + bindfs_mount=false + fi + + if ${bindfs_mount}; then + # Wrap ${GUEST_HOME} in a BindFS mount, so that + # ${GUEST_USER} will be seen as the owner of ${GUEST_HOME}'s contents. + bindfs -u ${GUEST_USER} -g ${GUEST_USER} ${GUEST_HOME} ${GUEST_HOME} || { + umount ${GUEST_HOME} # union mount + umount ${GUEST_HOME} # tmpfs mount + rm -rf ${GUEST_HOME} + exit 1 + } + fi + # If BindFS is not available, just fall back to copy over + else + cp -rT ${site_gs}/skel/ ${GUEST_HOME} + cp -rT ${dist_gs}/skel/ ${GUEST_HOME} + chown -R ${GUEST_USER}:${GUEST_USER} ${GUEST_HOME} + fi + else + cp -rT /etc/skel/ ${GUEST_HOME} + cp -rT ${dist_gs}/skel/ ${GUEST_HOME} + chown -R ${GUEST_USER}:${GUEST_USER} ${GUEST_HOME} + fi + + # setup session + su ${GUEST_USER} -c "env HOME=${GUEST_HOME} site_gs=${site_gs} @pkglibexecdir@/arctica-guest-session-setup.sh" + + # set possible local guest session preferences + source_local_prefs() { + local USER=${GUEST_USER} + local HOME=${GUEST_HOME} + . ${site_gs}/prefs.sh + chown -R ${USER}:${USER} ${HOME} + } + if [ -f ${site_gs}/prefs.sh ]; then + source_local_prefs + fi + + echo ${GUEST_USER} +} + +remove_account () +{ + GUEST_USER=${1} + + PWENT=$(getent passwd ${GUEST_USER}) || { + echo "Error: invalid user ${GUEST_USER}" + exit 1 + } + + GUEST_UID=$(echo ${PWENT} | cut -f3 -d:) + + if ! is_system_user ${GUEST_UID}; then + echo "Error: user ${GUEST_USER} is not a system user." + exit 1 + fi + + GUEST_HOME=$(echo ${PWENT} | cut -f6 -d:) + + # kill all remaining processes + if [ -x /bin/loginctl ] || [ -x /usr/bin/loginctl ]; then + loginctl --signal=9 kill-user ${GUEST_USER} >/dev/null || true + else + while ps h -u ${GUEST_USER} >/dev/null + do + killall -9 -u ${GUEST_USER} || true + sleep 0.2; + done + fi + + if [ ${GUEST_HOME} = ${GUEST_HOME#/tmp/} ]; then + echo "Warning: home directory ${GUEST_HOME} is not in /tmp/. It won't be removed." + else + umount ${GUEST_HOME} || umount -l ${GUEST_HOME} || true # BindFS mount + umount ${GUEST_HOME} || umount -l ${GUEST_HOME} || true # union mount + umount ${GUEST_HOME} || umount -l ${GUEST_HOME} || true # tmpfs mount + rm -rf ${GUEST_HOME} + fi + + # remove leftovers in /tmp + find /tmp -mindepth 1 -maxdepth 1 -uid ${GUEST_UID} -print0 | xargs -0 rm -rf || true + + # remove possible {/run,}/media/guest-XXXXXX folder + for media_dir in /run/media/${GUEST_USER} /media/${GUEST_USER}; do + if [ -d ${media_dir} ]; then + for dir in $(find ${media_dir} -mindepth 1 -maxdepth 1); do + umount ${dir} || true + done + + rmdir ${media_dir} || true + fi + done + + userdel --force ${GUEST_USER} +} + +case ${1} in + add) + add_account + ;; + remove) + if [ -z ${2} ] ; then + echo "Usage: ${0} remove [account]" + exit 1 + fi + + remove_account ${2} + ;; + *) + echo "Usage: ${0} add" + echo " ${0} remove [account]" + exit 1 +esac diff --git a/arctica-greeter-guest-session-auto.sh b/arctica-greeter-guest-session-auto.sh new file mode 100755 index 0000000..785b077 --- /dev/null +++ b/arctica-greeter-guest-session-auto.sh @@ -0,0 +1,68 @@ +#!/bin/sh +# +# Copyright (C) 2013 Canonical Ltd +# Author: Gunnar Hjalmarsson +# +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, version 3 of the License. +# +# See http://www.gnu.org/copyleft/gpl.html the full text of the license. + +# This script is run via autostart at the launch of a guest session. + +. gettext.sh + +export TEXTDOMAINDIR=/usr/share/locale +export TEXTDOMAIN=arctica-greeter + +DIALOG_SLEEP=${DIALOG_SLEEP:-4} + +# disable screen locking (GNOME, Unity) +gsettings set org.gnome.desktop.lockdown disable-lock-screen true + +# disable screen locking (MATE) +gsettings set org.mate.screensaver lock-enabled false + +# disable screenlocking (XFCE, Pantheon) +gsettings set apps.light-locker light-locker-enabled false +gsettings set apps.light-locker late-locking false +gsettings set apps.light-locker lock-on-lid false +gsettings set apps.light-locker lock-on-suspend false + +# info dialog about the temporary nature of a guest session +dialog_content () { + TITLE=$(eval_gettext 'Temporary Guest Session') + TEXT=$(eval_gettext 'All data created during this guest session will be deleted +when you log out, and settings will be reset to defaults. +Please save files on some external device, for instance a +USB stick, if you would like to access them again later.') + para2=$(eval_gettext 'Another alternative is to save files in the +/var/guest-data folder.') + test -w /var/guest-data && TEXT="$TEXT\n\n$para2" +} +test -f "$HOME"/.skip-guest-warning-dialog || { + if [ "$KDE_FULL_SESSION" = true ] && [ -x /usr/bin/kdialog ]; then + dialog_content + TEXT_FILE="$HOME"/.guest-session-kdialog + echo -n "$TEXT" > $TEXT_FILE + { + # Sleep to wait for the the info dialog to start. + # This way the window will likely become focused. + sleep $DIALOG_SLEEP + kdialog --title "$TITLE" --textbox $TEXT_FILE 450 250 + rm -f $TEXT_FILE + } & + elif [ -x /usr/bin/zenity ]; then + dialog_content + { + # Sleep to wait for the the info dialog to start. + # This way the window will likely become focused. + sleep $DIALOG_SLEEP + zenity --warning --no-wrap --title="$TITLE" --text="$TEXT" + } & + fi +} + +# run possible local startup commands +test -f /etc/guest-session/auto.sh && . /etc/guest-session/auto.sh diff --git a/arctica-greeter-guest-session-setup.sh b/arctica-greeter-guest-session-setup.sh new file mode 100755 index 0000000..595d0bc --- /dev/null +++ b/arctica-greeter-guest-session-setup.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +HOME=${HOME:-$(getent passwd $(whoami) | cut -f6 -d:)} + +# disable some services that are unnecessary for the guest session +services="jockey-kde.desktop jockey-gtk.desktop update-notifier.desktop user-dirs-update-gtk.desktop" + +for service in ${services}; do + if [ -e /etc/xdg/autostart/${service} ]; then + [ -f ${HOME}/.config/autostart/${service} ] || cp /etc/xdg/autostart/${service} ${HOME}/.config/autostart + echo "X-GNOME-Autostart-enabled=false" >> ${HOME}/.config/autostart/${service} + fi +done + +# disable Unity shortcut hint +[ -d ${HOME}/.cache/unity ] || mkdir -p ${HOME}/.cache/unity +touch ${HOME}/.cache/unity/first_run.stamp + +[ -d ${HOME}/.kde/share/config ] || mkdir -p ${HOME}/.kde/share/config +echo "[Basic Settings]" >> ${HOME}/.kde/share/config/nepomukserverrc +echo "Start Nepomuk=false" >> ${HOME}/.kde/share/config/nepomukserverrc + +echo "[Event]" >> ${HOME}/.kde/share/config/notificationhelper +echo "hideHookNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper +echo "hideInstallNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper +echo "hideRestartNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper + +# Load restricted session +#dmrc='[Desktop]\nSession=guest-restricted' +#/bin/echo -e ${dmrc} > ${HOME}/.dmrc + +# delay the launch of info dialog +echo "export DIALOG_SLEEP=4" >> ${HOME}/.profile diff --git a/arctica-guest-account-script.sh.in b/arctica-guest-account-script.sh.in deleted file mode 100755 index 5c0786d..0000000 --- a/arctica-guest-account-script.sh.in +++ /dev/null @@ -1,231 +0,0 @@ -#!/bin/sh -e -# (C) 2008 Canonical Ltd. -# Author: Martin Pitt -# License: GPL v2 or later -# modified by David D Lowe and Thomas Detoux -# -# Setup user and temporary home directory for guest session. -# If this succeeds, this script needs to print the username as the last line to -# stdout. - -. gettext.sh - -export TEXTDOMAINDIR=/usr/share/locale -export TEXTDOMAIN=arctica-greeter - -# set the system wide locale for gettext calls -if [ -f /etc/default/locale ]; then - . /etc/default/locale - LANGUAGE= - export LANG LANGUAGE -fi - -is_system_user () -{ - UID_MIN=$(cat /etc/login.defs | grep UID_MIN | awk '{print $2}') - SYS_UID_MIN=$(cat /etc/login.defs | grep SYS_UID_MIN | awk '{print $2}') - SYS_UID_MAX=$(cat /etc/login.defs | grep SYS_UID_MAX | awk '{print $2}') - - SYS_UID_MIN=${SYS_UID_MIN:-101} - SYS_UID_MAX=${SYS_UID_MAX:-$(( UID_MIN - 1 ))} - - [ ${1} -ge ${SYS_UID_MIN} ] && [ ${1} -le ${SYS_UID_MAX} ] -} - -add_account () -{ - temp_home=$(mktemp -td guest-XXXXXX) - GUEST_HOME=$(echo ${temp_home} | tr '[:upper:]' '[:lower:]') - GUEST_USER=${GUEST_HOME#/tmp/} - if [ "${GUEST_HOME}" != "${temp_home}" ]; then - mkdir "${GUEST_HOME}" || { - echo "Failed to create ${GUEST_USER}'s home directory (${GUEST_HOME})" - exit 1 - } - rmdir "${temp_home}" - fi - - # if ${GUEST_USER} already exists, it must be a locked system account with no existing - # home directory - if PWSTAT=$(passwd -S ${GUEST_USER}) 2>/dev/null; then - if [ $(echo ${PWSTAT} | cut -f2 -d' ') != L ]; then - echo "User account ${GUEST_USER} already exists and is not locked" - exit 1 - fi - - PWENT=$(getent passwd ${GUEST_USER}) || { - echo "getent passwd ${GUEST_USER} failed" - exit 1 - } - - GUEST_UID=$(echo ${PWENT} | cut -f3 -d:) - - if ! is_system_user ${GUEST_UID}; then - echo "Account ${GUEST_USER} is not a system user" - exit 1 - fi - - GUEST_HOME=$(echo ${PWENT} | cut -f6 -d:) - - if [ ${GUEST_HOME} != / ] && [ ${GUEST_HOME#/tmp} = ${GUEST_HOME} ] && [ -d ${GUEST_HOME} ]; then - echo "Home directory of ${GUEST_USER} already exists" - exit 1 - fi - else - # does not exist, so create it - useradd --system --home-dir ${GUEST_HOME} --comment $(eval_gettext "Guest") --user-group --shell /bin/bash ${GUEST_USER} || { - rm -rf ${GUEST_HOME} - exit 1 - } - fi - - dist_gs=/usr/share/arctica-greeter/guest-session - site_gs=/etc/arctica-greeter/guest-session - - # create temporary home directory - mount -t tmpfs -o mode=700,uid=${GUEST_USER} none ${GUEST_HOME} || { - rm -rf ${GUEST_HOME} - exit 1 - } - - if [ -d ${site_gs}/skel ] && [ "$(ls -A ${site_gs}/skel)" ]; then - # Only perform union-mounting if BindFS is available - if [ -x /usr/bin/bindfs ]; then - bindfs_mount=true - - # Try OverlayFS first - if modinfo -n overlay >/dev/null 2>&1; then - mkdir ${GUEST_HOME}/upper ${GUEST_HOME}/work - chown ${GUEST_USER}:${GUEST_USER} ${GUEST_HOME}/upper ${GUEST_HOME}/work - - mount -t overlay -o lowerdir=${dist_gs}/skel:${site_gs}/skel,upperdir=${GUEST_HOME}/upper,workdir=${GUEST_HOME}/work overlay ${GUEST_HOME} || { - umount ${GUEST_HOME} - rm -rf ${GUEST_HOME} - exit 1 - } - # If OverlayFS is not available, try AuFS - elif [ -x /sbin/mount.aufs ]; then - mount -t aufs -o br=${GUEST_HOME}:${dist_gs}/skel:${site_gs}/skel none ${GUEST_HOME} || { - umount ${GUEST_HOME} - rm -rf ${GUEST_HOME} - exit 1 - } - # If none of them is available, fall back to copy over - else - cp -rT ${site_gs}/skel/ ${GUEST_HOME} - cp -rT ${dist_gs}/skel/ ${GUEST_HOME} - chown -R ${GUEST_USER}:${GUEST_USER} ${GUEST_HOME} - bindfs_mount=false - fi - - if ${bindfs_mount}; then - # Wrap ${GUEST_HOME} in a BindFS mount, so that - # ${GUEST_USER} will be seen as the owner of ${GUEST_HOME}'s contents. - bindfs -u ${GUEST_USER} -g ${GUEST_USER} ${GUEST_HOME} ${GUEST_HOME} || { - umount ${GUEST_HOME} # union mount - umount ${GUEST_HOME} # tmpfs mount - rm -rf ${GUEST_HOME} - exit 1 - } - fi - # If BindFS is not available, just fall back to copy over - else - cp -rT ${site_gs}/skel/ ${GUEST_HOME} - cp -rT ${dist_gs}/skel/ ${GUEST_HOME} - chown -R ${GUEST_USER}:${GUEST_USER} ${GUEST_HOME} - fi - else - cp -rT /etc/skel/ ${GUEST_HOME} - cp -rT ${dist_gs}/skel/ ${GUEST_HOME} - chown -R ${GUEST_USER}:${GUEST_USER} ${GUEST_HOME} - fi - - # setup session - su ${GUEST_USER} -c "env HOME=${GUEST_HOME} site_gs=${site_gs} @pkglibexecdir@/arctica-guest-session-setup.sh" - - # set possible local guest session preferences - source_local_prefs() { - local USER=${GUEST_USER} - local HOME=${GUEST_HOME} - . ${site_gs}/prefs.sh - chown -R ${USER}:${USER} ${HOME} - } - if [ -f ${site_gs}/prefs.sh ]; then - source_local_prefs - fi - - echo ${GUEST_USER} -} - -remove_account () -{ - GUEST_USER=${1} - - PWENT=$(getent passwd ${GUEST_USER}) || { - echo "Error: invalid user ${GUEST_USER}" - exit 1 - } - - GUEST_UID=$(echo ${PWENT} | cut -f3 -d:) - - if ! is_system_user ${GUEST_UID}; then - echo "Error: user ${GUEST_USER} is not a system user." - exit 1 - fi - - GUEST_HOME=$(echo ${PWENT} | cut -f6 -d:) - - # kill all remaining processes - if [ -x /bin/loginctl ] || [ -x /usr/bin/loginctl ]; then - loginctl --signal=9 kill-user ${GUEST_USER} >/dev/null || true - else - while ps h -u ${GUEST_USER} >/dev/null - do - killall -9 -u ${GUEST_USER} || true - sleep 0.2; - done - fi - - if [ ${GUEST_HOME} = ${GUEST_HOME#/tmp/} ]; then - echo "Warning: home directory ${GUEST_HOME} is not in /tmp/. It won't be removed." - else - umount ${GUEST_HOME} || umount -l ${GUEST_HOME} || true # BindFS mount - umount ${GUEST_HOME} || umount -l ${GUEST_HOME} || true # union mount - umount ${GUEST_HOME} || umount -l ${GUEST_HOME} || true # tmpfs mount - rm -rf ${GUEST_HOME} - fi - - # remove leftovers in /tmp - find /tmp -mindepth 1 -maxdepth 1 -uid ${GUEST_UID} -print0 | xargs -0 rm -rf || true - - # remove possible {/run,}/media/guest-XXXXXX folder - for media_dir in /run/media/${GUEST_USER} /media/${GUEST_USER}; do - if [ -d ${media_dir} ]; then - for dir in $(find ${media_dir} -mindepth 1 -maxdepth 1); do - umount ${dir} || true - done - - rmdir ${media_dir} || true - fi - done - - userdel --force ${GUEST_USER} -} - -case ${1} in - add) - add_account - ;; - remove) - if [ -z ${2} ] ; then - echo "Usage: ${0} remove [account]" - exit 1 - fi - - remove_account ${2} - ;; - *) - echo "Usage: ${0} add" - echo " ${0} remove [account]" - exit 1 -esac diff --git a/arctica-guest-session-auto.sh b/arctica-guest-session-auto.sh deleted file mode 100755 index 785b077..0000000 --- a/arctica-guest-session-auto.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2013 Canonical Ltd -# Author: Gunnar Hjalmarsson -# -# This program is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation, version 3 of the License. -# -# See http://www.gnu.org/copyleft/gpl.html the full text of the license. - -# This script is run via autostart at the launch of a guest session. - -. gettext.sh - -export TEXTDOMAINDIR=/usr/share/locale -export TEXTDOMAIN=arctica-greeter - -DIALOG_SLEEP=${DIALOG_SLEEP:-4} - -# disable screen locking (GNOME, Unity) -gsettings set org.gnome.desktop.lockdown disable-lock-screen true - -# disable screen locking (MATE) -gsettings set org.mate.screensaver lock-enabled false - -# disable screenlocking (XFCE, Pantheon) -gsettings set apps.light-locker light-locker-enabled false -gsettings set apps.light-locker late-locking false -gsettings set apps.light-locker lock-on-lid false -gsettings set apps.light-locker lock-on-suspend false - -# info dialog about the temporary nature of a guest session -dialog_content () { - TITLE=$(eval_gettext 'Temporary Guest Session') - TEXT=$(eval_gettext 'All data created during this guest session will be deleted -when you log out, and settings will be reset to defaults. -Please save files on some external device, for instance a -USB stick, if you would like to access them again later.') - para2=$(eval_gettext 'Another alternative is to save files in the -/var/guest-data folder.') - test -w /var/guest-data && TEXT="$TEXT\n\n$para2" -} -test -f "$HOME"/.skip-guest-warning-dialog || { - if [ "$KDE_FULL_SESSION" = true ] && [ -x /usr/bin/kdialog ]; then - dialog_content - TEXT_FILE="$HOME"/.guest-session-kdialog - echo -n "$TEXT" > $TEXT_FILE - { - # Sleep to wait for the the info dialog to start. - # This way the window will likely become focused. - sleep $DIALOG_SLEEP - kdialog --title "$TITLE" --textbox $TEXT_FILE 450 250 - rm -f $TEXT_FILE - } & - elif [ -x /usr/bin/zenity ]; then - dialog_content - { - # Sleep to wait for the the info dialog to start. - # This way the window will likely become focused. - sleep $DIALOG_SLEEP - zenity --warning --no-wrap --title="$TITLE" --text="$TEXT" - } & - fi -} - -# run possible local startup commands -test -f /etc/guest-session/auto.sh && . /etc/guest-session/auto.sh diff --git a/arctica-guest-session-setup.sh b/arctica-guest-session-setup.sh deleted file mode 100755 index 595d0bc..0000000 --- a/arctica-guest-session-setup.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -HOME=${HOME:-$(getent passwd $(whoami) | cut -f6 -d:)} - -# disable some services that are unnecessary for the guest session -services="jockey-kde.desktop jockey-gtk.desktop update-notifier.desktop user-dirs-update-gtk.desktop" - -for service in ${services}; do - if [ -e /etc/xdg/autostart/${service} ]; then - [ -f ${HOME}/.config/autostart/${service} ] || cp /etc/xdg/autostart/${service} ${HOME}/.config/autostart - echo "X-GNOME-Autostart-enabled=false" >> ${HOME}/.config/autostart/${service} - fi -done - -# disable Unity shortcut hint -[ -d ${HOME}/.cache/unity ] || mkdir -p ${HOME}/.cache/unity -touch ${HOME}/.cache/unity/first_run.stamp - -[ -d ${HOME}/.kde/share/config ] || mkdir -p ${HOME}/.kde/share/config -echo "[Basic Settings]" >> ${HOME}/.kde/share/config/nepomukserverrc -echo "Start Nepomuk=false" >> ${HOME}/.kde/share/config/nepomukserverrc - -echo "[Event]" >> ${HOME}/.kde/share/config/notificationhelper -echo "hideHookNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper -echo "hideInstallNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper -echo "hideRestartNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper - -# Load restricted session -#dmrc='[Desktop]\nSession=guest-restricted' -#/bin/echo -e ${dmrc} > ${HOME}/.dmrc - -# delay the launch of info dialog -echo "export DIALOG_SLEEP=4" >> ${HOME}/.profile diff --git a/data/50-arctica-greeter-guest-wrapper.conf.in b/data/50-arctica-greeter-guest-wrapper.conf.in new file mode 100644 index 0000000..1ccd04d --- /dev/null +++ b/data/50-arctica-greeter-guest-wrapper.conf.in @@ -0,0 +1,2 @@ +[Seat:*] +guest-wrapper=@libexecdir@/lightdm/lightdm-guest-session diff --git a/data/50-arctica-guest-wrapper.conf.in b/data/50-arctica-guest-wrapper.conf.in deleted file mode 100644 index 1ccd04d..0000000 --- a/data/50-arctica-guest-wrapper.conf.in +++ /dev/null @@ -1,2 +0,0 @@ -[Seat:*] -guest-wrapper=@libexecdir@/lightdm/lightdm-guest-session diff --git a/data/Makefile.am b/data/Makefile.am index 3ccc581..686a520 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -3,19 +3,19 @@ 50-arctica-greeter.conf: 50-arctica-greeter.conf.in $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ -50-arctica-guest-wrapper.conf: 50-arctica-guest-wrapper.conf.in +50-arctica-greeter-guest-wrapper.conf: 50-arctica-greeter-guest-wrapper.conf.in $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ lightdm_confdir = $(datadir)/lightdm/lightdm.conf.d lightdm_conf_DATA = \ 50-arctica-greeter.conf \ - 50-arctica-guest-wrapper.conf + 50-arctica-greeter-guest-wrapper.conf -arctica-guest-session-startup.desktop: arctica-guest-session-startup.desktop.in +arctica-greeter-guest-session-startup.desktop: arctica-greeter-guest-session-startup.desktop.in $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ guestsession_autostartdir = $(datadir)/arctica-greeter/guest-session/skel/.config/autostart -guestsession_autostart_DATA = arctica-guest-session-startup.desktop +guestsession_autostart_DATA = arctica-greeter-guest-session-startup.desktop xgreeterdir = $(datarootdir)/xgreeters dist_xgreeter_in_files = arctica-greeter.desktop.in @@ -91,8 +91,8 @@ EXTRA_DIST = \ DISTCLEANFILES = \ 50-arctica-greeter.conf \ - 50-arctica-guest-wrapper.conf \ + 50-arctica-greeter-guest-wrapper.conf \ arctica-greeter.desktop \ - arctica-guest-session-startup.desktop \ + arctica-greeter-guest-session-startup.desktop \ Makefile.in \ logo.png diff --git a/data/arctica-greeter-guest-account-script.1 b/data/arctica-greeter-guest-account-script.1 new file mode 100644 index 0000000..58a35a6 --- /dev/null +++ b/data/arctica-greeter-guest-account-script.1 @@ -0,0 +1,27 @@ +.TH UNITY-GREETER 1 "June 21, 2012" +.SH NAME +arctica-greeter \- LightDM greeter for the Unity desktop +.SH SYNOPSIS +.B arctica-greeter +[ +.I OPTIONS +] +.SH DESCRIPTION +.B Arctica Greeter +is a LightDM greeter for the Unity desktop. +It is run by the LightDM daemon if configured in lightdm.conf. +It is not normally run by a user, but can run in a test mode with the \-\-test-mode option. +This allows the interface to be tested without installing an updated version. +.PP +.SH OPTIONS +.TP +.B \-v, \-\-version +Show release version. +.TP +.B \-\-test-mode +Run the greeter in a test mode inside the current X session. +.TP +.B \-?, \-\-help +Show help options. +.SH SEE ALSO +.B lightdm diff --git a/data/arctica-greeter-guest-session-startup.desktop.in b/data/arctica-greeter-guest-session-startup.desktop.in new file mode 100644 index 0000000..f0b702f --- /dev/null +++ b/data/arctica-greeter-guest-session-startup.desktop.in @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=Custom startup command for Arctica Greeter's guest session +Type=Application +NoDisplay=true +Exec=@pkglibexecdir@/arctica-guest-session-auto.sh diff --git a/data/arctica-guest-session-startup.desktop.in b/data/arctica-guest-session-startup.desktop.in deleted file mode 100644 index f0b702f..0000000 --- a/data/arctica-guest-session-startup.desktop.in +++ /dev/null @@ -1,5 +0,0 @@ -[Desktop Entry] -Name=Custom startup command for Arctica Greeter's guest session -Type=Application -NoDisplay=true -Exec=@pkglibexecdir@/arctica-guest-session-auto.sh diff --git a/debian/arctica-greeter-guest-session.install b/debian/arctica-greeter-guest-session.install index 0b23f36..f5f55da 100644 --- a/debian/arctica-greeter-guest-session.install +++ b/debian/arctica-greeter-guest-session.install @@ -1,6 +1,6 @@ etc/lightdm/lightdm.conf.d/91* -usr/sbin/arctica-guest-account-script -usr/lib/*/arctica-greeter/arctica-guest-session-auto.sh -usr/lib/*/arctica-greeter/arctica-guest-session-setup.sh -usr/share/lightdm/lightdm.conf.d/50-arctica-guest-wrapper.conf -usr/share/arctica-greeter/guest-session/skel/.config/autostart/arctica-guest-session-startup.desktop +usr/sbin/arctica-greeter-guest-account-script +usr/lib/*/arctica-greeter/arctica-greeter-guest-session-auto.sh +usr/lib/*/arctica-greeter/arctica-greeter-guest-session-setup.sh +usr/share/lightdm/lightdm.conf.d/50-arctica-greeter-guest-wrapper.conf +usr/share/arctica-greeter/guest-session/skel/.config/autostart/arctica-greeter-guest-session-startup.desktop diff --git a/debian/copyright b/debian/copyright index 19644a1..91044ec 100644 --- a/debian/copyright +++ b/debian/copyright @@ -35,7 +35,7 @@ Copyright: 2011, Canonical Ltd 2017, Mike Gabriel License: GPL-3 -Files: arctica-guest-session-auto.sh +Files: arctica-greeter-guest-session-auto.sh lightdm-arctica-greeter-session src/cached-image.vala src/cairo-utils.vala @@ -267,7 +267,7 @@ Files: arctica-greeter-set-keyboard-layout Copyright: 2017, Clement Lefebvre License: GPL-3 -Files: arctica-guest-account-script.sh.in +Files: arctica-greeter-guest-account-script.sh.in Copyright: 2008, Canonical Ltd. License: GPL-2+ @@ -287,15 +287,15 @@ Files: AUTHORS NEWS.Canonical README arctica-greeter.doap - arctica-guest-session-setup.sh + arctica-greeter-guest-session-setup.sh autogen.sh configure.ac data/50-arctica-greeter.conf.in - data/50-arctica-guest-wrapper.conf.in + data/50-arctica-greeter-guest-wrapper.conf.in data/Makefile.am data/arctica-greeter.1 data/arctica-greeter.desktop.in - data/arctica-guest-session-startup.desktop.in + data/arctica-greeter-guest-session-startup.desktop.in data/org.ArcticaProject.arctica-greeter.gschema.xml po/LINGUAS po/POTFILES.in diff --git a/po/POTFILES.in b/po/POTFILES.in index 09042e2..73ba077 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -24,6 +24,6 @@ src/toggle-box.vala src/arctica-greeter.vala src/user-list.vala src/user-prompt-box.vala -arctica-guest-account-script.sh.in -arctica-guest-session-auto.sh +arctica-greeter-guest-account-script.sh.in +arctica-greeter-guest-session-auto.sh data/arctica-greeter.desktop.in -- cgit v1.2.3