diff options
-rw-r--r-- | src/firejail/fs_hostname.c | 8 |
1 files changed, 2 insertions, 6 deletions
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) { | |||
136 | if (is_link(rv)) | 136 | if (is_link(rv)) |
137 | goto errexit; | 137 | goto errexit; |
138 | 138 | ||
139 | // file owned by the user | 139 | // the user has read access to the file |
140 | struct stat s; | 140 | if (access(rv, R_OK)) |
141 | if (stat(rv, &s) == -1) | ||
142 | goto errexit; | ||
143 | |||
144 | if (s.st_uid != getuid()) | ||
145 | goto errexit; | 141 | goto errexit; |
146 | 142 | ||
147 | return rv; | 143 | return rv; |