launcher-direct: warn when opening devices non-root

Warn the user that this is not supposed to work. Developers who know
what they are doing know to ignore this message, others should think
twice.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 4 years ago committed by Pekka Paalanen
parent 4e9f4d0474
commit 2d738b856d
  1. 6
      libweston/launcher-direct.c

@ -232,6 +232,12 @@ launcher_direct_open(struct weston_launcher *launcher_base, const char *path, in
if (fd == -1) if (fd == -1)
return -1; return -1;
if (geteuid() != 0) {
weston_log("WARNING! Succeeded opening %s as non-root user."
" This implies your device can be spied on.\n",
path);
}
if (fstat(fd, &s) == -1) { if (fstat(fd, &s) == -1) {
close(fd); close(fd);
return -1; return -1;

Loading…
Cancel
Save