aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-01-23 09:53:37 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2017-01-23 09:53:37 -0500
commitd4e006cc1291dbb6a4c2857a0fcb15229bf83b0f (patch)
tree05a7b387dfac1b0e24dd5ca20f8e099d629c8a8e
parentbash completion for --hosts-file (diff)
downloadfirejail-d4e006cc1291dbb6a4c2857a0fcb15229bf83b0f.tar.gz
firejail-d4e006cc1291dbb6a4c2857a0fcb15229bf83b0f.tar.zst
firejail-d4e006cc1291dbb6a4c2857a0fcb15229bf83b0f.zip
fixed access for --hosts-file
-rw-r--r--src/firejail/fs_hostname.c8
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;