]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/samba/samba-3.6.23-gecos.patch
Merge branch 'core110'
[people/pmueller/ipfire-2.x.git] / src / patches / samba / samba-3.6.23-gecos.patch
1 From 02da0b0ae947f30480b1246de22e865491e479f0 Mon Sep 17 00:00:00 2001
2 From: Andreas Schneider <asn@samba.org>
3 Date: Wed, 12 Feb 2014 13:26:02 +0100
4 Subject: [PATCH] PATCHSET12: s3-winbind: Use strlcpy to avoid log entry.
5
6 The full_name from Windows can be longer than 255 chars which results in
7 a warning on log level 0 that we have a string overflow. This will avoid
8 the warning. However we should fix this sooner or later on the protocol
9 level to have no limit.
10
11 Signed-off-by: Andreas Schneider <asn@samba.org>
12 Reviewed-by: Volker Lendecke <vl@samba.org>
13
14 Conflicts:
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
20 diff --git a/source3/winbindd/wb_fill_pwent.c b/source3/winbindd/wb_fill_pwent.c
21 index 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 --
41 1.9.3
42