Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

/selinux/enforce may not exist. #7

Description

@jpickwell

The '/selinux/enforce' file may not exist. If it does not, then 'cat' outputs "cat: /selinux/enforce: No such file or directory".

The following patch prevents this:

diff --git a/handle_metadata b/handle_metadata
index d8642c8..9212b70 100755
--- a/handle_metadata
+++ b/handle_metadata
@@ -35,7 +35,7 @@ my $topdir = get_toplevel();
 chdir $topdir
   or die "Unable to change to git top level directory: $!\n";

-my $se_enforcing = qx/cat \/selinux\/enforce/;
+my $se_enforcing = qx/if [[ -f \/selinux\/enforce ]]; then cat \/selinux\/enforce; fi/;

 GetOptions(
   'create-on-missing' => \my $create_on_missing,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions