summaryrefslogtreecommitdiff
path: root/lib/libc/gen/auth_subr.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-10-13 21:13:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-10-13 21:13:00 +0000
commitcc530a61de1a0ca20521383004c79da9a6600933 (patch)
tree8c455916c9ece4ab9d5237c22415187da80fc014 /lib/libc/gen/auth_subr.c
parent9a2e0a09da2aed07c37c242bbf59970aaa38f6ee (diff)
Move the clearing of as->state in auth_challenge() to after the sanity
checks. The check for "as != NULL" is useless if you have already dereferenced "as". Also fix some comment typos. From Moritz Jodeit.
Diffstat (limited to 'lib/libc/gen/auth_subr.c')
-rw-r--r--lib/libc/gen/auth_subr.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c
index 32b1f309fea..24417d3b23f 100644
--- a/lib/libc/gen/auth_subr.c
+++ b/lib/libc/gen/auth_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth_subr.c,v 1.12 2002/08/04 22:44:12 millert Exp $ */
+/* $OpenBSD: auth_subr.c,v 1.13 2002/10/13 21:12:59 millert Exp $ */
/*-
* Copyright (c) 1995,1996,1997 Berkeley Software Design, Inc.
@@ -285,11 +285,11 @@ auth_challenge(auth_session_t *as)
{
char path[MAXPATHLEN];
- as->state = 0;
-
if (as == NULL || as->style == NULL || as->name == NULL)
return (NULL);
+ as->state = 0;
+
if (as->challenge) {
free(as->challenge);
as->challenge = NULL;
@@ -748,10 +748,9 @@ auth_check_change(auth_session_t *as)
* is AUTH_OKAY for approval like scripts.
*
* Internally additional trailing arguments can be read from as->ap
- * Options will be placed be placed just after the first argument
- * (not including path).
+ * Options will be placed just after the first argument (not including path).
*
- * Any data will sent (and freed) to the script
+ * Any data will be sent to (and freed by) the script
*/
int
auth_call(auth_session_t *as, char *path, ...)
@@ -764,7 +763,7 @@ auth_call(auth_session_t *as, char *path, ...)
int okay;
int pfd[2];
int argc;
- char *argv[64]; /* 64 args should more than enough */
+ char *argv[64]; /* 64 args should be more than enough */
#define Nargc (sizeof(argv)/sizeof(argv[0]))
va_start(as->ap0, path);