diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-07-01 00:55:34 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-07-01 00:55:34 +0200 |
commit | 1fd45a90f5c99a88c268981de321d0ef8542bd4f (patch) | |
tree | f54c239ad13964baaeb3822a363bd916775e2a16 | |
parent | 31e54cc807edf5294828233e53ca95e754c5cf80 (diff) |
unit: do wildcard expansion in ListenStream= and friends
-rw-r--r-- | src/load-fragment.c | 22 | ||||
-rw-r--r-- | src/logind.h | 1 |
2 files changed, 18 insertions, 5 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c index 3146186843..30fbb57f6b 100644 --- a/src/load-fragment.c +++ b/src/load-fragment.c @@ -251,7 +251,7 @@ static int config_parse_listen( if (streq(lvalue, "ListenFIFO")) { p->type = SOCKET_FIFO; - if (!(p->path = strdup(rvalue))) { + if (!(p->path = unit_full_printf(UNIT(s), rvalue))) { free(p); return -ENOMEM; } @@ -261,7 +261,7 @@ static int config_parse_listen( } else if (streq(lvalue, "ListenSpecial")) { p->type = SOCKET_SPECIAL; - if (!(p->path = strdup(rvalue))) { + if (!(p->path = unit_full_printf(UNIT(s), rvalue))) { free(p); return -ENOMEM; } @@ -272,7 +272,7 @@ static int config_parse_listen( p->type = SOCKET_MQUEUE; - if (!(p->path = strdup(rvalue))) { + if (!(p->path = unit_full_printf(UNIT(s), rvalue))) { free(p); return -ENOMEM; } @@ -280,18 +280,30 @@ static int config_parse_listen( path_kill_slashes(p->path); } else if (streq(lvalue, "ListenNetlink")) { + char *k; + int r; + p->type = SOCKET_SOCKET; + k = unit_full_printf(UNIT(s), rvalue); + r = socket_address_parse_netlink(&p->address, k); + free(k); - if (socket_address_parse_netlink(&p->address, rvalue) < 0) { + if (r < 0) { log_error("[%s:%u] Failed to parse address value, ignoring: %s", filename, line, rvalue); free(p); return 0; } } else { + char *k; + int r; + p->type = SOCKET_SOCKET; + k = unit_full_printf(UNIT(s), rvalue); + r = socket_address_parse(&p->address, k); + free(k); - if (socket_address_parse(&p->address, rvalue) < 0) { + if (r < 0) { log_error("[%s:%u] Failed to parse address value, ignoring: %s", filename, line, rvalue); free(p); return 0; diff --git a/src/logind.h b/src/logind.h index 10b75273fa..d91cae38fe 100644 --- a/src/logind.h +++ b/src/logind.h @@ -36,6 +36,7 @@ * * spawn user systemd * direct client API + * add display symlinks also per-session * * udev: * drop redundant udev_device_get_is_initialized() use as soon as libudev is fixed |