OSDN Git Service

Keep also the CAP_NET_RAW capability
authorPal Szasz <pal.szasz@sonyericsson.com>
Thu, 8 Apr 2010 07:24:09 +0000 (09:24 +0200)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 15 Apr 2011 10:24:31 +0000 (18:24 +0800)
This capability is used to open a packet connection, needed by
do_dhcp -> dhcp_init_ifc -> open_raw_socket in libnetutils.

Change-Id: Ib9fcabccea0bef551f93edf6d7f58f31ca748763

rild/rild.c

index c14cbfb..a3d7943 100644 (file)
@@ -93,7 +93,7 @@ void switchUser() {
     struct __user_cap_data_struct cap;
     header.version = _LINUX_CAPABILITY_VERSION;
     header.pid = 0;
-    cap.effective = cap.permitted = 1 << CAP_NET_ADMIN;
+    cap.effective = cap.permitted = (1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW);
     cap.inheritable = 0;
     capset(&header, &cap);
 }