diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-10-16 09:23:24 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-16 09:23:24 +0000 |
commit | d04d6c91a311af7a52f05fac5935c9327a990046 (patch) | |
tree | 0855786b837104bba8fa327dc92d915e1423de2a /services | |
parent | ffd7335088d228ac0c56fdc7e2faba79c78572bf (diff) | |
parent | b7d8514822aefbf8274f5464dc12cee151e2b78b (diff) | |
download | frameworks_base-d04d6c91a311af7a52f05fac5935c9327a990046.zip frameworks_base-d04d6c91a311af7a52f05fac5935c9327a990046.tar.gz frameworks_base-d04d6c91a311af7a52f05fac5935c9327a990046.tar.bz2 |
am b7d85148: Merge "Allow root and system to bypass the always-on VPN firewall rules" into lmp-dev
* commit 'b7d8514822aefbf8274f5464dc12cee151e2b78b':
Allow root and system to bypass the always-on VPN firewall rules
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/net/LockdownVpnTracker.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/net/LockdownVpnTracker.java b/services/core/java/com/android/server/net/LockdownVpnTracker.java index cf0aba4..3a1e4a4 100644 --- a/services/core/java/com/android/server/net/LockdownVpnTracker.java +++ b/services/core/java/com/android/server/net/LockdownVpnTracker.java @@ -35,6 +35,7 @@ import android.os.INetworkManagementService; import android.os.RemoteException; import android.security.Credentials; import android.security.KeyStore; +import android.system.Os; import android.text.TextUtils; import android.util.Slog; @@ -64,6 +65,8 @@ public class LockdownVpnTracker { private static final String ACTION_VPN_SETTINGS = "android.net.vpn.SETTINGS"; private static final String EXTRA_PICK_LOCKDOWN = "android.net.vpn.PICK_LOCKDOWN"; + private static final int ROOT_UID = 0; + private final Context mContext; private final INetworkManagementService mNetService; private final ConnectivityService mConnService; @@ -193,6 +196,9 @@ public class LockdownVpnTracker { setFirewallEgressSourceRule(addr, true); } + mNetService.setFirewallUidRule(ROOT_UID, true); + mNetService.setFirewallUidRule(Os.getuid(), true); + mErrorCount = 0; mAcceptedIface = iface; mAcceptedSourceAddr = sourceAddrs; @@ -279,6 +285,10 @@ public class LockdownVpnTracker { for (LinkAddress addr : mAcceptedSourceAddr) { setFirewallEgressSourceRule(addr, false); } + + mNetService.setFirewallUidRule(ROOT_UID, false); + mNetService.setFirewallUidRule(Os.getuid(), false); + mAcceptedSourceAddr = null; } } catch (RemoteException e) { |