s3:winbind_user: fix "getent passwd" to allocate new uids.
authorMichael Adam <obnox@samba.org>
Sun, 1 Feb 2009 23:36:59 +0000 (00:36 +0100)
committerMichael Adam <obnox@samba.org>
Sun, 1 Feb 2009 23:53:05 +0000 (00:53 +0100)
commita0d05192006c4bade760bd945ab91b5268ca47a6
tree9479e0a9f61826af50fcf1f0aff64570a9b0a276
parent8c57f34b99b9bd587e1c2be0905a8c41eebbd568
s3:winbind_user: fix "getent passwd" to allocate new uids.

"getent passwd" used to fill the idmap cache with negative
cache entries for unmapped user sids.

Don't pass domain name unconditionally to idmap_sid_to_[ug]id().
idmap_sid_to_[ug]id() only creates new mappings (allocating
idmap backends tdb, tdb2, ldap...) when the domain name passed
in is "".

Note that it is _wrong_ to directly call the idmap_sid_to_[ug]id()
functions here, in the main winbindd. The correct fix would be
to send a sid_to_[ug]id request to winbindd itself, but this needs
more work to prepare the async mechanisms, and we nee a quick
fix for getent passwd now.

Michael
source3/winbindd/winbindd_user.c