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.
This commit is contained in:
Lennart Poettering
2025-06-05 12:49:42 +02:00
parent 2ae32e9d8f
commit 79226d797d
+1 -1
View 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