Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (57 sloc) 2.12 KB
From be0a649a2d665cf02561204bb7959851d36235a6 Mon Sep 17 00:00:00 2001
From: Jianzheng Zhou <jianzheng.zhou@freescale.com>
Date: Wed, 31 Jul 2013 12:16:05 +0800
Subject: [PATCH 13/30] ENGR00233809: Ethernet:fix two NFS issues as
filesystem
Introduce property "ro.nfs.mode" default no to control two cases which will
broken NFS boot as filesystem.
1.For android4.2,drop_privilege in installd will let it have no permission
to install packages because of security policy's limitation in NFSV3.
2.Another case is suspend/resume in NFS mount.it will report "nfs: server
10.192.*.* not responding, still trying",This is caused by clearing ethernet
interface addresses. so the netd will not pass ethernet's link up message to
framework. In this case, no need to clear it for we keep on connecting to the
same network and no need to do dhcp again.
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
---
cmds/installd/installd.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 1904408..d9f8cee 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -1,5 +1,6 @@
/*
** Copyright 2008, The Android Open Source Project
+** Copyright (C) 2013 Freescale Semiconductor, Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@@ -16,6 +17,7 @@
#include <sys/capability.h>
#include <linux/prctl.h>
+#include <cutils/properties.h>
#include "installd.h"
@@ -520,6 +522,15 @@ static void drop_privileges() {
}
}
+static bool isNFSbooted() {
+ char prop_value[PROPERTY_VALUE_MAX] = {'\0'};
+ if (property_get("ro.nfs.mode", prop_value, "no")) {
+ if (strcmp(prop_value, "yes") == 0)
+ return true;
+ }
+ return false;
+}
+
int main(const int argc, const char *argv[]) {
char buf[BUFFER_MAX];
struct sockaddr addr;
@@ -538,6 +549,7 @@ int main(const int argc, const char *argv[]) {
exit(1);
}
+ if (!isNFSbooted())
drop_privileges();
lsocket = android_get_control_socket(SOCKET_PATH);
--
1.8.0