diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-02-13 22:49:41 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-02-13 22:49:41 +0000 |
commit | e46995dd33ac21694ef0761f36e39f189084608e (patch) | |
tree | 01f44e5c0bc45825fe3e973684210539ea53f5af /usr.bin | |
parent | daf640fcd3f72d3828949645a427bfce91fea321 (diff) |
setproctitle(user) only if getpwnam succeeds
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/auth1.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/auth2.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/ssh/auth1.c b/usr.bin/ssh/auth1.c index a53b0654023..494231925c2 100644 --- a/usr.bin/ssh/auth1.c +++ b/usr.bin/ssh/auth1.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth1.c,v 1.16 2001/02/12 16:16:23 markus Exp $"); +RCSID("$OpenBSD: auth1.c,v 1.17 2001/02/13 22:49:40 markus Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -335,8 +335,6 @@ do_authentication() authctxt->user = user; authctxt->style = style; - setproctitle("%s", user); - /* Verify that the user is a valid user. */ pw = getpwnam(user); if (pw && allowed_user(pw)) { @@ -348,6 +346,8 @@ do_authentication() } authctxt->pw = pw; + setproctitle("%s", pw ? user : "unknown"); + /* * If we are not running as root, the user must have the same uid as * the server. diff --git a/usr.bin/ssh/auth2.c b/usr.bin/ssh/auth2.c index d59ca025723..a9c7cb3bd59 100644 --- a/usr.bin/ssh/auth2.c +++ b/usr.bin/ssh/auth2.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2.c,v 1.41 2001/02/12 16:16:23 markus Exp $"); +RCSID("$OpenBSD: auth2.c,v 1.42 2001/02/13 22:49:40 markus Exp $"); #include <openssl/evp.h> @@ -185,7 +185,6 @@ input_userauth_request(int type, int plen, void *ctxt) if (authctxt->attempt++ == 0) { /* setup auth context */ struct passwd *pw = NULL; - setproctitle("%s", user); pw = getpwnam(user); if (pw && allowed_user(pw) && strcmp(service, "ssh-connection")==0) { authctxt->pw = pwcopy(pw); @@ -194,6 +193,7 @@ input_userauth_request(int type, int plen, void *ctxt) } else { log("input_userauth_request: illegal user %s", user); } + setproctitle("%s", pw ? user : "unknown"); authctxt->user = xstrdup(user); authctxt->service = xstrdup(service); authctxt->style = style ? xstrdup(style) : NULL; /* currently unused */ |