]> err.no Git - systemd/commitdiff
unit: do wildcard expansion in ListenStream= and friends
authorLennart Poettering <lennart@poettering.net>
Thu, 30 Jun 2011 22:55:34 +0000 (00:55 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 30 Jun 2011 22:55:34 +0000 (00:55 +0200)
src/load-fragment.c
src/logind.h

index 3146186843f166fd8a76a70b7a379255563fcae8..30fbb57f6bbf33c41500860a1b9f8a146d0b33b2 100644 (file)
@@ -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;
index 10b75273fa07f3d91475da2b9f10a2c0fec45d46..d91cae38fe19006630c353c3a4e7f2134f09edb7 100644 (file)
@@ -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