diff options
author | Simon McVittie <smcv@debian.org> | 2014-11-06 15:56:56 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2014-11-06 15:56:56 +0000 |
commit | d9ad458c3bee6874133711d08a4c69f5c2e017f0 (patch) | |
tree | 5d7c751dbf74d43c458a4f459ac44f82ea207f7a /bus/activation.c | |
parent | 403920f796c3cbeca1bba58bda497da4770e7d0a (diff) | |
parent | fc50a44527cf083da913533360ce4644cd69b243 (diff) | |
download | dbus-d9ad458c3bee6874133711d08a4c69f5c2e017f0.tar.gz |
Imported Upstream version 1.8.10upstream/1.8.10
Diffstat (limited to 'bus/activation.c')
-rw-r--r-- | bus/activation.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/bus/activation.c b/bus/activation.c index 149cca8a..ecd19bb4 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -1688,6 +1688,31 @@ out: return retval; } +static void +child_setup (void *user_data) +{ +#ifdef DBUS_UNIX + BusActivation *activation = user_data; + DBusRLimit *initial_fd_limit; + DBusError error; + + dbus_error_init (&error); + initial_fd_limit = bus_context_get_initial_fd_limit (activation->context); + + if (initial_fd_limit != NULL && + !_dbus_rlimit_restore_fd_limit (initial_fd_limit, &error)) + { + /* unfortunately we don't actually know the service name here */ + bus_context_log (activation->context, + DBUS_SYSTEM_LOG_INFO, + "Failed to reset fd limit before activating " + "service: %s: %s", + error.name, error.message); + } +#endif +} + + dbus_bool_t bus_activation_activate_service (BusActivation *activation, DBusConnection *connection, @@ -2121,7 +2146,8 @@ bus_activation_activate_service (BusActivation *activation, service_name, argv, envp, - NULL, activation, + child_setup, + activation, &tmp_error)) { _dbus_verbose ("Failed to spawn child\n"); |