Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions daemons/attrd/attrd_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ attrd_client_update(pcmk__request_t *request)
*
* \param[in,out] c New connection
* \param[in] uid Client user id
* \param[in] gid Client group id
* \param[in] gid Ignored
*
* \return pcmk_ok on success, -errno otherwise
*/
Expand All @@ -498,7 +498,7 @@ attrd_ipc_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
return -ECONNREFUSED;
}

if (pcmk__new_client(c, uid, gid) == NULL) {
if (pcmk__new_client(c, uid) == NULL) {
return -ENOMEM;
}
return pcmk_ok;
Expand Down
4 changes: 2 additions & 2 deletions daemons/based/based_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static qb_ipcs_service_t *ipcs_rw = NULL;
*
* \param[in,out] c New connection
* \param[in] uid Client user id
* \param[in] gid Client group id
* \param[in] gid Ignored
*
* \return 0 on success, \c -errno otherwise
*/
Expand All @@ -51,7 +51,7 @@ based_ipc_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
}

pcmk__trace("New client connection %p", c);
if (pcmk__new_client(c, uid, gid) == NULL) {
if (pcmk__new_client(c, uid) == NULL) {
return -ENOMEM;
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion daemons/based/based_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ cib_remote_listen(void *user_data)
return 0;
}

new_client = pcmk__new_unauth_client(NULL);
new_client = pcmk__new_unauth_client();
new_client->remote = pcmk__assert_alloc(1, sizeof(pcmk__remote_t));

if (is_tls) {
Expand Down
2 changes: 1 addition & 1 deletion daemons/controld/controld_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ static int32_t
accept_controller_client(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
{
pcmk__trace("Accepting new IPC client connection");
if (pcmk__new_client(c, uid, gid) == NULL) {
if (pcmk__new_client(c, uid) == NULL) {
return -ENOMEM;
}
return 0;
Expand Down
4 changes: 2 additions & 2 deletions daemons/execd/execd_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ static qb_ipcs_service_t *ipcs = NULL;
*
* \param[in,out] c New connection
* \param[in] uid Client user id
* \param[in] gid Client group id
* \param[in] gid Ignored
*
* \return 0 on success, -errno otherwise
*/
static int32_t
execd_ipc_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
{
pcmk__trace("New client connection %p", c);
if (pcmk__new_client(c, uid, gid) == NULL) {
if (pcmk__new_client(c, uid) == NULL) {
return -ENOMEM;
}
return 0;
Expand Down
29 changes: 13 additions & 16 deletions daemons/execd/remoted_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,36 @@ ipc_proxy_get_provider(void)
*
* \param[in,out] c New connection
* \param[in] uid Client user id
* \param[in] gid Client group id
* \param[in] ipc_channel Name of IPC server to proxy
*
* \return 0 on success, -errno on error
*/
static int32_t
ipc_proxy_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid, const char *ipc_channel)
ipc_proxy_accept(qb_ipcs_connection_t *c, uid_t uid, const char *ipc_channel)
{
pcmk__client_t *client = NULL;
pcmk__client_t *ipc_proxy = ipc_proxy_get_provider();
xmlNode *msg = NULL;

if (ipc_proxy == NULL) {
pcmk__warn("Cannot proxy IPC connection from uid %d gid %d to %s "
"because not connected to cluster",
uid, gid, ipc_channel);
pcmk__warn("Cannot proxy IPC connection from uid %lld to %s because "
"not connected to cluster", (long long) uid, ipc_channel);
return -EREMOTEIO;
}

/* This new client is a local IPC client on a Pacemaker Remote controlled
* node, needing to access cluster node IPC services.
*/
client = pcmk__new_client(c, uid, gid);
client = pcmk__new_client(c, uid);
if (client == NULL) {
return -ENOMEM;
}

/* This ipc client is bound to a single ipc provider. If the
* provider goes away, this client is disconnected */
client->userdata = pcmk__str_copy(ipc_proxy->id);
client->name = pcmk__assert_asprintf("proxy-%s-%d-%.8s", ipc_channel,
client->pid, client->id);
client->name = pcmk__assert_asprintf("proxy-%s-%lld-%.8s", ipc_channel,
(long long) client->pid, client->id);

/* Allow remote executor to distinguish between proxied local clients and
* actual executor API clients
Expand All @@ -115,28 +113,27 @@ ipc_proxy_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid, const char *ipc_
pcmk__xe_set(msg, PCMK__XA_LRMD_IPC_SESSION, client->id);
lrmd_server_send_notify(ipc_proxy, msg);
pcmk__xml_free(msg);
pcmk__debug("Accepted IPC proxy connection (session ID %s) from uid %d "
"gid %d on channel %s",
client->id, uid, gid, ipc_channel);
pcmk__debug("Accepted IPC proxy connection (session ID %s) from uid %lld "
"on channel %s", client->id, (long long) uid, ipc_channel);
return 0;
}

static int32_t
crmd_proxy_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
{
return ipc_proxy_accept(c, uid, gid, CRM_SYSTEM_CRMD);
return ipc_proxy_accept(c, uid, CRM_SYSTEM_CRMD);
}

static int32_t
attrd_proxy_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
{
return ipc_proxy_accept(c, uid, gid, PCMK__VALUE_ATTRD);
return ipc_proxy_accept(c, uid, PCMK__VALUE_ATTRD);
}

static int32_t
fencer_proxy_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
{
return ipc_proxy_accept(c, uid, gid, "stonith-ng");
return ipc_proxy_accept(c, uid, "stonith-ng");
}

static int32_t
Expand All @@ -148,13 +145,13 @@ pacemakerd_proxy_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
static int32_t
cib_proxy_accept_rw(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
{
return ipc_proxy_accept(c, uid, gid, PCMK__SERVER_BASED_RW);
return ipc_proxy_accept(c, uid, PCMK__SERVER_BASED_RW);
}

static int32_t
cib_proxy_accept_ro(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
{
return ipc_proxy_accept(c, uid, gid, PCMK__SERVER_BASED_RO);
return ipc_proxy_accept(c, uid, PCMK__SERVER_BASED_RO);
}

int
Expand Down
2 changes: 1 addition & 1 deletion daemons/execd/remoted_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ lrmd_remote_listen(void *data)
return TRUE;
}

new_client = pcmk__new_unauth_client(NULL);
new_client = pcmk__new_unauth_client();
new_client->remote = pcmk__assert_alloc(1, sizeof(pcmk__remote_t));
pcmk__set_client_flags(new_client, pcmk__client_tls);
new_client->remote->tls_session = session;
Expand Down
4 changes: 2 additions & 2 deletions daemons/fenced/fenced_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ handle_ipc_reply(pcmk__client_t *client, xmlNode *request)
*
* \param[in,out] c New connection
* \param[in] uid Client user id
* \param[in] gid Client group id
* \param[in] gid Ignored
*
* \return 0 on success, -errno otherwise
*/
Expand All @@ -71,7 +71,7 @@ fenced_ipc_accept(qb_ipcs_connection_t *c, uid_t uid, gid_t gid)
return -ECONNREFUSED;
}

if (pcmk__new_client(c, uid, gid) == NULL) {
if (pcmk__new_client(c, uid) == NULL) {
return -ENOMEM;
}
return 0;
Expand Down
4 changes: 2 additions & 2 deletions daemons/pacemakerd/pacemakerd.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ main(int argc, char **argv)
}

#if SUPPORT_COROSYNC
if (pacemakerd_read_config() == FALSE) {
if (!pacemakerd_corosync_read_config()) {
crm_exit(CRM_EX_UNAVAILABLE);
}
#endif
Expand All @@ -436,7 +436,7 @@ main(int argc, char **argv)

#if SUPPORT_COROSYNC
/* Allows us to block shutdown */
if (!cluster_connect_cfg()) {
if (!pacemakerd_corosync_connect_cfg()) {
exit_code = CRM_EX_PROTOCOL;
goto done;
}
Expand Down
Loading