Strings in xmldb_put not properly encoded, eg eth/0 became eth.00000
This commit is contained in:
parent
9d8a2f73c2
commit
d58ffb2c72
5 changed files with 23 additions and 11 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
# Clixon CHANGELOG
|
# Clixon CHANGELOG
|
||||||
|
|
||||||
|
- Strings in xmldb_put not properly encoded, eg eth/0 became eth.00000
|
||||||
|
|
||||||
## 3.3.0
|
## 3.3.0
|
||||||
|
|
||||||
May 2017
|
May 2017
|
||||||
|
|
|
||||||
6
configure
vendored
6
configure
vendored
|
|
@ -2136,7 +2136,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||||
|
|
||||||
CLIXON_VERSION_MAJOR="3"
|
CLIXON_VERSION_MAJOR="3"
|
||||||
CLIXON_VERSION_MINOR="3"
|
CLIXON_VERSION_MINOR="3"
|
||||||
CLIXON_VERSION_PATCH="0"
|
CLIXON_VERSION_PATCH="1"
|
||||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
|
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
|
||||||
# Fix to specific version (eg 3.5) or head (3)
|
# Fix to specific version (eg 3.5) or head (3)
|
||||||
CLIGEN_VERSION="3"
|
CLIGEN_VERSION="3"
|
||||||
|
|
@ -2172,8 +2172,8 @@ _ACEOF
|
||||||
|
|
||||||
# Bind to specific CLIgen version
|
# Bind to specific CLIgen version
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CLIXON version is ${CLIXON_VERSION}_PRE1" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CLIXON version is ${CLIXON_VERSION}_PRE" >&5
|
||||||
$as_echo "CLIXON version is ${CLIXON_VERSION}_PRE1" >&6; }
|
$as_echo "CLIXON version is ${CLIXON_VERSION}_PRE" >&6; }
|
||||||
|
|
||||||
ac_aux_dir=
|
ac_aux_dir=
|
||||||
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
|
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ AC_INIT(lib/clixon/clixon.h.in)
|
||||||
|
|
||||||
CLIXON_VERSION_MAJOR="3"
|
CLIXON_VERSION_MAJOR="3"
|
||||||
CLIXON_VERSION_MINOR="3"
|
CLIXON_VERSION_MINOR="3"
|
||||||
CLIXON_VERSION_PATCH="0"
|
CLIXON_VERSION_PATCH="1"
|
||||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
|
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
|
||||||
# Fix to specific version (eg 3.5) or head (3)
|
# Fix to specific version (eg 3.5) or head (3)
|
||||||
CLIGEN_VERSION="3"
|
CLIGEN_VERSION="3"
|
||||||
|
|
@ -62,7 +62,7 @@ AC_SUBST(CLIXON_VERSION_MAJOR)
|
||||||
AC_SUBST(CLIXON_VERSION_MINOR)
|
AC_SUBST(CLIXON_VERSION_MINOR)
|
||||||
AC_SUBST(CLIGEN_VERSION) # Bind to specific CLIgen version
|
AC_SUBST(CLIGEN_VERSION) # Bind to specific CLIgen version
|
||||||
|
|
||||||
AC_MSG_RESULT(CLIXON version is ${CLIXON_VERSION}_PRE1)
|
AC_MSG_RESULT(CLIXON version is ${CLIXON_VERSION}_PRE)
|
||||||
|
|
||||||
AC_CANONICAL_TARGET
|
AC_CANONICAL_TARGET
|
||||||
AC_SUBST(CC)
|
AC_SUBST(CC)
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,8 @@ text_apipath_modify(char *api_path,
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
char *name;
|
char *name;
|
||||||
char *restval;
|
char *restval_enc;
|
||||||
|
char *restval = NULL;
|
||||||
yang_stmt *y = NULL;
|
yang_stmt *y = NULL;
|
||||||
yang_stmt *ykey;
|
yang_stmt *ykey;
|
||||||
cxobj *x = NULL;
|
cxobj *x = NULL;
|
||||||
|
|
@ -490,9 +491,16 @@ text_apipath_modify(char *api_path,
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i<nvec){
|
while (i<nvec){
|
||||||
name = vec[i]; /* E.g "x=1,2" -> name:x restval=1,2 */
|
name = vec[i]; /* E.g "x=1,2" -> name:x restval=1,2 */
|
||||||
if ((restval = index(name, '=')) != NULL){
|
/* restval is RFC 3896 encoded */
|
||||||
*restval = '\0';
|
if (restval){
|
||||||
restval++;
|
free(restval);
|
||||||
|
restval = NULL;
|
||||||
|
}
|
||||||
|
if ((restval_enc = index(name, '=')) != NULL){
|
||||||
|
*restval_enc = '\0';
|
||||||
|
restval_enc++;
|
||||||
|
if (percent_decode(restval_enc, &restval) < 0)
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
if (y == NULL) /* top-node */
|
if (y == NULL) /* top-node */
|
||||||
y = yang_find_topnode(yspec, name);
|
y = yang_find_topnode(yspec, name);
|
||||||
|
|
@ -646,6 +654,8 @@ text_apipath_modify(char *api_path,
|
||||||
ok:
|
ok:
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
|
if (restval)
|
||||||
|
free(restval);
|
||||||
if (vec)
|
if (vec)
|
||||||
free(vec);
|
free(vec);
|
||||||
if (valvec)
|
if (valvec)
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ clicon_rpc_get_config(clicon_handle h,
|
||||||
if (xpath && strlen(xpath))
|
if (xpath && strlen(xpath))
|
||||||
cprintf(cb, "<filter type=\"xpath\" select=\"%s\"/>", xpath);
|
cprintf(cb, "<filter type=\"xpath\" select=\"%s\"/>", xpath);
|
||||||
cprintf(cb, "</get-config></rpc>");
|
cprintf(cb, "</get-config></rpc>");
|
||||||
if ((msg = clicon_msg_encode(cbuf_get(cb))) == NULL)
|
if ((msg = clicon_msg_encode("%s", cbuf_get(cb))) == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
if (clicon_rpc_msg(h, msg, &xret, NULL) < 0)
|
if (clicon_rpc_msg(h, msg, &xret, NULL) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -325,7 +325,7 @@ clicon_rpc_edit_config(clicon_handle h,
|
||||||
if (xmlstr)
|
if (xmlstr)
|
||||||
cprintf(cb, "%s", xmlstr);
|
cprintf(cb, "%s", xmlstr);
|
||||||
cprintf(cb, "</edit-config></rpc>");
|
cprintf(cb, "</edit-config></rpc>");
|
||||||
if ((msg = clicon_msg_encode(cbuf_get(cb))) == NULL)
|
if ((msg = clicon_msg_encode("%s", cbuf_get(cb))) == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
if (clicon_rpc_msg(h, msg, &xret, NULL) < 0)
|
if (clicon_rpc_msg(h, msg, &xret, NULL) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue