=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/monitor.c,v retrieving revision 1.231 retrieving revision 1.232 diff -u -r1.231 -r1.232 --- src/usr.bin/ssh/monitor.c 2022/01/28 06:18:42 1.231 +++ src/usr.bin/ssh/monitor.c 2022/02/25 02:09:27 1.232 @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.231 2022/01/28 06:18:42 guenther Exp $ */ +/* $OpenBSD: monitor.c,v 1.232 2022/02/25 02:09:27 djm Exp $ */ /* * Copyright 2002 Niels Provos * Copyright 2002 Markus Friedl @@ -643,7 +643,6 @@ int mm_answer_pwnamallow(struct ssh *ssh, int sock, struct sshbuf *m) { - char *username; struct passwd *pwent; int r, allowed = 0; u_int i; @@ -653,14 +652,12 @@ if (authctxt->attempt++ != 0) fatal_f("multiple attempts for getpwnam"); - if ((r = sshbuf_get_cstring(m, &username, NULL)) != 0) + if ((r = sshbuf_get_cstring(m, &authctxt->user, NULL)) != 0) fatal_fr(r, "parse"); - pwent = getpwnamallow(ssh, username); + pwent = getpwnamallow(ssh, authctxt->user); - authctxt->user = xstrdup(username); - setproctitle("%s [priv]", pwent ? username : "unknown"); - free(username); + setproctitle("%s [priv]", pwent ? authctxt->user : "unknown"); sshbuf_reset(m);