diff options
author | horsemanoffaith | 2016-09-11 22:13:38 -0700 |
---|---|---|
committer | horsemanoffaith | 2016-09-11 22:13:38 -0700 |
commit | efb2783ecafc631d31a0ee90c9820a7053f48817 (patch) | |
tree | 22a0975d675faf2265a05805a302e5101f39477a /0001-guest-account-Use-cross-distro-commands.patch | |
parent | 9e83d769dc2d41789a9ba10ce27b6af38d62beb1 (diff) | |
download | aur-efb2783ecafc631d31a0ee90c9820a7053f48817.tar.gz |
update to version 1.19.3
Diffstat (limited to '0001-guest-account-Use-cross-distro-commands.patch')
-rw-r--r-- | 0001-guest-account-Use-cross-distro-commands.patch | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/0001-guest-account-Use-cross-distro-commands.patch b/0001-guest-account-Use-cross-distro-commands.patch deleted file mode 100644 index 525db42fe7b7..000000000000 --- a/0001-guest-account-Use-cross-distro-commands.patch +++ /dev/null @@ -1,95 +0,0 @@ -# Created by Michael Healy <horsemanoffaith@gmail.com> - ---- a/debian/guest-account.sh 2016-02-01 14:52:37.852819467 -0800 -+++ b/debian/guest-account.sh 2016-02-01 15:05:12.117293961 -0800 -@@ -32,10 +32,12 @@ - - add_account () - { -- temp_home=$(mktemp -td guest-XXXXXX) -- GUEST_HOME=$(echo ${temp_home} | tr '[:upper:]' '[:lower:]') -- GUEST_USER=${GUEST_HOME#/tmp/} -- [ ${GUEST_HOME} != ${temp_home} ] && mv ${temp_home} ${GUEST_HOME} -+ NEWHOME=`mktemp -td guest-XXXXXX` -+ # useradd does not accept upper case characters in the username -+ HOME=`echo $NEWHOME | tr '[A-Z]' '[a-z]'` -+ if [ "x$NEWHOME" != "x$HOME" ]; then -+ mv $NEWHOME $HOME -+ fi - - # if ${GUEST_USER} already exists, it must be a locked system account with no existing - # home directory -@@ -65,7 +67,21 @@ - fi - else - # does not exist, so create it -- useradd --system --home-dir ${GUEST_HOME} --comment $(gettext "Guest") --user-group --shell /bin/bash ${GUEST_USER} || { -+ # Arch Linux modification: Ubuntu/Debian uses their own adduser package, -+ # which works differently from the own provided by the shadow package. -+ # Instead, use useradd, which works in any distro. -+ # -+ # Only the syntax is changed -+ # adduser -> useradd -+ # --system -> --system -+ # --no-create-home -> --no-create-home -+ # --home -> --home-dir -+ # --gecos -> --comment -+ # --group -> --user-group -+ # --shell -> --shell -+ # -+ #adduser --system --no-create-home --home / --gecos $(gettext "Guest") --group --shell /bin/bash $USER || { -+ useradd --system --no-create-home --home-dir / --comment $(gettext "Guest") --user-group --shell /bin/bash $USER || { - rm -rf ${GUEST_HOME} - exit 1 - } -@@ -148,14 +164,18 @@ - } - - 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:) - -+ # deluser is provided by the adduser package on Debian/Ubuntu. useradd -+ # doesn't have a '--system' parameter, which causes deluser to only delete -+ # system users, so this will be handled using this script. -+ 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}')" -+ if [ "$GUEST_UID" -lt "$SYS_UID_MIN" ] || [ "$GUEST_UID" -gt "$SYS_UID_MAX" ]; then -+ echo "Error: user $GUEST_USER is not a system user." -+ exit 1 -+ fi -+ - # kill all remaining processes - if [ -x /bin/loginctl ] || [ -x /usr/bin/loginctl ]; then - loginctl kill-user ${GUEST_USER} >/dev/null || true -@@ -179,18 +199,18 @@ - # 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 -+ # remove possible /run/media/guest-XXXXXX folder -+ if [ -d /run/media/"$GUEST_USER" ]; then -+ for dir in $( find /run/media/"$GUEST_USER" -mindepth 1 -maxdepth 1 ); do - umount ${dir} || true - done - -- rmdir ${media_dir} || true -+ rmdir /run/media/"$GUEST_USER" || true - fi - done - -- userdel --force ${GUEST_USER} -+ #deluser --system "$GUEST_USER" -+ userdel "$GUEST_USER" - } - - case ${1} in - |