>From 12a4b6be267519edb3f1c28ea726e210c4b99bd0 Mon Sep 17 00:00:00 2001 From: Nathan Kinder Date: Wed, 31 Mar 2010 16:11:16 -0700 Subject: [PATCH] Change parsing of start-slapd for instance name The format of start-slapd changed recently, causing the parsing of the instance name from that script in the CGIs to break. This corrects the parsing. --- lib/libdsa/dsalib_location.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/libdsa/dsalib_location.c b/lib/libdsa/dsalib_location.c index 8cccd0f..7b4bfff 100644 --- a/lib/libdsa/dsalib_location.c +++ b/lib/libdsa/dsalib_location.c @@ -110,13 +110,10 @@ ds_get_run_dir() fp = fopen(start_script, "r"); if (fp) { while(fgets(line, BIG_LINE, fp)) { - /* Find the line that calls start-dirsrv */ - if ((start = strstr(line, "start-dirsrv"))) { + /* Find the line with the instance name */ + if ((start = strstr(line, "INSTANCE"))) { /* skip any spaces after start-dirsrv */ - start += strlen("start-dirsrv"); - while (isspace(*start)) { - start++; - } + start += strlen("INSTANCE="); /* find the end of the instance name */ p = start; @@ -128,6 +125,8 @@ ds_get_run_dir() if (strlen(start) > 0) { inst_name = PR_smprintf("%s", start); } + + break; } } fclose(fp); -- 1.6.2.5