[PATCH] Make winbindd_getpwnam() return consistent values

Tom Shaw tomisfaraway at gmail.com
Fri Jul 30 02:43:10 GMT 2004


Hi all

Summary: In the function winbindd_getpwnam(), winbind calls
query_user(). However instead of using the user_info.acct_name value
returned by this call to populate the result, the function uses the
username supplied in the argument to winbindd_getpwnam() .

This causes an inconsistency where queries about the same user can
return different usernames and different home directories. My patch
changes the method so that the acct_name value returned by the server
is used to populate the result.

Before the patch:

# getent passwd 10009
casetest:x:10009:10000:Case Test:/export/winhome/casetest:/bin/bash
# getent passwd casetest
casetest:x:10009:10000:Case Test:/export/winhome/casetest:/bin/bash
# getent passwd CaseTest
CaseTest:x:10009:10000:Case Test:/export/winhome/CaseTest:/bin/bash

After the patch:

# getent passwd 10009
casetest:x:10009:10000:Case Test:/export/winhome/casetest:/bin/bash
# getent passwd casetest
casetest:x:10009:10000:Case Test:/export/winhome/casetest:/bin/bash
# getent passwd CaseTest
casetest:x:10009:10000:Case Test:/export/winhome/casetest:/bin/bash

My real-world problem was that users were able to successfully login
(via pam_winbind) to a Solaris machine using their Windows
username/password with any combination of uppercase and lowercase.
Then when programs started up and wanted to know where the home
directory was to put their dotfiles, different programs tried
different places: eg if a user logged in as CaseTest, some programs
tried /export/winhome/casetest, and others tried
/export/winhome/CaseTest.

Is my patch on the right track, or is there a reason for the existing behaviour?

Cheers
Tom Shaw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winbind_username.patch
Type: application/octet-stream
Size: 587 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20040730/125a9b78/winbind_username.obj


More information about the samba-technical mailing list