{
int count;
AccessControl *a;
+ char accessmaskbuf[ACCESSMASK_MAXLEN];
slap_access_mask_t mask;
slap_control_t control;
"=> access_allowed: %s access %s by %s\n",
access2str( access ),
ACL_GRANT(mask, access) ? "granted" : "denied",
- accessmask2str( mask ) );
+ accessmask2str( mask, accessmaskbuf ) );
return ACL_GRANT(mask, access);
}
)
{
AccessControl *next;
-
assert( e != NULL );
assert( count != NULL );
{
int i;
Access *b;
+ char accessmaskbuf[ACCESSMASK_MAXLEN];
assert( a != NULL );
assert( mask != NULL );
"=> acl_mask: to value \"%s\" by \"%s\", (%s) \n",
val ? val->bv_val : "*",
op->o_ndn ? op->o_ndn : "",
- accessmask2str( *mask ) );
+ accessmask2str( *mask, accessmaskbuf ) );
for ( i = 1, b = a->acl_access; b != NULL; b = b->a_next, i++ ) {
slap_access_mask_t oldmask, modmask;
Debug( LDAP_DEBUG_ACL,
"<= acl_mask: [%d] applying %s (%s)\n",
- i, accessmask2str( modmask ),
+ i, accessmask2str( modmask, accessmaskbuf ),
b->a_type == ACL_CONTINUE
? "continue"
: b->a_type == ACL_BREAK
}
Debug( LDAP_DEBUG_ACL,
- "<= acl_mask: [%d] old: %s new: %s\n",
- i, accessmask2str(oldmask), accessmask2str(*mask));
+ "<= acl_mask: [%d] mask: %s\n",
+ i, accessmask2str(*mask, accessmaskbuf), 0 );
if( b->a_type == ACL_CONTINUE ) {
continue;
Debug( LDAP_DEBUG_ACL,
"<= acl_mask: no more <who> clauses, returning %s (stop)\n",
- accessmask2str(*mask), 0, 0 );
+ accessmask2str(*mask, accessmaskbuf), 0, 0 );
return ACL_STOP;
}
size = 0;
newbuf[0] = '\0';
+ bufsiz--; /* leave space for lone $ */
flag = 0;
for ( dp = newbuf, sp = pat; size < bufsiz && *sp ; sp++) {
}
}
}
+
+ if (flag) {
+ /* must have ended with a single $ */
+ *dp++ = '$';
+ size++;
+ }
+
*dp = '\0';
Debug( LDAP_DEBUG_TRACE, "=> string_expand: pattern: %s\n", pat, 0, 0 );
}
char *
-accessmask2str( slap_access_mask_t mask )
+accessmask2str( slap_access_mask_t mask, char *buf )
{
- static char buf[sizeof("unknown (+wrscan)")];
int none=1;
+ assert( buf != NULL );
+
if ( ACL_IS_INVALID( mask ) ) {
return "invalid";
}
static void
print_access( Access *b )
{
+ char maskbuf[ACCESSMASK_MAXLEN];
+
fprintf( stderr, "\tby" );
if ( b->a_dn_pat != NULL ) {
fprintf( stderr, " %s%s",
b->a_dn_self ? "self" : "",
- accessmask2str( b->a_mask ) );
+ accessmask2str( b->a_mask, maskbuf ) );
if( b->a_type == ACL_BREAK ) {
fprintf( stderr, " break" );