Skip to content

Commit

Permalink
Merge pull request #877 from ajeddeloh/selinux-default
Browse files Browse the repository at this point in the history
Turn on SELinux by default, remove dead code
  • Loading branch information
Andrew Jeddeloh authored Oct 18, 2019
2 parents 355c46b + 5a4e5c7 commit 2c1b78a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 69 deletions.
4 changes: 2 additions & 2 deletions internal/distro/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
xfsMkfsCmd = "mkfs.xfs"

// Flags
selinuxRelabel = "false"
selinuxRelabel = "true"
blackboxTesting = "false"
// writeAuthorizedKeysFragment indicates whether to write SSH keys
// specified in the Ignition config as a fragment to
Expand Down Expand Up @@ -84,7 +84,7 @@ func SwapMkfsCmd() string { return swapMkfsCmd }
func VfatMkfsCmd() string { return vfatMkfsCmd }
func XfsMkfsCmd() string { return xfsMkfsCmd }

func SelinuxRelabel() bool { return bakedStringToBool(selinuxRelabel) }
func SelinuxRelabel() bool { return bakedStringToBool(selinuxRelabel) && !BlackboxTesting() }
func BlackboxTesting() bool { return bakedStringToBool(blackboxTesting) }
func WriteAuthorizedKeysFragment() bool {
return bakedStringToBool(fromEnv("WRITE_AUTHORIZED_KEYS_FRAGMENT", writeAuthorizedKeysFragment))
Expand Down
7 changes: 1 addition & 6 deletions tests/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,8 @@ func prepareRootPartitionForPasswd(ctx context.Context, root *types.Partition) e
}

// TODO: use the architecture, not hardcode amd64
// copy to mountPath/usr/bin/id as it's used by Ignition via a chroot to the mountPath
_, err := run(ctx, "cp", "bin/amd64/id-stub", filepath.Join(mountPath, "usr", "bin", "id"))
if err != nil {
return err
}
// TODO: needed for user_group_lookup.c
_, err = run(ctx, "cp", "/lib64/libnss_files.so.2", filepath.Join(mountPath, "usr", "lib64"))
_, err := run(ctx, "cp", "/lib64/libnss_files.so.2", filepath.Join(mountPath, "usr", "lib64"))
return err
}

Expand Down
61 changes: 0 additions & 61 deletions tests/stubs/id-stub/main.go

This file was deleted.

0 comments on commit 2c1b78a

Please sign in to comment.