mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 09:48:03 -08:00
Compare commits
8 Commits
fdc6162e6f
...
de0487f11c
Author | SHA1 | Date | |
---|---|---|---|
|
de0487f11c | ||
|
33c15ba8e8 | ||
|
5495b11360 | ||
|
7655550a49 | ||
|
36dd429680 | ||
|
52a2b04947 | ||
|
b2347d690a | ||
|
1b58645207 |
0
.gitmodules
vendored
0
.gitmodules
vendored
@ -1451,10 +1451,15 @@ evdev:input:b0003v046DpC309*
|
||||
KEYBOARD_KEY_c01b6=images # My Pictures (F11)
|
||||
KEYBOARD_KEY_c01b7=audio # My Music (F12)
|
||||
|
||||
# The wireless receiver b0003v046Dp4092* seems to be used by multiple models.
|
||||
# See issue #35691. Hence, the entry below cannot be enabled by default. If
|
||||
# you're using the model below, consider copying the entry to a custom hwdb
|
||||
# file to enable the setting.
|
||||
#
|
||||
# Logitech MX Keys for Mac
|
||||
evdev:input:b0003v046Dp4092*
|
||||
KEYBOARD_KEY_70035=102nd # '<' key
|
||||
KEYBOARD_KEY_70064=grave # '^' key
|
||||
#evdev:input:b0003v046Dp4092*
|
||||
# KEYBOARD_KEY_70035=102nd # '<' key
|
||||
# KEYBOARD_KEY_70064=grave # '^' key
|
||||
|
||||
###########################################################
|
||||
# Maxdata
|
||||
|
@ -24,8 +24,8 @@ if command -v authselect >/dev/null; then
|
||||
|
||||
authselect select "$PROFILE"
|
||||
|
||||
if authselect list-features "$PROFILE" | grep -q "with-homed"; then
|
||||
authselect enable-feature with-homed
|
||||
if authselect list-features "$PROFILE" | grep -q "with-systemd-homed"; then
|
||||
authselect enable-feature with-systemd-homed
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -860,6 +860,10 @@ int bus_init_api(Manager *m) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to set up API bus: %m");
|
||||
|
||||
r = bus_track_coldplug(bus, &m->subscribed, /* recursive= */ false, m->subscribe_serialization);
|
||||
if (r < 0)
|
||||
return r;
|
||||
m->subscribe_serialization = strv_free(m->subscribe_serialization);
|
||||
m->api_bus = TAKE_PTR(bus);
|
||||
|
||||
return 0;
|
||||
@ -1004,8 +1008,19 @@ static void destroy_bus(Manager *m, sd_bus **bus) {
|
||||
}
|
||||
|
||||
/* Get rid of tracked clients on this bus */
|
||||
if (m->subscribed && sd_bus_track_get_bus(m->subscribed) == *bus)
|
||||
if (m->subscribed && sd_bus_track_get_bus(m->subscribed) == *bus) {
|
||||
_cleanup_strv_free_ char **subscribed = NULL;
|
||||
int r;
|
||||
|
||||
r = bus_track_to_strv(m->subscribed, &subscribed);
|
||||
if (r < 0)
|
||||
log_error_errno(r, "Failed to serialize api subscribers: %m");
|
||||
r = strv_extend_strv_consume(&m->subscribe_serialization, TAKE_PTR(subscribed), /* filter_duplicates = */ false);
|
||||
if (r < 0)
|
||||
log_error_errno(r, "Failed to record api subscribers: %m");
|
||||
|
||||
m->subscribed = sd_bus_track_unref(m->subscribed);
|
||||
}
|
||||
|
||||
HASHMAP_FOREACH(j, m->jobs)
|
||||
if (j->bus_track && sd_bus_track_get_bus(j->bus_track) == *bus)
|
||||
@ -1064,7 +1079,6 @@ void bus_done(Manager *m) {
|
||||
|
||||
assert(!m->subscribed);
|
||||
|
||||
m->deserialized_subscribed = strv_free(m->deserialized_subscribed);
|
||||
m->polkit_registry = hashmap_free(m->polkit_registry);
|
||||
}
|
||||
|
||||
@ -1153,20 +1167,19 @@ void bus_track_serialize(sd_bus_track *t, FILE *f, const char *prefix) {
|
||||
}
|
||||
}
|
||||
|
||||
int bus_track_coldplug(Manager *m, sd_bus_track **t, bool recursive, char **l) {
|
||||
int bus_track_coldplug(sd_bus *bus, sd_bus_track **t, bool recursive, char **l) {
|
||||
int r;
|
||||
|
||||
assert(m);
|
||||
assert(t);
|
||||
|
||||
if (strv_isempty(l))
|
||||
return 0;
|
||||
|
||||
if (!m->api_bus)
|
||||
if (!bus)
|
||||
return 0;
|
||||
|
||||
if (!*t) {
|
||||
r = sd_bus_track_new(m->api_bus, t, NULL, NULL);
|
||||
r = sd_bus_track_new(bus, t, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ void bus_done(Manager *m);
|
||||
int bus_fdset_add_all(Manager *m, FDSet *fds);
|
||||
|
||||
void bus_track_serialize(sd_bus_track *t, FILE *f, const char *prefix);
|
||||
int bus_track_coldplug(Manager *m, sd_bus_track **t, bool recursive, char **l);
|
||||
int bus_track_coldplug(sd_bus *bus, sd_bus_track **t, bool recursive, char **l);
|
||||
|
||||
int bus_foreach_bus(Manager *m, sd_bus_track *subscribed2, int (*send_message)(sd_bus *bus, void *userdata), void *userdata);
|
||||
|
||||
|
@ -489,7 +489,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
|
||||
(void) exec_shared_runtime_deserialize_one(m, val, fds);
|
||||
else if ((val = startswith(l, "subscribed="))) {
|
||||
|
||||
r = strv_extend(&m->deserialized_subscribed, val);
|
||||
r = strv_extend(&m->subscribe_serialization, val);
|
||||
if (r < 0)
|
||||
return r;
|
||||
} else if ((val = startswith(l, "varlink-server-socket-address="))) {
|
||||
|
@ -1804,6 +1804,9 @@ Manager* manager_free(Manager *m) {
|
||||
free(m->switch_root);
|
||||
free(m->switch_root_init);
|
||||
|
||||
sd_bus_track_unref(m->subscribed);
|
||||
strv_free(m->subscribe_serialization);
|
||||
|
||||
unit_defaults_done(&m->defaults);
|
||||
|
||||
FOREACH_ARRAY(map, m->units_needing_mounts_for, _UNIT_MOUNT_DEPENDENCY_TYPE_MAX) {
|
||||
@ -2140,10 +2143,10 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds, const char *roo
|
||||
manager_setup_bus(m);
|
||||
|
||||
/* Now that we are connected to all possible buses, let's deserialize who is tracking us. */
|
||||
r = bus_track_coldplug(m, &m->subscribed, false, m->deserialized_subscribed);
|
||||
r = bus_track_coldplug(m->api_bus, &m->subscribed, false, m->subscribe_serialization);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to deserialized tracked clients, ignoring: %m");
|
||||
m->deserialized_subscribed = strv_free(m->deserialized_subscribed);
|
||||
m->subscribe_serialization = strv_free(m->subscribe_serialization);
|
||||
|
||||
r = manager_varlink_init(m);
|
||||
if (r < 0)
|
||||
@ -3809,9 +3812,6 @@ int manager_reload(Manager *m) {
|
||||
/* Clean up runtime objects no longer referenced */
|
||||
manager_vacuum(m);
|
||||
|
||||
/* Clean up deserialized tracked clients */
|
||||
m->deserialized_subscribed = strv_free(m->deserialized_subscribed);
|
||||
|
||||
/* Consider the reload process complete now. */
|
||||
assert(m->n_reloading > 0);
|
||||
m->n_reloading--;
|
||||
|
@ -340,7 +340,7 @@ struct Manager {
|
||||
considered subscribes, since they last for very short only,
|
||||
and it is much simpler that way. */
|
||||
sd_bus_track *subscribed;
|
||||
char **deserialized_subscribed;
|
||||
char **subscribe_serialization;
|
||||
|
||||
/* This is used during reloading: before the reload we queue
|
||||
* the reply message here, and afterwards we send it */
|
||||
|
@ -698,6 +698,28 @@ int bus_track_add_name_many(sd_bus_track *t, char **l) {
|
||||
return r;
|
||||
}
|
||||
|
||||
int bus_track_to_strv(sd_bus_track *t, char ***ret) {
|
||||
_cleanup_strv_free_ char **subscribed = NULL;
|
||||
int r = 0;
|
||||
|
||||
assert(ret);
|
||||
|
||||
for (const char *n = sd_bus_track_first(t); n; n = sd_bus_track_next(t)) {
|
||||
r = sd_bus_track_count_name(t, n);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
for (int j = 0; j < r; j++) {
|
||||
r = strv_extend(&subscribed, n);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
*ret = TAKE_PTR(subscribed);
|
||||
return r;
|
||||
}
|
||||
|
||||
int bus_open_system_watch_bind_with_description(sd_bus **ret, const char *description) {
|
||||
_cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL;
|
||||
const char *e;
|
||||
|
@ -66,6 +66,7 @@ int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id,
|
||||
int bus_path_decode_unique(const char *path, const char *prefix, char **ret_sender, char **ret_external);
|
||||
|
||||
int bus_track_add_name_many(sd_bus_track *t, char **l);
|
||||
int bus_track_to_strv(sd_bus_track *t, char ***ret);
|
||||
|
||||
int bus_open_system_watch_bind_with_description(sd_bus **ret, const char *description);
|
||||
static inline int bus_open_system_watch_bind(sd_bus **ret) {
|
||||
|
@ -18,6 +18,7 @@ BusName=org.freedesktop.home1
|
||||
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE CAP_SETPCAP CAP_DAC_READ_SEARCH CAP_SETFCAP
|
||||
DeviceAllow=/dev/loop-control rw
|
||||
DeviceAllow=/dev/mapper/control rw
|
||||
DeviceAllow=/dev/btrfs-control rw
|
||||
DeviceAllow=block-* rw
|
||||
DeviceAllow=char-hidraw rw
|
||||
ExecStart={{LIBEXECDIR}}/systemd-homed
|
||||
|
@ -20,7 +20,7 @@ ConditionPathExists=/proc/pressure/cpu
|
||||
ConditionPathExists=/proc/pressure/io
|
||||
ConditionPathExists=/proc/pressure/memory
|
||||
Requires=systemd-oomd.socket
|
||||
After=systemd-oomd.socket
|
||||
After=systemd-oomd.socket systemd-sysusers.service
|
||||
|
||||
[Service]
|
||||
AmbientCapabilities=CAP_KILL CAP_DAC_OVERRIDE
|
||||
|
Loading…
Reference in New Issue
Block a user