rethinking the order of getpwnam call in Get_Pwnam_internals?

Bo Yang boyang at novell.com
Thu Feb 21 06:28:54 GMT 2008


Hi, Jeremy:
       The order of getpwnam call in Get_Pwnam_internals is:
1. lowercase username.
2. given username, ie, original username
3. uppercase username
4. level-N combinations of uppercase username.  for example, nodns1, Nodns1, NOdns1, etc.

    There is a problem of this order when "winbind use default domain = yes" and "username map = filename".
    
    I have one unix local user NODNS1 and one domain user NODNSUPDATE\nodns1, and there following entry exists in my smbuser(the username map file):
NODNS1 = NODNSUPDATE\nodns1.
   
    After authentication, NODNSUPDATE\nodns1 is correctly mapped to NODNS1. But the problem is the construction of user information from username when "winbind use default domain = yes".
    Get_Pwnam_internals tries lowercase name first, and domain name is automatically prepended to username in winbindd, results in NODNSUPDATE\nodns1. Therefore the lookup of NODNS1
    results in domain user account instead of local unix user account, That might not be what users want to see.  User's attension is to map the domain username to local unix username.

    I suggest change the order of getpwnam call to:
1. given username
2. lowercase username
3. uppercase username
4. level-Ncombinations of uppercase username.

Patch for v3-0-test and v3-2-test in the attachment, please review them.

Correct me if there is anything wrong.

Thanks!

Best
        Regards
BoYang
2.21
-------------- next part --------------
A non-text attachment was scrubbed...
Name: order_of_GetPwnam_internals_v3_0_test.diff
Type: application/octet-stream
Size: 1107 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20080220/b9eec048/order_of_GetPwnam_internals_v3_0_test.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: order_of_GetPwnam_internals_v3_2_test.diff
Type: application/octet-stream
Size: 1107 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20080220/b9eec048/order_of_GetPwnam_internals_v3_2_test.obj


More information about the samba-technical mailing list