fi
if ! grep -q -e "^USER=" $FIRMA_CONFIG_FILE; then
- USER="nobody"
+ FIRMA_USER="nobody"
else
- USER="`grep "^USER=" $FIRMA_CONFIG_FILE | sed -e 's/"//g' -e "s/'//g" | cut -d = -f 2`"
+ FIRMA_USER="`grep "^USER=" $FIRMA_CONFIG_FILE | sed -e 's/"//g' -e "s/'//g" | cut -d = -f 2`"
fi
if ! grep -q -e "^GROUP=" $FIRMA_CONFIG_FILE; then
- GROUP="nobody"
+ FIRMA_GROUP="nobody"
else
- GROUP="`grep "^GROUP=" $FIRMA_CONFIG_FILE | sed -e 's/"//g' -e "s/'//g" | cut -d = -f 2`"
+ FIRMA_GROUP="`grep "^GROUP=" $FIRMA_CONFIG_FILE | sed -e 's/"//g' -e "s/'//g" | cut -d = -f 2`"
fi
return $return_code
LIST_ADMIN="$valid_admins"
fi
+ if grep -q -e "^USER=" $LIST_CONFIG_FILE; then
+ FIRMA_USER="`grep "^USER=" $LIST_CONFIG_FILE | sed -e 's/"//g' -e "s/'//g" | cut -d = -f 2`"
+ fi
+
+ if grep -q -e "^GROUP=" $LIST_CONFIG_FILE; then
+ FIRMA_GROUP="`grep "^GROUP=" $LIST_CONFIG_FILE | sed -e 's/"//g' -e "s/'//g" | cut -d = -f 2`"
+ fi
+
return $return_code
}
echo "Creating your config..."
touch $LIST_CONFIG_FILE
chmod 600 $LIST_CONFIG_FILE
- chown $USER.$GROUP $LIST_CONFIG_FILE
+ chown $FIRMA_USER.$FIRMA_GROUP $LIST_CONFIG_FILE
if [ -f "$LIST_CONFIG_FILE" ]; then
DeclareGpgVars
# removed: MAIL_AGENT=$MAIL_AGENT\nGPG_BINARY=$GPG_BINARY\n
EOF
# TODO: import admin pubkey and send list pubkey to admin
- chown -R $USER.$GROUP $LIST_HOMEDIR
+ chown -R $FIRMA_USER.$FIRMA_GROUP $LIST_HOMEDIR
else
echo "$(basename $0): cannot create $LIST_PATH: Installation aborted"
function CheckPermission {
#-------------------------------------------------------------
# check if file has correct permissions (600) and also
- # +if the file is owned by $USER
+ # +if the file is owned by $FIRMA_USER
# +got the idea for this function from backupninja
#
# parameter(s): file name
return 1
fi
- if [ `ls -ld $file | awk '{print $3}'` != "$USER" ]; then
- echo "WARNING: Configuration files must be owned by $USER! Dying on file $file"
+ if [ `ls -ld $file | awk '{print $3}'` != "$FIRMA_USER" ]; then
+ echo "WARNING: Configuration files must be owned by $FIRMA_USER! Dying on file $file"
fi
return 0
function CheckListPermissions {
#-------------------------------------------------------------
# check if list files has correct permissions (600) and also
- # +if the files are owned by $USER
+ # +if the files are owned by $FIRMA_USER
#
# parameter(s): list config file
# depends on function(s): CheckPermission
local folder
local config
- # check and fix permissions on all files from $LIST_PATH to $USER.$GROUP
+ # check and fix permissions on all files from $LIST_PATH to $FIRMA_USER.$FIRMA_GROUP
if [ ! -z "$1" ]; then
folder="`dirname $1`"
config="`basename $1`"
if ! CheckPermission $folder/$file; then
LogMessage "Fixing permission and ownership for $folder/$file"
chmod 600 $folder/$file
- chown $USER.$GROUP $folder/$file
+ chown $FIRMA_USER.$FIRMA_GROUP $folder/$file
fi
done
fi
done
fi
- chown -R $USER.$GROUP $LIST_PATH
+ chown -R $FIRMA_USER.$FIRMA_GROUP $LIST_PATH
return $return_code
}
GLOBAL_VARS VAR
USER
GROUP
- BASENAME"
+ BASENAME
+ FIRMA_USER
+ FIRMA_GROUP"
FUNCTIONS="
Usage