summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2013-01-29 17:19:17 +0100
committerMichael Adam <obnox@samba.org>2013-02-05 19:14:25 +0100
commit6c2d6ada42779b1c7015ddf3cf0dc420c4558be1 (patch)
tree02ac9c0e4e182b40d5413d79005c991e26110e95 /source3
parentdeea99ac36a431befae3af39b7e160ce2d7ba5dc (diff)
downloadsamba-6c2d6ada42779b1c7015ddf3cf0dc420c4558be1.tar.gz
samba-6c2d6ada42779b1c7015ddf3cf0dc420c4558be1.tar.bz2
samba-6c2d6ada42779b1c7015ddf3cf0dc420c4558be1.zip
s3:auth small optimization in create_token_from_sid
save some calls to lp_idmap_default_range(), calling it once is enough Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Feb 5 19:14:25 CET 2013 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/auth/token_util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index 33b5507744..d86d589cc3 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -565,6 +565,8 @@ static NTSTATUS create_token_from_sid(TALLOC_CTX *mem_ctx,
uint32_t num_group_sids;
uint32_t num_gids;
uint32_t i;
+ uint32_t high, low;
+ bool range_ok;
if (sid_check_is_in_our_sam(user_sid)) {
bool ret;
@@ -757,13 +759,13 @@ static NTSTATUS create_token_from_sid(TALLOC_CTX *mem_ctx,
to 'valid user = "Domain Admins"'. --jerry */
num_gids = num_group_sids;
+ range_ok = lp_idmap_default_range(&low, &high);
for ( i=0; i<num_gids; i++ ) {
- uint32_t high, low;
/* don't pickup anything managed by Winbind */
-
- if ( lp_idmap_default_range(&low, &high) && (gids[i] >= low) && (gids[i] <= high) )
+ if (range_ok && (gids[i] >= low) && (gids[i] <= high)) {
continue;
+ }
gid_to_unix_groups_sid(gids[i], &unix_group_sid);