diff options
author | Volker Lendecke <vl@samba.org> | 2013-05-03 10:28:59 +0000 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-05-03 14:48:35 +0200 |
commit | 0a2910152aaafa1c7d484f8a0ade869d7962d4e3 (patch) | |
tree | f721b5ca1fe2882a9f8977dd0f2eafc7461b6b36 | |
parent | 1966e28d157da3ef561a6e760eb4736e917fdd81 (diff) | |
download | samba-0a2910152aaafa1c7d484f8a0ade869d7962d4e3.tar.gz samba-0a2910152aaafa1c7d484f8a0ade869d7962d4e3.tar.bz2 samba-0a2910152aaafa1c7d484f8a0ade869d7962d4e3.zip |
idmap: Store negative cache entries if the backend fails
This changes the behaviour for out-of-range queries: The tdb backend
(probably all backends) returns NT_STATUS_NONE_MAPPED and does not set the
map.status value to ID_UNMAPPED. This means that we did an early error
exit, not setting a negative cache value. This makes smbd ask winbind
over and over again for out-of-range gids, which can be a performance
problem in certain scenarios.
The new code makes us fall through to the code setting the negative
cache entry in all cases.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri May 3 14:48:35 CEST 2013 on sn-devel-104
-rw-r--r-- | source3/winbindd/idmap_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c index 7bd81a141d..e671acf837 100644 --- a/source3/winbindd/idmap_util.c +++ b/source3/winbindd/idmap_util.c @@ -70,7 +70,7 @@ backend: if ( ! NT_STATUS_IS_OK(ret)) { DEBUG(10, ("error mapping uid [%lu]: %s\n", (unsigned long)uid, nt_errstr(ret))); - return ret; + map.status = ID_UNMAPPED; } if (map.status != ID_MAPPED) { @@ -134,7 +134,7 @@ backend: if ( ! NT_STATUS_IS_OK(ret)) { DEBUG(10, ("error mapping gid [%lu]: %s\n", (unsigned long)gid, nt_errstr(ret))); - return ret; + map.status = ID_UNMAPPED; } if (map.status != ID_MAPPED) { |