diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2011-04-01 08:24:13 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2011-04-01 12:00:35 -0700 |
commit | 71ead1835317af5305f9ef87ce06ebdf9cff92e6 (patch) | |
tree | 1808d34fb5c82a1f38e70fe4f4e8f3addce2f242 /init | |
parent | 9f1e0e3ae3108086948b74ce58af32df92ff8331 (diff) | |
download | system_core-71ead1835317af5305f9ef87ce06ebdf9cff92e6.zip system_core-71ead1835317af5305f9ef87ce06ebdf9cff92e6.tar.gz system_core-71ead1835317af5305f9ef87ce06ebdf9cff92e6.tar.bz2 |
Close the client socket early for ctl.* properties.
Bug: 4199411
Change-Id: I3bf335e16e0df8405c538989a8f4f6db7795fa36
Diffstat (limited to 'init')
-rw-r--r-- | init/property_service.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/init/property_service.c b/init/property_service.c index 7fc4f65..c8d6c09 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) |