]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Move setting of user, service and style earlier since
authordtucker@openbsd.org <dtucker@openbsd.org>
Sun, 8 Feb 2026 00:16:34 +0000 (00:16 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Sun, 8 Feb 2026 17:05:27 +0000 (04:05 +1100)
-portable needs to use these when setting up PAM.  Removes two diffs vs
portable.

OpenBSD-Commit-ID: 8db130d42a3581b7a1eaed65917673d4474fc4fe

auth2.c

diff --git a/auth2.c b/auth2.c
index a9d76a59a633f7390a34be0d31af95c94c0f3ab4..2e6808152d9ffb622a16f562fc126ea03a937368 100644 (file)
--- a/auth2.c
+++ b/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.
  *
@@ -293,6 +293,8 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh)
                /* 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);
@@ -311,8 +313,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->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)