summaryrefslogtreecommitdiff
path: root/src/core/busname.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-05 12:24:03 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-05 13:09:46 +0200
commita4152e3fe28b53b8919cc404dd7eca7ead1bf9bd (patch)
tree6d19cc912c50c123de8d4d599f802f83aea73b4a /src/core/busname.h
parent5331194c120520579eede9dba4bd9c3329629601 (diff)
kdbus: when uploading bus name policy, resolve users/groups out-of-process
It's not safe invoking NSS from PID 1, hence fork off worker processes that upload the policy into the kernel for busnames.
Diffstat (limited to 'src/core/busname.h')
-rw-r--r--src/core/busname.h57
1 files changed, 33 insertions, 24 deletions
diff --git a/src/core/busname.h b/src/core/busname.h
index ab3082bb05..65d57f710a 100644
--- a/src/core/busname.h
+++ b/src/core/busname.h
@@ -28,9 +28,12 @@ typedef struct BusNamePolicy BusNamePolicy;
typedef enum BusNameState {
BUSNAME_DEAD,
+ BUSNAME_MAKING,
BUSNAME_REGISTERED,
BUSNAME_LISTENING,
BUSNAME_RUNNING,
+ BUSNAME_SIGTERM,
+ BUSNAME_SIGKILL,
BUSNAME_FAILED,
_BUSNAME_STATE_MAX,
_BUSNAME_STATE_INVALID = -1
@@ -39,34 +42,18 @@ typedef enum BusNameState {
typedef enum BusNameResult {
BUSNAME_SUCCESS,
BUSNAME_FAILURE_RESOURCES,
+ BUSNAME_FAILURE_TIMEOUT,
+ BUSNAME_FAILURE_EXIT_CODE,
+ BUSNAME_FAILURE_SIGNAL,
+ BUSNAME_FAILURE_CORE_DUMP,
BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT,
_BUSNAME_RESULT_MAX,
_BUSNAME_RESULT_INVALID = -1
} BusNameResult;
-struct BusName {
- Unit meta;
-
- char *name;
- int starter_fd;
-
- bool activating;
- bool accept_fd;
-
- UnitRef service;
-
- BusNameState state, deserialized_state;
- BusNameResult result;
-
- sd_event_source *event_source;
-
- LIST_HEAD(BusNamePolicy, policy);
-};
-
typedef enum BusNamePolicyType {
BUSNAME_POLICY_TYPE_USER,
BUSNAME_POLICY_TYPE_GROUP,
- BUSNAME_POLICY_TYPE_WORLD,
_BUSNAME_POLICY_TYPE_MAX,
_BUSNAME_POLICY_TYPE_INVALID = -1
} BusNamePolicyType;
@@ -83,14 +70,36 @@ struct BusNamePolicy {
BusNamePolicyType type;
BusNamePolicyAccess access;
- union {
- uid_t uid;
- gid_t gid;
- };
+ char *name;
LIST_FIELDS(BusNamePolicy, policy);
};
+struct BusName {
+ Unit meta;
+
+ char *name;
+ int starter_fd;
+
+ bool activating;
+ bool accept_fd;
+
+ UnitRef service;
+
+ BusNameState state, deserialized_state;
+ BusNameResult result;
+
+ usec_t timeout_usec;
+
+ sd_event_source *starter_event_source;
+ sd_event_source *timer_event_source;
+
+ pid_t control_pid;
+
+ LIST_HEAD(BusNamePolicy, policy);
+ BusNamePolicyAccess policy_world;
+};
+
extern const UnitVTable busname_vtable;
const char* busname_state_to_string(BusNameState i) _const_;