From fe85f6f544bb9213d56983bc4be2e7e7c138f567 Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Mon, 3 Jan 2011 23:13:20 +0000 Subject: [PATCH] Add -VVV option to slapd to list statically compiled backends and overlays --- servers/slapd/main.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 6990e91674..0cb0de1660 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -99,6 +99,9 @@ const char Versionstr[] = OPENLDAP_PACKAGE " " OPENLDAP_VERSION " Standalone LDAP Server (slapd)"; #endif +extern OverlayInit slap_oinfo[]; +extern BackendInfo slap_binfo[]; + #define CHECK_NONE 0x00 #define CHECK_CONFIG 0x01 #define CHECK_LOGLEVEL 0x02 @@ -340,7 +343,8 @@ usage( char *name ) #if defined(HAVE_SETUID) && defined(HAVE_SETGID) "\t-u user\t\tUser (id or name) to run as\n" #endif - "\t-V\t\tprint version info (-VV only)\n" + "\t-V\t\tprint version info (-VV exit afterwards, -VVV print\n" + "\t\t\tinfo about static overlays and backends)\n" ); } @@ -684,6 +688,21 @@ unhandled_option:; if ( version ) { fprintf( stderr, "%s\n", Versionstr ); + if ( version > 2 ) { + if ( slap_oinfo[0].ov_type ) { + fprintf( stderr, "Included static overlays:\n"); + for ( i= 0 ; slap_oinfo[i].ov_type; i++ ) { + fprintf( stderr, " %s\n", slap_oinfo[i].ov_type ); + } + } + if ( slap_binfo[0].bi_type ) { + fprintf( stderr, "Included static backends:\n"); + for ( i= 0 ; slap_binfo[i].bi_type; i++ ) { + fprintf( stderr, " %s\n", slap_binfo[i].bi_type ); + } + } + } + if ( version > 1 ) goto stop; } -- 2.39.5