#include <ac/errno.h>
#include <ac/signal.h>
#include <ac/string.h>
+#include <ac/ctype.h>
#include <ac/time.h>
#include <ac/unistd.h>
* it's a hard error and return.
*/
- Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno %d msg (%s)\n",
+ Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno=%d reason=\"%s\"\n",
err, err > -1 && err < sys_nerr ? sys_errlist[err]
: "unknown", 0 );
ber_tag_t tag,
ber_int_t msgid,
ber_int_t err,
- char *matched,
- char *text,
+ const char *matched,
+ const char *text,
struct berval **ref,
- char *resoid,
+ const char *resoid,
struct berval *resdata,
LDAPControl **ctrls
)
ber = ber_alloc_t( LBER_USE_DER );
- Debug( LDAP_DEBUG_TRACE, "send_ldap_response: tag=%ld msgid=%ld err=%ld\n",
- (long) tag, (long) msgid, (long) err );
+ Debug( LDAP_DEBUG_TRACE, "send_ldap_response: msgid=%ld tag=%ld err=%ld\n",
+ (long) msgid, (long) tag, (long) err );
if ( ber == NULL ) {
Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
Connection *conn,
Operation *op,
ber_int_t err,
- char *text
+ const char *text
)
{
ber_tag_t tag;
Statslog( LDAP_DEBUG_STATS,
"conn=%ld op=%ld DISCONNECT err=%ld tag=%lu text=%s\n",
(long) op->o_connid, (long) op->o_opid,
- (long) tag, (long) err, text );
+ (long) tag, (long) err, text ? text : "" );
}
void
Connection *conn,
Operation *op,
ber_int_t err,
- char *matched,
- char *text,
+ const char *matched,
+ const char *text,
struct berval **ref,
LDAPControl **ctrls
)
err = LDAP_NO_SUCH_OBJECT;
} else if ( op->o_protocol < LDAP_VERSION3 ) {
err = LDAP_PARTIAL_RESULTS;
- tmp = text = v2ref( ref );
+ tmp = v2ref( ref );
+ text = tmp;
ref = NULL;
}
}
NULL, NULL, ctrls );
Statslog( LDAP_DEBUG_STATS,
- "conn=%ld op=%ld RESULT err=%ld tag=%lu text=%s\n",
+ "conn=%ld op=%ld RESULT tag=%lu err=%ld text=%s\n",
(long) op->o_connid, (long) op->o_opid,
- (long) err, (long) tag, text );
+ (long) tag, (long) err, text ? text : "" );
if( tmp != NULL ) {
free(tmp);
Connection *conn,
Operation *op,
ber_int_t err,
- char *matched,
- char *text,
+ const char *matched,
+ const char *text,
struct berval **refs,
LDAPControl **ctrls,
int nentries
err = LDAP_PARTIAL_RESULTS;
}
- tmp = text = v2ref( refs );
+ tmp = v2ref( refs );
+ text = tmp;
refs = NULL;
} else {
NULL, NULL, ctrls );
Statslog( LDAP_DEBUG_STATS,
- "conn=%ld op=%ld SEARCH RESULT err=%ld tag=%lu text=%s\n",
+ "conn=%ld op=%ld SEARCH RESULT tag=%lu err=%ld text=%s\n",
(long) op->o_connid, (long) op->o_opid,
- (long) err, (long) tag, text );
+ (long) tag, (long) err, text ? text : "" );
}
acl = acl_get_applicable( be, op, e, a->a_type,
MAXREMATCHES, matches );
- if ( ! acl_access_allowed( acl, be, conn, e,
+ if ( ! acl_access_allowed( acl, a->a_type, be, conn, e,
NULL, op, ACL_READ, edn, matches ) )
{
continue;
if ( ! attrsonly ) {
for ( i = 0; a->a_vals[i] != NULL; i++ ) {
if ( a->a_syntax & SYNTAX_DN &&
- ! acl_access_allowed( acl, be, conn, e, a->a_vals[i], op,
+ ! acl_access_allowed( acl, a->a_type, be, conn, e, a->a_vals[i], op,
ACL_READ, edn, matches) )
{
continue;
acl = acl_get_applicable( be, op, e, a->a_type,
MAXREMATCHES, matches );
- if ( ! acl_access_allowed( acl, be, conn, e,
+ if ( ! acl_access_allowed( acl, a->a_type, be, conn, e,
NULL, op, ACL_READ, edn, matches ) )
{
continue;
if ( ! attrsonly ) {
for ( i = 0; a->a_vals[i] != NULL; i++ ) {
if ( a->a_syntax & SYNTAX_DN &&
- ! acl_access_allowed( acl, be, conn, e, a->a_vals[i], op,
+ ! acl_access_allowed( acl, a->a_type, be, conn, e, a->a_vals[i], op,
ACL_READ, edn, matches) )
{
continue;