diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-02-22 21:59:45 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-02-22 21:59:45 +0000 |
commit | c53bea2d689b27f3ff0de5586bf6463b04abb457 (patch) | |
tree | 7a884e1364a1d8acadc4b8752286292396a344d8 /usr.bin/ssh/ssh.c | |
parent | dea01b6e7f0865d98a3de5f0818d2d09b8987f0f (diff) |
use pwcopy in ssh.c, too
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 191e5c8343c..ac422b7b0b8 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.97 2001/02/21 21:14:04 stevesk Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.98 2001/02/22 21:59:44 markus Exp $"); #include <openssl/evp.h> #include <openssl/err.h> @@ -237,7 +237,7 @@ main(int ac, char **av) u_short fwd_port, fwd_host_port; char *optarg, *cp, buf[256]; struct stat st; - struct passwd *pw, pwcopy; + struct passwd *pw; int dummy; uid_t original_effective_uid; @@ -542,15 +542,7 @@ main(int ac, char **av) exit(1); } /* Take a copy of the returned structure. */ - memset(&pwcopy, 0, sizeof(pwcopy)); - pwcopy.pw_name = xstrdup(pw->pw_name); - pwcopy.pw_passwd = xstrdup(pw->pw_passwd); - pwcopy.pw_uid = pw->pw_uid; - pwcopy.pw_gid = pw->pw_gid; - pwcopy.pw_class = xstrdup(pw->pw_class); - pwcopy.pw_dir = xstrdup(pw->pw_dir); - pwcopy.pw_shell = xstrdup(pw->pw_shell); - pw = &pwcopy; + pw = pwcopy(pw); /* Initialize "log" output. Since we are the client all output actually goes to the terminal. */ |