diff options
author | pst <pst@FreeBSD.org> | 1997-02-02 21:33:37 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1997-02-02 21:33:37 +0000 |
commit | e6146b21843fb7496815f6f75d745422de6debec (patch) | |
tree | 6a2c929fd0ef2b2042c11b43016a1e1223741dd5 /lib/libpam/modules | |
parent | 6baba2abafdca4dcb3d6d1daec2c228b454a2a00 (diff) | |
download | FreeBSD-src-e6146b21843fb7496815f6f75d745422de6debec.zip FreeBSD-src-e6146b21843fb7496815f6f75d745422de6debec.tar.gz |
Cruft cleanup to eliminate useless warnings
Diffstat (limited to 'lib/libpam/modules')
-rw-r--r-- | lib/libpam/modules/pam_login_access/login_access.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libpam/modules/pam_login_access/login_access.c b/lib/libpam/modules/pam_login_access/login_access.c index 6284216..b5003c7 100644 --- a/lib/libpam/modules/pam_login_access/login_access.c +++ b/lib/libpam/modules/pam_login_access/login_access.c @@ -41,6 +41,7 @@ static int string_match(); /* login_access - match username/group and host/tty with access control file */ +int login_access(user, from) char *user; char *from; @@ -62,7 +63,7 @@ char *from; * non-existing table means no access control. */ - if (fp = fopen(_PATH_LOGACCESS, "r")) { + if ((fp = fopen(_PATH_LOGACCESS, "r")) != NULL) { while (!match && fgets(line, sizeof(line), fp)) { lineno++; if (line[end = strlen(line) - 1] != '\n') { @@ -120,7 +121,7 @@ int (*match_fn) (); for (tok = strtok(list, sep); tok != 0; tok = strtok((char *) 0, sep)) { if (strcasecmp(tok, "EXCEPT") == 0) /* EXCEPT: give up */ break; - if (match = (*match_fn) (tok, item)) /* YES */ + if ((match = (*match_fn)(tok, item)) != NULL) /* YES */ break; } /* Process exceptions to matches. */ @@ -137,6 +138,7 @@ int (*match_fn) (); /* netgroup_match - match group against machine or user */ static int netgroup_match(group, machine, user) +gid_t group; char *machine; char *user; { @@ -148,6 +150,7 @@ char *user; return (innetgr(group, machine, user, mydomain)); #else syslog(LOG_ERR, "NIS netgroup support not configured"); + return 0; #endif } @@ -170,7 +173,7 @@ char *string; return (netgroup_match(tok + 1, (char *) 0, string)); } else if (string_match(tok, string)) { /* ALL or exact match */ return (YES); - } else if (group = getgrnam(tok)) { /* try group membership */ + } else if ((group = getgrnam(tok)) != NULL) {/* try group membership */ for (i = 0; group->gr_mem[i]; i++) if (strcasecmp(string, group->gr_mem[i]) == 0) return (YES); |