From mboxrd@z Thu Jan 1 00:00:00 1970 From: ccaulfield@sourceware.org Date: 17 Jul 2008 08:29:00 -0000 Subject: [Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.06-17-gdfb973e Message-ID: <20080717082900.29010.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 "Cluster Project". http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=dfb973e106b4544fd57b459422f60d82596a7f6c The branch, master has been updated via dfb973e106b4544fd57b459422f60d82596a7f6c (commit) from 31d7346b1f901ad5c7351261cff0699918fbd782 (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 dfb973e106b4544fd57b459422f60d82596a7f6c Author: Christine Caulfield Date: Thu Jul 17 09:28:05 2008 +0100 [CONFIG] Add some more errnos to libccsconfdb Signed-off-by: Christine Caulfield ----------------------------------------------------------------------- Summary of changes: config/libs/libccsconfdb/libccs.c | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/config/libs/libccsconfdb/libccs.c b/config/libs/libccsconfdb/libccs.c index bf9216d..dd71d36 100644 --- a/config/libs/libccsconfdb/libccs.c +++ b/config/libs/libccsconfdb/libccs.c @@ -611,8 +611,10 @@ int _ccs_get_fullxpath(int desc, const char *query, char **rtn, int list) xmlXPathObjectPtr obj = NULL; char realquery[PATH_MAX + 16]; - if(strncmp(query, "/", 1)) + if(strncmp(query, "/", 1)) { + errno = EINVAL; return -EINVAL; + } if (list && !strcmp(query, previous_query)) xmllistindex++; @@ -626,8 +628,10 @@ int _ccs_get_fullxpath(int desc, const char *query, char **rtn, int list) obj = xmlXPathEvalExpression((xmlChar *)realquery, ctx); - if(!obj) + if(!obj) { + errno = EINVAL; return -EINVAL; + } if (obj->nodesetval && (obj->nodesetval->nodeNr > 0)) { xmlNodePtr node; @@ -755,8 +759,10 @@ int ccs_lookup_nodename(int cd, const char *nodename, char **retval) { nodename_len = strlen(nodename); ret = snprintf(path, sizeof(path), "/cluster/clusternodes/clusternode[@name=\"%s\"]/@name", nodename); - if (ret < 0 || (size_t) ret >= sizeof(path)) + if (ret < 0 || (size_t) ret >= sizeof(path)) { + errno = E2BIG; return (-E2BIG); + } str = NULL; error = ccs_get(cd, path, &str); @@ -765,8 +771,10 @@ int ccs_lookup_nodename(int cd, const char *nodename, char **retval) { return (0); } - if (nodename_len >= sizeof(host_only)) + if (nodename_len >= sizeof(host_only)) { + errno = E2BIG; return (-E2BIG); + } /* Try just the hostname */ strcpy(host_only, nodename); @@ -832,6 +840,7 @@ int ccs_lookup_nodename(int cd, const char *nodename, char **retval) { if (altcnt == 0) { if (strlen(str) >= sizeof(canonical_name)) { free(str); + errno = E2BIG; return (-E2BIG); } strcpy(canonical_name, str); @@ -839,6 +848,7 @@ int ccs_lookup_nodename(int cd, const char *nodename, char **retval) { if (strlen(str) >= sizeof(cur_node)) { free(str); + errno = E2BIG; return (-E2BIG); } @@ -855,8 +865,10 @@ int ccs_lookup_nodename(int cd, const char *nodename, char **retval) { { free(str); *retval = strdup(canonical_name); - if (*retval == NULL) + if (*retval == NULL) { + errno = ENOMEM; return (-ENOMEM); + } return (0); } @@ -877,8 +889,10 @@ int ccs_lookup_nodename(int cd, const char *nodename, char **retval) { freeaddrinfo(ai); free(str); *retval = strdup(canonical_name); - if (*retval == NULL) + if (*retval == NULL) { + errno = ENOMEM; return (-ENOMEM); + } return (0); } } @@ -892,6 +906,7 @@ int ccs_lookup_nodename(int cd, const char *nodename, char **retval) { } out_fail: + errno = EINVAL; *retval = NULL; return (-1); } hooks/post-receive -- Cluster Project