[Pkg-samba-maint] DO NOT REPLY [Bug 5198] Samba Fails to Split GECOS on Comma

samba-bugs at samba.org samba-bugs at samba.org
Fri Feb 5 18:49:30 UTC 2010


https://bugzilla.samba.org/show_bug.cgi?id=5198





------- Comment #4 from jmalone at jsoft.ca  2010-02-05 12:49 CST -------
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
> > 
> 


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Pkg-samba-maint mailing list