X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fload-fragment.c;h=3146186843f166fd8a76a70b7a379255563fcae8;hb=e025b4c306d4b0895786839ebbb934188edc6e61;hp=321214ef4668b980637ff212c28686afd57e2355;hpb=6ea832a20700f5282c08c70f38422c6ab290a0b5;p=elogind.git diff --git a/src/load-fragment.c b/src/load-fragment.c index 321214ef4..314618684 100644 --- a/src/load-fragment.c +++ b/src/load-fragment.c @@ -1071,10 +1071,23 @@ static int config_parse_cgroup( char *state; FOREACH_WORD_QUOTED(w, l, rvalue, state) { - char *t; + char *t, *k; int r; - if (!(t = cunescape_length(w, l))) + t = strndup(w, l); + if (!t) + return -ENOMEM; + + k = unit_full_printf(u, t); + free(t); + + if (!k) + return -ENOMEM; + + t = cunescape(k); + free(k); + + if (!t) return -ENOMEM; r = unit_add_cgroup_from_text(u, t); @@ -1661,13 +1674,16 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) { * unit name. */ name = file_name_from_path(*filename); - if (unit_name_is_valid(name, false)) { - if (!(id = set_get(names, name))) { + if (unit_name_is_valid(name, true)) { - if (!(id = strdup(name))) + id = set_get(names, name); + if (!id) { + id = strdup(name); + if (!id) return -ENOMEM; - if ((r = set_put(names, id)) < 0) { + r = set_put(names, id); + if (r < 0) { free(id); return r; } @@ -1908,7 +1924,8 @@ static int load_from_path(Unit *u, const char *path) { { "KillMode", config_parse_kill_mode, 0, &(context).kill_mode, section }, \ { "KillSignal", config_parse_kill_signal, 0, &(context).kill_signal, section }, \ { "SendSIGKILL", config_parse_bool, 0, &(context).send_sigkill, section }, \ - { "UtmpIdentifier", config_parse_string_printf, 0, &(context).utmp_id, section } + { "UtmpIdentifier", config_parse_string_printf, 0, &(context).utmp_id, section }, \ + { "ControlGroupModify", config_parse_bool, 0, &(context).control_group_modify, section } const ConfigItem items[] = { { "Names", config_parse_names, 0, u, "Unit" }, @@ -1995,6 +2012,8 @@ static int load_from_path(Unit *u, const char *path) { { "Mark", config_parse_int, 0, &u->socket.mark, "Socket" }, { "PipeSize", config_parse_size, 0, &u->socket.pipe_size, "Socket" }, { "FreeBind", config_parse_bool, 0, &u->socket.free_bind, "Socket" }, + { "Transparent", config_parse_bool, 0, &u->socket.transparent, "Socket" }, + { "Broadcast", config_parse_bool, 0, &u->socket.broadcast, "Socket" }, { "TCPCongestion", config_parse_string, 0, &u->socket.tcp_congestion, "Socket" }, { "MessageQueueMaxMessages", config_parse_long, 0, &u->socket.mq_maxmsg, "Socket" }, { "MessageQueueMessageSize", config_parse_long, 0, &u->socket.mq_msgsize, "Socket" },