version 1.14, 2005/03/31 19:21:16
|
version 1.15, 2005/04/02 23:20:36
|
Line 34
|
Line 34
|
|
|
#include "slapcommon.h" |
#include "slapcommon.h" |
|
|
|
static int |
|
print_access( |
|
Operation *op, |
|
Entry *e, |
|
AttributeDescription *desc, |
|
struct berval *val, |
|
struct berval *nval ) |
|
{ |
|
int rc; |
|
slap_mask_t mask; |
|
char accessmaskbuf[ACCESSMASK_MAXLEN]; |
|
slap_access_t access = ACL_AUTH; |
|
|
|
rc = access_allowed_mask( op, e, desc, nval, ACL_AUTH, NULL, &mask ); |
|
|
|
fprintf( stderr, "%s%s%s: %s\n", |
|
desc->ad_cname.bv_val, |
|
( val && !BER_BVISNULL( val ) ) ? "=" : "", |
|
( val && !BER_BVISNULL( val ) ) ? |
|
( desc == slap_schema.si_ad_userPassword ? "****" : val->bv_val ) : "", |
|
accessmask2str( mask, accessmaskbuf, 1 ) ); |
|
|
|
return rc; |
|
} |
|
|
int |
int |
slapacl( int argc, char **argv ) |
slapacl( int argc, char **argv ) |
{ |
{ |
Line 111 slapacl( int argc, char **argv )
|
Line 136 slapacl( int argc, char **argv )
|
op->o_ndn = authcDN; |
op->o_ndn = authcDN; |
} |
} |
|
|
if ( argc == 0 ) { |
|
argc = 1; |
|
attr = slap_schema.si_ad_entry->ad_cname.bv_val; |
|
} |
|
|
|
if ( !dryrun ) { |
if ( !dryrun ) { |
ID id; |
ID id; |
|
|
Line 153 slapacl( int argc, char **argv )
|
Line 173 slapacl( int argc, char **argv )
|
goto destroy; |
goto destroy; |
|
|
} |
} |
|
|
|
if ( argc == 0 ) { |
|
Attribute *a; |
|
|
|
(void)print_access( op, ep, slap_schema.si_ad_entry, NULL, NULL ); |
|
(void)print_access( op, ep, slap_schema.si_ad_children, NULL, NULL ); |
|
|
|
for ( a = ep->e_attrs; a; a = a->a_next ) { |
|
int i; |
|
|
|
for ( i = 0; !BER_BVISNULL( &a->a_nvals[ i ] ); i++ ) { |
|
(void)print_access( op, ep, a->a_desc, |
|
&a->a_vals[ i ], |
|
&a->a_nvals[ i ] ); |
|
} |
|
} |
|
} |
} |
} |
|
|
for ( ; argc--; argv++ ) { |
for ( ; argc--; argv++ ) { |
slap_mask_t mask; |
slap_mask_t mask; |
AttributeDescription *desc = NULL; |
AttributeDescription *desc = NULL; |
int rc; |
|
struct berval val = BER_BVNULL, |
struct berval val = BER_BVNULL, |
*valp = NULL; |
*valp = NULL; |
const char *text; |
const char *text; |