diff --git a/corosync.spec.in b/corosync.spec.in index 3ef0025f..6ff3e227 100644 --- a/corosync.spec.in +++ b/corosync.spec.in @@ -1,505 +1,507 @@ @ALPHATAG@ @NUMCOMM@ @DIRTY@ # Conditionals # Invoke "rpmbuild --without " or "rpmbuild --with " # to disable or enable specific features %bcond_with testagents %bcond_with watchdog %bcond_with monitoring %bcond_with snmp %bcond_with dbus %bcond_with rdma %bcond_with systemd %bcond_with upstart %bcond_with xmlconf %bcond_with runautogen %bcond_with qdevices %bcond_with qnetd %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}} %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}} Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces Version: @version@ Release: 1%{?gitver}%{?dist} License: BSD Group: System Environment/Base URL: http://corosync.github.io/corosync/ Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz # Runtime bits Requires: corosynclib = %{version}-%{release} Requires(pre): /usr/sbin/useradd Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Conflicts: openais <= 0.89, openais-devel <= 0.89 # Build bits BuildRequires: groff BuildRequires: libqb-devel BuildRequires: nss-devel BuildRequires: zlib-devel %if %{with runautogen} BuildRequires: autoconf automake libtool %endif %if %{with monitoring} BuildRequires: libstatgrab-devel %endif %if %{with rdma} BuildRequires: libibverbs-devel librdmacm-devel %endif %if %{with snmp} BuildRequires: net-snmp-devel %endif %if %{with dbus} BuildRequires: dbus-devel %endif %if %{with systemd} BuildRequires: systemd-units Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %endif %if %{with xmlconf} Requires: libxslt %endif %if %{with qdevices} || %{with qnetd} Requires: nss-tools %endif %if %{with qnetd} BuildRequires: sed %endif BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %prep %setup -q -n %{name}-%{version}%{?gittarver} %build %if %{with runautogen} ./autogen.sh %endif %if %{with rdma} export ibverbs_CFLAGS=-I/usr/include/infiniband \ export ibverbs_LIBS=-libverbs \ export rdmacm_CFLAGS=-I/usr/include/rdma \ export rdmacm_LIBS=-lrdmacm \ %endif %{configure} \ %if %{with testagents} --enable-testagents \ %endif %if %{with watchdog} --enable-watchdog \ %endif %if %{with monitoring} --enable-monitoring \ %endif %if %{with snmp} --enable-snmp \ %endif %if %{with dbus} --enable-dbus \ %endif %if %{with rdma} --enable-rdma \ %endif %if %{with systemd} --enable-systemd \ %endif %if %{with upstart} --enable-upstart \ %endif %if %{with xmlconf} --enable-xmlconf \ %endif %if %{with qdevices} --enable-qdevices \ %endif %if %{with qnetd} --enable-qnetd \ %endif --with-initddir=%{_initrddir} \ --with-systemddir=%{_unitdir} \ --with-upstartdir=%{_sysconfdir}/init \ --with-tmpfilesdir=%{_tmpfilesdir} make %{_smp_mflags} %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} %if %{with dbus} mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf %endif ## tree fixup # drop static libs rm -f %{buildroot}%{_libdir}/*.a rm -f %{buildroot}%{_libdir}/*.la # drop docs and html docs for now rm -rf %{buildroot}%{_docdir}/* # /etc/sysconfig/corosync-notifyd mkdir -p %{buildroot}%{_sysconfdir}/sysconfig install -m 644 tools/corosync-notifyd.sysconfig.example \ %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd # /etc/sysconfig/corosync install -m 644 init/corosync.sysconfig.example \ %{buildroot}%{_sysconfdir}/sysconfig/corosync %if %{with qdevices} # /etc/sysconfig/corosync-qdevice install -m 644 init/corosync-qdevice.sysconfig.example \ %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice %endif %if %{with qnetd} # /etc/sysconfig/corosync-qnetd install -m 644 init/corosync-qnetd.sysconfig.example \ %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd %if %{with systemd} sed -i -e 's/^#User=/User=/' \ %{buildroot}%{_unitdir}/corosync-qnetd.service sed -i -e 's/root/coroqnetd/g' \ %{buildroot}%{_tmpfilesdir}/corosync-qnetd.conf %else sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \ %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd %endif %endif %clean rm -rf %{buildroot} %description This package contains the Corosync Cluster Engine Executive, several default APIs and libraries, default configuration files, and an init script. %post %if %{with systemd} && 0%{?systemd_post:1} %systemd_post corosync.service %else if [ $1 -eq 1 ]; then /sbin/chkconfig --add corosync || : fi %endif %preun %if %{with systemd} && 0%{?systemd_preun:1} %systemd_preun corosync.service %else if [ $1 -eq 0 ]; then /sbin/service corosync stop &>/dev/null || : /sbin/chkconfig --del corosync || : fi %endif %postun %if %{with systemd} && 0%{?systemd_postun:1} %systemd_postun %endif %files %defattr(-,root,root,-) %doc LICENSE SECURITY %{_sbindir}/corosync %{_sbindir}/corosync-keygen %{_sbindir}/corosync-cmapctl %{_sbindir}/corosync-cfgtool %{_sbindir}/corosync-cpgtool %{_sbindir}/corosync-quorumtool %{_sbindir}/corosync-notifyd %{_bindir}/corosync-blackbox %if %{with xmlconf} %{_bindir}/corosync-xmlproc %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example %dir %{_datadir}/corosync %{_datadir}/corosync/xml2conf.xsl %{_mandir}/man8/corosync-xmlproc.8* %{_mandir}/man5/corosync.xml.5* %endif %dir %{_sysconfdir}/corosync %dir %{_sysconfdir}/corosync/uidgid.d %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd %config(noreplace) %{_sysconfdir}/sysconfig/corosync %config(noreplace) %{_sysconfdir}/logrotate.d/corosync %if %{with dbus} %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf %endif %if %{with snmp} %{_datadir}/snmp/mibs/COROSYNC-MIB.txt %endif %if %{with systemd} %{_unitdir}/corosync.service %{_unitdir}/corosync-notifyd.service %dir %{_datadir}/corosync %{_datadir}/corosync/corosync %{_datadir}/corosync/corosync-notifyd %else %{_initrddir}/corosync %{_initrddir}/corosync-notifyd %endif %if %{with upstart} %{_sysconfdir}/init/corosync.conf %{_sysconfdir}/init/corosync-notifyd.conf %endif %dir %{_localstatedir}/lib/corosync %dir %{_localstatedir}/log/cluster %{_mandir}/man8/corosync_overview.8* %{_mandir}/man8/corosync.8* %{_mandir}/man8/corosync-blackbox.8* %{_mandir}/man8/corosync-cmapctl.8* %{_mandir}/man8/corosync-keygen.8* %{_mandir}/man8/corosync-cfgtool.8* %{_mandir}/man8/corosync-cpgtool.8* %{_mandir}/man8/corosync-notifyd.8* %{_mandir}/man8/corosync-quorumtool.8* %{_mandir}/man5/corosync.conf.5* %{_mandir}/man5/votequorum.5* %{_mandir}/man8/cmap_keys.8* # optional testagent rpm # %if %{with testagents} %package -n corosync-testagents Summary: The Corosync Cluster Engine Test Agents Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description -n corosync-testagents This package contains corosync test agents. %files -n corosync-testagents %defattr(755,root,root,-) %{_datadir}/corosync/tests/mem_leak_test.sh %{_datadir}/corosync/tests/net_breaker.sh %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh %{_datadir}/corosync/tests/shm_leak_audit.sh %{_bindir}/cpg_test_agent %{_bindir}/sam_test_agent %{_bindir}/votequorum_test_agent %endif # library # %package -n corosynclib Summary: The Corosync Cluster Engine Libraries Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} %description -n corosynclib This package contains corosync libraries. %files -n corosynclib %defattr(-,root,root,-) %doc LICENSE %{_libdir}/libcfg.so.* %{_libdir}/libcpg.so.* %{_libdir}/libcmap.so.* %{_libdir}/libtotem_pg.so.* %{_libdir}/libquorum.so.* %{_libdir}/libvotequorum.so.* %{_libdir}/libsam.so.* %{_libdir}/libcorosync_common.so.* %post -n corosynclib -p /sbin/ldconfig %postun -n corosynclib -p /sbin/ldconfig %package -n corosynclib-devel Summary: The Corosync Cluster Engine Development Kit Group: Development/Libraries Requires: corosynclib = %{version}-%{release} Requires: pkgconfig Provides: corosync-devel = %{version} Obsoletes: corosync-devel < 0.92-7 %description -n corosynclib-devel This package contains include files and man pages used to develop using The Corosync Cluster Engine APIs. %files -n corosynclib-devel %defattr(-,root,root,-) %doc LICENSE %dir %{_includedir}/corosync/ %{_includedir}/corosync/corodefs.h %{_includedir}/corosync/cfg.h %{_includedir}/corosync/cmap.h %{_includedir}/corosync/corotypes.h %{_includedir}/corosync/cpg.h %{_includedir}/corosync/hdb.h %{_includedir}/corosync/sam.h %{_includedir}/corosync/quorum.h %{_includedir}/corosync/votequorum.h %dir %{_includedir}/corosync/totem/ %{_includedir}/corosync/totem/totem.h %{_includedir}/corosync/totem/totemip.h %{_includedir}/corosync/totem/totempg.h %{_libdir}/libcfg.so %{_libdir}/libcpg.so %{_libdir}/libcmap.so %{_libdir}/libtotem_pg.so %{_libdir}/libquorum.so %{_libdir}/libvotequorum.so %{_libdir}/libsam.so %{_libdir}/libcorosync_common.so %{_libdir}/pkgconfig/*.pc %{_mandir}/man3/cpg_*3* %{_mandir}/man3/quorum_*3* %{_mandir}/man3/votequorum_*3* %{_mandir}/man3/sam_*3* %{_mandir}/man8/cpg_overview.8* %{_mandir}/man8/votequorum_overview.8* %{_mandir}/man8/sam_overview.8* %{_mandir}/man3/cmap_*3* %{_mandir}/man8/cmap_overview.8* %{_mandir}/man8/quorum_overview.8* # optional qdevices # %if %{with qdevices} %package -n corosync-qdevice Summary: The Corosync Cluster Engine Qdevice Group: System Environment/Base Requires: corosync Requires: nss-tools %if %{with systemd} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %endif %description -n corosync-qdevice This package contains the Corosync Cluster Engine Qdevice, script for creating NSS certificates and an init script. %post -n corosync-qdevice %if %{with systemd} && 0%{?systemd_post:1} %systemd_post corosync-qdevice.service %else if [ $1 -eq 1 ]; then /sbin/chkconfig --add corosync-qdevice || : fi %endif %preun -n corosync-qdevice %if %{with systemd} && 0%{?systemd_preun:1} %systemd_preun corosync-qdevice.service %else if [ $1 -eq 0 ]; then /sbin/service corosync-qdevice stop &>/dev/null || : /sbin/chkconfig --del corosync-qdevice || : fi %endif %postun -n corosync-qdevice %if %{with systemd} && 0%{?systemd_postun:1} %systemd_postun %endif %files -n corosync-qdevice %defattr(-,root,root,-) %dir %{_sysconfdir}/corosync/qdevice %dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net %dir %{_localstatedir}/run/corosync-qdevice %{_sbindir}/corosync-qdevice %{_sbindir}/corosync-qdevice-net-certutil %{_sbindir}/corosync-qdevice-tool %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice %if %{with systemd} %{_unitdir}/corosync-qdevice.service %dir %{_datadir}/corosync %{_datadir}/corosync/corosync-qdevice %else %{_initrddir}/corosync-qdevice %endif %{_mandir}/man8/corosync-qdevice-tool.8* +%{_mandir}/man8/corosync-qdevice-net-certutil.8* %endif # optional qnetd # %if %{with qnetd} %package -n corosync-qnetd Summary: The Corosync Cluster Engine Qdevice Network Daemon Group: System Environment/Base Requires: nss-tools Requires(pre): shadow-utils %if %{with systemd} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %endif %description -n corosync-qnetd This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating NSS certificates and an init script. %pre -n corosync-qnetd getent group coroqnetd >/dev/null || groupadd -r coroqnetd getent passwd coroqnetd >/dev/null || \ useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd exit 0 %post -n corosync-qnetd %if %{with systemd} && 0%{?systemd_post:1} %systemd_post corosync-qnetd.service %else if [ $1 -eq 1 ]; then /sbin/chkconfig --add corosync-qnetd || : fi %endif %preun -n corosync-qnetd %if %{with systemd} && 0%{?systemd_preun:1} %systemd_preun corosync-qnetd.service %else if [ $1 -eq 0 ]; then /sbin/service corosync-qnetd stop &>/dev/null || : /sbin/chkconfig --del corosync-qnetd || : fi %endif %postun -n corosync-qnetd %if %{with systemd} && 0%{?systemd_postun:1} %systemd_postun %endif %files -n corosync-qnetd %defattr(-,root,root,-) %dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd %dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd %{_bindir}/corosync-qnetd %{_bindir}/corosync-qnetd-certutil %{_bindir}/corosync-qnetd-tool %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd %if %{with systemd} %{_unitdir}/corosync-qnetd.service %dir %{_datadir}/corosync %{_datadir}/corosync/corosync-qnetd %{_tmpfilesdir}/corosync-qnetd.conf %else %{_initrddir}/corosync-qnetd %endif %{_mandir}/man8/corosync-qnetd-tool.8* %{_mandir}/man8/corosync-qnetd-certutil.8* +%{_mandir}/man8/corosync-qnetd.8* %endif %changelog * @date@ Autotools generated version - @version@-1-@numcomm@.@alphatag@.@dirty@ - Autotools generated version diff --git a/man/Makefile.am b/man/Makefile.am index c4824693..cff2a563 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,187 +1,189 @@ # Copyright (c) 2004 MontaVista Software, Inc. # Copyright (c) 2009, 2012, 2014 Red Hat, Inc. # # Authors: Steven Dake (sdake@redhat.com) # Fabio M. Di Nitto (fdinitto@redhat.com) # # All rights reserved. # # This software licensed under BSD license, the text of which follows: # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the MontaVista Software, Inc. nor the names of its # contributors may be used to endorse or promote products derived from this # software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. MAINTAINERCLEANFILES = Makefile.in xml_man = corosync-xmlproc.8 \ corosync.xml.5 INDEX_HTML = index.html autogen_man = cpg_context_get.3 \ cpg_context_set.3 \ cpg_dispatch.3 \ cpg_fd_get.3 \ cpg_finalize.3 \ cpg_initialize.3 \ cpg_join.3 \ cpg_leave.3 \ cpg_local_get.3 \ cpg_mcast_joined.3 \ cpg_model_initialize.3 \ cpg_zcb_mcast_joined.3 \ cpg_zcb_alloc.3 \ cpg_zcb_free.3 \ cpg_membership_get.3 \ cpg_iteration_finalize.3 \ cpg_iteration_initialize.3 \ cpg_iteration_next.3 \ quorum_initialize.3 \ quorum_finalize.3 \ quorum_fd_get.3 \ quorum_dispatch.3 \ quorum_context_get.3 \ quorum_context_set.3 \ quorum_getquorate.3 \ quorum_trackstart.3 \ quorum_trackstop.3 \ votequorum_dispatch.3 \ votequorum_fd_get.3 \ votequorum_context_get.3 \ votequorum_context_set.3 \ votequorum_finalize.3 \ votequorum_getinfo.3 \ votequorum_initialize.3 \ votequorum_setexpected.3 \ votequorum_setvotes.3 \ votequorum_trackstart.3 \ votequorum_trackstop.3 \ votequorum_qdevice_register.3 \ votequorum_qdevice_unregister.3 \ votequorum_qdevice_update.3 \ votequorum_qdevice_master_wins.3 \ votequorum_qdevice_poll.3 \ sam_data_getsize.3 \ sam_data_restore.3 \ sam_data_store.3 \ sam_finalize.3 \ sam_hc_callback_register.3 \ sam_hc_send.3 \ sam_initialize.3 \ sam_mark_failed.3 \ sam_register.3 \ sam_start.3 \ sam_stop.3 \ sam_warn_signal_set.3 \ cmap_context_get.3 \ cmap_dec.3 \ cmap_iter_init.3 \ cmap_get.3 \ cmap_inc.3 \ cmap_set.3 \ cmap_iter_next.3 \ cmap_delete.3 \ cmap_iter_finalize.3 \ cmap_finalize.3 \ cmap_dispatch.3 \ cmap_initialize.3 \ cmap_track_add.3 \ cmap_context_set.3 \ cmap_fd_get.3 \ cmap_track_delete.3 autogen_common = ipc_common.sh.errors EXTRA_DIST = $(INDEX_HTML) \ $(xml_man) \ $(autogen_man:%=%.in) \ $(autogen_common) man_MANS = $(autogen_man) dist_man_MANS = corosync.conf.5 \ votequorum.5 \ corosync.8 \ corosync-cmapctl.8 \ corosync-blackbox.8 \ corosync-keygen.8 \ corosync-cfgtool.8 \ corosync-cpgtool.8 \ corosync-notifyd.8 \ corosync-quorumtool.8 \ corosync_overview.8 \ cpg_overview.8 \ quorum_overview.8 \ votequorum_overview.8 \ sam_overview.8 \ cmap_overview.8 \ cmap_keys.8 if INSTALL_XMLCONF dist_man_MANS += $(xml_man) endif if BUILD_QNETD dist_man_MANS += corosync-qnetd-tool.8 \ - corosync-qnetd-certutil.8 + corosync-qnetd-certutil.8 \ + corosync-qnetd.8 endif if BUILD_QDEVICES -dist_man_MANS += corosync-qdevice-tool.8 +dist_man_MANS += corosync-qdevice-tool.8 \ + corosync-qdevice-net-certutil.8 endif HTML_DOCS = $(dist_man_MANS:%=%.html) $(man_MANS:%=%.html) # developer man page generation %.3: %.3.in $(autogen_common) @echo Generating $@ man page && \ rm -f $@-t-t $@-t $@ && \ date="$$(LC_ALL=C date "+%F")" && \ awk "{print}(\$$1 ~ /@COMMONIPCERRORS@/){exit 0}" ${top_srcdir}/man/$@.in > $@-t-t && \ cat ${top_srcdir}/man/$(autogen_common) >> $@-t-t && \ awk -v p=0 "(\$$1 ~ /@COMMONIPCERRORS@/){p = 1} {if(p==1)print}" ${top_srcdir}/man/$@.in >> $@-t-t && \ cat $@-t-t | \ sed -e 's#@BUILDDATE@#'$$date'#g' \ -e 's#@COMMONIPCERRORS@##g' \ > $@-t && \ rm -f $@-t-t && \ mv $@-t $@ clean-local: rm -rf $(HTML_DOCS) $(autogen_man) if BUILD_HTML_DOCS %.html: % $(GROFF) -mandoc -Thtml $^ > $@ install-data-local: $(INSTALL) -d $(DESTDIR)/${docdir}/html $(INSTALL) -m 644 ${srcdir}/$(INDEX_HTML) $(HTML_DOCS) $(DESTDIR)/${docdir}/html/ uninstall-local: cd $(DESTDIR)/${docdir}/html && rm -f $(INDEX_HTML) $(HTML_DOCS) rmdir $(DESTDIR)/${docdir}/html 2> /dev/null || : all-local: $(HTML_DOCS) endif diff --git a/man/corosync-qnetd-certutil.8 b/man/corosync-qdevice-net-certutil.8 similarity index 61% copy from man/corosync-qnetd-certutil.8 copy to man/corosync-qdevice-net-certutil.8 index 4fad8ee4..4cdda110 100644 --- a/man/corosync-qnetd-certutil.8 +++ b/man/corosync-qdevice-net-certutil.8 @@ -1,68 +1,84 @@ .\"/* .\" * Copyright (C) 2016 Red Hat, Inc. .\" * .\" * All rights reserved. .\" * .\" * Author: Jan Friesse .\" * .\" * This software licensed under BSD license, the text of which follows: .\" * .\" * Redistribution and use in source and binary forms, with or without .\" * modification, are permitted provided that the following conditions are met: .\" * .\" * - Redistributions of source code must retain the above copyright notice, .\" * this list of conditions and the following disclaimer. .\" * - Redistributions in binary form must reproduce the above copyright notice, .\" * this list of conditions and the following disclaimer in the documentation .\" * and/or other materials provided with the distribution. .\" * - Neither the name of Red Hat, Inc. nor the names of its .\" * contributors may be used to endorse or promote products derived from this .\" * software without specific prior written permission. .\" * .\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" .\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE .\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" * THE POSSIBILITY OF SUCH DAMAGE. .\" */ -.TH COROSYNC-QNETD-CERTUTIL 8 2016-06-23 +.TH COROSYNC-QDEVICE-NET-CERTUTIL 8 2016-06-28 .SH NAME -corosync-qnetd-certutil - tool to generate qnetd TLS certificates +corosync-qdevice-net-certutil - tool to generate qdevice model net TLS certificates .SH SYNOPSIS -.B "corosync-qnetd-certutil [-i|-s] [-c certificate] [-n cluster_name]" +.B "corosync-qdevice-net-certutil [-i|-m|-M|-r|-s|-Q] [-c certificate] [-n cluster_name]" .SH DESCRIPTION -.B corosync-qnetd-certutil -is frontend for NSS certutil used for generating QNetd CA, server certificate and -signing cluster certificate used by -.B corosync-qdevice -model net. +.B corosync-qdevice-net-certutil +is frontend for NSS certutil used for generating client certificate for net model of +qdevice. .SH OPTIONS .TP .B -i -Initialize QNetd NSS certificate database and generate QNetd CA and server certificate. -Default directory with database is /etc/corosync/qnetd. This directory has to be -writable by current user. QNetd CA certificate is also exported into file +Initialize QDevice Net NSS certificate database. +Default directory with database is /etc/corosync/qdevice/net/. This directory +has to be writable by current user. It needs QNetd CA certificate passed as +.B -c +parameter. Certificate can be found on server running QNetd in file /etc/corosync/qnetd/nssdb/qnetd-cacert.crt. .TP -.B -s -Sign cluster certificate. It's required to pass name of cluster (equal to -one configured in corosync.conf) and certificate request file. Signed certificate is -stored into file /etc/corosync/qnetd/nssdb/cluster-$ClusterName.crt +.B -m +Import cluster certificate and key from pk12 file. +.TP +.B -r +Generate certificate request. Certificate request is exported into +/etc/corosync/qdevice/net/qdevice-net-node.crq file. It's required to +pass cluster name +.B -n +parameter. Cluster name has to match one defined in /etc/corosync/corosync.conf. +.TP +.B -M +Import signed certificate and export certificate with private key into +pk12 file. .TP +.B -Q +Use ssh/scp to properly set both +.B corosync-qnetd +and +.B corosync-qdevice +certificates on all nodes. It's highly recommended to use ssh agent, +otherwise ssh/scp will keep you asking for password roughly 8 times number of nodes. .B -c -Certificate request file to sign. +File with certificate to load. .TP .B -n Name of the cluster. .SH SEE ALSO .BR corosync-qnetd (8) .BR corosync-qdevice (8) .SH AUTHOR Jan Friesse .PP diff --git a/man/corosync-qnetd-certutil.8 b/man/corosync-qnetd-certutil.8 index 4fad8ee4..878f53bb 100644 --- a/man/corosync-qnetd-certutil.8 +++ b/man/corosync-qnetd-certutil.8 @@ -1,68 +1,73 @@ .\"/* .\" * Copyright (C) 2016 Red Hat, Inc. .\" * .\" * All rights reserved. .\" * .\" * Author: Jan Friesse .\" * .\" * This software licensed under BSD license, the text of which follows: .\" * .\" * Redistribution and use in source and binary forms, with or without .\" * modification, are permitted provided that the following conditions are met: .\" * .\" * - Redistributions of source code must retain the above copyright notice, .\" * this list of conditions and the following disclaimer. .\" * - Redistributions in binary form must reproduce the above copyright notice, .\" * this list of conditions and the following disclaimer in the documentation .\" * and/or other materials provided with the distribution. .\" * - Neither the name of Red Hat, Inc. nor the names of its .\" * contributors may be used to endorse or promote products derived from this .\" * software without specific prior written permission. .\" * .\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" .\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE .\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" * THE POSSIBILITY OF SUCH DAMAGE. .\" */ -.TH COROSYNC-QNETD-CERTUTIL 8 2016-06-23 +.TH COROSYNC-QNETD-CERTUTIL 8 2016-06-28 .SH NAME corosync-qnetd-certutil - tool to generate qnetd TLS certificates .SH SYNOPSIS .B "corosync-qnetd-certutil [-i|-s] [-c certificate] [-n cluster_name]" .SH DESCRIPTION .B corosync-qnetd-certutil is frontend for NSS certutil used for generating QNetd CA, server certificate and signing cluster certificate used by .B corosync-qdevice model net. .SH OPTIONS .TP .B -i Initialize QNetd NSS certificate database and generate QNetd CA and server certificate. Default directory with database is /etc/corosync/qnetd. This directory has to be writable by current user. QNetd CA certificate is also exported into file /etc/corosync/qnetd/nssdb/qnetd-cacert.crt. .TP .B -s Sign cluster certificate. It's required to pass name of cluster (equal to one configured in corosync.conf) and certificate request file. Signed certificate is stored into file /etc/corosync/qnetd/nssdb/cluster-$ClusterName.crt .TP .B -c Certificate request file to sign. .TP .B -n Name of the cluster. +.SH NOTES +If qnetd is executed by non root user, /etc/corosync/qnetd and it's subdirectories has to have +set owner (and/or group) to given user. If +.B corosync-qnetd-certutil +is executed as root it tries to copy owner and group of /etc/corosync/qnetd to all its created files. .SH SEE ALSO .BR corosync-qnetd (8) .BR corosync-qdevice (8) .SH AUTHOR Jan Friesse .PP diff --git a/man/corosync-qnetd.8 b/man/corosync-qnetd.8 new file mode 100644 index 00000000..cc32383f --- /dev/null +++ b/man/corosync-qnetd.8 @@ -0,0 +1,223 @@ +.\"/* +.\" * Copyright (C) 2016 Red Hat, Inc. +.\" * +.\" * All rights reserved. +.\" * +.\" * Author: Jan Friesse +.\" * +.\" * This software licensed under BSD license, the text of which follows: +.\" * +.\" * Redistribution and use in source and binary forms, with or without +.\" * modification, are permitted provided that the following conditions are met: +.\" * +.\" * - Redistributions of source code must retain the above copyright notice, +.\" * this list of conditions and the following disclaimer. +.\" * - Redistributions in binary form must reproduce the above copyright notice, +.\" * this list of conditions and the following disclaimer in the documentation +.\" * and/or other materials provided with the distribution. +.\" * - Neither the name of Red Hat, Inc. nor the names of its +.\" * contributors may be used to endorse or promote products derived from this +.\" * software without specific prior written permission. +.\" * +.\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +.\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +.\" * THE POSSIBILITY OF SUCH DAMAGE. +.\" */ +.TH COROSYNC-QNETD 8 2016-06-28 +.SH NAME +corosync-qnetd \- QNet daemon +.SH SYNOPSIS +.B "corosync-qnetd [-46dfhv] [-l listen_addr] [-p listen_port] [-s tls] +.B [-c client_cert_required] [-m max_clients] [-S option=value[,option2=value2,...]]" + +.SH DESCRIPTION +.B corosync-qnetd +is daemon running outside of cluster and being able to provide vote to +.B corosync-qdevice +model net. It's designed to support multiple clusters and be almost configuration +and state free. New clusters are handled dynamically and no configuration file exists. +It's also able to (recommended) run as non root user. Connection between +.B corosync-qdevice +model net client can be optionally TLS with client certificate checking. Communication +protocol between server and client is designed to be very simple and allow backward +compatibility. +.SH OPTIONS +.TP +.B -4 +and it's counterpart +.B -6 +are used to force to use only IPv4 or IPv6. Default is to listen on both addresses. +.TP +.B -d +Turn on debug information. By default priority of messages forwarded into syslog +is not bumped so for most of deployments debug messages are simply thrown. To bump +up priority use +.B -d +parameter twice. +.TP +.B -h +Show short help +.TP +.B -v +Show version and supported communication protocol messages/options. +.TP +.B -l +IP address to listen on. By default daemon listen on any address (wildcard). +.TP +.B -p +TCP port to listen on. Default port is 5403. +.TP +.B -s +Determines if TLS should be used and can be one of +.I on/off/required +values (default is +.I on +). +.I on +means TLS is enabled but client is not required to start TLS, +.I off +means TLS is completely disabled, and +.I required +means TLS is required. +.I on +and +.I required +requires NSS database to be properly initialized by running a +.B corosync-qnetd-certutil +command. +.TP +.B -c +can be set to +.I on/off +value. Option make sense only if TLS is enabled. When +.B -c +is +.I on +client is required to send it's client certificate (default). +.TP +.B -m +Maximum simultaneous clients. Default is 0 what means no limit. +.TP +.B -S +Set advanced settings described in it's own section. This option +shouldn't be generally used because most of the options are +not safe to change. +.SH UNPRIVILEGED USER CONFIGURATION +It's generally recommended to be running +.B corosync-qnetd +as non root user. If you get package from distribution it's highly +possible packager made hard work for you. If installation is performed +from source code, few steps has to be taken. + +First it's needed to create unprivileged user/group. Following commands +can be used (execute as root): + +.nf +# groupadd -r coroqnetd +# useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd +.fi + +Next step is to set correct owner to /etc/corosync/qnetd and /var/run/corosync-qnetd +directories. + +.nf +# chown -R coroqnetd:coroqnetd /etc/corosync/qnetd /var/run/corosync-qnetd +.fi + +Some systems has /var/run directory on tmpfs file system which gets discarded after +reboot. Solution is to use initscript which takes care of /var/run/corosync-qnetd +creating and set correct owner and permissions or for systems with systemd, it's possible +to use tmpfile.d configuration file (installed by default if systemd is enabled during +corosync compilation). + +Last step is to make sure +.B corosync-qnetd +is really executed as unpriviliged user. For initscript it's enough to set +line COROSYNC_QNETD_RUNAS in /etc/(sysconfig|default)/corosync-qnetd file. If file +is not already installed, use one provided in corosync source code +(init/corosync-qnetd.sysconfig.example). For systemd overwrite/copy +corosync-qnetd.service unit file and uncomment/change "User=" directive. + +.SH TLS CONFIGURATION +For TLS to work it's required to create NSS database. +.B corosync-qnetd-certutil +is tool to perform required actions automatically. Just execute: + +.nf +# corosync-qnetd-certutil -i +.fi + +If TLS is not required just edit /etc/(sysconfig|default)/corosync-qnetd or +systemd unit file and add parameter +.B -s +.I off +proper place. + +.SH ADVANCED SETTINGS +Set by using +.B -S +option. At the end of description in braces is default value. +.TP +.B listen_backlog +Parameter passed to listen syscall. (10) +.TP +.B max_client_send_buffers +Maximum number of send buffers for one client. (32) +.TP +.B max_client_send_size +Maximum size of one send buffer (message) to be send to client. (32768) +.TP +.B max_client_receive_size +Maximum size of receive buffer for client message (maximum +allowed message size received by client). (32768) +.TP +.B nss_db_dir +NSS database directory. (/etc/corosync/qnetd/nssdb) +.TP +.B cert_nickname +NSS nickname of qnetd server certificate. (QNetd Cert) +.TP +.B heartbeat_interval_min +Minimal heartbeat timeout accepted by server in ms. (1000) +.TP +.B heartbeat_interval_max +Maximal heartbeat timeout accepted by server in ms. (120000) +.TP +.B dpd_enabled +Dead peer detection enabled. (on) +.TP +.B dpd_interval +How often DPD algorithm detects dead peers in ms. (10000) +.TP +.B lock_file +Lock file location. (/var/run/corosync-qnetd/corosync-qnetd.pid) +.TP +.B local_socket_file +Internal IPC socket file location. (/var/run/corosync-qnetd/corosync-qnetd.sock) +.TP +.B local_socket_backlog +Parameter passed to listen syscall. (10) +.TP +.B ipc_max_clients +Maximum allowed simultaneous IPC clients. (10) +.TP +.B ipc_max_receive_size +Maximum size of message received by IPC client. (4096) +.TP +.B ipc_max_send_size +Maximum size of message allowed to send to IPC client. (10485760) +.SH SEE ALSO +.BR corosync-qnetd-tool (8) +.BR corosync-qnetd-certutil (8) +.BR corosync-qdevice (8) +.SH AUTHOR +Jan Friesse +.PP diff --git a/qdevices/qnetd-advanced-settings.c b/qdevices/qnetd-advanced-settings.c index 2a08f3f0..f1eff374 100644 --- a/qdevices/qnetd-advanced-settings.c +++ b/qdevices/qnetd-advanced-settings.c @@ -1,220 +1,213 @@ /* * Copyright (c) 2015-2016 Red Hat, Inc. * * All rights reserved. * * Author: Jan Friesse (jfriesse@redhat.com) * * This software licensed under BSD license, the text of which follows: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - Neither the name of the Red Hat, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include #include #include #include "dynar.h" #include "dynar-getopt-lex.h" #include "dynar-str.h" #include "qnet-config.h" #include "qnetd-advanced-settings.h" #include "utils.h" int qnetd_advanced_settings_init(struct qnetd_advanced_settings *settings) { memset(settings, 0, sizeof(*settings)); settings->listen_backlog = QNETD_DEFAULT_LISTEN_BACKLOG; settings->max_client_send_buffers = QNETD_DEFAULT_MAX_CLIENT_SEND_BUFFERS; settings->max_client_send_size = QNETD_DEFAULT_MAX_CLIENT_SEND_SIZE; settings->max_client_receive_size = QNETD_DEFAULT_MAX_CLIENT_RECEIVE_SIZE; if ((settings->nss_db_dir = strdup(QNETD_DEFAULT_NSS_DB_DIR)) == NULL) { return (-1); } if ((settings->cert_nickname = strdup(QNETD_DEFAULT_CERT_NICKNAME)) == NULL) { return (-1); } settings->heartbeat_interval_min = QNETD_DEFAULT_HEARTBEAT_INTERVAL_MIN; settings->heartbeat_interval_max = QNETD_DEFAULT_HEARTBEAT_INTERVAL_MAX; settings->dpd_enabled = QNETD_DEFAULT_DPD_ENABLED; settings->dpd_interval = QNETD_DEFAULT_DPD_INTERVAL; if ((settings->lock_file = strdup(QNETD_DEFAULT_LOCK_FILE)) == NULL) { return (-1); } if ((settings->local_socket_file = strdup(QNETD_DEFAULT_LOCAL_SOCKET_FILE)) == NULL) { return (-1); } settings->local_socket_backlog = QNETD_DEFAULT_LOCAL_SOCKET_BACKLOG; settings->ipc_max_clients = QNETD_DEFAULT_IPC_MAX_CLIENTS; settings->ipc_max_receive_size = QNETD_DEFAULT_IPC_MAX_RECEIVE_SIZE; settings->ipc_max_send_size = QNETD_DEFAULT_IPC_MAX_SEND_SIZE; return (0); } void qnetd_advanced_settings_destroy(struct qnetd_advanced_settings *settings) { free(settings->nss_db_dir); free(settings->cert_nickname); free(settings->lock_file); free(settings->local_socket_file); } /* * 0 - No error * -1 - Unknown option * -2 - Incorrect value */ int qnetd_advanced_settings_set(struct qnetd_advanced_settings *settings, const char *option, const char *value) { long long int tmpll; char *ep; if (strcasecmp(option, "listen_backlog") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_LISTEN_BACKLOG || errno != 0 || *ep != '\0') { return (-2); } settings->listen_backlog = (int)tmpll; } else if (strcasecmp(option, "max_client_send_buffers") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_CLIENT_SEND_BUFFERS || errno != 0 || *ep != '\0') { return (-2); } settings->max_client_send_buffers = (size_t)tmpll; } else if (strcasecmp(option, "max_client_send_size") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_CLIENT_RECEIVE_SEND_SIZE || errno != 0 || *ep != '\0') { return (-2); } settings->max_client_send_size = (size_t)tmpll; } else if (strcasecmp(option, "max_client_receive_size") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_CLIENT_RECEIVE_SEND_SIZE || errno != 0 || *ep != '\0') { return (-2); } settings->max_client_receive_size = (size_t)tmpll; } else if (strcasecmp(option, "nss_db_dir") == 0) { free(settings->nss_db_dir); if ((settings->nss_db_dir = strdup(value)) == NULL) { return (-1); } } else if (strcasecmp(option, "cert_nickname") == 0) { free(settings->cert_nickname); if ((settings->cert_nickname = strdup(value)) == NULL) { return (-1); } } else if (strcasecmp(option, "heartbeat_interval_min") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_HEARTBEAT_INTERVAL || errno != 0 || *ep != '\0') { return (-2); } settings->heartbeat_interval_min = (uint32_t)tmpll; } else if (strcasecmp(option, "heartbeat_interval_max") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_HEARTBEAT_INTERVAL || errno != 0 || *ep != '\0') { return (-2); } settings->heartbeat_interval_max = (uint32_t)tmpll; } else if (strcasecmp(option, "dpd_enabled") == 0) { if ((tmpll = utils_parse_bool_str(value)) == -1) { return (-2); } settings->dpd_enabled = (uint8_t)tmpll; } else if (strcasecmp(option, "dpd_interval") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_DPD_INTERVAL || errno != 0 || *ep != '\0') { return (-2); } settings->dpd_interval = (uint32_t)tmpll; } else if (strcasecmp(option, "lock_file") == 0) { free(settings->lock_file); if ((settings->lock_file = strdup(value)) == NULL) { return (-1); } } else if (strcasecmp(option, "local_socket_file") == 0) { free(settings->local_socket_file); if ((settings->local_socket_file = strdup(value)) == NULL) { return (-1); } } else if (strcasecmp(option, "local_socket_backlog") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_LOCAL_SOCKET_BACKLOG || errno != 0 || *ep != '\0') { return (-2); } settings->local_socket_backlog = (int)tmpll; } else if (strcasecmp(option, "ipc_max_clients") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_IPC_MAX_CLIENTS || errno != 0 || *ep != '\0') { return (-2); } settings->ipc_max_clients = (size_t)tmpll; } else if (strcasecmp(option, "ipc_max_receive_size") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_IPC_RECEIVE_SEND_SIZE || errno != 0 || *ep != '\0') { return (-2); } settings->ipc_max_receive_size = (size_t)tmpll; } else if (strcasecmp(option, "ipc_max_send_size") == 0) { tmpll = strtoll(value, &ep, 10); if (tmpll < QNETD_MIN_IPC_RECEIVE_SEND_SIZE || errno != 0 || *ep != '\0') { return (-2); } - settings->ipc_max_send_size = (size_t)tmpll; - } else if (strcasecmp(option, "ipc_max_send_size") == 0) { - tmpll = strtoll(value, &ep, 10); - if (tmpll < QNETD_MIN_IPC_RECEIVE_SEND_SIZE || errno != 0 || *ep != '\0') { - return (-2); - } - settings->ipc_max_send_size = (size_t)tmpll; } else { return (-1); } return (0); }