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

* renamed StructCapUserData to StructUserCapData
 * renamed StructCapUserHeader to StructUserCapHeader
 * made StructLinger public (removed from SystemApi)

Bug: 183513856
Test: m droid
Change-Id: I722099aa9ed6b04733330e910a2231275bc358f8
This commit is contained in:
Nikita Iashchenko
2021-04-28 18:11:36 +01:00
parent 0e41945e3a
commit fa36bdff9f
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.StructCapUserData;
import android.system.StructCapUserHeader;
import android.system.StructUserCapData;
import android.system.StructUserCapHeader;
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() {
StructCapUserHeader header = new StructCapUserHeader(
StructUserCapHeader header = new StructUserCapHeader(
OsConstants._LINUX_CAPABILITY_VERSION_3, 0);
StructCapUserData[] data;
StructUserCapData[] 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 StructCapUserData(data[0].effective, data[0].permitted,
data[0] = new StructUserCapData(data[0].effective, data[0].permitted,
data[0].permitted);
data[1] = new StructCapUserData(data[1].effective, data[1].permitted,
data[1] = new StructUserCapData(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.StructCapUserData;
import android.system.StructCapUserHeader;
import android.system.StructUserCapData;
import android.system.StructUserCapHeader;
import android.text.Hyphenator;
import android.util.EventLog;
import android.util.Log;
@@ -742,9 +742,9 @@ public class ZygoteInit {
OsConstants.CAP_BLOCK_SUSPEND
);
/* Containers run without some capabilities, so drop any caps that are not available. */
StructCapUserHeader header = new StructCapUserHeader(
StructUserCapHeader header = new StructUserCapHeader(
OsConstants._LINUX_CAPABILITY_VERSION_3, 0);
StructCapUserData[] data;
StructUserCapData[] data;
try {
data = Os.capget(header);
} catch (ErrnoException ex) {