From: Chris B. <buc...@us...> - 2011-06-10 19:57:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via a113b68040c7627af055bf744c3725a22a7dcd55 (commit) from 7c7b0ec227317272e0891c7da4bbef39eedc93d5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a113b68040c7627af055bf744c3725a22a7dcd55 Author: buccella <buc...@li...> Date: Fri Jun 10 15:58:43 2011 -0400 [ 3165732 ] Add ability for client library to specify configuration file ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 5f5574c..4f87f68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ [ 3314762 ] Memory leak in method invoke using SFCB local interface (patch by Chris Poblete) + * control.c: + [ 3165732 ] Add ability for client library to specify configuration file + (patch by Josef Moellers) + 2011-06-09 Chris Buccella <buc...@li...> * control.c, cimcClientSfcbLocal.c: diff --git a/NEWS b/NEWS index d9032c8..9384213 100644 --- a/NEWS +++ b/NEWS @@ -88,6 +88,7 @@ Bugs Fixed: - 3314383 Memory leak in CimResource_Enumerate_EP - 3047562 [patch] Create bzip2 tarballs on "make dist" - 3314762 Memory leak in method invoke using SFCB local interface +- 3165732 Add ability for client library to specify configuration file Changes in 1.3.11 ================= diff --git a/contributions.txt b/contributions.txt index 65234ae..5e2383d 100644 --- a/contributions.txt +++ b/contributions.txt @@ -190,3 +190,4 @@ Chris Poblete, Dell Josef Moellers -------------- 11/17/2010 [ 3109469 ] Potential Buffer Overflow in msgqueue.c:localConnectServer() +06/10/2011 [ 3165732 ] Add ability for client library to specify configuration file diff --git a/control.c b/control.c index debfba8..e39a246 100644 --- a/control.c +++ b/control.c @@ -152,6 +152,7 @@ setupControl(char *fn) n = 0, err = 0; CntlVals rv; + char *configFile; if (ct) return 0; @@ -164,11 +165,18 @@ setupControl(char *fn) } if (fn) { - strcpy(fin, fn); + if (strlen(fn) >= sizeof(fin)) + mlogf(M_ERROR,M_SHOW, "--- \"%s\" too long\n", fn); + strncpy(fin,fn,sizeof(fin)); + } + else if ((configFile = getenv("SFCB_CONFIG_FILE")) != NULL && configFile[0] != '\0') { + if (strlen(configFile) >= sizeof(fin)) + mlogf(M_ERROR,M_SHOW, "--- \"%s\" too long\n", configFile); + strncpy(fin,configFile,sizeof(fin)); } else { - strcpy(fin, SFCB_CONFDIR); - strcat(fin, "/sfcb.cfg"); + strncpy(fin, SFCB_CONFDIR "/sfcb.cfg", sizeof(fin)); } + fin[sizeof(fin)-1] = '\0'; if (fin[0] == '/') mlogf(M_INFO, M_SHOW, "--- Using %s\n", fin); hooks/post-receive -- SFCB - Small Footprint CIM Broker |