summaryrefslogtreecommitdiffstats
path: root/misc.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-05 06:56:40 +0100
committerBen Lindstrom <mouring@eviladmin.org>2001-03-05 06:56:40 +0100
commit086cf214cf70cbb1658a9e966f84e7c12214554c (patch)
treef71acc5803d24430ed87ddf4fc53f31dd9369e37 /misc.c
parent - markus@cvs.openbsd.org 2001/02/22 21:57:27 (diff)
downloadopenssh-086cf214cf70cbb1658a9e966f84e7c12214554c.tar.xz
openssh-086cf214cf70cbb1658a9e966f84e7c12214554c.zip
- markus@cvs.openbsd.org 2001/02/22 21:59:44
[auth.c auth.h auth1.c auth2.c misc.c misc.h ssh.c] use pwcopy in ssh.c, too
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index 743011654..4a1213a29 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.1 2001/01/21 19:05:52 markus Exp $ */
+/* $OpenBSD: misc.c,v 1.2 2001/02/22 21:59:44 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -25,7 +25,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: misc.c,v 1.1 2001/01/21 19:05:52 markus Exp $");
+RCSID("$OpenBSD: misc.c,v 1.2 2001/02/22 21:59:44 markus Exp $");
#include "misc.h"
#include "log.h"
@@ -96,6 +96,21 @@ strdelim(char **s)
return (old);
}
+struct passwd *
+pwcopy(struct passwd *pw)
+{
+ struct passwd *copy = xmalloc(sizeof(*copy));
+ memset(copy, 0, sizeof(*copy));
+ copy->pw_name = xstrdup(pw->pw_name);
+ copy->pw_passwd = xstrdup(pw->pw_passwd);
+ copy->pw_uid = pw->pw_uid;
+ copy->pw_gid = pw->pw_gid;
+ copy->pw_class = xstrdup(pw->pw_class);
+ copy->pw_dir = xstrdup(pw->pw_dir);
+ copy->pw_shell = xstrdup(pw->pw_shell);
+ return copy;
+}
+
mysig_t
mysignal(int sig, mysig_t act)
{