bwrap replacement - part4

This commit is contained in:
netblue30 2025-12-18 20:22:06 -05:00
parent 582036ba07
commit 180e3f4640

View file

@ -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;