]> git.sur5r.net Git - openldap/commitdiff
Fix previous change to getRegParam, SERVICE_NAME is only known in slapd.
authorHoward Chu <hyc@openldap.org>
Fri, 12 May 2000 21:26:30 +0000 (21:26 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 12 May 2000 21:26:30 +0000 (21:26 +0000)
libraries/liblutil/ntservice.c
servers/slapd/main.c

index d9be5df4966994b856438a4aa81e65385eb4c2f1..ce036b4944e110bd6cffb25ab52b47c1ae0cee31 100644 (file)
@@ -293,7 +293,7 @@ void *getRegParam( char *svc, char *value )
        static char vValue[1024];
        DWORD valLen = sizeof( vValue );
 
-       if ( svc && strcmp(svc, SERVICE_NAME) )
+       if ( svc != NULL )
                sprintf ( path, "SOFTWARE\\%s", svc );
        else
                strcpy (path, "SOFTWARE\\OpenLDAP\\Parameters" );
index 84e0d28debd4d7a68f95aebd51cf81e8a278c4c0..3dd6a9a21103e9e6d50a28b5fe2381745bbf56fe 100644 (file)
@@ -172,20 +172,23 @@ int main( int argc, char **argv )
                int *i;
                char *newConfigFile;
                char *newUrls;
+               char *regService = NULL;
 
                if ( is_NT_Service ) {
                        NTservice = argv[0];
                        CommenceStartupProcessing( NTservice, slap_sig_shutdown );
+                       if ( strcmp(NTservice, SERVICE_NAME) )
+                           regService = NTservice;
                }
 
-               i = (int*)getRegParam( NTservice, "DebugLevel" );
+               i = (int*)getRegParam( regService, "DebugLevel" );
                if ( i != NULL ) 
                {
                        slap_debug = *i;
                        Debug( LDAP_DEBUG_ANY, "new debug level from registry is: %d\n", slap_debug, 0, 0 );
                }
 
-               newUrls = (char *) getRegParam(NTservice, "Urls");
+               newUrls = (char *) getRegParam(regService, "Urls");
                if (newUrls)
                {
                    if (urls)
@@ -196,7 +199,7 @@ int main( int argc, char **argv )
                          urls, 0, 0);
                }
 
-               newConfigFile = (char*)getRegParam( NTservice, "ConfigFile" );
+               newConfigFile = (char*)getRegParam( regService, "ConfigFile" );
                if ( newConfigFile != NULL ) 
                {
                        configfile = newConfigFile;