diff options
Diffstat (limited to 'parabolaweb-changepassword.real.in')
-rw-r--r-- | parabolaweb-changepassword.real.in | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/parabolaweb-changepassword.real.in b/parabolaweb-changepassword.real.in index 07499e8..78d526f 100644 --- a/parabolaweb-changepassword.real.in +++ b/parabolaweb-changepassword.real.in @@ -1,6 +1,6 @@ #!/bin/bash -e -# Copyright (c) 2014 Luke Shumaker <lukeshu@sbcglobal.net> +# Copyright (c) 2014, 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # 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 @@ -19,16 +19,15 @@ export PATH usage() { printf 'Usage: %s [USERNAME]\n' "${0##*/}" - printf 'A username may only be specified if run as root or WEBUSER.\n' + printf 'A username may only be specified if run as root or @webuser@.\n' } main() { . @pkgconffile@ [[ -e "${WEBDIR}/manage.py" ]] - [[ -n "${WEBUSER}" ]] local REAL_USER=$USER - if ! { [[ $SUID_USER == root ]] || [[ $SUID_USER == "$WEBUSER" ]]; }; then + if ! { [[ $SUID_USER == root ]] || [[ $SUID_USER == @webuser@ ]]; }; then unset SUDO_USER SUDO_UID SUDO_GID SUDO_COMMAND fi @@ -44,7 +43,7 @@ main() { local PERM_OF=${SUID_USER:-$REAL_USER} local username - if [[ $PERM_OF == root ]] || [[ $PERM_OF == "$WEBUSER" ]]; then + if [[ $PERM_OF == root ]] || [[ $PERM_OF == @webuser@ ]]; then if [[ $# -gt 1 ]]; then usage >&2 return 1 @@ -58,7 +57,7 @@ main() { username=$NAME_OF fi - sudo -u "${WEBUSER}" python2 "${WEBDIR}/manage.py" changepassword "${username}" + sudo -u @webuser@ python2 "${WEBDIR}/manage.py" changepassword "${username}" } main "$@" |