diff options
author | Andreas Schneider <asn@samba.org> | 2014-02-12 13:26:02 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-06-04 16:49:11 +0200 |
commit | 62b4d442b9b43d40137ba82e9d00c864ef2d1c25 (patch) | |
tree | 54630a505dc2305d40d5282dbe5be2fba8ea909a /source3 | |
parent | ed89624896b782525bf75dba5d4b75fa3067e80f (diff) | |
download | samba-62b4d442b9b43d40137ba82e9d00c864ef2d1c25.tar.gz samba-62b4d442b9b43d40137ba82e9d00c864ef2d1c25.tar.xz samba-62b4d442b9b43d40137ba82e9d00c864ef2d1c25.zip |
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
Diffstat (limited to 'source3')
-rw-r--r-- | source3/winbindd/wb_fill_pwent.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/winbindd/wb_fill_pwent.c b/source3/winbindd/wb_fill_pwent.c index c1f83e5e91..8c8f839a51 100644 --- a/source3/winbindd/wb_fill_pwent.c +++ b/source3/winbindd/wb_fill_pwent.c @@ -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(), |