------=_Part_20_22034730.1091155390880
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_20_22034730.1091155390880
Content-Type: application/octet-stream; name="winbind_username.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="winbind_username.patch"

LS0tIHNhbWJhLTMuMC41LW9sZC9zb3VyY2UvbnNzd2l0Y2gvd2 luYmluZGRfdXNlci5jICAgICBX
ZWQgSnVsIDIxIDAwOjI4OjAxIDIwMDQKKysrIHNhbWJhLTMuMC 41L3NvdXJjZS9uc3N3aXRjaC93
aW5iaW5kZF91c2VyLmMgRnJpIEp1bCAzMCAwOToyNDoxNSAyMD A0CkBAIC0xODUsNyArMTg1LDcg
QEAKICAgICAgICB9CiAgICAgCiAgICAgICAgLyogTm93IHRha2 UgYWxsIHRoaXMgaW5mb3JtYXRp
b24gYW5kIGZpbGwgaW4gYSBwYXNzd2Qgc3RydWN0dXJlICovIC AgICAgCi0gICAgICAgaWYgKCF3
aW5iaW5kZF9maWxsX3B3ZW50KG5hbWVfZG9tYWluLCBuYW1lX3 VzZXIsIAorICAgICAgIGlmICgh
d2luYmluZGRfZmlsbF9wd2VudChuYW1lX2RvbWFpbiwgdXNlcl 9pbmZvLmFjY3RfbmFtZSwgCiAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJfaW 5mby51c2VyX3NpZCwgdXNlcl9p
bmZvLmdyb3VwX3NpZCwgCiAgICAgICAgICAgICAgICAgICAgIC AgICAgICAgICAgIHVzZXJfaW5m
by5mdWxsX25hbWUsCiAgICAgICAgICAgICAgICAgICAgICAgIC AgICAgICAgICZzdGF0ZS0+cmVz
cG9uc2UuZGF0YS5wdykpIHsK
------=_Part_20_22034730.1091155390880--