summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-08-17 14:55:23 +1000
committerAndrew Tridgell <tridge@samba.org>2010-08-17 21:21:51 +1000
commit896f10301cc3db10793cac115bcbca0f58f0f010 (patch)
treeda8678eb993843737dda6771f1580a8b9f74c08c /source4/dsdb/samdb
parent21729b63f0a43798751517369a032ba8672aeb20 (diff)
downloadsamba-896f10301cc3db10793cac115bcbca0f58f0f010.tar.gz
samba-896f10301cc3db10793cac115bcbca0f58f0f010.tar.bz2
samba-896f10301cc3db10793cac115bcbca0f58f0f010.zip
s4-dsdb: check the type of session_info from the opaque
we saw a crash with a bad pointer here, and this may help track it down Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c
index fda1733f62..23a8da2228 100644
--- a/source4/dsdb/samdb/ldb_modules/util.c
+++ b/source4/dsdb/samdb/ldb_modules/util.c
@@ -906,7 +906,7 @@ bool dsdb_module_am_system(struct ldb_module *module)
{
struct ldb_context *ldb = ldb_module_get_ctx(module);
struct auth_session_info *session_info
- = (struct auth_session_info *)ldb_get_opaque(ldb, "sessionInfo");
+ = talloc_get_type(ldb_get_opaque(ldb, "sessionInfo"), struct auth_session_info);
return security_session_user_level(session_info, NULL) == SECURITY_SYSTEM;
}
@@ -914,7 +914,7 @@ bool dsdb_module_am_administrator(struct ldb_module *module)
{
struct ldb_context *ldb = ldb_module_get_ctx(module);
struct auth_session_info *session_info
- = (struct auth_session_info *)ldb_get_opaque(ldb, "sessionInfo");
+ = talloc_get_type(ldb_get_opaque(ldb, "sessionInfo"), struct auth_session_info);
return security_session_user_level(session_info, NULL) == SECURITY_ADMINISTRATOR;
}