summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-keygen.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2021-03-12 03:43:40 +0000
committerdjm <djm@openbsd.org>2021-03-12 03:43:40 +0000
commit971544661b24e34ed627a04d1b26779976f85174 (patch)
tree0f835e270aa7f757155854c6569fd736d55f7ba1 /usr.bin/ssh/ssh-keygen.c
parentProvide definition of CTRL in vi.c like we do for emacs.c. (diff)
downloadwireguard-openbsd-971544661b24e34ed627a04d1b26779976f85174.tar.xz
wireguard-openbsd-971544661b24e34ed627a04d1b26779976f85174.zip
pwcopy() struct passwd that we're going to reuse across a bunch of
library calls; bz3273 ok dtucker@
Diffstat (limited to 'usr.bin/ssh/ssh-keygen.c')
-rw-r--r--usr.bin/ssh/ssh-keygen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 69886d4a738..7bc02750141 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/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
@@ -3130,6 +3130,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));