Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 856df42a authored by Stephen Smalley's avatar Stephen Smalley
Browse files

Remove setEnforcingMode from SELinuxPolicyInstallReceiver.



It never worked anyhow, at least in AOSP, as nothing checks that property,
and is pointless now that enforcing mode is set by init.

Change-Id: If05dd49963c5d7081e00039b5e378032bea0939b
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
parent f226bc60
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -125,25 +125,11 @@ public class SELinuxPolicyInstallReceiver extends ConfigUpdateInstallReceiver {
        SystemProperties.set("selinux.reload_policy", "1");
    }

    private void setEnforcingMode(Context context) {
        String mode = Settings.Global.getString(context.getContentResolver(),
            Settings.Global.SELINUX_STATUS);
        if ("1".equals(mode)) {
            Slog.i(TAG, "Setting enforcing mode");
            SystemProperties.set("persist.selinux.enforcing", mode);
        } else if ("0".equals(mode)) {
            Slog.i(TAG, "Tried to set permissive mode, ignoring");
        } else {
            Slog.e(TAG, "Got invalid enforcing mode: " + mode);
        }
    }

    @Override
    protected void postInstall(Context context, Intent intent) {
        try {
            unpackBundle();
            applyUpdate();
            setEnforcingMode(context);
        } catch (IllegalArgumentException e) {
            Slog.e(TAG, "SELinux policy update malformed: ", e);
        } catch (IOException e) {