diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2013-08-01 09:40:04 +0800 |
---|---|---|
committer | Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> | 2013-12-12 03:59:16 +0100 |
commit | d33ebd7bc130fb5f567a592e5377d8d9d169e4ba (patch) | |
tree | 6952577c5224f1eaafc47d31129b0e3140b72474 | |
parent | 95c7fb8f9c5a0843e7ec411920910484c0bd37bc (diff) | |
download | native-d33ebd7bc130fb5f567a592e5377d8d9d169e4ba.tar.gz |
installd: insert one backdoor to support boot via nfs
when boot via nfs, we need the install usr on nfs server to have the
chown permission as it does on android. but that's no easy to do with
setting of nfs. so we will make the install to run as root via the
property hack.installd.for.nfs set to 1 when want to boot via nfs
Change-Id: I101849f9b7f55b9e8dd657ae321cf9341ddc7d02
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | cmds/installd/installd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index 1904408f7e..b63c3a26cd 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -525,6 +525,7 @@ int main(const int argc, const char *argv[]) { struct sockaddr addr; socklen_t alen; int lsocket, s, count; + char nfs_hack_flag[PROPERTY_VALUE_MAX]; ALOGI("installd firing up\n"); @@ -538,7 +539,12 @@ int main(const int argc, const char *argv[]) { exit(1); } - drop_privileges(); + property_get("hack.installd.for.nfs", nfs_hack_flag, "0"); + if(!strcmp(nfs_hack_flag, "1")) { + ALOGI("Will not drop the privileges of installd service since hack.installd.for.nfs=%s.\n", nfs_hack_flag); + }else{ + drop_privileges(); + } lsocket = android_get_control_socket(SOCKET_PATH); if (lsocket < 0) { |