remove unneeded --shell option from sudo, fix mbox_ratelimit_default

This commit is contained in:
Matthew Saunders Brown 2022-04-20 11:56:19 -07:00
parent 6bd470c435
commit 18e103e50d
2 changed files with 6 additions and 6 deletions

View File

@ -31,8 +31,8 @@ vmail:getoptions "$@"
# check for domain # check for domain
if [[ -z $domain ]]; then if [[ -z $domain ]]; then
echo "domain name is required" echo "ERROR: domain name is required"
exit exit 1
fi fi
# set initial db query data # set initial db query data
@ -85,7 +85,7 @@ if [ "$rowcount" -eq '0' ] ; then
if [[ "$ratelimit" == "NULL" ]]; then if [[ "$ratelimit" == "NULL" ]]; then
dbquery="$dbquery, mbox_ratelimit_default=NULL" dbquery="$dbquery, mbox_ratelimit_default=NULL"
elif [[ "$ratelimit" =~ ^[0-9]+$ ]]; then elif [[ "$ratelimit" =~ ^[0-9]+$ ]]; then
dbquery="$dbquery, mbox_quota_default='$ratelimit'" dbquery="$dbquery, mbox_ratelimit_default='$ratelimit'"
else else
echo "ERROR: ratelimit (-r) must numeric or NULL" echo "ERROR: ratelimit (-r) must numeric or NULL"
exit 1 exit 1

View File

@ -13,15 +13,15 @@ readonly MYSQL_CONNECTION_INFO_FILE=$VMAIL_DIR/.my.cnf
# switch to required user # switch to required user
if [[ $(basename $0) == "vmail-dkim-"* ]]; then if [[ $(basename $0) == "vmail-dkim-"* ]]; then
if [[ "$USER" != "Debian-exim" ]]; then if [[ "$USER" != "Debian-exim" ]]; then
exec sudo -u Debian-exim -g ssl-cert --shell /bin/bash $0 $@ exec sudo -u Debian-exim -g ssl-cert $0 $@
fi fi
elif [[ $(basename $0) == "vmail-purge-spool.sh" ]]; then elif [[ $(basename $0) == "vmail-purge-spool.sh" ]]; then
if [[ "$USER" != "Debian-exim" ]]; then if [[ "$USER" != "Debian-exim" ]]; then
exec sudo -u Debian-exim --shell /bin/bash $0 $@ exec sudo -u Debian-exim $0 $@
fi fi
else else
if [[ "$USER" != "vmail" ]]; then if [[ "$USER" != "vmail" ]]; then
exec sudo -u vmail --shell /bin/bash $0 $@ exec sudo -u vmail $0 $@
else else
# check that MYSQL_CONNECTION_INFO_FILE exists and is readable # check that MYSQL_CONNECTION_INFO_FILE exists and is readable
if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then