Lines Matching refs:context

79   BusContext *context;  member
87 BusContext *context; in server_get_context() local
100 context = bd->context; in server_get_context()
104 return context; in server_get_context()
112 BusContext *context; in add_server_watch() local
114 context = server_get_context (server); in add_server_watch()
116 return _dbus_loop_add_watch (context->loop, watch); in add_server_watch()
124 BusContext *context; in remove_server_watch() local
126 context = server_get_context (server); in remove_server_watch()
128 _dbus_loop_remove_watch (context->loop, watch); in remove_server_watch()
136 BusContext *context; in toggle_server_watch() local
138 context = server_get_context (server); in toggle_server_watch()
140 _dbus_loop_toggle_watch (context->loop, watch); in toggle_server_watch()
148 BusContext *context; in add_server_timeout() local
150 context = server_get_context (server); in add_server_timeout()
152 return _dbus_loop_add_timeout (context->loop, timeout); in add_server_timeout()
160 BusContext *context; in remove_server_timeout() local
162 context = server_get_context (server); in remove_server_timeout()
164 _dbus_loop_remove_timeout (context->loop, timeout); in remove_server_timeout()
172 BusContext *context = data; in new_connection_callback() local
174 if (!bus_connections_setup_connection (context->connections, new_connection)) in new_connection_callback()
187 context->limits.max_incoming_bytes); in new_connection_callback()
190 context->limits.max_message_size); in new_connection_callback()
193 context->limits.max_incoming_unix_fds); in new_connection_callback()
196 context->limits.max_message_unix_fds); in new_connection_callback()
199 context->allow_anonymous); in new_connection_callback()
213 setup_server (BusContext *context, in setup_server() argument
230 bd->context = context; in setup_server()
240 context, NULL); in setup_server()
271 process_config_first_time_only (BusContext *context, in process_config_first_time_only() argument
295 context->systemd_activation = TRUE; in process_config_first_time_only()
297 context->systemd_activation = FALSE; in process_config_first_time_only()
345 context->pidfile = _dbus_strdup (pidfile); in process_config_first_time_only()
349 context->type = _dbus_strdup (bus_config_parser_get_type (parser)); in process_config_first_time_only()
350 if (bus_config_parser_get_type (parser) != NULL && context->type == NULL) in process_config_first_time_only()
356 context->user = _dbus_strdup (user); in process_config_first_time_only()
357 if (context->user == NULL) in process_config_first_time_only()
364 if (context->type && !strcmp (context->type, "system")) in process_config_first_time_only()
369 else if (context->type && !strcmp (context->type, "session")) in process_config_first_time_only()
393 if (!_dbus_string_steal_data (&log_prefix, &context->log_prefix)) in process_config_first_time_only()
438 else if (!setup_server (context, server, auth_mechanisms, error)) in process_config_first_time_only()
444 if (!_dbus_list_append (&context->servers, server)) in process_config_first_time_only()
462 else if (!setup_server (context, server, auth_mechanisms, error)) in process_config_first_time_only()
468 if (!_dbus_list_append (&context->servers, server)) in process_config_first_time_only()
475 context->fork = bus_config_parser_get_fork (parser); in process_config_first_time_only()
476 context->syslog = bus_config_parser_get_syslog (parser); in process_config_first_time_only()
477 context->keep_umask = bus_config_parser_get_keep_umask (parser); in process_config_first_time_only()
478 context->allow_anonymous = bus_config_parser_get_allow_anonymous (parser); in process_config_first_time_only()
500 process_config_every_time (BusContext *context, in process_config_every_time() argument
526 bus_config_parser_get_limits (parser, &context->limits); in process_config_every_time()
528 if (context->policy) in process_config_every_time()
529 bus_policy_unref (context->policy); in process_config_every_time()
530 context->policy = bus_config_parser_steal_policy (parser); in process_config_every_time()
531 _dbus_assert (context->policy != NULL); in process_config_every_time()
536 link = _dbus_list_get_last_link (&context->servers); in process_config_every_time()
564 link = _dbus_list_get_prev_link (&context->servers, link); in process_config_every_time()
568 dbus_free (context->address); in process_config_every_time()
570 if (!_dbus_string_copy_data (&full_address, &context->address)) in process_config_every_time()
590 dbus_free(context->servicehelper); in process_config_every_time()
591 context->servicehelper = s; in process_config_every_time()
595 if (context->activation) in process_config_every_time()
597 if (!bus_activation_reload (context->activation, &full_address, dirs, error)) in process_config_every_time()
602 context->activation = bus_activation_new (context, &full_address, dirs, error); in process_config_every_time()
605 if (context->activation == NULL) in process_config_every_time()
650 raise_file_descriptor_limit (BusContext *context) in raise_file_descriptor_limit() argument
660 limit = context->limits.max_completed_connections + in raise_file_descriptor_limit()
661 context->limits.max_incomplete_connections in raise_file_descriptor_limit()
668 process_config_postinit (BusContext *context, in process_config_postinit() argument
675 raise_file_descriptor_limit (context); in process_config_postinit()
678 if (!bus_registry_set_service_context_table (context->registry, in process_config_postinit()
698 bus_set_watched_dirs (context, &watched_dirs); in process_config_postinit()
713 BusContext *context; in bus_context_new() local
721 context = NULL; in bus_context_new()
730 context = dbus_new0 (BusContext, 1); in bus_context_new()
731 if (context == NULL) in bus_context_new()
736 context->refcount = 1; in bus_context_new()
738 _dbus_generate_uuid (&context->uuid); in bus_context_new()
740 if (!_dbus_string_copy_data (config_file, &context->config_file)) in bus_context_new()
746 context->loop = _dbus_loop_new (); in bus_context_new()
747 if (context->loop == NULL) in bus_context_new()
753 context->registry = bus_registry_new (context); in bus_context_new()
754 if (context->registry == NULL) in bus_context_new()
767 if (!process_config_first_time_only (context, parser, address, flags, error)) in bus_context_new()
772 if (!process_config_every_time (context, parser, FALSE, error)) in bus_context_new()
792 const char *a = bus_context_get_address (context); in bus_context_new()
829 context->connections = bus_connections_new (context); in bus_context_new()
830 if (context->connections == NULL) in bus_context_new()
836 context->matchmaker = bus_matchmaker_new (); in bus_context_new()
837 if (context->matchmaker == NULL) in bus_context_new()
844 if (context->user != NULL) in bus_context_new()
846 if (!_dbus_verify_daemon_user (context->user)) in bus_context_new()
850 context->user); in bus_context_new()
860 if (context->pidfile) in bus_context_new()
861 _dbus_string_init_const (&u, context->pidfile); in bus_context_new()
863 if (((flags & BUS_CONTEXT_FLAG_FORK_NEVER) == 0 && context->fork) || in bus_context_new()
868 if (!_dbus_become_daemon (context->pidfile ? &u : NULL, in bus_context_new()
871 context->keep_umask)) in bus_context_new()
886 if (!_dbus_write_pid_to_file_and_pipe (context->pidfile ? &u : NULL, in bus_context_new()
896 if (((flags & BUS_CONTEXT_FLAG_FORK_NEVER) == 0 && context->fork) || in bus_context_new()
902 context->keep_umask)) in bus_context_new()
917 …bus_context_log (context, DBUS_SYSTEM_LOG_FATAL, "SELinux enabled but AVC initialization failed; c… in bus_context_new()
920 if (!process_config_postinit (context, parser, error)) in bus_context_new()
935 if (context->user != NULL) in bus_context_new()
937 if (!_dbus_change_to_daemon_user (context->user, error)) in bus_context_new()
951 return context; in bus_context_new()
956 if (context != NULL) in bus_context_new()
957 bus_context_unref (context); in bus_context_new()
966 bus_context_get_id (BusContext *context, in bus_context_get_id() argument
969 return _dbus_uuid_encode (&context->uuid, uuid); in bus_context_get_id()
973 bus_context_reload_config (BusContext *context, in bus_context_reload_config() argument
984 _dbus_string_init_const (&config_file, context->config_file); in bus_context_reload_config()
992 if (!process_config_every_time (context, parser, TRUE, error)) in bus_context_reload_config()
997 if (!process_config_postinit (context, parser, error)) in bus_context_reload_config()
1004 bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Reloaded configuration"); in bus_context_reload_config()
1007 …bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Unable to reload configuration: %s", error->messa… in bus_context_reload_config()
1014 shutdown_server (BusContext *context, in shutdown_server() argument
1023 context, in shutdown_server()
1029 context, in shutdown_server()
1037 bus_context_shutdown (BusContext *context) in bus_context_shutdown() argument
1041 link = _dbus_list_get_first_link (&context->servers); in bus_context_shutdown()
1044 shutdown_server (context, link->data); in bus_context_shutdown()
1046 link = _dbus_list_get_next_link (&context->servers, link); in bus_context_shutdown()
1051 bus_context_ref (BusContext *context) in bus_context_ref() argument
1053 _dbus_assert (context->refcount > 0); in bus_context_ref()
1054 context->refcount += 1; in bus_context_ref()
1056 return context; in bus_context_ref()
1060 bus_context_unref (BusContext *context) in bus_context_unref() argument
1062 _dbus_assert (context->refcount > 0); in bus_context_unref()
1063 context->refcount -= 1; in bus_context_unref()
1065 if (context->refcount == 0) in bus_context_unref()
1069 _dbus_verbose ("Finalizing bus context %p\n", context); in bus_context_unref()
1071 bus_context_shutdown (context); in bus_context_unref()
1073 if (context->connections) in bus_context_unref()
1075 bus_connections_unref (context->connections); in bus_context_unref()
1076 context->connections = NULL; in bus_context_unref()
1079 if (context->registry) in bus_context_unref()
1081 bus_registry_unref (context->registry); in bus_context_unref()
1082 context->registry = NULL; in bus_context_unref()
1085 if (context->activation) in bus_context_unref()
1087 bus_activation_unref (context->activation); in bus_context_unref()
1088 context->activation = NULL; in bus_context_unref()
1091 link = _dbus_list_get_first_link (&context->servers); in bus_context_unref()
1096 link = _dbus_list_get_next_link (&context->servers, link); in bus_context_unref()
1098 _dbus_list_clear (&context->servers); in bus_context_unref()
1100 if (context->policy) in bus_context_unref()
1102 bus_policy_unref (context->policy); in bus_context_unref()
1103 context->policy = NULL; in bus_context_unref()
1106 if (context->loop) in bus_context_unref()
1108 _dbus_loop_unref (context->loop); in bus_context_unref()
1109 context->loop = NULL; in bus_context_unref()
1112 if (context->matchmaker) in bus_context_unref()
1114 bus_matchmaker_unref (context->matchmaker); in bus_context_unref()
1115 context->matchmaker = NULL; in bus_context_unref()
1118 dbus_free (context->config_file); in bus_context_unref()
1119 dbus_free (context->log_prefix); in bus_context_unref()
1120 dbus_free (context->type); in bus_context_unref()
1121 dbus_free (context->address); in bus_context_unref()
1122 dbus_free (context->user); in bus_context_unref()
1123 dbus_free (context->servicehelper); in bus_context_unref()
1126 if (context->pidfile) in bus_context_unref()
1129 _dbus_string_init_const (&u, context->pidfile); in bus_context_unref()
1136 dbus_free (context->pidfile); in bus_context_unref()
1140 dbus_free (context); in bus_context_unref()
1148 bus_context_get_type (BusContext *context) in bus_context_get_type() argument
1150 return context->type; in bus_context_get_type()
1154 bus_context_get_address (BusContext *context) in bus_context_get_address() argument
1156 return context->address; in bus_context_get_address()
1160 bus_context_get_servicehelper (BusContext *context) in bus_context_get_servicehelper() argument
1162 return context->servicehelper; in bus_context_get_servicehelper()
1166 bus_context_get_systemd_activation (BusContext *context) in bus_context_get_systemd_activation() argument
1168 return context->systemd_activation; in bus_context_get_systemd_activation()
1172 bus_context_get_registry (BusContext *context) in bus_context_get_registry() argument
1174 return context->registry; in bus_context_get_registry()
1178 bus_context_get_connections (BusContext *context) in bus_context_get_connections() argument
1180 return context->connections; in bus_context_get_connections()
1184 bus_context_get_activation (BusContext *context) in bus_context_get_activation() argument
1186 return context->activation; in bus_context_get_activation()
1190 bus_context_get_matchmaker (BusContext *context) in bus_context_get_matchmaker() argument
1192 return context->matchmaker; in bus_context_get_matchmaker()
1196 bus_context_get_loop (BusContext *context) in bus_context_get_loop() argument
1198 return context->loop; in bus_context_get_loop()
1202 bus_context_allow_unix_user (BusContext *context, in bus_context_allow_unix_user() argument
1205 return bus_policy_allow_unix_user (context->policy, in bus_context_allow_unix_user()
1214 bus_context_allow_windows_user (BusContext *context, in bus_context_allow_windows_user() argument
1217 return bus_policy_allow_windows_user (context->policy, in bus_context_allow_windows_user()
1222 bus_context_get_policy (BusContext *context) in bus_context_get_policy() argument
1224 return context->policy; in bus_context_get_policy()
1228 bus_context_create_client_policy (BusContext *context, in bus_context_create_client_policy() argument
1233 return bus_policy_create_client_policy (context->policy, connection, in bus_context_create_client_policy()
1238 bus_context_get_activation_timeout (BusContext *context) in bus_context_get_activation_timeout() argument
1241 return context->limits.activation_timeout; in bus_context_get_activation_timeout()
1245 bus_context_get_auth_timeout (BusContext *context) in bus_context_get_auth_timeout() argument
1247 return context->limits.auth_timeout; in bus_context_get_auth_timeout()
1251 bus_context_get_max_completed_connections (BusContext *context) in bus_context_get_max_completed_connections() argument
1253 return context->limits.max_completed_connections; in bus_context_get_max_completed_connections()
1257 bus_context_get_max_incomplete_connections (BusContext *context) in bus_context_get_max_incomplete_connections() argument
1259 return context->limits.max_incomplete_connections; in bus_context_get_max_incomplete_connections()
1263 bus_context_get_max_connections_per_user (BusContext *context) in bus_context_get_max_connections_per_user() argument
1265 return context->limits.max_connections_per_user; in bus_context_get_max_connections_per_user()
1269 bus_context_get_max_pending_activations (BusContext *context) in bus_context_get_max_pending_activations() argument
1271 return context->limits.max_pending_activations; in bus_context_get_max_pending_activations()
1275 bus_context_get_max_services_per_connection (BusContext *context) in bus_context_get_max_services_per_connection() argument
1277 return context->limits.max_services_per_connection; in bus_context_get_max_services_per_connection()
1281 bus_context_get_max_match_rules_per_connection (BusContext *context) in bus_context_get_max_match_rules_per_connection() argument
1283 return context->limits.max_match_rules_per_connection; in bus_context_get_max_match_rules_per_connection()
1287 bus_context_get_max_replies_per_connection (BusContext *context) in bus_context_get_max_replies_per_connection() argument
1289 return context->limits.max_replies_per_connection; in bus_context_get_max_replies_per_connection()
1293 bus_context_get_reply_timeout (BusContext *context) in bus_context_get_reply_timeout() argument
1295 return context->limits.reply_timeout; in bus_context_get_reply_timeout()
1299 bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char *msg, ...) _DBUS_G…
1302 bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char *msg, ...) in bus_context_log() argument
1306 if (!context->syslog) in bus_context_log()
1318 if (context->log_prefix) in bus_context_log()
1324 if (!_dbus_string_append (&full_msg, context->log_prefix)) in bus_context_log()
1351 complain_about_message (BusContext *context, in complain_about_message() argument
1405 bus_context_log (context, DBUS_SYSTEM_LOG_SECURITY, "%s", in complain_about_message()
1425 bus_context_check_security_policy (BusContext *context, in bus_context_check_security_policy() argument
1488 complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, in bus_context_check_security_policy()
1600 context->registry, in bus_context_check_security_policy()
1605 complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, in bus_context_check_security_policy()
1617 complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, in bus_context_check_security_policy()
1625 context->registry, in bus_context_check_security_policy()
1631 complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, in bus_context_check_security_policy()
1641 … ((dbus_connection_get_outgoing_size (proposed_recipient) > context->limits.max_outgoing_bytes) || in bus_context_check_security_policy()
1642 …(dbus_connection_get_outgoing_unix_fds (proposed_recipient) > context->limits.max_outgoing_unix_fd… in bus_context_check_security_policy()
1644 complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED, in bus_context_check_security_policy()