From 8bcd392ee79996f828fd40c52198071ec0f273dd Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 6 Apr 2022 16:47:59 +0100 Subject: On platforms with no way to get peer UID, use getuid(), also fix some failure checks. --- cmd-queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd-queue.c') diff --git a/cmd-queue.c b/cmd-queue.c index 633af06b..6c7c3675 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -569,7 +569,7 @@ cmdq_add_message(struct cmdq_item *item) tmp = cmd_print(item->cmd); if (c != NULL) { uid = proc_get_peer_uid(c->peer); - if (uid != getuid()) { + if (uid != (uid_t)-1 && uid != getuid()) { if ((pw = getpwuid(uid)) != NULL) xasprintf(&user, "[%s]", pw->pw_name); else -- cgit