]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/samba/samba-3.6.23-gecos.patch
gcc: Fix building with glibc >= 2.28
[people/pmueller/ipfire-2.x.git] / src / patches / samba / samba-3.6.23-gecos.patch
CommitLineData
1d13e637
AF
1From 02da0b0ae947f30480b1246de22e865491e479f0 Mon Sep 17 00:00:00 2001
2From: Andreas Schneider <asn@samba.org>
3Date: Wed, 12 Feb 2014 13:26:02 +0100
4Subject: [PATCH] PATCHSET12: s3-winbind: Use strlcpy to avoid log entry.
5
6The full_name from Windows can be longer than 255 chars which results in
7a warning on log level 0 that we have a string overflow. This will avoid
8the warning. However we should fix this sooner or later on the protocol
9level to have no limit.
10
11Signed-off-by: Andreas Schneider <asn@samba.org>
12Reviewed-by: Volker Lendecke <vl@samba.org>
13
14Conflicts:
15 source3/winbindd/wb_fill_pwent.c
16---
17 source3/winbindd/wb_fill_pwent.c | 9 +++++++--
18 1 file changed, 7 insertions(+), 2 deletions(-)
19
20diff --git a/source3/winbindd/wb_fill_pwent.c b/source3/winbindd/wb_fill_pwent.c
21index 9634317..9d42b31 100644
22--- a/source3/winbindd/wb_fill_pwent.c
23+++ b/source3/winbindd/wb_fill_pwent.c
24@@ -141,8 +141,13 @@ static void wb_fill_pwent_getgrsid_done(struct tevent_req *subreq)
25 true);
26 }
27
28- fstrcpy(state->pw->pw_name, output_username);
29- fstrcpy(state->pw->pw_gecos, state->info->full_name);
30+ strlcpy(state->pw->pw_name,
31+ output_username,
32+ sizeof(state->pw->pw_name));
33+ /* FIXME The full_name can be longer than 255 chars */
34+ strlcpy(state->pw->pw_gecos,
35+ state->info->full_name ? state->info->full_name : "",
36+ sizeof(state->pw->pw_gecos));
37
38 /* Home directory and shell */
39 ok = fillup_pw_field(lp_template_homedir(),
40--
411.9.3
42