@@ -808,6 +808,7 @@ static int _write_script_header_to_fd(struct xccdf_policy *policy, struct xccdf_
808
808
const char * format = sys != NULL ? sys : "" ;
809
809
const char * template = sys != NULL ? " --template " : "" ;
810
810
const char * remediation_type = ansible_script ? "Ansible Playbook" : "Bash Remediation Script" ;
811
+ const char * shebang_with_newline = ansible_script ? "" : "#!/bin/bash\n" ;
811
812
812
813
char * fix_header ;
813
814
@@ -857,6 +858,7 @@ static int _write_script_header_to_fd(struct xccdf_policy *policy, struct xccdf_
857
858
}
858
859
859
860
fix_header = oscap_sprintf (
861
+ "%s"
860
862
"###############################################################################\n"
861
863
"#\n"
862
864
"# %s for %s\n"
@@ -879,7 +881,7 @@ static int _write_script_header_to_fd(struct xccdf_policy *policy, struct xccdf_
879
881
"%s\n"
880
882
"#\n"
881
883
"###############################################################################\n\n" ,
882
- remediation_type , profile_title ,
884
+ shebang_with_newline , remediation_type , profile_title ,
883
885
profile_description != NULL ? profile_description : "Not available" ,
884
886
profile_id , benchmark_id , benchmark_version_info , xccdf_version_name ,
885
887
oscap_version , profile_id , template , format , remediation_type ,
@@ -897,6 +899,7 @@ static int _write_script_header_to_fd(struct xccdf_policy *policy, struct xccdf_
897
899
const char * xccdf_version_name = xccdf_version_info_get_version (xccdf_version );
898
900
899
901
fix_header = oscap_sprintf (
902
+ "%s"
900
903
"###############################################################################\n"
901
904
"#\n"
902
905
"# %s generated from evaluation of %s\n"
@@ -915,7 +918,7 @@ static int _write_script_header_to_fd(struct xccdf_policy *policy, struct xccdf_
915
918
"%s\n"
916
919
"#\n"
917
920
"###############################################################################\n\n" ,
918
- remediation_type , profile_title , profile_id , xccdf_version_name ,
921
+ shebang_with_newline , remediation_type , profile_title , profile_id , xccdf_version_name ,
919
922
start_time != NULL ? start_time : "Unknown" , end_time , oscap_version ,
920
923
result_id , template , format , remediation_type , remediation_type , how_to_apply
921
924
);
0 commit comments