diff options
author | 2002-07-14 23:47:30 +0000 | |
---|---|---|
committer | 2002-07-14 23:47:30 +0000 | |
commit | 122af69aa98a125557f1a81b98e305e2ecd4a81a (patch) | |
tree | 3967e55bd9084aacd9e2d33b8268055e8a7e5ea1 /lib/libc/gen/authenticate.c | |
parent | Rewrite with more (and correct!) info, based on login_passwd.8. (diff) | |
download | wireguard-openbsd-122af69aa98a125557f1a81b98e305e2ecd4a81a.tar.xz wireguard-openbsd-122af69aa98a125557f1a81b98e305e2ecd4a81a.zip |
indent, and double free fix; millert ok
Diffstat (limited to 'lib/libc/gen/authenticate.c')
-rw-r--r-- | lib/libc/gen/authenticate.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/libc/gen/authenticate.c b/lib/libc/gen/authenticate.c index 55d84620929..f8b031bee5b 100644 --- a/lib/libc/gen/authenticate.c +++ b/lib/libc/gen/authenticate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: authenticate.c,v 1.11 2002/06/23 03:03:37 deraadt Exp $ */ +/* $OpenBSD: authenticate.c,v 1.12 2002/07/14 23:47:30 deraadt Exp $ */ /*- * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. @@ -129,8 +129,10 @@ _auth_checknologin(login_cap_t *lc, int print) /* First try the nologin file specified in login.conf. */ if (*nologin != '\0' && stat(nologin, &sb) == 0) goto print_nologin; - if (mustfree) + if (mustfree) { free(nologin); + mustfree = 0; + } /* If that doesn't exist try _PATH_NOLOGIN. */ if (stat(_PATH_NOLOGIN, &sb) == 0) { @@ -236,7 +238,7 @@ auth_approval(auth_session_t *as, login_cap_t *lc, char *name, char *type) login_close(lc); syslog(LOG_ERR, "Invalid %s script: %s", s, approve); _warnx("invalid path to approval script"); - free(approve); + free(approve); return (0); } @@ -245,8 +247,8 @@ auth_approval(auth_session_t *as, login_cap_t *lc, char *name, char *type) login_close(lc); syslog(LOG_ERR, "%m"); _warn(NULL); - if (approve) - free(approve); + if (approve) + free(approve); return (0); } @@ -270,18 +272,18 @@ auth_approval(auth_session_t *as, login_cap_t *lc, char *name, char *type) if (stat(pwd->pw_dir, &sb) < 0 || (sb.st_mode & 0170000) != S_IFDIR || (pwd->pw_uid && sb.st_uid == pwd->pw_uid && - (sb.st_mode & S_IXUSR) == 0)) { + (sb.st_mode & S_IXUSR) == 0)) { auth_setstate(as, (auth_getstate(as) & ~AUTH_ALLOW)); goto out; } } if (approve) - auth_call(as, approve, strrchr(approve, '/') + 1, name, - lc->lc_class, type, 0); + auth_call(as, approve, strrchr(approve, '/') + 1, name, + lc->lc_class, type, 0); out: - if (approve) - free(approve); + if (approve) + free(approve); if (close_lc_on_exit) login_close(lc); |