lib/libdsa/dsalib_location.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 258be85ceff527859d2834a282ca3d83b230e0b1
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Wed Mar 31 16:11:16 2010 -0700
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.
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);
Show replies by date