From c22d2db7c31aca9eb332022da3ad8a50387ce3db Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Tue, 7 May 2002 17:22:54 +0000 Subject: Relevant BUGIDs: 547051, 547521 Purpose of commit: bugfixes Commit summary: --------------- Both of these fixes inspired by use with X based services. The first makes a TTY of the form hostname:0 work (if you specify a different separator with the module argument "fieldsep=". The second treats "" for a RHOST the same way it would treat a NULL value. --- modules/pam_access/access.conf | 6 ++++++ modules/pam_access/pam_access.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/pam_access/access.conf b/modules/pam_access/access.conf index 9ecf2ffd..dbaadf67 100644 --- a/modules/pam_access/access.conf +++ b/modules/pam_access/access.conf @@ -8,6 +8,12 @@ # # Format of the login access control table is three fields separated by a # ":" character: +# +# [Note, if you supply a 'fieldsep=|' argument to the pam_access.so +# module, you can change the field separation character to be +# '|'. This is useful for configurations where you are trying to use +# pam_access with X applications that provide PAM_TTY values that are +# the display variable like "host:0".] # # permission : users : origins # diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 33bf767f..68a137ca 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -87,7 +87,7 @@ int strcasecmp(const char *s1, const char *s2); /* Delimiters for fields and for lists of users, ttys or hosts. */ -static const char fs[] = ":"; /* field separator */ +static const char *fs = ":"; /* field separator */ static const char sep[] = ", \t"; /* list-element separator */ /* Constants to be used in assignments only, not in comparisons... */ @@ -126,7 +126,12 @@ static int parse_args(struct login_info *loginfo, int argc, const char **argv) int i; for (i=0; i