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

Commit 4a453733 authored by Robert Craig's avatar Robert Craig
Browse files

Save off the seinfo value with packages.list.



Patch adds the seinfo label per package to the file.
This is of particular interest to the run-as program
which uses the seinfo tag to correctly label the
app security context before running the shell.

Change-Id: I9d7ea47c920b1bc09a19008345ed7fd0aa426e87
Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
parent 2aee33c1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1359,6 +1359,7 @@ final class Settings {
                    // userId     - application-specific user id
                    // debugFlag  - 0 or 1 if the package is debuggable.
                    // dataPath   - path to package's data path
                    // seinfo     - seinfo label for the app (assigned at install time)
                    //
                    // NOTE: We prefer not to expose all ApplicationInfo flags for now.
                    //
@@ -1372,6 +1373,8 @@ final class Settings {
                    sb.append((int)ai.uid);
                    sb.append(isDebug ? " 1 " : " 0 ");
                    sb.append(dataPath);
                    sb.append(" ");
                    sb.append(ai.seinfo);
                    sb.append("\n");
                    str.write(sb.toString().getBytes());
                }
+3 −3
Original line number Diff line number Diff line
@@ -111,9 +111,9 @@ public class PackageManagerSettingsTests extends AndroidTestCase {

    private void writePackagesList() {
        writeFile(new File(getContext().getFilesDir(), "system/packages.list"),
                ( "com.google.app1 11000 0 /data/data/com.google.app1"
                + "com.google.app2 11001 0 /data/data/com.google.app2"
                + "com.android.app3 11030 0 /data/data/com.android.app3")
                ( "com.google.app1 11000 0 /data/data/com.google.app1 seinfo1"
                + "com.google.app2 11001 0 /data/data/com.google.app2 seinfo2"
                + "com.android.app3 11030 0 /data/data/com.android.app3 seinfo3")
                .getBytes());
    }