Use work around for 'winbind use default domain' only if it is set
commitde2c0f0d3d1217814fce840a5050741de3938e0f
authorSumit Bose <sbose@redhat.com>
Mon, 29 Oct 2012 11:09:22 +0000 (29 12:09 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 3 Dec 2012 10:15:45 +0000 (3 11:15 +0100)
treeb8954ea336fe62d6d9881581a810db2103085b6d
parent4ab547a8ddcb45e479079361a601e08476954110
Use work around for 'winbind use default domain' only if it is set

Currently in smb_getpwnam() the NetBIOS domain name and the winbind separator
character is always added to the user name returned by Get_Pwnam_alloc() if it
does not contain the winbind separator character. As comments in the code
indicates this is done as a work around if 'winbind use default domain' is set
to yes in the samba configuration.

This make sense if the option is set because otherwise the domain information is
lost from the user name. But it causes errors if other services than winbind are
used for user lookup, e.g. sssd. sssd can handle different kind of fully
qualified user names as input, e.g. user@domain.name or DOM\user, but returns a
canonical name, by default user@domain.name.

While it would be possible to get around this issue with a special configuration
either on the sssd or samba side I think the cleaner solution is to use the work
around only if 'winbind use default domain' is set to yes which is what this
patch does.

Fix bug #9367 - Use work around for 'winbind use default domain' only if it is
set.
(cherry picked from commit 6c0b864654001046b8bbb585112e60a7e146cb2a)
source3/auth/auth_util.c