aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2011-04-01 12:27:04 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-04-01 12:27:04 -0700
commitd6efa4548998174404fe16840d34e24235a4ffaa (patch)
treebe6d465fbd54475440c3f02e41f211a4d05f453c /init
parentab0c4e03565c619a95fd39d3d3ee87c61c0bdb2b (diff)
parent80337ffcf45205750b8b90cbbe28c4c8e7e2baff (diff)
downloadsystem_core-d6efa4548998174404fe16840d34e24235a4ffaa.tar.gz
system_core-d6efa4548998174404fe16840d34e24235a4ffaa.tar.bz2
system_core-d6efa4548998174404fe16840d34e24235a4ffaa.zip
am 80337ffc: am 47e4ee59: am 71ead183: Close the client socket early for ctl.* properties.
* commit '80337ffcf45205750b8b90cbbe28c4c8e7e2baff': Close the client socket early for ctl.* properties.
Diffstat (limited to 'init')
-rw-r--r--init/property_service.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/init/property_service.c b/init/property_service.c
index 7fc4f655..c8d6c098 100644
--- a/init/property_service.c
+++ b/init/property_service.c
@@ -388,6 +388,9 @@ void handle_property_set_fd()
msg.value[PROP_VALUE_MAX-1] = 0;
if(memcmp(msg.name,"ctl.",4) == 0) {
+ // Keep the old close-socket-early behavior when handling
+ // ctl.* properties.
+ close(s);
if (check_control_perms(msg.value, cr.uid, cr.gid)) {
handle_control_message((char*) msg.name + 4, (char*) msg.value);
} else {
@@ -401,17 +404,18 @@ void handle_property_set_fd()
ERROR("sys_prop: permission denied uid:%d name:%s\n",
cr.uid, msg.name);
}
+
+ // Note: bionic's property client code assumes that the
+ // property server will not close the socket until *AFTER*
+ // the property is written to memory.
+ close(s);
}
break;
default:
+ close(s);
break;
}
-
- // Note: bionic's property client code assumes that the property
- // server will not close the socket until *AFTER* the property is
- // written to memory.
- close(s);
}
void get_property_workspace(int *fd, int *sz)