mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
partially revert previous commit (the "creator" special DN pattern is redundant as "dnattr" is more expressive
This commit is contained in:
parent
ca5d5c6fc7
commit
947268c5ee
@ -55,7 +55,6 @@ static struct berval
|
||||
aci_bv_public = BER_BVC("public"),
|
||||
aci_bv_users = BER_BVC("users"),
|
||||
aci_bv_self = BER_BVC("self"),
|
||||
aci_bv_creator = BER_BVC("creator"),
|
||||
aci_bv_dnattr = BER_BVC("dnattr"),
|
||||
aci_bv_group = BER_BVC("group"),
|
||||
aci_bv_role = BER_BVC("role"),
|
||||
@ -698,10 +697,10 @@ acl_mask(
|
||||
* the entry, OR the given dn matches the dn pattern
|
||||
*/
|
||||
/*
|
||||
* NOTE: styles "anonymous", "users", "self"
|
||||
* and "creator" have been moved to an enumeration,
|
||||
* whose value is set in a_dn_style; however,
|
||||
* the string is maintaned in a_dn_pat.
|
||||
* NOTE: styles "anonymous", "users" and "self"
|
||||
* have been moved to an enumeration, * whose value
|
||||
* is set in a_dn_style; however, the string
|
||||
* is maintaned in a_dn_pat.
|
||||
*/
|
||||
if ( b->a_dn_style == ACL_STYLE_ANONYMOUS /* bvmatch( &b->a_dn_pat, &aci_bv_anonymous ) */ ) {
|
||||
if ( op->o_ndn.bv_len != 0 ) {
|
||||
@ -722,20 +721,6 @@ acl_mask(
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if ( b->a_dn_style == ACL_STYLE_CREATOR /* bvmatch ( &b->a_dn_pat, &aci_bv_creator ) */ ) {
|
||||
/* creator */
|
||||
Attribute *a;
|
||||
|
||||
for ( a = e->e_attrs; a; a = a->a_next ) {
|
||||
if ( a->a_desc == slap_schema.si_ad_creatorsName ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( a == NULL || !dn_match( &a->a_nvals[ 0 ], &op->o_ndn ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if ( b->a_dn_style == ACL_STYLE_REGEX ) {
|
||||
if ( !ber_bvccmp( &b->a_dn_pat, '*' ) ) {
|
||||
int tmp_nmatch;
|
||||
@ -2415,19 +2400,6 @@ aci_mask(
|
||||
return 1;
|
||||
}
|
||||
|
||||
} else if ( ber_bvstrcasecmp( &aci_bv_creator, &bv ) == 0 ) {
|
||||
Attribute *a;
|
||||
|
||||
for ( a = e->e_attrs; a; a = a->a_next ) {
|
||||
if ( a->a_desc == slap_schema.si_ad_creatorsName ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( a != NULL && dn_match( &op->o_ndn, &a->a_nvals[ 0 ] ) ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
} else if ( ber_bvstrcasecmp( &aci_bv_dnattr, &bv ) == 0 ) {
|
||||
Attribute *at;
|
||||
AttributeDescription *ad = NULL;
|
||||
|
@ -647,10 +647,6 @@ parse_acl(
|
||||
ber_str2bv("self", STRLENOF( "self" ), 1, &bv);
|
||||
sty = ACL_STYLE_SELF;
|
||||
|
||||
} else if ( strcasecmp( argv[i], "creator" ) == 0 ) {
|
||||
ber_str2bv("creator", STRLENOF( "creator" ), 1, &bv);
|
||||
sty = ACL_STYLE_CREATOR;
|
||||
|
||||
} else if ( strcasecmp( left, "dn" ) == 0 ) {
|
||||
if ( sty == ACL_STYLE_REGEX ) {
|
||||
b->a_dn_style = ACL_STYLE_REGEX;
|
||||
@ -733,7 +729,6 @@ parse_acl(
|
||||
sty != ACL_STYLE_ANONYMOUS &&
|
||||
sty != ACL_STYLE_USERS &&
|
||||
sty != ACL_STYLE_SELF &&
|
||||
sty != ACL_STYLE_CREATOR &&
|
||||
expand == 0 )
|
||||
{
|
||||
rc = dnNormalize(0, NULL, NULL,
|
||||
@ -1797,7 +1792,7 @@ acl_usage( void )
|
||||
"<what> ::= * | [dn[.<dnstyle>]=<DN>] [filter=<filter>] [attrs=<attrlist>]\n"
|
||||
"<attrlist> ::= <attr> [val[.<style>]=<value>] | <attr> , <attrlist>\n"
|
||||
"<attr> ::= <attrname> | entry | children\n",
|
||||
"<who> ::= [ * | anonymous | users | self | creator | dn[.<dnstyle>]=<DN> ]\n"
|
||||
"<who> ::= [ * | anonymous | users | self | dn[.<dnstyle>]=<DN> ]\n"
|
||||
"\t[dnattr=<attrname>]\n"
|
||||
"\t[group[/<objectclass>[/<attrname>]][.<style>]=<group>]\n"
|
||||
"\t[peername[.<peernamestyle>]=<peer>] [sockname[.<style>]=<name>]\n"
|
||||
@ -2032,8 +2027,7 @@ print_access( Access *b )
|
||||
if ( ber_bvccmp( &b->a_dn_pat, '*' ) ||
|
||||
b->a_dn_style == ACL_STYLE_ANONYMOUS /* strcmp( b->a_dn_pat.bv_val, "anonymous" ) == 0 */ ||
|
||||
b->a_dn_style == ACL_STYLE_USERS /* strcmp( b->a_dn_pat.bv_val, "users" ) == 0 */ ||
|
||||
b->a_dn_style == ACL_STYLE_SELF /* strcmp( b->a_dn_pat.bv_val, "self" ) == 0 */ ||
|
||||
b->a_dn_style == ACL_STYLE_CREATOR /* strcmp( b->a_dn_pat.bv_val, "creator" ) == 0 */ )
|
||||
b->a_dn_style == ACL_STYLE_SELF /* strcmp( b->a_dn_pat.bv_val, "self" ) == 0 */ )
|
||||
{
|
||||
fprintf( stderr, " %s", b->a_dn_pat.bv_val );
|
||||
|
||||
|
@ -1139,7 +1139,6 @@ typedef enum slap_style_e {
|
||||
ACL_STYLE_ANONYMOUS,
|
||||
ACL_STYLE_USERS,
|
||||
ACL_STYLE_SELF,
|
||||
ACL_STYLE_CREATOR,
|
||||
ACL_STYLE_IP,
|
||||
ACL_STYLE_PATH
|
||||
} slap_style_t;
|
||||
|
Loading…
Reference in New Issue
Block a user