pluto: Switch to user 'vpn' on Android.
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@
|
||||
#include <threading/thread.h>
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <private/android_filesystem_config.h>
|
||||
#include <private/android_filesystem_config.h> /* for AID_VPN */
|
||||
#endif
|
||||
|
||||
#ifndef LOG_AUTHPRIV /* not defined on OpenSolaris */
|
||||
|
||||
@@ -81,6 +81,10 @@
|
||||
#include "whack_attribute.h"
|
||||
#include "pluto.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <private/android_filesystem_config.h> /* for AID_VPN */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Number of threads in the thread pool, if not specified in config.
|
||||
*/
|
||||
@@ -739,6 +743,13 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef ANDROID
|
||||
if (setuid(AID_VPN) != 0)
|
||||
{
|
||||
plog("unable to change daemon user");
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CAPABILITIES_LIBCAP
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user