Commit Graph

60 Commits

Author SHA1 Message Date
Fabio M. Di Nitto
eb3d49ef7d pload: make it a test service and not a public one
pload is a performance benchmark that measures the onwire
speed of corosync.

problem is that once pload has been executed, the cluster
is basically dead.

turn pload into a test tool, by removing corosync-pload tool
and user library.

cleanup pload code to make it more readable and drop lots
of unnecessary stuff.

add test/ploadstart tool that can configure and start pload
via cmap calls.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-03-12 07:11:51 +01:00
Fabio M. Di Nitto
2d7a8ab29a votequorum: rename leave_remove to allow_downscale
pointed out that leave_remove can be easily confused with the old
cman leave_remove behavior. The two are substantially different
and we need to avoid confusion both for users and our support team.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-03-02 14:36:48 +01:00
Fabio M. Di Nitto
cb5fd77501 votequorum: major rework to fix qdevice API and integration with core
qdevice is a very special node in the cluster and it adds a certain
amount of complexity and special cases across the code.

most of the qdevice data are shared across the cluster (name/votes)
but effectively each node has a different view of the qdevice
(registered/unregistered/voting/etc.)

with this change, we align the qdevice view across the node,
exchanging more data between nodes and we fix how qdevice behaves
and it is configured.

The only side effect is that the amount of data transmitted on wire
is slightly higher.

The qdevice API is still disabled by default. This means that
the amount of real changes in current code are a lot smaller
than it appears by this patch.

TODO: documentation/man pages needs to be updated once
      this change is in (and behavior finalized).

User visible changes:

- configuration (coroparse, exec/votequorum):
  the quorum device section is now standalone within the quorum.

  quorum {
    provider: corosync_votequorum
    device {
      model: (name)
      timeout: (millisec)
      votes:
    }
  }

  the keyword "model:" is mandatory to enable qdevice in configuration
  and should express the name of the script/daemon that will provide
  the qdevice. Looking into the future, an init script or systemd
  service will look for that name in /path/to/be/decided/name
  and start/stop qdevice.

  timeout: defines the maximum interval the qdevice implementation
  has available between poll (see votequorum_qdevice_poll.3) before
  the device is considered dead and votes discarded

  votes: is now a configuration parameter and not an API call.
  quorum devices don't care what they need to vote.
  votes is autocalculated when a nodelist is available and all
  nodes in the list vote 1. Otherwise this parameter is mandatory.

- configuration (exec/votequorum):
  startup and runtime configuration changes have been improved.
  errors at startup are considered fatal. errors at runtime
  have different exit paths.

  startup:

  * quorum.two_node and qdevice are incompatible.
  * quorum.expected_votes requires quorum.device.votes.
  * quorum.expected_votes - quorum.device.votes cannot be lower
    than 2.
  * qdevice and last_man_standing are mutually exclusive.
  * qdevice and auto_tie_breaker are mutually exclusive.

  runtime config changes:

  * quorum.two_node and qdevice are incompatible:
    if quorum device is alive, two_node is disabled.
    if quorum device is not alive and node count is 2, two_node is
       enabled, and quorum device cannot be registered

  * if either last_man_standing or auto_tie_breaker were enabled
    at startup, and at runtime quorum device is configured,
    quorum device registration will be blocked.

  * if quorum.expected_votes is configured but not quorum.device.votes,
    quorum device registration will be blocked.

  * if quorum.device.votes is not configured and we cannot
    automatically calculate it, quorum device registration will be blocked.

  * An error in configuring quorum.expected_votes and quorum.device.votes
    will block quorum device registration.

blocking quorum device registation, also means dropping the votes.

quorum.device.votes (either set or automatically calculated) is now
used to determine current expected_votes in the cluster.

- logging (exec/votequorum):

  all errors from configuration are treated as WARNING/CRITICAL.

  lots of extra DEBUG output is added (see internal changes too).

- corosync-quorumtool (tools/corosync-quorumtool):

  * added option to forcefully kick out a quorum device from the local
    node. This is for emergency recovery only and it is only
    available when qdevice API is built-in.

  * Improved status output, specifically add node state and qdevice
    information

[root@fedora-master-node2 coro]# corosync-quorumtool -s
Version:          1.99.4.12-9c7d-dirty
Quorum type:      corosync_votequorum
Nodes:            2
Ring ID:          132
Quorate:          Yes
Node votes:       1
Node state:       Member
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2
Flags:            Quorate Qdevice
Nodeid     Votes  Name
   1     1  fedora-master-node1.int.fabbione.net
   2     1  fedora-master-node2.int.fabbione.net
   0     1  QDEVICE (Voting)

  * allow to print status for any node in the cluster known to
    local node.

[root@fedora-master-node1 coro]# corosync-quorumtool -s
Version:          1.99.4.12-9c7d-dirty
Quorum type:      corosync_votequorum
Nodes:            2
Ring ID:          144
Quorate:          Yes
Node votes:       1
Node state:       Member
Expected votes:   3
Highest expected: 3
Total votes:      2
Quorum:           2
Flags:            Quorate
Nodeid     Votes  Name
   1     1  fedora-master-node1.int.fabbione.net
   2     1  fedora-master-node2.int.fabbione.net

[root@fedora-master-node1 coro]# corosync-quorumtool -s -n 2
Version:          1.99.4.12-9c7d-dirty
Quorum type:      corosync_votequorum
Nodes:            2
Ring ID:          144
Quorate:          Yes
Node votes:       1
Node state:       Member
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2
Flags:            Quorate Qdevice
Nodeid     Votes  Name
   1     1  fedora-master-node1.int.fabbione.net
   2     1  fedora-master-node2.int.fabbione.net
         0     1  QDEVICE (Voting)

Internal changes:

- change qdevice timer to not run all time, but only when necessary.
- change votequorum_nodeinfo on wire data to use flags instead of uint8_t
  and add QDEVICE status.
- allocate nodeid 0 to qdevice since it's the only real
  nodeid that be reserved.
- change send_nodeinfo to allow to send nodeinfo for any node
  so that we can share qdevice info across the cluster
  (and this might be useful in future if we need to sync
   internal cluster view).
- add votequorum api call to update qdevice name
- add runtime data if quorum device has been forcefully disabled
  by config error
- add qdevice votes to expected_votes calculation (this
  is probably the biggest difference vs cman)
- change votequorum_read_nodelist_configuration so that
  we can autocalculate votes for qdevice (we need the nodecount
  vs votes).
- add all checks for startup/runtime config (see above).
- do not make qdevice part of the membership_list received from
  totem. None of our users care about it and it is not a real node.
- change onwire message handlers to deal with "data for this node from any node"
  case and undersand nodeid 0 for qdevice info
- always allocate qdevice at startup. this simplifies code a lot.
- dispatch qdevice nodeinfo on membership changes.
- inform libvotequorum users when a qdevice is registered
- improve substantially qdevice api and add a simple
  barrier based on qdevice name.
- add qdevice API barrier at cluster level. This feature allow
  only one qdevice name to be active in the cluster at any time.
- qdevice getinfo can now report status for qdevice on any node.
- change slightly the way the qdevice API is built-in/out:
  only the libvotequorum calls are #ifdef'out now. Doing so in
  the core is too complex and would make the code unreadable
  with the risk of missing a bit or two effectively introducing
  an on-wire incompatibility if we will ever turn the API on.
- probably added some bugs on the way...

TODO: update qdevice_* API once the above is settled and test
      qdevice integration with other features.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com> (only second part)
2012-02-27 09:30:26 +01:00
Jan Friesse
88ae75d6c2 Allow autoconfiguration of interface section
Thanks to totemip_getifaddrs infrastructure it's now possible to use
nodelist informations to autoconfigure interface bindnetaddr. Together
with cluster_name, interface section can be completely omitted.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-02-16 10:47:57 +01:00
Steven Dake
2ad0cdc832 Update copyright header dates in exec directory
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-13 17:05:04 -07:00
Jan Friesse
0929dcb68c Better checks of integer values in coroparse
Instead of atoi, strtol is used. This allows detection of typical
problems like empty value of key and incorrectly entered numbers.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-02-03 09:16:43 +01:00
Fabio M. Di Nitto
46b7b155a4 votequorum: add leave_remove option
this also cleanup NODESTATE for good. JOINING was never used

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2012-01-31 16:58:08 +01:00
Fabio M. Di Nitto
769fc913f3 quorum: drop quorum.quorate config option
it's unused / unnecessary

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-By: Christine Caulfield <ccaulfie@redhat.com>
2012-01-27 11:16:36 +01:00
Angus Salkeld
3131601ce2 Remove all unneccessary "\n" from log messages
These look ugly, are inconsistently done and just have
to be removed later in libqb before calling syslog.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-23 13:08:23 +11:00
Jan Friesse
6d0b0b1493 Parse nodelist in coroparse
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2012-01-20 11:08:34 +01:00
Fabio M. Di Nitto
6f5e3293ef coroparse: fix include path after drop lcrso merge
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalked@redhat.com>
2012-01-17 12:40:42 +01:00
Steven Dake
a919908ed6 Add break where one was missing
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalked@redhat.com>
2012-01-16 17:20:51 -07:00
Steven Dake
bb849be586 Get rid of external config loader in include/engine/config.h
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-16 09:30:50 -07:00
Steven Dake
0e2ca7edac Remove service.d directory since plugins are gone
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-16 09:30:46 -07:00
Steven Dake
75bc06d916 Remove lcr directory, files, and references since it is no longer needed
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-16 09:30:40 -07:00
Steven Dake
f763d3ba4a Initial removal of plugins
Quorum is broken in this patch.
service.h needs to be cleaned up significantly

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-16 09:30:26 -07:00
Steven Dake
7e1c9771f2 unshare exec/icmap.so
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-12 07:29:41 -07:00
Steven Dake
7c8e83ac34 Change all ais references to corosync
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio Di Nitto <fdinitto@redhat.com>
2012-01-12 07:29:15 -07:00
Fabio M. Di Nitto
10098dba27 votequorum: add last_man_standing support (default: off)
this flag (0|1) can be configured via quorum.last_man_standing and when
enabled, it allows expected_votes to be dynamically recalculated.

Assuming an 8 nodes cluster, every node votes 1 (mandatory requirement for
this feature).

In the first event, 3 nodes are lost.

The remaining partition of 5 is barely quorate.

After a configurable timeout (quorum.last_man_standing_window, default 10sec)
the quorate partition is allow to recalculate expected_votes based on
the remaining nodes.

This operation will bring expected_votes to 5 and quorum to 3.

Repeating the above loop, in the next event, 2 more nodes are allowed to
die. etc. etc.

Reviewed-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-01-10 15:48:17 +01:00
Fabio M. Di Nitto
9589611dc4 votequorum: drop concept of DISALLOWED
this is a very old leftover from the RHEL5 timeframe, not used in RHEL6.

Also change votequorum soname since this change implies an ABI change.

Reviewed-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-01-10 15:48:10 +01:00
Fabio M. Di Nitto
b41372c6b2 votequorum: add auto_tie_breaker support (default: off)
this flag (0|1) can be configured via quorum.auto_tie_breaker and when
enabled, support for perfect even split is on.

In case of a 50% of votes loss in one single transition, the partition
with the node that has the lowest node id will remain quorate.

Reviewed-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-01-10 15:47:57 +01:00
Fabio M. Di Nitto
e8d0af0bc8 votequorum: add wait_for_all support (default: off)
this flag (0|1) can be configured via quorum.wait_for_all and changes
behavior when granting quorum for the first time.

Normal behavior (default / 0) grants quorum as soon as enough nodes
are available in a cluster.

Setting this value to 1 will grant quorum only after all cluster
memembers are part of the cluster at the same time.

Reviewed-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-01-10 15:47:52 +01:00
Steven Dake
8ad583a54c Move logsys.c into corosync binary instead of a shared object
Our preferred shared logging system is exported via the libqb library.  As
a result, the corosync project no longer needs to export logsys.so and the
code can be directly included in the binary.  The header file can also be
removed.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2012-01-06 18:19:59 -07:00
Jan Friesse
8a45e2b152 Move corosync core to use icmap
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-12-15 09:19:17 +01:00
Angus Salkeld
37e17e7a94 libqb: logging & trace
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:16 +10:00
Angus Salkeld
c6895faa05 libqb: change ipc -> qb_ipc
IPC: return 0/-ENOBUFS from message handler
IPC: use the new rate_limit API to improve perf.
CPG: add send_async API & hook up flow control
IPC: Fix flow control getting stuck.
IPC: Port the remaining libs to use libqb IPC
IPC: remove libqb flowcontrol API
TEST: put cpg_dispatch() in it's own thread
IPC: cleanup ipc_glue.c name everything cs_ipcs_*()
IPC: add back statistics
IPC: remove coroipcc_ symbols from lib*.versions
IPC: init each se's IPC as it is loaded.
IPC: use the new connection_closed() event to free the context.
IPC: re-add zero copy functionality back
IPC: remove cpg_mcast_joined_async() and make it the default
 -> now cpg_mcast_joined() == cpg_mcast_joined_async()
libqb: expose a libqb error converter
libqb: add missing error conversions
libqb: remove repeat try loop in lib/cpg.c
CPG: fix zero copy mcast
CPG: use newer return codes
Add ENOTCONN to qb_to_cs_error()
libqb: fix error conversion from errno to cs_error_t in confdb
libqb: change errno_to_cs to qb_to_cs_error
libqb: add a cs_strerror() to get a more meaningful message
libqb: fix some confusing error conversions.
libqb: set the timeout on recv's to -1 (wait forever)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:14 +10:00
Jerome Flesch
00434a4f10 Fix usage of strerror_r()/perror()
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-28 09:56:58 +02:00
Jan Friesse
c2a39cb8e2 coroparse: don't leak dirent
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 11:00:56 +02:00
Steven Dake
6992410df6 Remove checking of sub parameters in service.d files.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3024 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-24 18:45:43 +00:00
Jan Friesse
eda1e364f4 Remove pathconf which may fall
Corosync has problem with readdir_r if pathconf function fails.

Main problem is hidden in calling pathconf (internally calls statfs)
which may fail. After this fail, newly allocated memory for readdir_r
was smaller than expected and memory was overwritten by readdir_r.

Patch removes calling of pathconf and rather use NAME_MAX constant which
is always large enough for all file systems.

Also return value of malloc SHOULD be checked.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2962 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-23 08:39:49 +00:00
Angus Salkeld
8236a0873e cov 10404: don't assign loc pointer when not used.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2847 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 00:14:02 +00:00
Angus Salkeld
20f3331d0e convert strerror() into strerror_r()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2665 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-25 19:28:36 +00:00
Angus Salkeld
2290913d28 convert readdir into readdir_r
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2664 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-25 19:26:54 +00:00
Jan Friesse
99db356765 Fix coroparse to allow white chars before comment
- allows white characters before #
- new function to parse log destinations (remove code duplicity)
- clarify man page


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2642 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-01-13 09:52:07 +00:00
Angus Salkeld
73b7aa19bb Add value types to objdb keys.
This allows you to create a key with a know type.
And then get the type with the key value.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2511 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-10 03:20:38 +00:00
Fabio M. Di Nitto
3ffb151aa7 Fix missing symbol error when loading plugins without executive
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2405 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-07 10:41:42 +00:00
Jan Friesse
996850db39 Support for service.d
This patch is very similar to uidgid.d patch, but support for loading
services (so read service section).


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2368 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-07-22 08:25:45 +00:00
Fabio M. Di Nitto
2135d91c27 Fix handling of sysconfdir
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2265 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-19 07:02:55 +00:00
Jan Friesse
c54e74e3f6 Make /etc/corosync/corosync.conf default configuration file
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2235 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-12 10:22:32 +00:00
Steven Dake
ae5895c3f7 Call initializer directly for broken platforms which don't honor ctors in the shared object on dlopen.
This could probably be more tidy to detect those OS platforms which don't do this instead of hardcoding
to a specific platform we intend to port to.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2221 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-07 07:47:10 +00:00
Steven Dake
6fd822c485 Include limits.h in coroparse.c to properly define PATH_MAX.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2220 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-07 07:36:44 +00:00
Steven Dake
1bd8aba6bb Change NAME_MAX to FILENAME_MAX to compile properly on Posix OS.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2219 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-07 07:36:11 +00:00
Steven Dake
1e0d40cdeb Make readdir operation portable by removing BSDism from coroparse.c.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2215 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-07 02:30:13 +00:00
Jan Friesse
ae22983140 Support for uidgid feature
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2198 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-20 13:30:29 +00:00
Jim Meyering
1f40a10983 don't include <signal.h> when it's not used
* exec/coroparse.c: Likewise.
* exec/quorum.c: Likewise.
* exec/sync.c: Likewise.
* exec/totemmrp.c: Likewise.
* exec/totemnet.c: Likewise.
* exec/totemrrp.c: Likewise.
* exec/totemsrp.c: Likewise.
* exec/vsf_quorum.c: Likewise.
* exec/vsf_ykd.c: Likewise.
* lcr/uic.c: Likewise.
* lcr/uis.c: Likewise.
* lib/cfg.c: Likewise.
* services/cfg.c: Likewise.
* services/cpg.c: Likewise.
* services/evs.c: Likewise.
* services/pload.c: Likewise.
* services/testquorum.c: Likewise.
* services/votequorum.c: Likewise.
* test/testconfdb.c: Likewise.
* test/testcpg.c: Likewise.
* test/testcpgzc.c: Likewise.
* test/testzcgc.c: Likewise.
* tools/corosync-cfgtool.c: Likewise.
* tools/corosync-objctl.c: Likewise.
* tools/corosync-pload.c: Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2193 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-18 16:41:46 +00:00
Jan Friesse
94b64352a4 coroparse: Handle different EOLs and pass error_string
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2186 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-18 11:44:58 +00:00
Steven Dake
e9d718d01d Remove mempool since it is unused and isn't going to be a feature in
this release.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2141 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-23 19:39:20 +00:00
Jim Meyering
283011c669 rename function: s/strstr_rs/strchr_rs/ to reflect new semantics
* exec/coroparse.c (parse_section):
* exec/util.c (strchr_rs, strstr_rs):
* exec/util.h (corosync_exit_error):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2112 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-21 11:56:55 +00:00
Jim Meyering
89c6d6a1a1 rewrite strstr_rs not to use strdup
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
2009-04-21 11:56:47 +00:00
Steven Dake
870046d065 Patch to use snprintf where appropriate to avoid buffer overrun.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1990 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-02 18:49:24 +00:00