diff options
author | 2020-09-12 14:27:01 +0200 | |
---|---|---|
committer | 2020-09-12 14:28:36 +0200 | |
commit | feac8c422b0238b9ba8d69c2e610b86614f5a4af (patch) | |
tree | 8e1217418e2be5177bc9b282df777261a12b91a9 /src | |
parent | some dbus tests (diff) | |
download | firejail-feac8c422b0238b9ba8d69c2e610b86614f5a4af.tar.gz firejail-feac8c422b0238b9ba8d69c2e610b86614f5a4af.tar.zst firejail-feac8c422b0238b9ba8d69c2e610b86614f5a4af.zip |
print errors to stderr and prefix them consistently
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/profile.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index f6ef934db..e010d968d 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c | |||
@@ -461,7 +461,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
461 | else if (strncmp(ptr, "dbus-user.see ", 14) == 0) { | 461 | else if (strncmp(ptr, "dbus-user.see ", 14) == 0) { |
462 | #ifdef HAVE_DBUSPROXY | 462 | #ifdef HAVE_DBUSPROXY |
463 | if (!dbus_check_name(ptr + 14)) { | 463 | if (!dbus_check_name(ptr + 14)) { |
464 | printf("Invalid dbus-user.see name: %s\n", ptr + 15); | 464 | fprintf(stderr, "Invalid dbus-user.see name: %s\n", ptr + 15); |
465 | exit(1); | 465 | exit(1); |
466 | } | 466 | } |
467 | #endif | 467 | #endif |
@@ -470,7 +470,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
470 | else if (strncmp(ptr, "dbus-user.talk ", 15) == 0) { | 470 | else if (strncmp(ptr, "dbus-user.talk ", 15) == 0) { |
471 | #ifdef HAVE_DBUSPROXY | 471 | #ifdef HAVE_DBUSPROXY |
472 | if (!dbus_check_name(ptr + 15)) { | 472 | if (!dbus_check_name(ptr + 15)) { |
473 | printf("Invalid dbus-user.talk name: %s\n", ptr + 15); | 473 | fprintf(stderr, "Error: Invalid dbus-user.talk name: %s\n", ptr + 15); |
474 | exit(1); | 474 | exit(1); |
475 | } | 475 | } |
476 | #endif | 476 | #endif |
@@ -479,7 +479,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
479 | else if (strncmp(ptr, "dbus-user.own ", 14) == 0) { | 479 | else if (strncmp(ptr, "dbus-user.own ", 14) == 0) { |
480 | #ifdef HAVE_DBUSPROXY | 480 | #ifdef HAVE_DBUSPROXY |
481 | if (!dbus_check_name(ptr + 14)) { | 481 | if (!dbus_check_name(ptr + 14)) { |
482 | fprintf(stderr, "Invalid dbus-user.own name: %s\n", ptr + 14); | 482 | fprintf(stderr, "Error: Invalid dbus-user.own name: %s\n", ptr + 14); |
483 | exit(1); | 483 | exit(1); |
484 | } | 484 | } |
485 | #endif | 485 | #endif |
@@ -488,7 +488,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
488 | else if (strncmp(ptr, "dbus-user.call ", 15) == 0) { | 488 | else if (strncmp(ptr, "dbus-user.call ", 15) == 0) { |
489 | #ifdef HAVE_DBUSPROXY | 489 | #ifdef HAVE_DBUSPROXY |
490 | if (!dbus_check_call_rule(ptr + 15)) { | 490 | if (!dbus_check_call_rule(ptr + 15)) { |
491 | fprintf(stderr, "Invalid dbus-user.call rule: %s\n", ptr + 15); | 491 | fprintf(stderr, "Error: Invalid dbus-user.call rule: %s\n", ptr + 15); |
492 | exit(1); | 492 | exit(1); |
493 | } | 493 | } |
494 | #endif | 494 | #endif |
@@ -497,7 +497,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
497 | else if (strncmp(ptr, "dbus-user.broadcast ", 20) == 0) { | 497 | else if (strncmp(ptr, "dbus-user.broadcast ", 20) == 0) { |
498 | #ifdef HAVE_DBUSPROXY | 498 | #ifdef HAVE_DBUSPROXY |
499 | if (!dbus_check_call_rule(ptr + 20)) { | 499 | if (!dbus_check_call_rule(ptr + 20)) { |
500 | fprintf(stderr, "Invalid dbus-user.broadcast rule: %s\n", ptr + 20); | 500 | fprintf(stderr, "Error: Invalid dbus-user.broadcast rule: %s\n", ptr + 20); |
501 | exit(1); | 501 | exit(1); |
502 | } | 502 | } |
503 | #endif | 503 | #endif |
@@ -519,7 +519,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
519 | } | 519 | } |
520 | arg_dbus_system = DBUS_POLICY_BLOCK; | 520 | arg_dbus_system = DBUS_POLICY_BLOCK; |
521 | } else { | 521 | } else { |
522 | fprintf(stderr, "Unknown dbus-system policy: %s\n", ptr); | 522 | fprintf(stderr, "Error: Unknown dbus-system policy: %s\n", ptr); |
523 | exit(1); | 523 | exit(1); |
524 | } | 524 | } |
525 | #endif | 525 | #endif |
@@ -528,7 +528,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
528 | else if (strncmp(ptr, "dbus-system.see ", 16) == 0) { | 528 | else if (strncmp(ptr, "dbus-system.see ", 16) == 0) { |
529 | #ifdef HAVE_DBUSPROXY | 529 | #ifdef HAVE_DBUSPROXY |
530 | if (!dbus_check_name(ptr + 16)) { | 530 | if (!dbus_check_name(ptr + 16)) { |
531 | fprintf(stderr, "Invalid dbus-system.see name: %s\n", ptr + 17); | 531 | fprintf(stderr, "Error: Invalid dbus-system.see name: %s\n", ptr + 17); |
532 | exit(1); | 532 | exit(1); |
533 | } | 533 | } |
534 | #endif | 534 | #endif |
@@ -537,7 +537,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
537 | else if (strncmp(ptr, "dbus-system.talk ", 17) == 0) { | 537 | else if (strncmp(ptr, "dbus-system.talk ", 17) == 0) { |
538 | #ifdef HAVE_DBUSPROXY | 538 | #ifdef HAVE_DBUSPROXY |
539 | if (!dbus_check_name(ptr + 17)) { | 539 | if (!dbus_check_name(ptr + 17)) { |
540 | fprintf(stderr, "Invalid dbus-system.talk name: %s\n", ptr + 17); | 540 | fprintf(stderr, "Error: Invalid dbus-system.talk name: %s\n", ptr + 17); |
541 | exit(1); | 541 | exit(1); |
542 | } | 542 | } |
543 | #endif | 543 | #endif |
@@ -546,7 +546,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
546 | else if (strncmp(ptr, "dbus-system.own ", 16) == 0) { | 546 | else if (strncmp(ptr, "dbus-system.own ", 16) == 0) { |
547 | #ifdef HAVE_DBUSPROXY | 547 | #ifdef HAVE_DBUSPROXY |
548 | if (!dbus_check_name(ptr + 16)) { | 548 | if (!dbus_check_name(ptr + 16)) { |
549 | fprintf(stderr, "Invalid dbus-system.own name: %s\n", ptr + 16); | 549 | fprintf(stderr, "Error: Invalid dbus-system.own name: %s\n", ptr + 16); |
550 | exit(1); | 550 | exit(1); |
551 | } | 551 | } |
552 | #endif | 552 | #endif |
@@ -555,7 +555,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
555 | else if (strncmp(ptr, "dbus-system.call ", 17) == 0) { | 555 | else if (strncmp(ptr, "dbus-system.call ", 17) == 0) { |
556 | #ifdef HAVE_DBUSPROXY | 556 | #ifdef HAVE_DBUSPROXY |
557 | if (!dbus_check_call_rule(ptr + 17)) { | 557 | if (!dbus_check_call_rule(ptr + 17)) { |
558 | fprintf(stderr, "Invalid dbus-system.call rule: %s\n", ptr + 17); | 558 | fprintf(stderr, "Error: Invalid dbus-system.call rule: %s\n", ptr + 17); |
559 | exit(1); | 559 | exit(1); |
560 | } | 560 | } |
561 | #endif | 561 | #endif |
@@ -564,7 +564,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
564 | else if (strncmp(ptr, "dbus-system.broadcast ", 22) == 0) { | 564 | else if (strncmp(ptr, "dbus-system.broadcast ", 22) == 0) { |
565 | #ifdef HAVE_DBUSPROXY | 565 | #ifdef HAVE_DBUSPROXY |
566 | if (!dbus_check_call_rule(ptr + 22)) { | 566 | if (!dbus_check_call_rule(ptr + 22)) { |
567 | fprintf(stderr, "Invalid dbus-system.broadcast rule: %s\n", ptr + 22); | 567 | fprintf(stderr, "Error: Invalid dbus-system.broadcast rule: %s\n", ptr + 22); |
568 | exit(1); | 568 | exit(1); |
569 | } | 569 | } |
570 | #endif | 570 | #endif |
@@ -1472,7 +1472,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
1472 | arg_rlimit_as = 1; | 1472 | arg_rlimit_as = 1; |
1473 | } | 1473 | } |
1474 | else { | 1474 | else { |
1475 | fprintf(stderr, "Invalid rlimit option on line %d\n", lineno); | 1475 | fprintf(stderr, "Error: Invalid rlimit option on line %d\n", lineno); |
1476 | exit(1); | 1476 | exit(1); |
1477 | } | 1477 | } |
1478 | 1478 | ||