From e7efe98a30489fe582aae9f05b7d0e5e5381c98a Mon Sep 17 00:00:00 2001 From: Ollivier Robert Date: Fri, 5 Sep 2014 23:08:02 +0200 Subject: [PATCH] Add support for %group in calife.auth. --- calife.auth.5.in | 11 ++++++++--- db.c | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/calife.auth.5.in b/calife.auth.5.in index 913b465..630bb7c 100644 --- a/calife.auth.5.in +++ b/calife.auth.5.in @@ -5,7 +5,7 @@ .\" modification, are permitted under the GNU General Public Licence. .\" Look into the COPYING file. .\" -.\" @(#) $Id: calife.auth.5.in,v 88c4f70961ac 2008/08/19 15:34:11 roberto $ +.\" @(#) $Id: calife.auth.5.in,v 25570e2f1dfc 2014/09/05 21:08:02 roberto $ .\"" .Dd September 25, 1994 .Dt CALIFE.AUTH 5 @@ -23,7 +23,8 @@ follows: .Bl -tag -width shell -offset indent .It Ar name User's login name / -.Ar @group . +.Ar @group / +.Ar %group . .It Ar shell User's shell .It Ar user1,user2,...,usern @@ -46,7 +47,10 @@ to specify that any user in the given .Ar group is allowed to use .Nm calife -to become root. +to become root. Alternative syntax using +.Ar %group +is also allowed just like +.Nm sudo . .Pp The .Ar shell @@ -82,6 +86,7 @@ is placed in fcb roberto:/bin/tcsh pb::guest,blaireau +%wheel .Ed .Sh SEE ALSO .Xr calife 1 , diff --git a/db.c b/db.c index b6761e9..46ff551 100644 --- a/db.c +++ b/db.c @@ -10,7 +10,7 @@ **/ #ifndef lint -static const char * rcsid = "@(#) $Id: db.c,v 29ff9dbb76a9 2012/08/22 08:49:25 roberto $"; +static const char * rcsid = "@(#) $Id: db.c,v 25570e2f1dfc 2014/09/05 21:08:02 roberto $"; #endif #include "config.h" /* GNU configure */ @@ -129,9 +129,9 @@ verify_auth_info (char * name, char * user_to_be) MESSAGE_1 ("Line read = |%s|\n", line); line_name = line; /* - * Look for a @ as first character (for groups) + * Look for a @ or % as first character (for groups) */ - if (*line == '@') + if (*line == '@' || *line == '%') { group = strdup(line); group_name = strtok(group, ":");