#include "slap.h"
#ifdef LDAP_DEBUG
-static void at_index_print( void );
+static void at_index_print( void ) {};
#endif
void
{
struct monitorinfo *mi;
- char buf[1024];
Entry *e;
struct berval *bv[2], val;
"cn: Monitor\n"
"description: %s",
SLAPD_MONITOR_DN,
- (char *) Versionstr
+ /* (char *) Versionstr */ "slapd 2.0"
);
e = str2entry( buf );
if ( e == NULL) {
struct monitorinfo *mi = (struct monitorinfo *) be->be_private;
Entry *e, *e_tmp;
struct monitorentrypriv *mp;
+ int nentries;
int rc;
mp = ( struct monitorentrypriv * )e_parent->e_private;
}
monitor_cache_release( mi, e_parent );
- for ( ; e != NULL; ) {
+ for ( nentries = *nentriesp; e != NULL; ) {
mp = ( struct monitorentrypriv * )e->e_private;
monitor_entry_update( mi, e );
if ( rc == LDAP_COMPARE_TRUE ) {
send_search_entry( be, conn, op, e,
attrs, attrsonly, NULL );
- *nentriesp++;
+ nentries++;
}
if ( ( mp->mp_children || MONITOR_HAS_VOLATILE_CH( mp ) )
&& sub ) {
rc = monitor_send_children( be, conn, op, filter,
attrs, attrsonly,
- e, sub, nentriesp );
+ e, sub, &nentries );
if ( rc ) {
return( rc );
}
NULL, text, NULL, NULL );
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
- "do_bind: conn %d v%d unknown authentication method (%d)\n",
+ "do_bind: conn %ld v%d unknown authentication method (%ld)\n",
conn->c_connid, version, method ));
#else
Debug( LDAP_DEBUG_TRACE,
- "do_bind: v%d unknown authentication method (%d)\n",
+ "do_bind: v%d unknown authentication method (%ld)\n",
version, method, 0 );
#endif
goto cleanup;
)
{
Entry *entry = NULL;
- Attribute *a = NULL;
char *dn = NULL, *ndn=NULL;
struct berval desc;
struct berval value;
#ifdef NEW_LOGGING
LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
"%s: line %d: \"%s\" is reserved for monitoring slapd\n",
- SLAPD_MONITOR_DN, fname, lineno ));
+ fname, lineno, SLAPD_MONITOR_DN ));
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: \"%s\" is reserved for monitoring slapd\n",
- SLAPD_MONITOR_DN, fname, lineno );
+ fname, lineno, SLAPD_MONITOR_DN );
#endif
return( 1 );
#endif /* SLAPD_MONITOR_DN */
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/time.h>
+#include <ac/unistd.h>
#include "ldap_pvt.h"
#include "lutil.h"
#include "slap.h"
+/* I guess this should be declared in ldap_pvt.h */
+extern void * ldap_pvt_tls_sb_ctx( Sockbuf *sb );
+
/* protected by connections_mutex */
static ldap_pvt_thread_mutex_t connections_mutex;
static Connection *connections = NULL;
if ( c->c_is_tls && c->c_needs_tls_accept ) {
rc = ldap_pvt_tls_accept( c->c_sb, NULL );
if ( rc < 0 ) {
+#if 0 /* required by next #if 0 */
struct timeval tv;
fd_set rfd;
+#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
hints.ai_family = AF_UNSPEC;
snprintf(serv, sizeof serv, "%d", port);
- if (err = getaddrinfo(host, serv, &hints, &res)) {
+ if ( (err = getaddrinfo(host, serv, &hints, &res)) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
"slap_get_listener_addresses: getaddrinfo failed: %s\n",
Listener *li;
LDAPURLDesc *lud;
unsigned short port;
- int err, addrlen;
+ int err, addrlen = 0;
struct sockaddr **sal, **psal;
int socktype = SOCK_STREAM; /* default to COTS */
)
{
int l;
- time_t last_idle_check;
+ time_t last_idle_check = 0;
time( &starttime );
if ( global_idletimeout > 0 ) {
slap_ssf_t ssf = 0;
char *authid = NULL;
- char *dnsname;
+ char *dnsname = NULL;
char *peeraddr;
#ifdef LDAP_PF_LOCAL
char peername[MAXPATHLEN + sizeof("PATH=")];
#define INQUOTEDVALUE 7
#define B4SEPARATOR 8
+/* schema_init.c */
+extern int
+dnNormalize( Syntax *syntax, struct berval *val, struct berval **normalized );
+
/*
* dn_validate - validate and compress dn. the dn is
* compressed in place are returned if valid.
{
int rc;
Entry *e;
- Attribute **a = NULL;
char *type;
struct berval value;
struct berval *vals[2];
#include <ac/wait.h>
#include <ac/errno.h>
+#include "ldap_pvt.h"
+
#include "slap.h"
#include "lutil.h"
#include "ldif.h"
+/* I guess this should be declared in ldap_pvt.h */
+extern int ldap_pvt_tls_init_def_ctx( void );
+
#ifdef LDAP_SIGCHLD
static RETSIGTYPE wait4child( int sig );
#endif
#endif
{
int i, no_detach = 0;
- int rc;
+ int rc = 1;
char *urls = NULL;
#if defined(HAVE_SETUID) && defined(HAVE_SETGID)
char *username = NULL;
/*
* Other...
*/
-#define SLAP_SB_MAX_INCOMING_DEFAULT (1<<18 - 1)
-#define SLAP_SB_MAX_INCOMING_AUTH (1<<24 - 1)
+#define SLAP_SB_MAX_INCOMING_DEFAULT ((1<<18) - 1)
+#define SLAP_SB_MAX_INCOMING_AUTH ((1<<24) - 1)
LDAP_SLAPD_F (ber_len_t) sockbuf_max_incoming;
LDAP_SLAPD_F (ber_len_t) sockbuf_max_incoming_auth;
#include <ac/time.h>
#include <ac/unistd.h>
+#include <ldap_pvt.h>
+
#include "slap.h"
/*
#include <ac/string.h>
#include "slap.h"
+#include <ldif.h>
static char *supportedFeatures[] = {
"1.3.6.1.4.1.4203.1.5.1", /* All Operational Attributes ("+") */
int read_root_dse_file( const char *fname )
{
FILE *fp;
- char *line, *savefname, *saveline;
int rc = 0, lineno = 0, lmax = 0;
char *buf = NULL;
usr_attr->e_attrs = NULL;
while( ldif_read_record( fp, &lineno, &buf, &lmax ) ) {
- ID id;
Entry *e = str2entry( buf );
if( e == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
- "SASL [conn=%d] %s: %s\n",
+ "SASL [conn=%ld] %s: %s\n",
conn ? conn->c_connid : -1,
label, message ));
#else
- Debug( level, "SASL [conn=%d] %s: %s\n",
+ Debug( level, "SASL [conn=%ld] %s: %s\n",
conn ? conn->c_connid: -1,
label, message );
#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
- "sasl_bind: conn %ld dn=\"%s\" mech=%s datalen=%d\n",
+ "sasl_bind: conn %ld dn=\"%s\" mech=%s datalen=%ld\n",
conn->c_connid, dn,
conn->c_sasl_bind_in_progress ? "<continuing>" : conn->c_sasl_bind_mech,
cred ? cred->bv_len : 0 ));
#else
Debug(LDAP_DEBUG_ARGS,
- "==> sasl_bind: dn=\"%s\" mech=%s datalen=%d\n", dn,
+ "==> sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n", dn,
conn->c_sasl_bind_in_progress ? "<continuing>":conn->c_sasl_bind_mech,
cred ? cred->bv_len : 0 );
#endif
void *assertedValue )
{
int match = 0;
- SubstringsAssertion *sub;
+ SubstringsAssertion *sub = NULL;
struct berval left;
int i;
ber_len_t inlen=0;
*/
while (base < n) {
unsigned int carry;
- unsigned int temp;
carry = 0;
for (i = base; i<n; i++ ) {
struct berval *serial;
struct berval *issuer_dn;
struct berval *bv_tmp;
- int ret;
xcert = d2i_X509(NULL, &p, in->bv_len);
if ( !xcert ) {
return LBER_ERROR_MEMORY;
}
- sprintf( out->bv_val, "%02ld%02ld%02ld%02ld%02ld%02ldZ",
+ sprintf( out->bv_val, "%02d%02d%02d%02d%02d%02dZ",
parts[1], parts[2] + 1, parts[3] + 1,
parts[4], parts[5], parts[6] );
out->bv_len = 13;
return LBER_ERROR_MEMORY;
}
- sprintf( out->bv_val, "%02ld%02ld%02ld%02ld%02ld%02ld%02ldZ",
+ sprintf( out->bv_val, "%02d%02d%02d%02d%02d%02d%02dZ",
parts[0], parts[1], parts[2] + 1, parts[3] + 1,
parts[4], parts[5], parts[6] );
out->bv_len = 15;
int code;
const char *err;
char *oid = NULL;
- char *soid = NULL;
at = ldap_str2attributetype(line,&code,&err,LDAP_SCHEMA_ALLOW_ALL);
if ( !at ) {
*results = NULL;
stp = -1;
- while (c = *filter++) {
+ while ((c = *filter++)) {
set = NULL;
switch (c) {
case ' ':
_error:
if (IS_SET(set))
set_dispose(set);
- while (set = SF_POP()) {
+ while ((set = SF_POP())) {
if (IS_SET(set))
set_dispose(set);
}
#include <stdio.h>
#include <ac/socket.h>
+#include <ldap_pvt.h>
+
#include "slap.h"
#ifdef HAVE_TLS
void
slap_init_user( char *user, char *group )
{
- uid_t uid;
- gid_t gid;
+ uid_t uid = 0;
+ gid_t gid = 0;
int got_uid = 0, got_gid = 0;
if ( user ) {
int rc;
struct berval *nv1 = NULL;
struct berval *nv2 = NULL;
- Syntax *syntax;
if( !mr->smr_match ) {
return LDAP_INAPPROPRIATE_MATCHING;