msg/Accepter: check setsockopt return value

CCID 716856: Other violation (CHECKED_RETURN)
At (7): Calling function "setsockopt(this->listen_sd, 1, 2, &on, 4U)" without checking return value. This library function may fail and return an error code.

Signed-off-by: Sage Weil <sage@inktank.com>
crypto: fix fd leak from get_random_bytes()

Signed-off-by: Sage Weil <sage@inktank.com>
auth: fix uninit vars

Signed-off-by: Sage Weil <sage@inktank.com>
ceph-dencoder: don't leak object

Signed-off-by: Sage Weil <sage@inktank.com>
librbd: fix delete[]

CID 716902: Non-array delete for scalars (DELETE_ARRAY)
At (15): Deleting array variable "buf" with non-array delete in "delete buf".

Signed-off-by: Sage Weil <sage@inktank.com>
msg/Pipe: make banner buffer slightly bigger

CID 717023: Out-of-bounds access (OVERRUN_DYNAMIC)
At (4): Allocating insufficient memory for the terminating null of the string.

This appears to be a false positive (we don't interpret the buffer as a
string, ever), but it will make coverity happier.

Signed-off-by: Sage Weil <sage@inktank.com>
LogEntry: pass by reference

CID 717030: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter w of type entity_inst_t (size 152 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
common/LogEntry: pass by value for contains()

CID 717031: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter k of type LogEntryKey (size 168 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
log: protect m_stop with lock

CID 716965: Data race condition (MISSING_LOCK)
At (2): Accessing "this->m_stop" ("_ZN4ceph3log3LogE.m_stop") requires the "_ZN4ceph3log3LogE.m_queue_mutex" lock.

This isn't strictly needed since we assume only one thread will call this
method and start a thead, but it makes coverity happy.

Signed-off-by: Sage Weil <sage@inktank.com>
msg/Accepter: move nonce init to ctor

This was suggested by Greg too but I was too lazy.

CID 717331: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "nonce" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
fix accepter bind fix
msg: pass by reference

CID 717048: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter a of type entity_addr_t (size 136 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
msg/Message: fix possible null deref

cct may be null

CID 716930: Dereference after null check (FORWARD_NULL)
At (11): Dereferencing null pointer "cct".

Signed-off-by: Sage Weil <sage@inktank.com>
msg/DispatchQueue: simplify shutdown()

lcok isn't held during dispatch, so we can take it unconditionally.  THis
also makes coverity happier:

CID 716966: Data race condition (MISSING_LOCK)
At (4): Accessing "this->stop" ("DispatchQueue.stop") requires the "Mutex._m" lock.

Signed-off-by: Sage Weil <sage@inktank.com>
paxos: init vars in ctr

At (2): Non-static class member "latest_stashed" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "num_last" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "uncommitted_v" is not initialized in this constructor nor in any functions that it calls.
CID 717330: Uninitialized scalar field (UNINIT_CTOR)
At (8): Non-static class member "uncommitted_pn" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonitorStore: uninit var in ctor

CID 717329: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "lock_fd" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
monclient: uninit var in ctor

CID 717328: Uninitialized scalar field (UNINIT_CTOR) [select defect]
At (2): Non-static class member "newest" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>