They return SIGPIPE when send is used with a closed socket. A SIGPIPE handler
must be used or SIGPIPE should be set ignored with SIG_IGN. In this case send
returns -1 instead of a SIGPIPE. The setting to ignore SIGPIPE is global and
should be used only where it is absolutely necessary.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Linux doesn't pass credential information by default, only when it has
been specifically requested with SO_PASSCRED. This means there's a
race between when the ipc server side has set up and is listening on the
socket, and when the client may connect; if the client connects and sends
its first message before the server has set SO_PASSCRED on the socket,
then there will be no ucred information associated with the message.
The fix is to set SO_PASSCRED on the client socket as well, so that
the message will always have a ucred associated with it when the server
reads it.
Without this change, around 1% of cpg_model_initialize() calls fail
with CS_ERR_ACCESS.
(This Linux behaviour was introduced just on a year ago in
16e5726269611b71c930054ffe9b858c1cea88eb "af_unix: dont send
SCM_CREDENTIALS by default".)
the strlcat was not call correctly, it needs the
original string to find the end and return the
correct length.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Two issues:
1. when writing out the function name length, don't just write the 4 MSB
of the size
2. when reading the time, don't just use the 4 MSB of the time as the
timestamp; the log contains a full time_t, so we may as well use it.
LIB_RT is unnecessary around. AC_CHECK_LIBS will do the right thing
similar for the other libs that are all exported via LIBS
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
this is required for all systems that don't use bash for /bin/sh
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
It seems like poll() was not producing a POLLHUP
so we rely on qb_ipc_us_recv() returning -ENOTCONN.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This is just too painful for buildsystems like koji and travis.
You can't get access to the detailed output (error logs) that
otherwise be printed to screen.
I can't find a way to disable them on the command line (that
would be the best solution).
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Here's another fix.
In adjusting the printf, I added a cast and switched to %5ld.
I would have preferred to use %5jd as the printf format (i.e., then no
cast is needed), but saw no other uses of the "j" directive, so perhaps
you do not yet depend on printf with such support.
From 6d5d3af35d1f6851537f7af8996d1106c1ebe435 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 18 Jul 2012 17:54:38 +0200
Subject: [PATCH] tests/rbwriter: don't ignore write failure
Spotted by coverity:
This less-than-zero comparison of an unsigned value is never true.
"res < 0U".
http://libqb.org/html/0.14.1/coverity/1/7rbwriter.c.html#error
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>