[libqb] [asalkeld/libqb] b79f8c: ipc_us: clear request unused fields

Angus Salkeld asalkeld at redhat.com
Thu Sep 6 01:36:56 UTC 2012


  Branch: refs/heads/master
  Home:   https://github.com/asalkeld/libqb
  Commit: b79f8ceb1e5e691906878c1c39eca7c2b5420224
      https://github.com/asalkeld/libqb/commit/b79f8ceb1e5e691906878c1c39eca7c2b5420224
  Author: Jeremy Fitzhardinge <jeremy at exablox.com>
  Date:   2012-09-05 (Wed, 05 Sep 2012)

  Changed paths:
    M lib/ipc_us.c

  Log Message:
  -----------
  ipc_us: clear request unused fields

Clear unused request fields and padding so that valgrind doesn't complain
about undefined data being sent over the socket.


  Commit: 6d75ccba6f2ebff3c3485f7e2dfceeda38c62c1b
      https://github.com/asalkeld/libqb/commit/6d75ccba6f2ebff3c3485f7e2dfceeda38c62c1b
  Author: Jeremy Fitzhardinge <jeremy at exablox.com>
  Date:   2012-09-05 (Wed, 05 Sep 2012)

  Changed paths:
    M lib/ipc_us.c

  Log Message:
  -----------
  ipc_us: on Linux, set SO_PASSCRED on the sending socket too

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".)


  Commit: 20a707586280cf57d97e56f55fc190cf4dcde180
      https://github.com/asalkeld/libqb/commit/20a707586280cf57d97e56f55fc190cf4dcde180
  Author: Jeremy Fitzhardinge <jeremy at exablox.com>
  Date:   2012-09-05 (Wed, 05 Sep 2012)

  Changed paths:
    M lib/ipc_us.c

  Log Message:
  -----------
  ipc_us: slightly more robust cmsg handling

Cope with multiple cmsg structures in the received msg.


  Commit: 3fcdb5db77d285a7594d0b716253f97888791ba6
      https://github.com/asalkeld/libqb/commit/3fcdb5db77d285a7594d0b716253f97888791ba6
  Author: Angus Salkeld <asalkeld at redhat.com>
  Date:   2012-09-05 (Wed, 05 Sep 2012)

  Changed paths:
    M lib/ipc_us.c

  Log Message:
  -----------
  Merge pull request #42 from jsgf/master

Three fixes for ipc_us.c


Compare: https://github.com/asalkeld/libqb/compare/951c9826f8a7...3fcdb5db77d2


More information about the quarterback-devel mailing list