From 0a1a5efb05a88667ca3391267cb60f1b8c17a8a2 Mon Sep 17 00:00:00 2001 From: dtucker Date: Sun, 8 Feb 2026 00:16:34 +0000 Subject: [PATCH] Move setting of user, service and style earlier since -portable needs to use these when setting up PAM. Removes two diffs vs portable. --- usr.bin/ssh/auth2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/ssh/auth2.c b/usr.bin/ssh/auth2.c index 9b1edf263a5..7d07a647091 100644 --- a/usr.bin/ssh/auth2.c +++ b/usr.bin/ssh/auth2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2.c,v 1.171 2026/02/07 17:04:22 dtucker Exp $ */ +/* $OpenBSD: auth2.c,v 1.172 2026/02/08 00:16:34 dtucker Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -282,6 +282,9 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) if (authctxt->attempt++ == 0) { /* setup auth context */ authctxt->pw = mm_getpwnamallow(ssh, user); + authctxt->user = xstrdup(user); + authctxt->service = xstrdup(service); + authctxt->style = style ? xstrdup(style) : NULL; if (authctxt->pw && strcmp(service, "ssh-connection")==0) { authctxt->valid = 1; debug2_f("setting up authctxt for %s", user); @@ -293,9 +296,6 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) ssh_packet_set_log_preamble(ssh, "%suser %s", authctxt->valid ? "authenticating " : "invalid ", user); setproctitle("%s [net]", authctxt->valid ? user : "unknown"); - authctxt->user = xstrdup(user); - authctxt->service = xstrdup(service); - authctxt->style = style ? xstrdup(style) : NULL; mm_inform_authserv(service, style); userauth_banner(ssh); if ((r = kex_server_update_ext_info(ssh)) != 0)