Remove isV2App

This selector is no longer used.

Bug: 123605817
Bug: 111314398
Test: compiles and boots
Change-Id: Ieb45a797706d3c274922b5b0aa48edf50b646f89
This commit is contained in:
Nick Kralevich 2019-04-16 17:29:42 -07:00
parent 04af6a3c5a
commit 8c158034dd

View file

@ -277,8 +277,6 @@ struct seapp_context {
bool isSystemServer;
bool isEphemeralAppSet;
bool isEphemeralApp;
bool isV2AppSet;
bool isV2App;
bool isOwnerSet;
bool isOwner;
struct prefix_str user;
@ -328,12 +326,6 @@ static int seapp_context_cmp(const void *A, const void *B)
if (s1->isEphemeralAppSet != s2->isEphemeralAppSet)
return (s1->isEphemeralAppSet ? -1 : 1);
/* Give precedence to a specified isV2= over an
* unspecified isV2=. */
if (s1->isV2AppSet != s2->isV2AppSet)
return (s1->isV2AppSet ? -1 : 1);
/* Give precedence to a specified isOwner= over an unspecified isOwner=. */
if (s1->isOwnerSet != s2->isOwnerSet)
return (s1->isOwnerSet ? -1 : 1);
@ -421,7 +413,6 @@ static int seapp_context_cmp(const void *A, const void *B)
(s1->isPrivAppSet && s1->isPrivApp == s2->isPrivApp) &&
(s1->isOwnerSet && s1->isOwner == s2->isOwner) &&
(s1->isSystemServer && s1->isSystemServer == s2->isSystemServer) &&
(s1->isV2AppSet && s1->isV2App == s2->isV2App) &&
(s1->isEphemeralAppSet && s1->isEphemeralApp == s2->isEphemeralApp);
if (dup) {
@ -594,16 +585,6 @@ int selinux_android_seapp_context_reload(void)
free_seapp_context(cur);
goto err;
}
} else if (!strcasecmp(name, "isV2App")) {
cur->isV2AppSet = true;
if (!strcasecmp(value, "true"))
cur->isV2App = true;
else if (!strcasecmp(value, "false"))
cur->isV2App = false;
else {
free_seapp_context(cur);
goto err;
}
} else if (!strcasecmp(name, "isOwner")) {
cur->isOwnerSet = true;
if (!strcasecmp(value, "true"))
@ -789,12 +770,11 @@ int selinux_android_seapp_context_reload(void)
int i;
for (i = 0; i < nspec; i++) {
cur = seapp_contexts[i];
selinux_log(SELINUX_INFO, "%s: isSystemServer=%s isEphemeralApp=%s isV2App=%s isOwner=%s user=%s seinfo=%s "
selinux_log(SELINUX_INFO, "%s: isSystemServer=%s isEphemeralApp=%s isOwner=%s user=%s seinfo=%s "
"name=%s path=%s isPrivApp=%s minTargetSdkVersion=%d fromRunAs=%s -> domain=%s type=%s level=%s levelFrom=%s",
__FUNCTION__,
cur->isSystemServer ? "true" : "false",
cur->isEphemeralAppSet ? (cur->isEphemeralApp ? "true" : "false") : "null",
cur->isV2AppSet ? (cur->isV2App ? "true" : "false") : "null",
cur->isOwnerSet ? (cur->isOwner ? "true" : "false") : "null",
cur->user.str,
cur->seinfo, cur->name.str, cur->path.str,
@ -855,7 +835,6 @@ enum seapp_kind {
#define PRIVILEGED_APP_STR ":privapp"
#define EPHEMERAL_APP_STR ":ephemeralapp"
#define V2_APP_STR ":v2"
#define TARGETSDKVERSION_STR ":targetSdkVersion="
#define FROM_RUNAS_STR ":fromRunAs"
static int32_t get_app_targetSdkVersion(const char *seinfo)
@ -915,7 +894,6 @@ static int seapp_context_lookup(enum seapp_kind kind,
bool isPrivApp = false;
bool isEphemeralApp = false;
int32_t targetSdkVersion = 0;
bool isV2App = false;
bool fromRunAs = false;
char parsedseinfo[BUFSIZ];
@ -926,7 +904,6 @@ static int seapp_context_lookup(enum seapp_kind kind,
goto err;
isPrivApp = strstr(seinfo, PRIVILEGED_APP_STR) ? true : false;
isEphemeralApp = strstr(seinfo, EPHEMERAL_APP_STR) ? true : false;
isV2App = strstr(seinfo, V2_APP_STR) ? true : false;
fromRunAs = strstr(seinfo, FROM_RUNAS_STR) ? true : false;
targetSdkVersion = get_app_targetSdkVersion(seinfo);
if (targetSdkVersion < 0) {
@ -975,9 +952,6 @@ static int seapp_context_lookup(enum seapp_kind kind,
if (cur->isEphemeralAppSet && cur->isEphemeralApp != isEphemeralApp)
continue;
if (cur->isV2AppSet && cur->isV2App != isV2App)
continue;
if (cur->isOwnerSet && cur->isOwner != isOwner)
continue;