X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmain.c;h=4dc163838245f5328ba5cf50019055d1c6d953af;hb=f06e69dd130ffec77d106dd96453d0b8548264f0;hp=528867ba00163986dcce9300541caad4fc7f4a73;hpb=44725e73034f8a077ca73f1ad359f913d37a89ac;p=openldap diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 528867ba00..4dc1638382 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2004 The OpenLDAP Foundation. + * Copyright 1998-2007 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -34,8 +35,6 @@ #include #include -#include "ldap_pvt.h" - #include "slap.h" #include "lutil.h" #include "ldif.h" @@ -65,7 +64,8 @@ static struct sockaddr_in bind_addr; #endif typedef int (MainFunc) LDAP_P(( int argc, char *argv[] )); -extern MainFunc slapadd, slapcat, slapdn, slapindex, slappasswd, slaptest; +extern MainFunc slapadd, slapcat, slapdn, slapindex, slappasswd, + slaptest, slapauth, slapacl; static struct { char *name; @@ -77,6 +77,14 @@ static struct { {"slapindex", slapindex}, {"slappasswd", slappasswd}, {"slaptest", slaptest}, + {"slapauth", slapauth}, + {"slapacl", slapacl}, + /* NOTE: new tools must be added in chronological order, + * not in alphabetical order, because for backwards + * compatibility name[4] is used to identify the + * tools; so name[4]=='a' must refer to "slapadd" and + * not to "slapauth". Alphabetical order can be used + * for tools whose name[4] is not used yet */ {NULL, NULL} }; @@ -91,7 +99,6 @@ const char Versionstr[] = #endif #ifdef LOG_LOCAL4 - #define DEFAULT_SYSLOG_USER LOG_LOCAL4 typedef struct _str2intDispatch { @@ -100,7 +107,6 @@ typedef struct _str2intDispatch { int intVal; } STRDISP, *STRDISP_P; - /* table to compute syslog-options to integer */ static STRDISP syslog_types[] = { { "LOCAL0", sizeof("LOCAL0"), LOG_LOCAL0 }, @@ -111,11 +117,16 @@ static STRDISP syslog_types[] = { { "LOCAL5", sizeof("LOCAL5"), LOG_LOCAL5 }, { "LOCAL6", sizeof("LOCAL6"), LOG_LOCAL6 }, { "LOCAL7", sizeof("LOCAL7"), LOG_LOCAL7 }, +#ifdef LOG_USER + { "USER", sizeof("USER"), LOG_USER }, +#endif +#ifdef LOG_DAEMON + { "DAEMON", sizeof("DAEMON"), LOG_DAEMON }, +#endif { NULL, 0, 0 } }; -static int cnvt_str2int( char *, STRDISP_P, int ); - +static int cnvt_str2int( char *, STRDISP_P, int ); #endif /* LOG_LOCAL4 */ #define CHECK_NONE 0x00 @@ -123,6 +134,122 @@ static int cnvt_str2int( char *, STRDISP_P, int ); static int check = CHECK_NONE; static int version = 0; +void *slap_tls_ctx; + +static int +slapd_opt_slp( const char *val, void *arg ) +{ +#ifdef HAVE_SLP + /* NULL is default */ + if ( val == NULL || strcasecmp( val, "on" ) == 0 ) { + slapd_register_slp = 1; + + } else if ( strcasecmp( val, "off" ) == 0 ) { + slapd_register_slp = 0; + + /* NOTE: add support for URL specification? */ + + } else { + fprintf(stderr, "unrecognized value \"%s\" for SLP option\n", val ); + return -1; + } + + return 0; + +#else + fputs( "slapd: SLP support is not available\n", stderr ); + return 0; +#endif +} + +/* + * Option helper structure: + * + * oh_nam is left-hand part of