Skip to content

Commit

Permalink
Turn attempted DBus policy downgrade into warning (fixes netblue30#3408)
Browse files Browse the repository at this point in the history
  • Loading branch information
kris7t committed May 8, 2020
1 parent 28a3d38 commit 9a430b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/firejail/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2065,10 +2065,10 @@ int main(int argc, char **argv, char **envp) {
else if (strncmp("--dbus-user=", argv[i], 12) == 0) {
if (strcmp("filter", argv[i] + 12) == 0) {
if (arg_dbus_user == DBUS_POLICY_BLOCK) {
fprintf(stderr, "Error: Cannot relax --dbus-user policy, it is already set to block\n");
exit(1);
fprintf(stderr, "Warning: Cannot relax --dbus-user policy, it is already set to block\n");
} else {
arg_dbus_user = DBUS_POLICY_FILTER;
}
arg_dbus_user = DBUS_POLICY_FILTER;
} else if (strcmp("none", argv[i] + 12) == 0) {
if (arg_dbus_log_user) {
fprintf(stderr, "Error: --dbus-user.log requires --dbus-user=filter\n");
Expand Down Expand Up @@ -2123,10 +2123,10 @@ int main(int argc, char **argv, char **envp) {
else if (strncmp("--dbus-system=", argv[i], 14) == 0) {
if (strcmp("filter", argv[i] + 14) == 0) {
if (arg_dbus_system == DBUS_POLICY_BLOCK) {
fprintf(stderr, "Error: Cannot relax --dbus-system policy, it is already set to block\n");
exit(1);
fprintf(stderr, "Warning: Cannot relax --dbus-system policy, it is already set to block\n");
} else {
arg_dbus_system = DBUS_POLICY_FILTER;
}
arg_dbus_system = DBUS_POLICY_FILTER;
} else if (strcmp("none", argv[i] + 14) == 0) {
if (arg_dbus_log_system) {
fprintf(stderr, "Error: --dbus-system.log requires --dbus-system=filter\n");
Expand Down
8 changes: 4 additions & 4 deletions src/firejail/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
if (strcmp("filter", ptr) == 0) {
if (arg_dbus_user == DBUS_POLICY_BLOCK) {
fprintf(stderr, "Error: Cannot relax dbus-user policy, it is already set to block\n");
exit(1);
} else {
arg_dbus_user = DBUS_POLICY_FILTER;
}
arg_dbus_user = DBUS_POLICY_FILTER;
} else if (strcmp("none", ptr) == 0) {
if (arg_dbus_log_user) {
fprintf(stderr, "Error: --dbus-user.log requires --dbus-user=filter\n");
Expand Down Expand Up @@ -496,9 +496,9 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
if (strcmp("filter", ptr) == 0) {
if (arg_dbus_system == DBUS_POLICY_BLOCK) {
fprintf(stderr, "Error: Cannot relax dbus-system policy, it is already set to block\n");
exit(1);
} else {
arg_dbus_system = DBUS_POLICY_FILTER;
}
arg_dbus_system = DBUS_POLICY_FILTER;
} else if (strcmp("none", ptr) == 0) {
if (arg_dbus_log_system) {
fprintf(stderr, "Error: --dbus-system.log requires --dbus-system=filter\n");
Expand Down

0 comments on commit 9a430b9

Please sign in to comment.