<tag><bf>Recognized arguments:</bf></tag>
-<tt>accessconf=<it>/path/to/file.conf</it></tt>
+<tt>accessfile=<it>/path/to/file.conf</it></tt>
<tag><bf>Description:</bf></tag>
arguments:
<itemize>
-<item><tt>accessconf=/path/to/file.conf</tt> -
+<item><tt>accessfile=/path/to/file.conf</tt> -
indicate an alternative <em/access/ configuration file to override
the default. This can be useful when different services need different
access lists.
{
FILE *fp;
char line[BUFSIZ];
- char *perm; /* becomes permission field */
- char *users; /* becomes list of login names */
- char *froms; /* becomes list of terminals or hosts */
+ char *perm; /* becomes permission field */
+ char *users; /* becomes list of login names */
+ char *froms; /* becomes list of terminals or hosts */
int match = NO;
int end;
- int lineno = 0; /* for diagnostics */
+ int lineno = 0; /* for diagnostics */
/*
* Process the table one line at a time and stop at the first match.
* non-existing table means no access control.
*/
- if ((fp = fopen(PAM_ACCESS_CONFIG, "r"))!=NULL) {
+ if ((fp = fopen(item->config_file, "r"))!=NULL) {
while (!match && fgets(line, sizeof(line), fp)) {
lineno++;
if (line[end = strlen(line) - 1] != '\n') {
_log_err("%s: line %d: missing newline or line too long",
- PAM_ACCESS_CONFIG, lineno);
+ item->config_file, lineno);
continue;
}
if (line[0] == '#')
|| !(users = strtok((char *) 0, fs))
|| !(froms = strtok((char *) 0, fs))
|| strtok((char *) 0, fs)) {
- _log_err("%s: line %d: bad field count", PAM_ACCESS_CONFIG, lineno);
+ _log_err("%s: line %d: bad field count",
+ item->config_file, lineno);
continue;
}
if (perm[0] != '+' && perm[0] != '-') {
- _log_err("%s: line %d: bad first field", PAM_ACCESS_CONFIG, lineno);
+ _log_err("%s: line %d: bad first field",
+ item->config_file, lineno);
continue;
}
match = (list_match(froms, item, from_match)
}
(void) fclose(fp);
} else if (errno != ENOENT) {
- _log_err("cannot open %s: %m", PAM_ACCESS_CONFIG);
+ _log_err("cannot open %s: %m", item->config_file);
}
return (match == 0 || (line[0] == '+'));
}
if ((user_pw=getpwnam(user))==NULL) return (PAM_USER_UNKNOWN);
/*
- * Bundle up the arguments to avoid unnecessary clumsiness lateron.
+ * Bundle up the arguments to avoid unnecessary clumsiness later on.
*/
loginfo.user = user_pw;
loginfo.from = from;