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);
+ return security_session_user_level(session_info, NULL);
}
static const char *user_name(TALLOC_CTX *mem_ctx, struct ldb_module *module)
{
struct ldb_message_element *oc_el;
struct ldb_message_element *allowedAttributes;
- const struct dsdb_schema *schema = dsdb_get_schema(ldb);
+ /* We need to ensure that the strings returned are valid for as long as the msg is valid */
+ const struct dsdb_schema *schema = dsdb_get_schema(ldb, msg);
TALLOC_CTX *mem_ctx;
const char **attr_list;
- int i, ret;
+ unsigned int i;
+ int ret;
/* If we don't have a schema yet, we can't do anything... */
if (schema == NULL) {
mem_ctx = talloc_new(msg);
if (!mem_ctx) {
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
/* To ensure that oc_el is valid, we must look for it after
{
struct ldb_message_element *oc_el;
struct ldb_message_element *allowedClasses;
- const struct dsdb_schema *schema = dsdb_get_schema(ldb);
+
+ /* We need to ensure that the strings returned are valid for as long as the msg is valid */
+ const struct dsdb_schema *schema = dsdb_get_schema(ldb, msg);
const struct dsdb_class *sclass;
- int i, j, ret;
+ unsigned int i, j;
+ int ret;
/* If we don't have a schema yet, we can't do anything... */
if (schema == NULL) {
struct ldb_context *ldb;
struct kludge_acl_context *ac;
struct kludge_private_data *data;
- int i, ret;
+ unsigned int i;
+ int ret;
ac = talloc_get_type(req->context, struct kludge_acl_context);
data = talloc_get_type(ldb_module_get_private(ac->module), struct kludge_private_data);
struct ldb_request *down_req;
struct kludge_private_data *data;
const char * const *attrs;
- int ret, i;
+ int ret;
+ unsigned int i;
ldb = ldb_module_get_ctx(module);
ac = talloc(req, struct kludge_acl_context);
if (ac == NULL) {
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
data = talloc_get_type(ldb_module_get_private(module), struct kludge_private_data);
static int kludge_acl_init(struct ldb_module *module)
{
struct ldb_context *ldb;
- int ret, i;
+ int ret;
+ unsigned int i;
TALLOC_CTX *mem_ctx = talloc_new(module);
static const char *attrs[] = { "passwordAttribute", NULL };
struct ldb_result *res;
data = talloc(module, struct kludge_private_data);
if (data == NULL) {
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
data->password_attrs = NULL;
- data->acl_perform = lp_parm_bool(ldb_get_opaque(ldb, "loadparm"),
+ data->acl_perform = lpcfg_parm_bool(ldb_get_opaque(ldb, "loadparm"),
NULL, "acl", "perform", false);
ldb_module_set_private(module, data);
if (!mem_ctx) {
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
ret = ldb_search(ldb, mem_ctx, &res,
data->password_attrs = talloc_array(data, const char *, password_attributes->num_values + 1);
if (!data->password_attrs) {
talloc_free(mem_ctx);
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
for (i=0; i < password_attributes->num_values; i++) {
data->password_attrs[i] = (const char *)password_attributes->values[i].data;