summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-01-08 09:29:01 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-08 13:03:06 +1100
commitf118f54ee783a97ed2bc5415213f3145710e0b4c (patch)
tree091587afd99efd0f9f53e9646491154707c84b8b
parentd22a9e5d3bee44ac59922a2a602ad235bf450d5d (diff)
downloadsamba-f118f54ee783a97ed2bc5415213f3145710e0b4c.tar.gz
samba-f118f54ee783a97ed2bc5415213f3145710e0b4c.tar.bz2
samba-f118f54ee783a97ed2bc5415213f3145710e0b4c.zip
s4-dsdb: added dsdb_module_am_system()
better than each module inventing their own
-rw-r--r--source4/dsdb/samdb/ldb_modules/util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c
index b4f81978d3..46252cb279 100644
--- a/source4/dsdb/samdb/ldb_modules/util.c
+++ b/source4/dsdb/samdb/ldb_modules/util.c
@@ -26,6 +26,7 @@
#include "dsdb/samdb/ldb_modules/util.h"
#include "dsdb/samdb/samdb.h"
#include "util.h"
+#include "libcli/security/security.h"
/*
add a set of controls to a ldb_request structure based on a set of
@@ -629,3 +630,11 @@ int dsdb_module_set_integer(struct ldb_module *module, struct ldb_dn *dn,
talloc_free(msg);
return ret;
}
+
+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");
+ return security_session_user_level(session_info) == SECURITY_SYSTEM;
+}