diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-10-16 11:42:20 +0200 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-10-16 12:16:16 +0200 |
commit | f94f8fde7ec5c96e794772d75bc59b45cea54141 (patch) | |
tree | 4d4e0d97307bfdbd93a5f0b12ab313c2b1ed50c1 | |
parent | ae93c6e6fe5649473116aa081c1acedac10f2be4 (diff) |
sway/ipc: Support multiple users.
-rw-r--r-- | sway/ipc.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -81,7 +81,11 @@ struct sockaddr_un *ipc_user_sockaddr(void) { assert(ipc_sockaddr != NULL); ipc_sockaddr->sun_family = AF_UNIX; - strcpy(ipc_sockaddr->sun_path, "/tmp/sway-ipc.sock"); + + int path_size = sizeof(ipc_sockaddr->sun_path); + + // Without logind: + assert(snprintf(ipc_sockaddr->sun_path, path_size, "/tmp/sway-ipc.%i.sock", getuid()) < path_size); return ipc_sockaddr; } |