mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-16 14:16:16 -06:00
bwrap replacement - part4
This commit is contained in:
parent
582036ba07
commit
180e3f4640
1 changed files with 4 additions and 4 deletions
|
|
@ -716,18 +716,18 @@ void fs_mnt(const int enforce) {
|
|||
// replace /usr/bin/bwrap if present in the system
|
||||
void fs_bwrap(void) {
|
||||
// open bwrap without following symbolic links
|
||||
if (is_link("/usr/bin/bwrap")) // just in case O_NOFOLLOW below failes in glibc
|
||||
if (is_link("/usr/bin/bwrap")) // just in case O_NOFOLLOW below fails in glibc
|
||||
goto out;
|
||||
int fd = open("/usr/bin/bwrap", O_NOFOLLOW|O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
goto out;
|
||||
|
||||
int err = bind_mount_path_to_fd("/usr/lib/firejail/fbwrap", fd);
|
||||
int err = bind_mount_path_to_fd(LIBDIR "/firejail/fbwrap", fd);
|
||||
if (err) {
|
||||
close(fd);
|
||||
goto out;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
close(fd);
|
||||
fprintf(stderr, "Info: /usr/bin/bwrap was disabled\n");
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue