+/* posixgroup.c */
/* $OpenLDAP$ */
-/*
- * Copyright 1998-2005 The OpenLDAP Foundation.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2013 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
static int
pg_dynacl_mask(
void *priv,
- struct slap_op *op,
+ Operation *op,
Entry *target,
AttributeDescription *desc,
struct berval *val,
rc = LDAP_SUCCESS;
} else {
- user_be = op->o_bd = select_backend( &op->o_ndn, 0, 0 );
+ user_be = op->o_bd = select_backend( &op->o_ndn, 0 );
if ( op->o_bd == NULL ) {
op->o_bd = be;
return 0;
if ( pg->pg_style == ACL_STYLE_EXPAND ) {
char buf[ 1024 ];
struct berval bv;
+ AclRegexMatches amatches = { 0 };
+
+ amatches.dn_count = nmatch;
+ AC_MEMCPY( amatches.dn_data, matches, sizeof( amatches.dn_data ) );
bv.bv_len = sizeof( buf ) - 1;
bv.bv_val = buf;
if ( acl_string_expand( &bv, &pg->pg_pat,
- target->e_nname.bv_val,
- nmatch, matches ) )
+ &target->e_nname,
+ NULL, &amatches ) )
{
goto cleanup;
}
rc = LDAP_SUCCESS;
} else {
- group_be = op->o_bd = select_backend( &group_ndn, 0, 0 );
+ group_be = op->o_bd = select_backend( &group_ndn, 0 );
if ( op->o_bd == NULL ) {
goto cleanup;
}
Attribute *a_uid,
*a_member;
- a_uid = attr_find( user->e_attrs, pg_uidNumber);
+ a_uid = attr_find( user->e_attrs, pg_uidNumber );
if ( !a_uid || !BER_BVISNULL( &a_uid->a_nvals[ 1 ] ) ) {
rc = LDAP_NO_SUCH_ATTRIBUTE;
if ( user != NULL && user != target ) {
op->o_bd = user_be;
- be_entry_release_r( op, group );
+ be_entry_release_r( op, user );
op->o_bd = be;
}