Revert "Refactor StructCapUser{Header,Data} and StructLinger for API review"

Revert the class rename in master as discussed in http://b/183513856#comment19,
because the API has landed Android S.

This reverts the commit fa36bdff9f

Bug: 183513856
Test: m droid
Change-Id: I38bd8b7a9dad85d993dd432ab8f72995a23550fc
This commit is contained in:
Victor Chang
2021-06-23 17:22:01 +01:00
parent 33d67f0b14
commit 9a285e79f3
2 changed files with 10 additions and 10 deletions

View File

@@ -21,8 +21,8 @@ import android.os.Trace;
import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
import android.system.StructUserCapData;
import android.system.StructUserCapHeader;
import android.system.StructCapUserData;
import android.system.StructCapUserHeader;
import android.util.Slog;
import android.util.TimingsTraceLog;
@@ -187,9 +187,9 @@ public class WrapperInit {
* capabilities, which may make it crash, but not exceed its allowances.
*/
private static void preserveCapabilities() {
StructUserCapHeader header = new StructUserCapHeader(
StructCapUserHeader header = new StructCapUserHeader(
OsConstants._LINUX_CAPABILITY_VERSION_3, 0);
StructUserCapData[] data;
StructCapUserData[] data;
try {
data = Os.capget(header);
} catch (ErrnoException e) {
@@ -199,9 +199,9 @@ public class WrapperInit {
if (data[0].permitted != data[0].inheritable ||
data[1].permitted != data[1].inheritable) {
data[0] = new StructUserCapData(data[0].effective, data[0].permitted,
data[0] = new StructCapUserData(data[0].effective, data[0].permitted,
data[0].permitted);
data[1] = new StructUserCapData(data[1].effective, data[1].permitted,
data[1] = new StructCapUserData(data[1].effective, data[1].permitted,
data[1].permitted);
try {
Os.capset(header, data);

View File

@@ -45,8 +45,8 @@ import android.security.keystore2.AndroidKeyStoreProvider;
import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
import android.system.StructUserCapData;
import android.system.StructUserCapHeader;
import android.system.StructCapUserData;
import android.system.StructCapUserHeader;
import android.text.Hyphenator;
import android.util.EventLog;
import android.util.Log;
@@ -750,9 +750,9 @@ public class ZygoteInit {
OsConstants.CAP_BLOCK_SUSPEND
);
/* Containers run without some capabilities, so drop any caps that are not available. */
StructUserCapHeader header = new StructUserCapHeader(
StructCapUserHeader header = new StructCapUserHeader(
OsConstants._LINUX_CAPABILITY_VERSION_3, 0);
StructUserCapData[] data;
StructCapUserData[] data;
try {
data = Os.capget(header);
} catch (ErrnoException ex) {