Loading services/java/com/android/server/pm/SELinuxMMAC.java +12 −4 Original line number Original line Diff line number Diff line Loading @@ -137,6 +137,14 @@ public final class SELinuxMMAC { } } public static boolean readInstallPolicy() { public static boolean readInstallPolicy() { return readInstallPolicy(MAC_PERMISSIONS); } public static boolean readInstallPolicy(String macPermsPath) { if (macPermsPath == null) { throw new NullPointerException("mac_permissions.xml file path is null"); } // Temp structures to hold the rules while we parse the xml file. // Temp structures to hold the rules while we parse the xml file. // We add all the rules together once we know there's no structural problems. // We add all the rules together once we know there's no structural problems. HashMap<Signature, Policy> sigSeinfo = new HashMap<Signature, Policy>(); HashMap<Signature, Policy> sigSeinfo = new HashMap<Signature, Policy>(); Loading @@ -144,8 +152,8 @@ public final class SELinuxMMAC { FileReader policyFile = null; FileReader policyFile = null; try { try { policyFile = new FileReader(MAC_PERMISSIONS); policyFile = new FileReader(macPermsPath); Slog.d(TAG, "Using policy file " + MAC_PERMISSIONS); Slog.d(TAG, "Using policy file " + macPermsPath); XmlPullParser parser = Xml.newPullParser(); XmlPullParser parser = Xml.newPullParser(); parser.setInput(policyFile); parser.setInput(policyFile); Loading Loading @@ -190,10 +198,10 @@ public final class SELinuxMMAC { } } } } } catch (XmlPullParserException xpe) { } catch (XmlPullParserException xpe) { Slog.w(TAG, "Got exception parsing " + MAC_PERMISSIONS, xpe); Slog.w(TAG, "Got exception parsing " + macPermsPath, xpe); return false; return false; } catch (IOException ioe) { } catch (IOException ioe) { Slog.w(TAG, "Got exception parsing " + MAC_PERMISSIONS, ioe); Slog.w(TAG, "Got exception parsing " + macPermsPath, ioe); return false; return false; } finally { } finally { IoUtils.closeQuietly(policyFile); IoUtils.closeQuietly(policyFile); Loading Loading
services/java/com/android/server/pm/SELinuxMMAC.java +12 −4 Original line number Original line Diff line number Diff line Loading @@ -137,6 +137,14 @@ public final class SELinuxMMAC { } } public static boolean readInstallPolicy() { public static boolean readInstallPolicy() { return readInstallPolicy(MAC_PERMISSIONS); } public static boolean readInstallPolicy(String macPermsPath) { if (macPermsPath == null) { throw new NullPointerException("mac_permissions.xml file path is null"); } // Temp structures to hold the rules while we parse the xml file. // Temp structures to hold the rules while we parse the xml file. // We add all the rules together once we know there's no structural problems. // We add all the rules together once we know there's no structural problems. HashMap<Signature, Policy> sigSeinfo = new HashMap<Signature, Policy>(); HashMap<Signature, Policy> sigSeinfo = new HashMap<Signature, Policy>(); Loading @@ -144,8 +152,8 @@ public final class SELinuxMMAC { FileReader policyFile = null; FileReader policyFile = null; try { try { policyFile = new FileReader(MAC_PERMISSIONS); policyFile = new FileReader(macPermsPath); Slog.d(TAG, "Using policy file " + MAC_PERMISSIONS); Slog.d(TAG, "Using policy file " + macPermsPath); XmlPullParser parser = Xml.newPullParser(); XmlPullParser parser = Xml.newPullParser(); parser.setInput(policyFile); parser.setInput(policyFile); Loading Loading @@ -190,10 +198,10 @@ public final class SELinuxMMAC { } } } } } catch (XmlPullParserException xpe) { } catch (XmlPullParserException xpe) { Slog.w(TAG, "Got exception parsing " + MAC_PERMISSIONS, xpe); Slog.w(TAG, "Got exception parsing " + macPermsPath, xpe); return false; return false; } catch (IOException ioe) { } catch (IOException ioe) { Slog.w(TAG, "Got exception parsing " + MAC_PERMISSIONS, ioe); Slog.w(TAG, "Got exception parsing " + macPermsPath, ioe); return false; return false; } finally { } finally { IoUtils.closeQuietly(policyFile); IoUtils.closeQuietly(policyFile); Loading