]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Use the caller provided (copied) pwent struct in
authorbeck@openbsd.org <beck@openbsd.org>
Wed, 25 Jul 2018 13:10:56 +0000 (13:10 +0000)
committerDamien Miller <djm@mindrot.org>
Thu, 26 Jul 2018 03:54:30 +0000 (13:54 +1000)
load_public_identity_files instead of calling getpwuid() again and discarding
the argument. This prevents a client crash where tilde_expand_filename calls
getpwuid() again before the pwent pointer is used. Issue noticed and reported
by Pierre-Olivier Martel <pom@apple.com> ok djm@ deraadt@

OpenBSD-Commit-ID: a067d74b5b098763736c94cc1368de8ea3f0b157

ssh.c

diff --git a/ssh.c b/ssh.c
index a95d0cf93e84e1d635720f61a27fca62648e8a0f..c08693d303835cbbb228558e693933af298e5c90 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.488 2018/07/19 10:28:47 dtucker Exp $ */
+/* $OpenBSD: ssh.c,v 1.489 2018/07/25 13:10:56 beck Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2011,8 +2011,6 @@ load_public_identity_files(struct passwd *pw)
                free(keys);
        }
 #endif /* ENABLE_PKCS11 */
-       if ((pw = getpwuid(original_real_uid)) == NULL)
-               fatal("load_public_identity_files: getpwuid failed");
        for (i = 0; i < options.num_identity_files; i++) {
                if (n_ids >= SSH_MAX_IDENTITY_FILES ||
                    strcasecmp(options.identity_files[i], "none") == 0) {