Pulling up the Start Menu on a Windows XP machine joined to a Samba PDC shows, for example, "Richard Laager,,," as the full name. This is because the GECOS field on the server contains commas, apparently added by chfn(1). Samba should stop at the first comma. See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=460494
I see the same issue Richard Laager reported. Red Hat Enterprise Linux ES release 3 (Taroon Update 9) samba-3.0.9-1.3E.10
A comment here might be useful for implementing this: https://bugs.freedesktop.org/show_bug.cgi?id=18699#c5
I can confirm this in samba version 3.4.3 I'd really like to get this resolved. I don't know the internals of samba too well. Any thoughts on parsing gecos in pdb_get_fullname() (pdb_get_set.c)? (In reply to comment #2) > A comment here might be useful for implementing this: > https://bugs.freedesktop.org/show_bug.cgi?id=18699#c5 >
I'll start off by saying I really don't know this project so opinions/corrections/suggestions are very much appreciated. Proposed fix (untested thus far): For samba 3.4.3 in passdb/pdb_get_set.c, at line 36 const char *pdb_fullname_from_gecos(const char* gecos) { // the sampass->fullname field doesn't separate // fullname from the other gecos fields. This // will grab just the name size_t len; char* fullname; len = strcspn(gecos,","); fullname = malloc((len+1)*sizeof(char)); strncpy(fullname,gecos,len); fullname[len] = '\0'; //ensure null termination return fullname; } const char *pdb_get_fullname(const struct samu *sampass) { return pdb_fullname_from_gecos(sampass->full_name); } (In reply to comment #3) > I can confirm this in samba version 3.4.3 > > I'd really like to get this resolved. I don't know the internals of samba too > well. Any thoughts on parsing gecos in pdb_get_fullname() (pdb_get_set.c)? > > (In reply to comment #2) > > A comment here might be useful for implementing this: > > https://bugs.freedesktop.org/show_bug.cgi?id=18699#c5 > > >
Created attachment 5292 [details] Alternative patch Can you test the attached patch? Should apply cleanly to 3.4. Volker
Created attachment 5311 [details] patch Looking good now. count_commas was looping indefinitely due to a wee typo. Here's the working patch. Thanks
Thanks for testing the patch! I've pushed it to master with 2ea2d2a. I don't want to load the 3.5.0 release with yet another patch, so it will probably go into 3.5.1 and one of the next 3.4 releases. Jeremy, please check this and if ok ack it for 3.5.1/3.4.x Thanks, Volker
Try to get the review flags right...
+1 patch looks good for 3.5.1. Re-assigning to Karolin for inclusion in 3.5.1. Jeremy.
Pushed to v3-5-test and v3-4-test. Closing out bug report. Thanks!