access_mode should be blacklist by default

This commit is contained in:
Jack L. Frost 2015-09-05 14:33:43 +03:00
parent 6460b1c312
commit f13a29f960
3 changed files with 13 additions and 11 deletions

View File

@ -1,7 +1,6 @@
# make.sh config # make.sh config
PREFIX=${PREFIX:-/}
USR=${USR:-"${PREFIX}usr/local"}
BINDIR=${BINDIR:-"${DESTDIR}${USR}/bin"}
LOGDIR=${LOGDIR:-"/tmp/userrc"} LOGDIR=${LOGDIR:-"/tmp/userrc"}
CONFIG=${CONFIG:-"/etc/userrc.conf"}
BINDIR=${BINDIR:-"${PREFIX}/bin"}
CONFDIR=${CONFDIR:-"${PREFIX}/etc"}
CONFIG=${CONFIG:-"${CONFDIR}/userrc.conf"}

13
make.sh
View File

@ -5,9 +5,12 @@ set -e
set_vars() { set_vars() {
printf 'Setting vars...\n' >&2 printf 'Setting vars...\n' >&2
sed -r \ for i in "$@"; do
-e "s%@CONFIG@%${CONFIG}%" \ sed -r \
-e "s%@LOGDIR@%${LOGDIR}%" -e "s%@CONFIG@%${CONFIG}%" \
-e "s%@LOGDIR@%${LOGDIR}%" \
< "$i".in > "$i"
done
} }
do_tell() { do_tell() {
@ -20,9 +23,9 @@ target_userrc() {
target='userrc' target='userrc'
printf '%s\n' "Building $target..." printf '%s\n' "Building $target..."
set_vars < "$target".in > "$target"
set_vars "$target"
do_tell chmod 755 "$target" do_tell chmod 755 "$target"
ls -l "$target"
} }
target_clean() { target_clean() {

View File

@ -47,7 +47,7 @@ get_allowed_users() {
msg "Running in $access_mode access mode." msg "Running in $access_mode access mode."
case "${access_mode:-freeforall}" in case "${access_mode:-blacklist}" in
explicit) explicit)
while IFS=':' read -r username pass uid gid description homedir shell; do while IFS=':' read -r username pass uid gid description homedir shell; do
if is_whitelisted "$username"; then if is_whitelisted "$username"; then