|
From: Thorsten K. <ku...@su...> - 2005-05-27 10:03:22
|
On Tue, May 24, Tomas Mraz wrote: > The attached patch adds support for list element separator to > pam_access. > Do you think it's worth committing? I think it cannot harm, so it is ok for me to commit. Thorsten > See also https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=132135 > -- > Tomas Mraz <tm...@re...> > Index: doc/modules/pam_access.sgml > =================================================================== > RCS file: /cvsroot/pam/Linux-PAM/doc/modules/pam_access.sgml,v > retrieving revision 1.4 > diff -u -r1.4 pam_access.sgml > --- doc/modules/pam_access.sgml 7 May 2002 17:22:54 -0000 1.4 > +++ doc/modules/pam_access.sgml 24 May 2005 15:51:01 -0000 > @@ -59,6 +59,7 @@ > > <tt>accessfile=<it>/path/to/file.conf</it></tt>; > <tt>fieldsep=<it>separators</it></tt> > +<tt>listsep=<it>separators</it></tt> > > <tag><bf>Description:</bf></tag> > > @@ -89,6 +90,15 @@ > <tt/PAM_TTY/ item is likely to be of the form "hostname:0" which > includes a `:' character in its value. > > +<item><tt>listsep=<it>separators</it></tt> - > +this option modifies the list separator character that > +<tt/pam_access/ will recognize when parsing the access configuration > +file. For example: <tt>listsep=,</tt> will cause the default ` ' and `\t' > +characters to be treated as part of a list element value and `,' becomes the > +only list element separator. Doing this is useful on a system with > +group information obtained from a Windows domain, where the default built-in > +groups "Domain Users", "Domain Admins" contain a space. > + > </itemize> > > <tag><bf>Examples/suggested usage:</bf></tag> > Index: modules/pam_access/pam_access.c > =================================================================== > RCS file: /cvsroot/pam/Linux-PAM/modules/pam_access/pam_access.c,v > retrieving revision 1.12 > diff -u -r1.12 pam_access.c > --- modules/pam_access/pam_access.c 16 Nov 2004 14:27:41 -0000 1.12 > +++ modules/pam_access/pam_access.c 24 May 2005 15:51:03 -0000 > @@ -86,7 +86,7 @@ > /* Delimiters for fields and for lists of users, ttys or hosts. */ > > static const char *fs = ":"; /* field separator */ > -static const char sep[] = ", \t"; /* list-element separator */ > +static const char *sep = ", \t"; /* list-element separator */ > > /* Constants to be used in assignments only, not in comparisons... */ > > @@ -129,6 +129,11 @@ > /* the admin wants to override the default field separators */ > fs = argv[i]+9; > > + } else if (!strncmp("listsep=", argv[i], 8)) { > + > + /* the admin wants to override the default list separators */ > + sep = argv[i]+8; > + > } else if (!strncmp("accessfile=", argv[i], 11)) { > FILE *fp = fopen(11 + argv[i], "r"); > -- Thorsten Kukuk http://www.suse.de/~kukuk/ ku...@su... SUSE LINUX Products GmbH Maxfeldstr. 5 D-90409 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B |