/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2004-2005 The OpenLDAP Foundation.
+ * Copyright 2004-2006 The OpenLDAP Foundation.
* Portions Copyright 2004 Pierangelo Masarati.
* All rights reserved.
*
desc->ad_cname.bv_val,
( val && !BER_BVISNULL( val ) ) ? "=" : "",
( val && !BER_BVISNULL( val ) ) ?
- ( desc == slap_schema.si_ad_userPassword ? "****" : val->bv_val ) : "",
+ ( desc == slap_schema.si_ad_userPassword ?
+ "****" : val->bv_val ) : "",
accessmask2str( mask, accessmaskbuf, 1 ) );
return rc;
const char *progname = "slapacl";
Connection conn = { 0 };
Listener listener;
- char opbuf[OPERATION_BUFFER_SIZE];
- Operation *op;
+ OperationBuffer opbuf;
+ Operation *op = NULL;
Entry e = { 0 }, *ep = &e;
char *attr = NULL;
int doclose = 0;
argv = &argv[ optind ];
argc -= optind;
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, &conn );
conn.c_listener = &listener;
accessstr = strchr( attr, '/' );
if ( accessstr != NULL ) {
+ int invalid = 0;
+
accessstr[0] = '\0';
accessstr++;
access = str2access( accessstr );
- if ( access == ACL_INVALID_ACCESS ) {
+ switch ( access ) {
+ case ACL_INVALID_ACCESS:
fprintf( stderr, "unknown access \"%s\" for attribute \"%s\"\n",
accessstr, attr );
+ invalid = 1;
+ break;
+
+ case ACL_NONE:
+ fprintf( stderr, "\"none\" not allowed for attribute \"%s\"\n",
+ attr );
+ invalid = 1;
+ break;
+
+ default:
+ break;
+ }
+
+ if ( invalid ) {
if ( continuemode ) {
continue;
}