Skip to content

Commit

Permalink
Initialize config with default values if no config file can be parsed
Browse files Browse the repository at this point in the history
If no configuration file is given on the command line and no
system configuration file can be found, initialize the settings to their
default values.

Avoids:

    example.te:           0: (F): Unknown ordering configuration given to C-001 (F-002)
    example.te:           9: (F): Could not find ordering info for line (F-002)
    example.te:          10: (F): Could not find ordering info for line (F-002)
    example.te:          11: (F): Could not find ordering info for line (F-002)
    example.te:          12: (F): Could not find ordering info for line (F-002)
    example.te:          14: (F): Could not find ordering info for line (F-002)
    example.te:          15: (F): Could not find ordering info for line (F-002)
    example.te:          17: (F): Could not find ordering info for line (F-002)
    example.te:          18: (F): Could not find ordering info for line (F-002)
    example.te:          25: (F): Could not find ordering info for line (F-002)
    example.te:          27: (F): Could not find ordering info for line (F-002)
    example.te:          28: (F): Could not find ordering info for line (F-002)
  • Loading branch information
cgzones authored and dburgener committed May 19, 2020
1 parent f0460f1 commit 8155da7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ int main(int argc, char **argv)
// roles that we wouldn't otherwise know about
insert_into_decl_map("system_u", "__assumed__", DECL_USER);
insert_into_decl_map("object_r", "__assumed__", DECL_ROLE);

// initialize to default settings
ccd.order_conf = ORDER_LAX;
ccd.skip_checking_generated_fcs = true;
}

for (const struct string_list *config_check_id = config_disabled_checks; config_check_id; config_check_id = config_check_id->next) {
Expand Down

0 comments on commit 8155da7

Please sign in to comment.