From 24047da530be555972ecda99832ffb7b41f0f93c Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 29 Jul 2007 08:31:10 +0000 Subject: - Trying to create a list with the same name of an existing list would cause the existing list to be removed. Fixed. - User:group would always be set to nobody:nobody. Fixed. - Not all global variables were being unset after execution. Fixed. - Minor bugs fixed on the list creation routine. --- firma | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'firma') diff --git a/firma b/firma index e2f2e1c..630c40e 100755 --- a/firma +++ b/firma @@ -920,7 +920,8 @@ function NewList { echo "Deleting folder $LIST_HOMEDIR..." rm -rf $LIST_HOMEDIR echo "List creation aborted." - exit 1 + return_code=1 + break elif CheckValidEmail $LIST_ADDRESS; then break else @@ -936,7 +937,8 @@ function NewList { echo "Deleting folder $LIST_HOMEDIR..." rm -rf $LIST_HOMEDIR echo "List creation aborted." - exit 1 + return_code=1 + break else for admin in $LIST_ADMIN; do if ! CheckValidEmail $admin; then @@ -945,6 +947,7 @@ function NewList { done if [[ -n "$invalid" ]]; then echo " Invalid email address: $invalid." + invalid="" else break fi @@ -989,7 +992,8 @@ function NewList { echo "Deleting folder $LIST_HOMEDIR..." rm -rf $LIST_HOMEDIR echo "List creation aborted." - exit 1 + return_code=1 + break elif [[ "$answer" == "1" || "$answer" == "1024" ]]; then KEY_SIZE="1024" break @@ -1026,7 +1030,8 @@ function NewList { echo "Deleting folder $LIST_HOMEDIR..." rm -rf $LIST_HOMEDIR echo "List creation aborted." - exit 1 + return_code=1 + break elif [[ -z "$(echo $digits_only | sed -e 's/[0-9]//g')" || -n "$last_char" ]]; then break else @@ -1123,9 +1128,6 @@ EOF echo "Your list was created. Now check its configuration at $LIST_CONFIG_FILE." echo "To see a list of optional config parameters, type firma --help config." fi - else - echo "Cannot create list $LIST_HOMEDIR: Installation aborted" - return_code=1 fi else echo "Could not create list homedir $LIST_HOMEDIR." @@ -1134,9 +1136,7 @@ EOF fi # list creation should be atomic - if [[ "$return_code" == "1" ]]; then - rm -rf $LIST_HOMEDIR - else + if [[ "$return_code" == "0" ]]; then echo "List creation complete." fi @@ -2020,17 +2020,17 @@ function SourceFirmaConfig { [[ "$1" == "help" ]] && echo -e "\nOptional global firma config parameters\n" - [[ "$1" == "help" ]] && echo -e "\tUSER= user that runs firma (usually the same as your MTA user); + [[ "$1" == "help" ]] && echo -e "\tFIRMA_USER= user that runs firma (usually the same as your MTA user); \t defaults to "nobody"; you can also specify this parameter \t in each mailing list config file if you plan to have one \t user per mailing list." || \ - FIRMA_USER="$(EvalConfigParameter $FIRMA_CONFIG_FILE USER)" + FIRMA_USER="$(EvalConfigParameter $FIRMA_CONFIG_FILE FIRMA_USER)" - [[ "$1" == "help" ]] && echo -e "\tGROUP= group that runs firma (usually the same as your MTA group); + [[ "$1" == "help" ]] && echo -e "\tFIRMA_GROUP= group that runs firma (usually the same as your MTA group); \t defaults to "nobody"; you can also specify this parameter \t in each mailing list config file if you plan to have one \t group per mailing list." || \ - FIRMA_GROUP="$(EvalConfigParameter $FIRMA_CONFIG_FILE GROUP)" + FIRMA_GROUP="$(EvalConfigParameter $FIRMA_CONFIG_FILE FIRMA_GROUP)" [[ "$1" == "help" ]] && echo -e "\tLOG_TO_SYSLOG= set to "1" to log errors and warnings to syslog, else firma \t will print errors to STDERR." || \ @@ -2086,18 +2086,18 @@ function SourceListConfig { [[ "$1" == "help" ]] && echo -e "\tLIST_HOMEDIR= list's GnuPG homedir, where the list's keyrings are located." || \ LIST_HOMEDIR="$(EvalConfigParameter $LIST_CONFIG_FILE LIST_HOMEDIR)" - [[ "$1" == "help" ]] && echo -e "\tUSER= user that runs firma (usually the same as your MTA user); + [[ "$1" == "help" ]] && echo -e "\tFIRMA_USER= user that runs firma (usually the same as your MTA user); \t defaults to "nobody"; you can also specify this parameter \t in each mailing list config file if you plan to have one \t user per mailing list." || \ - firma_user="$(EvalConfigParameter $LIST_CONFIG_FILE USER)" + firma_user="$(EvalConfigParameter $LIST_CONFIG_FILE FIRMA_USER)" [[ -n "$firma_user" ]] && FIRMA_USER="$firma_user" - [[ "$1" == "help" ]] && echo -e "\tGROUP= group that runs firma (usually the same as your MTA group); + [[ "$1" == "help" ]] && echo -e "\tFIRMA_GROUP= group that runs firma (usually the same as your MTA group); \t defaults to "nobody"; you can also specify this parameter \t in each mailing list config file if you plan to have one \t group per mailing list." || \ - firma_group="$(EvalConfigParameter $LIST_CONFIG_FILE GROUP)" + firma_group="$(EvalConfigParameter $LIST_CONFIG_FILE FIRMA_GROUP)" [[ -n "$firma_group" ]] && FIRMA_GROUP="$firma_group" [[ "$1" == "help" ]] && echo -e "\tPASSPHRASE= passphrase for the list's private keyring\n @@ -2286,8 +2286,8 @@ function ReplayProtectionCheck { #------------------------------------------------------------- # path to firma.conf and firma version -FIRMA_CONFIG_FILE="/usr/local/etc/firma.conf" -REPLAY_DEFAULT_FILE="/var/log/firma/replay.db" +FIRMA_CONFIG_FILE="/home/luis/tmp/firma/testing_release/firma.conf" +REPLAY_DEFAULT_FILE="/home/luis/tmp/firma/testing_release/replay" VERSION="0.3" # set environmental variables and options @@ -2312,10 +2312,6 @@ GLOBAL_VARS=" DECRYPTED_MESSAGE MESSAGE_HEADERS MESSAGE_BODY MESSAGE - FUNCTION FUNCTIONS - GLOBAL_VARS VAR - USER - GROUP BASENAME FIRMA_USER FIRMA_GROUP @@ -2327,7 +2323,9 @@ GLOBAL_VARS=" REPLAY_FILE REPLAY_DEFAULT_FILE REPLAY_PROTECTION - REPLAY_COUNT" + REPLAY_COUNT + FUNCTION FUNCTIONS + GLOBAL_VARS" FUNCTIONS=" Usage -- cgit v1.2.3