Fixed: [backend start resconf failed due to path string truncated #192](https://github.com/clicon/clixon/issues/192)
This commit is contained in:
parent
43db8dd5c5
commit
5ec8965d18
2 changed files with 13 additions and 6 deletions
|
|
@ -70,6 +70,7 @@ Developers may need to change their code
|
||||||
|
|
||||||
### Corrected Bugs
|
### Corrected Bugs
|
||||||
|
|
||||||
|
* Fixed: [backend start resconf failed due to path string truncated #192](https://github.com/clicon/clixon/issues/192)
|
||||||
* Fixed: [state showing error in cli with CLICON_STREAM_DISCOVERY_RFC8040 #191](https://github.com/clicon/clixon/issues/191)
|
* Fixed: [state showing error in cli with CLICON_STREAM_DISCOVERY_RFC8040 #191](https://github.com/clicon/clixon/issues/191)
|
||||||
* Fixed: [yang submodule show error in modules-state #190](yang submodule show error in modules-state #190)
|
* Fixed: [yang submodule show error in modules-state #190](yang submodule show error in modules-state #190)
|
||||||
* Fixed: [Backend can not read datastore with container named "config" #147](https://github.com/clicon/clixon/issues/147)
|
* Fixed: [Backend can not read datastore with container named "config" #147](https://github.com/clicon/clixon/issues/147)
|
||||||
|
|
|
||||||
|
|
@ -111,8 +111,7 @@ restconf_pseudo_process_control(clicon_handle h)
|
||||||
char **argv = NULL;
|
char **argv = NULL;
|
||||||
int i;
|
int i;
|
||||||
int nr;
|
int nr;
|
||||||
char dbgstr[8];
|
cbuf *cb = NULL;
|
||||||
char wwwstr[64];
|
|
||||||
|
|
||||||
nr = 4;
|
nr = 4;
|
||||||
if (clicon_debug_get() != 0)
|
if (clicon_debug_get() != 0)
|
||||||
|
|
@ -122,8 +121,12 @@ restconf_pseudo_process_control(clicon_handle h)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
i = 0;
|
i = 0;
|
||||||
snprintf(wwwstr, sizeof(wwwstr)-1, "%s/clixon_restconf", clicon_option_str(h, "CLICON_WWWDIR"));
|
if ((cb = cbuf_new()) == NULL){
|
||||||
argv[i++] = wwwstr;
|
clicon_err(OE_UNIX, errno, "cbuf_new");
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
cprintf(cb, "%s/clixon_restconf", clicon_option_str(h, "CLICON_WWWDIR"));
|
||||||
|
argv[i++] = cbuf_get(cb);
|
||||||
argv[i++] = "-f";
|
argv[i++] = "-f";
|
||||||
argv[i++] = clicon_option_str(h, "CLICON_CONFIGFILE");
|
argv[i++] = clicon_option_str(h, "CLICON_CONFIGFILE");
|
||||||
/* Add debug if backend has debug.
|
/* Add debug if backend has debug.
|
||||||
|
|
@ -131,8 +134,9 @@ restconf_pseudo_process_control(clicon_handle h)
|
||||||
*/
|
*/
|
||||||
if (clicon_debug_get() != 0){
|
if (clicon_debug_get() != 0){
|
||||||
argv[i++] = "-D";
|
argv[i++] = "-D";
|
||||||
snprintf(dbgstr, sizeof(dbgstr)-1, "%d", clicon_debug_get());
|
cbuf_reset(cb);
|
||||||
argv[i++] = dbgstr;
|
cprintf(cb, "%d", clicon_debug_get());
|
||||||
|
argv[i++] = cbuf_get(cb);
|
||||||
}
|
}
|
||||||
argv[i++] = NULL;
|
argv[i++] = NULL;
|
||||||
assert(i==nr);
|
assert(i==nr);
|
||||||
|
|
@ -146,6 +150,8 @@ restconf_pseudo_process_control(clicon_handle h)
|
||||||
free(argv);
|
free(argv);
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
|
if (cb)
|
||||||
|
cbuf_free(cb);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue