)
{
regex_t re;
- char newbuf[512];
+ char newbuf[ACL_BUF_SIZE];
struct berval bv;
int rc;
string_expand(&bv, pat, buf, matches);
if (( rc = regcomp(&re, newbuf, REG_EXTENDED|REG_ICASE))) {
- char error[512];
+ char error[ACL_BUF_SIZE];
regerror(rc, &re, error, sizeof(error));
#ifdef NEW_LOGGING
}
if ( strcasecmp( left, "filter" ) == 0 ) {
- if ( (a->acl_filter = str2filter(
- right )) == NULL ) {
+ if ( (a->acl_filter = str2filter( right )) == NULL ) {
fprintf( stderr,
"%s: line %d: bad filter \"%s\" in to clause\n",
fname, lineno, right );
}
if ( a->acl_dn_pat.bv_len != 0 &&
- strcmp(a->acl_dn_pat.bv_val, "*") == 0)
+ strcmp(a->acl_dn_pat.bv_val, "*") == 0 )
{
free( a->acl_dn_pat.bv_val );
a->acl_dn_pat.bv_val = NULL;
}
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
+
for (g = conn->c_groups; g; g=g->ga_next) {
if (g->ga_be != be || g->ga_oc != group_oc ||
g->ga_at != group_at || g->ga_len != gr_ndn->bv_len)
if (strcmp( g->ga_ndn, gr_ndn->bv_val ) == 0)
break;
}
+
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
+
if (g) {
return g->ga_res;
}
token = strtok_quote( line, " \t" );
logline = line;
- if ( token &&
- (strcasecmp( token, "rootpw" ) == 0 ||
- strcasecmp( token, "replica" ) == 0 || /* contains "credentials" */
- strcasecmp( token, "bindpw" ) == 0 || /* used in back-ldap */
- strcasecmp( token, "pseudorootpw" ) == 0 || /* used in back-meta */
- strcasecmp( token, "dbpasswd" ) == 0 ) ) /* used in back-sql */
- sprintf( logline = logbuf, "%s ***", token );
- if ( strtok_quote_ptr )
+
+ if ( token && ( strcasecmp( token, "rootpw" ) == 0 ||
+ strcasecmp( token, "replica" ) == 0 || /* contains "credentials" */
+ strcasecmp( token, "bindpw" ) == 0 || /* used in back-ldap */
+ strcasecmp( token, "pseudorootpw" ) == 0 || /* used in back-meta */
+ strcasecmp( token, "dbpasswd" ) == 0 ) ) /* used in back-sql */
+ {
+ snprintf( logline = logbuf, sizeof logbuf, "%s ***", token );
+ }
+
+ if ( strtok_quote_ptr ) {
*strtok_quote_ptr = ' ';
+ }
+
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, DETAIL1, "line %d (%s)\n", lineno, logline , 0 );
#else
Debug( LDAP_DEBUG_CONFIG, "line %d (%s)\n", lineno, logline, 0 );
#endif
- if ( strtok_quote_ptr )
+
+ if ( strtok_quote_ptr ) {
*strtok_quote_ptr = '\0';
+ }
for ( ; token != NULL; token = strtok_quote( NULL, " \t" ) ) {
if ( cargc == cargv_size - 1 ) {
static char buf[BUFSIZ];
static char *line;
-static int lmax, lcur;
-
-#define CATLINE( buf ) { \
- int len; \
- len = strlen( buf ); \
- while ( lcur + len + 1 > lmax ) { \
- lmax += BUFSIZ; \
- line = (char *) ch_realloc( line, lmax ); \
- } \
- strcpy( line + lcur, buf ); \
- lcur += len; \
-}
+static size_t lmax, lcur;
+
+#define CATLINE( buf ) \
+ do { \
+ size_t len = strlen( buf ); \
+ while ( lcur + len + 1 > lmax ) { \
+ lmax += BUFSIZ; \
+ line = (char *) ch_realloc( line, lmax ); \
+ } \
+ strcpy( line + lcur, buf ); \
+ lcur += len; \
+ } while( 0 )
static char *
fp_getline( FILE *fp, int *lineno )
{
char nbuf[64];
- sprintf( nbuf, "%d nentries=%d", err, nentries );
+ snprintf( nbuf, sizeof nbuf, "%d nentries=%d", err, nentries );
Statslog( LDAP_DEBUG_STATS,
"conn=%lu op=%lu SEARCH RESULT tag=%lu err=%s text=%s\n",
#include "lber_pvt.h"
static struct berval supportedFeatures[] = {
- BER_BVC("1.3.6.1.4.1.4203.1.5.1"), /* all Operational Attributes ("+") */
- BER_BVC("1.3.6.1.4.1.4203.1.5.2"), /* OCs in Attributes List */
- BER_BVC("1.3.6.1.4.1.4203.1.5.3"), /* (&) and (|) search filters */
- BER_BVC("1.3.6.1.4.1.4203.1.5.4"), /* Language Tag Options */
- BER_BVC("1.3.6.1.4.1.4203.1.5.5"), /* Language Range Options */
+ BER_BVC(LDAP_FEATURE_ALL_OPERATIONAL_ATTRS), /* all Operational Attributes ("+") */
+ BER_BVC(LDAP_FEATURE_OBJECTCLASS_ATTRS), /* OCs in Attributes List */
+ BER_BVC(LDAP_FEATURE_ABSOLUTE_FILTERS), /* (&) and (|) search filters */
+ BER_BVC(LDAP_FEATURE_LANGUAGE_TAG_OPTIONS), /* Language Tag Options */
+ BER_BVC(LDAP_FEATURE_LANGUAGE_RANGE_OPTIONS), /* Language Range Options */
{0,NULL}
};
Entry **entry,
const char **text )
{
- char buf[BUFSIZ];
Entry *e;
struct berval vals[2], *bv;
int i, j;
/* supportedLDAPVersion */
for ( i=LDAP_VERSION_MIN; i<=LDAP_VERSION_MAX; i++ ) {
+ char buf[BUFSIZ];
if (!( global_allows & SLAP_ALLOW_BIND_V2 ) &&
( i < LDAP_VERSION3 ) )
{
/* version 2 and lower are disallowed */
continue;
}
- sprintf(buf,"%d",i);
+ snprintf(buf, sizeof buf, "%d", i);
vals[0].bv_val = buf;
vals[0].bv_len = strlen( vals[0].bv_val );
attr_merge( e, ad_supportedLDAPVersion, vals );
+/*
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
/*
* Copyright (c) 2000, Mark Adamson, Carnegie Mellon. All rights reserved.
* This software is not subject to any license of Carnegie Mellon University.
off[n] = -1;
return( LDAP_SUCCESS );
}
-#endif /* HAVE_CYRUS_SASL */
int slap_sasl_regexp_config( const char *match, const char *replace )
{
-#ifdef HAVE_CYRUS_SASL
const char *c;
int rc, n;
SaslRegexp_t *reg;
}
nSaslRegexp++;
-#endif
return( LDAP_SUCCESS );
}
-#ifdef HAVE_CYRUS_SASL
-
/* Perform replacement on regexp matches */
static void slap_sasl_rx_exp( char *rep, int *off, regmatch_t *str,
char *saslname, struct berval *out )