From: Lennart Poettering Date: Thu, 5 Jun 2025 09:53:04 +0000 (+0200) Subject: sd-bus: treat '@' as equivalent to '@.host' X-Git-Tag: v258-rc1~384^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F37741%2Fhead;p=thirdparty%2Fsystemd.git sd-bus: treat '@' as equivalent to '@.host' We allow omission of the part before and the part after the @. But so far we didn't allow omitting both. There's no real reason for disallowing that, hence be systematic and allow it. --- diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index e8c208cb82e..a7fa36bc743 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -1692,7 +1692,7 @@ static int user_and_machine_equivalent(const char *user_and_machine) { /* Omitting the user name means that we shall use the same user name as we run as locally, which * means we'll end up on the same host, let's shortcut */ - if (streq(user_and_machine, "@.host")) + if (STR_IN_SET(user_and_machine, "@.host", "@")) return true; /* Otherwise, if we are root, then we can also allow the ".host" syntax, as that's the user this