diff --git a/apps/backend/backend_main.c b/apps/backend/backend_main.c index 8f4b691b..0fd10a22 100644 --- a/apps/backend/backend_main.c +++ b/apps/backend/backend_main.c @@ -745,7 +745,7 @@ main(int argc, } if (group_name2gid(backend_group, &gid) < 0){ clicon_log(LOG_ERR, "'%s' does not seem to be a valid user group.\n" /* \n required here due to multi-line log */ - "The config demon requires a valid group to create a server UNIX socket\n" + "The config daemon requires a valid group to create a server UNIX socket\n" "Define a valid CLICON_SOCK_GROUP in %s or via the -g option\n" "or create the group and add the user to it. Check documentation for how to do this on your platform", backend_group, @@ -984,7 +984,7 @@ main(int argc, goto ok; /* Daemonize and initiate logging. Note error is initiated here to make - demonized errors OK. Before this stage, errors are logged on stderr + daemonized errors OK. Before this stage, errors are logged on stderr also */ if (foreground==0){ /* Call plugin callbacks just before fork/daemonization */ diff --git a/apps/restconf/restconf_lib.c b/apps/restconf/restconf_lib.c index 6d703941..1eaf49d8 100644 --- a/apps/restconf/restconf_lib.c +++ b/apps/restconf/restconf_lib.c @@ -593,7 +593,7 @@ restconf_drop_privileges(clicon_handle h) } if (group_name2gid(group, &gid) < 0){ clicon_log(LOG_ERR, "'%s' does not seem to be a valid user group." /* \n required here due to multi-line log */ - "The config demon requires a valid group to create a server UNIX socket\n" + "The config daemon requires a valid group to create a server UNIX socket\n" "Define a valid CLICON_SOCK_GROUP in %s or via the -g option\n" "or create the group and add the user to it. Check documentation for how to do this on your platform", group, diff --git a/lib/src/clixon_err.c b/lib/src/clixon_err.c index 816acc02..769a8344 100644 --- a/lib/src/clixon_err.c +++ b/lib/src/clixon_err.c @@ -114,7 +114,7 @@ static struct errvec EV[] = { {"Regexp error", OE_REGEX}, {"UNIX error", OE_UNIX}, {"Syslog error", OE_SYSLOG}, - {"Routing demon error", OE_ROUTING}, + {"Routing daemon error", OE_ROUTING}, {"XML error", OE_XML}, {"JSON error", OE_JSON}, {"RESTCONF error", OE_RESTCONF}, diff --git a/lib/src/clixon_event.c b/lib/src/clixon_event.c index c268eec3..75543d8b 100644 --- a/lib/src/clixon_event.c +++ b/lib/src/clixon_event.c @@ -186,7 +186,7 @@ clixon_event_reg_fd(int fd, return -1; } memset(e, 0, sizeof(struct event_data)); - strncpy(e->e_string, str, EVENT_STRLEN); + strncpy(e->e_string, str, EVENT_STRLEN-1); e->e_fd = fd; e->e_fn = fn; e->e_arg = arg; @@ -261,7 +261,7 @@ clixon_event_reg_timeout(struct timeval t, return -1; } memset(e, 0, sizeof(struct event_data)); - strncpy(e->e_string, str, EVENT_STRLEN); + strncpy(e->e_string, str, EVENT_STRLEN-1); e->e_fn = fn; e->e_arg = arg; e->e_type = EVENT_TIME; diff --git a/lib/src/clixon_proto_client.c b/lib/src/clixon_proto_client.c index 4df076a8..bd6771ba 100644 --- a/lib/src/clixon_proto_client.c +++ b/lib/src/clixon_proto_client.c @@ -862,10 +862,8 @@ clicon_rpc_get(clicon_handle h, ". Internal error, backend returned invalid XML.", NULL) < 0) goto done; - if ((xd = xpath_first(xerr, NULL, "rpc-error")) == NULL){ - clicon_err(OE_XML, ENOENT, "Expected rpc-error tag but none found(internal)"); - goto done; - } + xd = xerr; + xerr = NULL; } } if (xt && xd){ diff --git a/lib/src/clixon_sig.c b/lib/src/clixon_sig.c index 92cdce67..da2fed7c 100644 --- a/lib/src/clixon_sig.c +++ b/lib/src/clixon_sig.c @@ -243,7 +243,7 @@ pidfile_zapold(pid_t pid) } if ((kill(pid, 0)) < 0){ if (errno != ESRCH){ - clicon_err(OE_DAEMON, errno, "Killing old demon"); + clicon_err(OE_DAEMON, errno, "Killing old daemon"); goto done; } } diff --git a/util/clixon_util_regexp.c b/util/clixon_util_regexp.c index e9b6b19f..c6047237 100644 --- a/util/clixon_util_regexp.c +++ b/util/clixon_util_regexp.c @@ -117,8 +117,8 @@ regex_posix(char *regexp, return -1; } /* note following two lines trigger [-Wstringop-truncation] warnings, but see no actual error */ - strncpy(pattern, "^(", 2); - strncpy(pattern+2, posix, sizeof(pattern)-2); + strncpy(pattern, "^(", 3); + strncpy(pattern+2, posix, sizeof(pattern)-3); strncat(pattern, ")$", sizeof(pattern)-len0-1); if (regcomp(&re, pattern, REG_NOSUB|REG_EXTENDED) != 0) return(0); /* report error */