From a0fe32ae0ec701890023ba34f6296aeea3a00dd7 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 24 Oct 2010 15:32:59 +0200 Subject: Treat usernames containing dash as auxiliary, and suppress human-user extensions then. --- adduser.local | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/adduser.local b/adduser.local index a822a17..a526ab2 100755 --- a/adduser.local +++ b/adduser.local @@ -42,9 +42,18 @@ add2list() { /bin/echo "$1" | /usr/sbin/add_members -w y -a y -r - "$2"; } [ -f /etc/local/users.conf ] && . /etc/local/users.conf +# resolve account profiles +case "$NEWUSERNAME" in + *-*) + profile_aux=1 + ;; + *) + ;; +esac + # Samba password #FIXME: Check if enabled in samba.conf (or included files!) -if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && ([ -x /usr/bin/pdbedit ] || [ -x /usr/bin/smbpasswd ]); then +if [ -z "$profile_aux" ] && [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && ([ -x /usr/bin/pdbedit ] || [ -x /usr/bin/smbpasswd ]); then echo -n "Add samba access to the account (y/N)? " read sambaaccount case $sambaaccount in @@ -59,7 +68,7 @@ if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && ([ -x /usr/bin/pdbedit ] || [ -x fi # Mail forwarding -if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -x /usr/local/sbin/userforward ]; then +if [ -z "$profile_aux" ] && [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -x /usr/local/sbin/userforward ]; then echo -n "Forward mail to an external account (y/N)? " read mailforward case $mailforward in @@ -80,7 +89,7 @@ fi # Mailing lists maildomain="`maildomain`" -if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -n "$maildomain" ]; then +if [ -z "$profile_aux" ] && [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -n "$maildomain" ]; then echo -n "Subscribe $NEWUSERNAME@$maildomain to mailinglists (y/N)? " read subscribe case $subscribe in @@ -105,7 +114,7 @@ if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -n "$maildomain" ]; then esac fi -if [ -f /etc/local/users.conf ]; then +if [ -z "$profile_aux" ] && [ -f /etc/local/users.conf ]; then . /etc/local/users.conf if [ -n "$USERS_GROUPNAME" ]; then @@ -134,7 +143,7 @@ fi #access to devices like CD-ROM, soundcard and modem needed)? # #+ -if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ]; then +if [ -z "$profile_aux" ] && [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ]; then echo -n "Grant this user access to local utilities (y/N)?" read localuser case $localuser in @@ -148,6 +157,6 @@ if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ]; then esac fi -if [ -x /usr/local/sbin/user-init ]; then +if [ -z "$profile_aux" ] && [ -x /usr/local/sbin/user-init ]; then /usr/local/sbin/user-init $NEWUSERNAME fi -- cgit v1.2.3