summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-05 06:22:01 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-05 06:22:01 +0000
commit4030442d77f13f87ecd58d2e43d688b206abb0f4 (patch)
treef71525c16249ef093aa42196525fcb04a5ed30ab /misc.c
parentcc74df79d79f20d685c0968430857de59320811c (diff)
- deraadt@cvs.openbsd.org 2001/02/28 17:52:54
[misc.c] for completeness, copy pw_gecos too
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index fdfd13ca6..24f7df597 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.3 2001/02/28 05:34:28 deraadt Exp $ */ 1/* $OpenBSD: misc.c,v 1.4 2001/02/28 17:52:54 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: misc.c,v 1.3 2001/02/28 05:34:28 deraadt Exp $"); 28RCSID("$OpenBSD: misc.c,v 1.4 2001/02/28 17:52:54 deraadt Exp $");
29 29
30#include "misc.h" 30#include "misc.h"
31#include "log.h" 31#include "log.h"
@@ -101,9 +101,11 @@ struct passwd *
101pwcopy(struct passwd *pw) 101pwcopy(struct passwd *pw)
102{ 102{
103 struct passwd *copy = xmalloc(sizeof(*copy)); 103 struct passwd *copy = xmalloc(sizeof(*copy));
104
104 memset(copy, 0, sizeof(*copy)); 105 memset(copy, 0, sizeof(*copy));
105 copy->pw_name = xstrdup(pw->pw_name); 106 copy->pw_name = xstrdup(pw->pw_name);
106 copy->pw_passwd = xstrdup(pw->pw_passwd); 107 copy->pw_passwd = xstrdup(pw->pw_passwd);
108 copy->pw_gecos = xstrdup(pw->pw_gecos);
107 copy->pw_uid = pw->pw_uid; 109 copy->pw_uid = pw->pw_uid;
108 copy->pw_gid = pw->pw_gid; 110 copy->pw_gid = pw->pw_gid;
109 copy->pw_class = xstrdup(pw->pw_class); 111 copy->pw_class = xstrdup(pw->pw_class);