Skip to content

Commit

Permalink
keep-dev-ntsync: block /dev/ntsync by default
Browse files Browse the repository at this point in the history
Restore and use `fs_dev_disable_ntsync()`.
  • Loading branch information
kmk3 committed Feb 23, 2025
1 parent 67e67a9 commit edc5d07
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions etc/profile-m-z/noprofile.profile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ignore read-only /sys/module/nvidia*
allow-debuggers
allusers
keep-config-pulse
keep-dev-ntsync
keep-dev-shm
keep-fd all
keep-var-tmp
Expand Down
1 change: 1 addition & 0 deletions src/firejail/firejail.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ void fs_dev_disable_dvd(void);
void fs_dev_disable_tpm(void);
void fs_dev_disable_u2f(void);
void fs_dev_disable_input(void);
void fs_dev_disable_ntsync(void);

// fs_home.c
// private mode (--private)
Expand Down
9 changes: 9 additions & 0 deletions src/firejail/fs_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,12 @@ void fs_dev_disable_input(void) {
i++;
}
}

void fs_dev_disable_ntsync(void) {
int i = 0;
while (dev[i].dev_fname != NULL) {
if (dev[i].type == DEV_NTSYNC)
disable_file_or_dir(dev[i].dev_fname);
i++;
}
}
3 changes: 3 additions & 0 deletions src/firejail/sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,9 @@ int sandbox(void* sandbox_arg) {
if (arg_noinput)
fs_dev_disable_input();

if (!arg_keep_dev_ntsync)
fs_dev_disable_ntsync();

//****************************
// set DNS
//****************************
Expand Down

0 comments on commit edc5d07

Please sign in to comment.