Skip to content

Commit

Permalink
Merge pull request #4560 from onny/nolinkcheck
Browse files Browse the repository at this point in the history
Remove /etc/hosts is_link check
  • Loading branch information
netblue30 committed Sep 24, 2021
2 parents 452916a + c2c51e7 commit a5c7189
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/firejail/fs_hostname.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ char *fs_check_hosts_file(const char *fname) {
invalid_filename(fname, 0); // no globbing
char *rv = expand_macros(fname);

// no a link
if (is_link(rv))
goto errexit;

// the user has read access to the file
if (access(rv, R_OK))
goto errexit;
Expand All @@ -119,9 +115,6 @@ void fs_mount_hosts_file(void) {
struct stat s;
if (stat("/etc/hosts", &s) == -1)
goto errexit;
// not a link
if (is_link("/etc/hosts"))
goto errexit;
// owned by root
if (s.st_uid != 0)
goto errexit;
Expand Down

0 comments on commit a5c7189

Please sign in to comment.