From the strcpy(3) man page, the following warning is given:
The strncpy() function is similar, except that at most n bytes of src
are copied. Warning: If there is no null byte among the first n bytes
of src, the string placed in dest will not be null-terminated.
The current corosync code base does not take this warning into account
when using strncpy, potentially resulting in non-null terminated strings.
Signed-off-by: Russell Bryant <russell@russellbryant.net>
Reviewed-by: Steven Dake <sdake@redhat.com>
we had some __attribute__((__noreturn__))
and some __attribute__((noreturn))
I made them all: __attribute__((noreturn))
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2853 fd59a12c-fef9-0310-b244-a6a79926bd2f
strstr_rs used strdup and didn't handle failure. This change removes
the use of strdup as well as the uses of strstr, since all callers
passed a string of length 1 as the second argument. This also changes
the prototype so that the 2nd parameter is a byte, not a string.
* util.h (strstr_rs): Adjust prototype.
* util.c (strstr_rs): Rewrite/simplify.
* sa-confdb.c (strstr_rs): Remove duplicate definition.
* coroparse.c (parse_section): Update callers.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2111 fd59a12c-fef9-0310-b244-a6a79926bd2f
- services/Makefile.am: add include search paths for config.h
- include/corosync/cs_config.h.in exports LCRSODIR and SOCKETDIR
- tools/Makefile.am: drop -D defines for dirs that are now in
cs_config.h or config.h
- configure.ac: sanitize prefix and exec_prefix paths. Export DIRS in
*config.h
- lib/Makefile.am: : drop -D defines for dirs that are now in
cs_config.h or config.h. Add rule to build lcr_ifact.o or building from
lib/ fails miserably
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1877 fd59a12c-fef9-0310-b244-a6a79926bd2f
Display strings safely, even if they are invalid, e.g. data in a received
message was corrupted.
Author: Tim Beale <tim.beale@alliedtelesis.co.nz>
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1657 fd59a12c-fef9-0310-b244-a6a79926bd2f
SAI-Overview-B.02.01.pdf. Other AMF changes as specified in
SAI-AIS-AMF-B.02.01.
Summary:
- SA Forum B.02 Information model for AMF
- groups.conf renamed to amf.conf
- amf.conf syntax changed heavily to follow SA Forum specs.
- AMF works when daemon.
- linux lists removed from AMF
- component cmd environment variables support
- component argv support
- multi value csi attributes
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1026 fd59a12c-fef9-0310-b244-a6a79926bd2f
- rests of old logging removed from all code (#define LOG_SERVICE...).
- line feed added if not in message.
- new trace() function added so that trace macros adds minimum of code and runtime penalties to user code.
- ENTER_ARGS macro changed to ENTER. ENTER macro now requires arguments.
- openais.conf.5 man page updated with logger directives.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1021 fd59a12c-fef9-0310-b244-a6a79926bd2f