From d4e006cc1291dbb6a4c2857a0fcb15229bf83b0f Mon Sep 17 00:00:00 2001 From: netblue30 Date: Mon, 23 Jan 2017 09:53:37 -0500 Subject: fixed access for --hosts-file --- src/firejail/fs_hostname.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/firejail/fs_hostname.c b/src/firejail/fs_hostname.c index ac831f6b9..19af11dd8 100644 --- a/src/firejail/fs_hostname.c +++ b/src/firejail/fs_hostname.c @@ -136,12 +136,8 @@ char *fs_check_hosts_fiile(const char *fname) { if (is_link(rv)) goto errexit; - // file owned by the user - struct stat s; - if (stat(rv, &s) == -1) - goto errexit; - - if (s.st_uid != getuid()) + // the user has read access to the file + if (access(rv, R_OK)) goto errexit; return rv; -- cgit v1.2.3-70-g09d2