Compare commits

...

3 Commits

Author SHA1 Message Date
Florian Klink 933e29b4ee
Merge 1c7359c9f6 into 5b2926d941 2024-11-24 06:31:24 +01:00
Yu Watanabe 5b2926d941 curl-util: do not configure new io event source when the event loop is already dead
Similar to c5ecf09494, but for io event source.

Fixes #35322.
2024-11-23 22:49:57 +01:00
Florian Klink 1c7359c9f6 man: document footgun on SocketUser=
`SocketUser=` might have inconsistent results if they're inside a path
specified by `RuntimeDirectory=` (or any other directory option where
directories are chown'ed on startup).

Especially in the case of creating a socket-activated service that's
reachable for another user (the most common usecase for this option),
it feels prudent to document this caveat, considering how frequently
these unix domain sockets happen to be created in /run.

I just ran into this, and it seems
https://github.com/systemd/systemd/issues/8635 is at least another
documented case.
2024-04-26 18:32:24 +03:00
2 changed files with 10 additions and 1 deletions

View File

@ -378,7 +378,12 @@
sockets, FIFO nodes, and message queues are owned by the specified user and group. If unset (the
default), the nodes are owned by the root user/group (if run in system context) or the invoking
user/group (if run in user context). If only a user is specified but no group, then the group is
derived from the user's default group.</para>
derived from the user's default group.
Note that this might not have the desired effect if a socket happens to be inside a directory also
referred to in a <varname>RuntimeDirectory=</varname>, <varname>StateDirectory=</varname>,
<varname>CacheDirectory=</varname>, or <varname>LogsDirectory=</varname> of any service, due to the
change of ownership caused by these options.
</para>
<xi:include href="version-info.xml" xpointer="v214"/></listitem>
</varlistentry>

View File

@ -75,6 +75,10 @@ static int curl_glue_socket_callback(CURL *curl, curl_socket_t s, int action, vo
return 0;
}
/* Don't configure io event source anymore when the event loop is dead already. */
if (g->event && sd_event_get_state(g->event) == SD_EVENT_FINISHED)
return 0;
r = hashmap_ensure_allocated(&g->ios, &trivial_hash_ops);
if (r < 0) {
log_oom();