]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: treat '@' as equivalent to '@.host' 37741/head
authorLennart Poettering <lennart@poettering.net>
Thu, 5 Jun 2025 09:53:04 +0000 (11:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 5 Jun 2025 10:49:42 +0000 (12:49 +0200)
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.

src/libsystemd/sd-bus/sd-bus.c

index e8c208cb82ebc5c6ec593280d9dd53bee6b9dd13..a7fa36bc74366e6c9f36692a92a85a1b852793ef 100644 (file)
@@ -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