1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-30 06:50:24 +03:00

s3-winbind: Use strlcpy to avoid log entry.

The full_name from Windows can be longer than 255 chars which results in
a warning on log level 0 that we have a string overflow. This will avoid
the warning. However we should fix this sooner or later on the protocol
level to have no limit.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun  4 16:49:11 CEST 2014 on sn-devel-104
This commit is contained in:
Andreas Schneider 2014-02-12 13:26:02 +01:00 committed by Andreas Schneider
parent ed89624896
commit 62b4d442b9

View File

@ -162,7 +162,10 @@ static void wb_fill_pwent_getgrsid_done(struct tevent_req *subreq)
strlcpy(state->pw->pw_name,
output_username,
sizeof(state->pw->pw_name));
fstrcpy(state->pw->pw_gecos, state->info->full_name);
/* FIXME The full_name can be longer than 255 chars */
strlcpy(state->pw->pw_gecos,
state->info->full_name != NULL ? state->info->full_name : "",
sizeof(state->pw->pw_gecos));
/* Home directory and shell */
ok = fillup_pw_field(lp_template_homedir(),