swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit 91c7010019b418428db97f807578f0127394960d
parent 0488d898373067d5567afe009976b9b336fec0aa
Author: uriel@soma <unknown>
Date:   Sat, 28 Feb 2009 13:27:16 +0000

Groups are now simply users with a /members file with one member per file.
Diffstat:
Mbin/aux/addwuser.rc | 6++++--
Mbin/werclib.rc | 4++--
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/aux/addwuser.rc b/bin/aux/addwuser.rc @@ -26,6 +26,8 @@ mkdir etc/users/$user_name echo $user_pass > etc/users/$user_name/password if(! ~ $#user_groups 0) - for(g in $user_groups) - echo $user_name >> etc/groups/$g + for(g in $user_groups) { + mkdir -p etc/users/$g + echo $user_name >> etc/users/$g/members + } diff --git a/bin/werclib.rc b/bin/werclib.rc @@ -29,8 +29,8 @@ fn check_user { _status=$status if(! ~ $"_status '') _status=(Not logged in: $"_status) - if not if(! ~ $#* 0 && ! grep -s '^'^$logged_user^'$' etc/groups/$* etc/groups/admin) - _status=(User $logged_user not in groups $*) + if not if(! ~ $#* 0 && ! ~ $logged_user $* && ! grep -s '^'^$logged_user^'$' etc/users/$*/members etc/users/admin/members >[2]/dev/null) + _status=(User $logged_user not in: $*) status=$_status }