summaryrefslogtreecommitdiff
path: root/net/samba/patches/patch-bv
diff options
context:
space:
mode:
Diffstat (limited to 'net/samba/patches/patch-bv')
-rw-r--r--net/samba/patches/patch-bv30
1 files changed, 25 insertions, 5 deletions
diff --git a/net/samba/patches/patch-bv b/net/samba/patches/patch-bv
index 3292780c784..cb73a3922ba 100644
--- a/net/samba/patches/patch-bv
+++ b/net/samba/patches/patch-bv
@@ -1,7 +1,7 @@
-$NetBSD: patch-bv,v 1.1 2005/11/14 08:05:28 jlam Exp $
+$NetBSD: patch-bv,v 1.2 2007/02/11 18:39:04 tron Exp $
---- lib/util_pw.c.orig 2005-10-12 13:03:30.000000000 -0400
-+++ lib/util_pw.c
+--- lib/util_pw.c.orig 2006-04-20 03:29:23.000000000 +0100
++++ lib/util_pw.c 2007-02-11 17:57:22.000000000 +0000
@@ -4,6 +4,7 @@
Safe versions of getpw* calls
@@ -10,9 +10,29 @@ $NetBSD: patch-bv,v 1.1 2005/11/14 08:05:28 jlam Exp $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-@@ -144,3 +145,38 @@ struct passwd *getpwuid_alloc(uid_t uid)
+@@ -25,6 +26,7 @@
+ struct passwd *tcopy_passwd(TALLOC_CTX *mem_ctx, const struct passwd *from)
+ {
+ struct passwd *ret = TALLOC_P(mem_ctx, struct passwd);
++ char *gecos;
+ if (!ret) {
+ return NULL;
+ }
+@@ -32,7 +34,10 @@
+ ret->pw_passwd = talloc_strdup(ret, from->pw_passwd);
+ ret->pw_uid = from->pw_uid;
+ ret->pw_gid = from->pw_gid;
+- ret->pw_gecos = talloc_strdup(ret, from->pw_gecos);
++ gecos = (from->pw_gecos != NULL) ? passwd_expand_gecos(from) : NULL;
++ ret->pw_gecos = talloc_strdup(ret, gecos);
++ if (gecos != NULL)
++ SAFE_FREE(gecos);
+ ret->pw_dir = talloc_strdup(ret, from->pw_dir);
+ ret->pw_shell = talloc_strdup(ret, from->pw_shell);
+ return ret;
+@@ -126,3 +131,38 @@
- return alloc_copy_passwd(temp);
+ return tcopy_passwd(mem_ctx, temp);
}
+
+