Skip to content

Commit

Permalink
private-lib: check firejail libraries as root user (#4576)
Browse files Browse the repository at this point in the history
users, and fldd in particular, might have no read permission
on the firejail executable, make that ok by running fldd
as root
  • Loading branch information
smitsohu committed Sep 25, 2021
1 parent 05374b0 commit 5025f4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/firejail/fs_lib2.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static void fdir(void) {
NULL,
};

// need to parse as root user, unprivileged users have no read permission on executables
// need to parse as root user, unprivileged users have no read permission on some of these binaries
int i;
for (i = 0; fbin[i]; i++)
fslib_mount_libs(fbin[i], 0);
Expand All @@ -153,7 +153,9 @@ void fslib_install_firejail(void) {
timetrace_start();
// bring in firejail executable libraries, in case we are redirected here
// by a firejail symlink from /usr/local/bin/firejail
fslib_mount_libs(PATH_FIREJAIL, 1); // parse as user
// fldd might have no read permission on the firejail executable
// parse as root in order to support these setups
fslib_mount_libs(PATH_FIREJAIL, 0);

// bring in firejail directory
fdir();
Expand Down

0 comments on commit 5025f4f

Please sign in to comment.