]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: pwcopy() struct passwd that we're going to reuse across a
authordjm@openbsd.org <djm@openbsd.org>
Fri, 12 Mar 2021 03:43:40 +0000 (03:43 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Sat, 13 Mar 2021 02:09:54 +0000 (13:09 +1100)
bunch of library calls; bz3273 ok dtucker@

OpenBSD-Commit-ID: b6eafa977b2e44607b1b121f5de855107809b762

ssh-keygen.c

index cfb5f11516614ae5bf69ae0617c71e99e562042b..a442dc8e8841432d201a551c2622ddaa857ebd63 100644 (file)
@@ -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));