Commit Graph

102 Commits

Author SHA1 Message Date
Jan Friesse
fed67019b4 qdevice: Merge msg_decode_error functions
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-08-12 17:47:39 +02:00
Jan Friesse
313d42d1e1 qdevice: Import log instead of qdevice-log
and move qdevice-log-debug to log-common to share it with qnetd.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-08-12 17:47:39 +02:00
Jan Friesse
c8d19612c2 qdevice: Use log instead of libqb log
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-08-12 17:47:39 +02:00
Jan Friesse
6cc1388e06 qnetd: Add function to set log target
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-08-12 17:47:39 +02:00
Jan Friesse
5128d3182d qnetd: Check log initialization error
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-08-12 17:47:39 +02:00
Jan Friesse
f78fd81e8d qnetd: Fix double -d description
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-08-12 17:47:39 +02:00
Jan Friesse
bb9dabf945 qnetd: Rename qnetd-log.c to log.c
And remove qnetd_ prefix from function names.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-08-12 17:47:39 +02:00
Jan Friesse
9bbf2f240d qdevice: Fix qdevice_heuristics_destroy error
When daemonization is used, heuristics worker is not a child of
the corosync-qdevice process any longer so it's not possible
to wait for its exit.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-06-10 11:15:37 +02:00
Jan Friesse
c6548f4079 configure: Add user-flags configure option
configure.ac adds by optimization and debug flags by default. This is
not always intended so conifgure option is added.

Support for using this option in specfile is added too.

Also fix GDB_CFLAGS typo. GDB_FLAGS (without C)
is the correct name of variable to print in the summary.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-06-10 11:15:37 +02:00
Jan Friesse
b560db5fa4 man: Fix corosync-qdevice default connect_timeout
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-04-25 19:01:51 +02:00
Jan Friesse
6a01299730 spec: Use install -p and add license
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-03-20 18:11:06 +01:00
Jan Friesse
31cc21726e qnetd: Check existence of NSS DB dir before fork
Previously, when user tried start corosync-qnetd without
initialized NSS database then generic (not very helpful
and misleading) NSS error was logged
"NSS error (-8015): The certificate/key database is in an old,
unsupported format.".

Solution is to check if it's possible to open NSS DB directory and
display (usually much more informative) result of strerror function.

Such check is called before fork, so init system can return error code
during start.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-03-19 15:23:09 +01:00
Jan Friesse
e1e9ae1086 certutils: Fix warnings found by coverity
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-11-26 14:04:46 +01:00
Jan Friesse
1965225e3e init: Fix init scripts to work with containers
Previously init scripts were not using pid file so pidof was used. This
is usually not a problem, but when containers are used it may result to
killing improper instance when issued on host.

Solution is to always use pidfile.

Also try to use LSB complaint status codes.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2018-11-15 17:34:35 +01:00
Jan Friesse
c65923bc9d configure: move to AC_COMPILE_IFELSE
from AC_PREPROC_IFELSE which is strongly discouraged.

Our detection system was very weak and recent versions of clang did
show that PREPROC_IFELFE (cpp) would enable warning options that
the compiler does not support (clang).

Use a full compilation test to detect what works and what doesn't.

Based on knet patch 88491f27375a9e8aceb946853a1abf4d23ebb8f3.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2018-11-07 15:22:48 +01:00
Jan Friesse
d146bfa883 git-version-gen: Fail on UNKNOWN version
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2018-09-03 17:02:12 +02:00
Jan Friesse
a09c6604ce build: Support for git archive stored tags
Attempt to solve problem with git archive generated tarballs
(used for example by github when release is downloaded) which are no
longer git tree and (in contrast to officially released tarballs) also
doesn't contain .tarball-version file so git-version-gen script simply
cannot obtain valid version info.

Solution is based on using gitattributes which is instructs git to
replace string in the .gitarchivever file by known ref names.
git-version-gen is enhanced to support this file and tries to parse
any string which looks like "tag: v[0-9]+.[0-9]+.[0-9]". If such string
is found it's used as a version. This file is used as a last attempt and
other methods (.tarball-version, git abbrev) have precedence.

Based on idea stated by Jan Pokorný <jpokorny@redhat.com>.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2018-09-03 17:01:21 +02:00
Jan Friesse
9186129ace qdevice: Propagate error to exit code
Net model never returned error when qdevice_model_run was called. This
was incorrect because with exception of local ipc close all other
disconnect reasons are errors.

Solution is to return proper error code.

Also instead of exit right after qdevice_model_run it's better to store
result value, try clean resources and use stored value to return correct
exit code.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-27 17:17:51 +02:00
Jan Friesse
f26ec675c0 build: Remove WITH_LIST
WITH_LIST is replaced in favor of bcond generator.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-22 14:20:49 +02:00
Jan Friesse
eae6806f52 spec: Autogenerate bcond options based on config
Inspired by kronosnet spec file generator.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-22 13:17:14 +02:00
Jan Friesse
77fb16e4f6 spec: add exlicit docdir
OpenSUSE does not ship docs in the normal dir and their rpm macro
does not appear to set it for us.

Based on corosync 30c7f3319f003efa1abeb2173eef9e5c7943ae5b.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-21 17:15:01 +02:00
Jan Friesse
5e029a4188 spec: Use different BuildRequires for SUSE
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-21 16:42:06 +02:00
Jan Friesse
91e31375b5 init: disable stderr output in systemd unit file
Usually both syslog and stderr are enabled so log entries are duplicated
in journal. Solution is to use similar patch as corosync
c34208ad402b45f52b5d3ee8d2a08df0779ec9aa and disable stderr.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-21 15:07:36 +02:00
Jan Friesse
1d80bc21b0 tests: Enlarge timeout for process-list test
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-21 09:18:58 +02:00
Jan Friesse
e5e1575611 spec: Add explicit gcc build dependency
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-09 15:52:51 +02:00
Jan Friesse
ed1610a3c6 config: Remove unneeded qb includes
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-09 15:35:24 +02:00
Jan Friesse
4cd74c8096 qnetd-certutil: Add -G option
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-09 15:05:05 +02:00
Jan Friesse
cb9ea58e00 man: Document NSS database conversion
This is not needed at least for cert8 -> cert9, but it's still nice to
have it documented. Also document NSS_IGNORE_SYSTEM_POLICY=1 workaround.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-09 13:59:44 +02:00
Jan Friesse
a6b587c1ef qdevice-net-certutil: Implement scp wrapper
Standard scp doesn't handle copy of file from remote machine to remote
machine very well when agent forwarding is used and no key exists
between the machines.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-09 13:59:44 +02:00
Jan Friesse
b561a902f7 certutil: Add support for new NSS database format
New NSS database uses files cert9.db, key4.db and pkcs11.txt. Add
support for these files into cert utilities.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-09 13:59:44 +02:00
Jan Friesse
2c3d881b9c gitignore: Add testsuite results
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-09 13:59:43 +02:00
Jan Friesse
37fda20a2f qdevice-cmap: Fix compiler warning on Sparc/ARM
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-08 12:41:20 +02:00
Jan Friesse
d71bfdb3fd tests: Notify process-list after trap was created
Previously there was no waiting for establish of bash trap.
This may result in situation when sigint/term was send before trap
making test fail.

Solution is to catch the sigusr1 and sigusr2 signals in tests and wait
till these signals are sent by bash after trap is established.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-08-08 08:10:49 +02:00
Jan Friesse
466ab62f10 unix-socket: Fix snprintf warning
Base N on sizeof sun_path instead of strlen of input path.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-05-02 15:19:23 +02:00
Jan Friesse
b27e907cbd tests: enlarge process-list timeouts
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-04-27 15:36:10 +02:00
Jan Friesse
2c963e4cc7 tests: process-list add stdlib include
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-04-27 11:10:46 +02:00
Jan Friesse
7defde9414 tests: Fix process-list test to work on FreeBSD
FreeBSD true and false commands are installed in the /usr/bin prefix
instead of Linux /bin.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-04-27 11:03:20 +02:00
Ferenc Wágner
fdbbe724e8 Fix typo: sucesfully -> successfully
Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2018-04-20 12:11:22 +02:00
Bin Liu
5aaabea8f5 qdevice: optarg should be str in init_from_cmap
Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2018-04-19 10:58:26 +02:00
Jan Friesse
a87af76b32 spec: Remove unused clean section
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-04-12 16:10:41 +02:00
Jan Friesse
9e98bf449d msgio: Remove unused code
Blocking version of send was used in the very early phases of qdevice
development and it's not used any longer, so it make sense to delete
it.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-04-03 09:01:26 +02:00
Jan Friesse
347b9405f0 msgio: Fix reading of msg longer than PR_INT32_MAX
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-23 17:23:50 +01:00
Jan Friesse
3b21d7584c qnetd: Replace strtol by strtonum
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-02 13:34:00 +01:00
Jan Friesse
c508183698 qdevice: Replace strtol by strtonum
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-02 13:33:59 +01:00
Jan Friesse
b0c1ef3ade Add safer wrapper of strtoll
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-02 13:33:59 +01:00
Jan Friesse
d5d7b26bff Check if user_data can be dereferenced
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-02 13:33:59 +01:00
Jan Friesse
7d150ecb65 Nodelist is set into string not array
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-02 13:33:59 +01:00
Jan Friesse
4f3763b0f0 Fix NULL pointer dereference
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-02 13:33:59 +01:00
Jan Friesse
164de0a8c0 Quote certutils scripts properly
Also remove unused variables.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-02 13:33:59 +01:00
Jan Friesse
158811557b init: Quote subshell result properly
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-03-02 13:33:59 +01:00