mirror of
https://github.com/tmux/tmux.git
synced 2025-09-09 19:41:55 +00:00
On platforms with no way to get peer UID, use getuid(), also fix some failure
checks.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user