Fail if wl_client_get_credentials fails on non-FreeBSD systems

This commit is contained in:
emersion 2018-11-08 12:18:12 +01:00
parent 6b200ca7e3
commit fa255aa994
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -68,9 +68,14 @@ static bool global_filter(const struct wl_client *client,
pid_t pid = 0;
wl_client_get_credentials((struct wl_client *)client, &pid, NULL, NULL);
if (pid == 0) {
#ifdef __FreeBSD__
wlr_log(WLR_DEBUG, "Host doesn't support Wayland credentials, "
"cannot enforce security rules");
return true;
#else
wlr_log(WLR_ERROR, "Failed to get Wayland connection credentials");
return false;
#endif
}
char cmd[PATH_MAX + 1];