summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-03-12 04:43:40 +0100
committerDarren Tucker <dtucker@dtucker.net>2021-03-13 03:09:54 +0100
commitf07519a2af96109325b5a48b1af18b57601074ca (patch)
tree83847642e9e67ace8b57f0a788b1e14bc1f34f1a
parentupstream: Import regenerated moduli file. (diff)
downloadopenssh-f07519a2af96109325b5a48b1af18b57601074ca.tar.xz
openssh-f07519a2af96109325b5a48b1af18b57601074ca.zip
upstream: pwcopy() struct passwd that we're going to reuse across a
bunch of library calls; bz3273 ok dtucker@ OpenBSD-Commit-ID: b6eafa977b2e44607b1b121f5de855107809b762
-rw-r--r--ssh-keygen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index cfb5f1151..a442dc8e8 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.427 2020/12/20 23:36:51 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.428 2021/03/12 03:43:40 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -3154,6 +3154,7 @@ main(int argc, char **argv)
pw = getpwuid(getuid());
if (!pw)
fatal("No user exists for uid %lu", (u_long)getuid());
+ pw = pwcopy(pw);
if (gethostname(hostname, sizeof(hostname)) == -1)
fatal("gethostname: %s", strerror(errno));