Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/snmp In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10019
Modified Files: main.c Log Message: Resolves: 344631 Summary: Corrected path generation for loading SNMP stats file.
Index: main.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/snmp/main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- main.c 18 Oct 2007 19:20:16 -0000 1.14 +++ main.c 22 Oct 2007 18:29:55 -0000 1.15 @@ -391,11 +391,12 @@ serv_p->port = atol(val); got_port = 1; } else if (strcmp(attr, "nsslapd-rundir") == 0) { - serv_p->stats_file = malloc(vlen + 13); + /* 8 = "/" + ".stats" + \0 */ + serv_p->stats_file = malloc(vlen + strlen(instancename) + 8); if (serv_p->stats_file != NULL) { - snprintf(serv_p->stats_file, vlen + 13, - "%s/%s.stats", instancename, val); - serv_p->stats_file[(vlen + 12)] = (char)0; + snprintf(serv_p->stats_file, vlen + strlen(instancename) + 8, + "%s/%s.stats", val, instancename); + serv_p->stats_file[(vlen + strlen(instancename) + 7)] = (char)0; } else { printf("ldap-agent: malloc error processing config file\n"); free(entry);