diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-04-30 20:21:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-05-05 15:06:42 -0700 |
commit | 7410616cd9dbbec97cf98d75324da5cda2b2f7a2 (patch) | |
tree | 6d968995b3bdf961603ab4853bf078c0dbdce27c /src/core/busname.c | |
parent | 6442185ab674cc202d63c18605057b9a51ca2722 (diff) |
core: rework unit name validation and manipulation logic
A variety of changes:
- Make sure all our calls distuingish OOM from other errors if OOM is
not the only error possible.
- Be much stricter when parsing escaped paths, do not accept trailing or
leading escaped slashes.
- Change unit validation to take a bit mask for allowing plain names,
instance names or template names or an combination thereof.
- Refuse manipulating invalid unit name
Diffstat (limited to 'src/core/busname.c')
-rw-r--r-- | src/core/busname.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/busname.c b/src/core/busname.c index 20d49fe3e9..8e92fb47fe 100644 --- a/src/core/busname.c +++ b/src/core/busname.c @@ -163,9 +163,9 @@ static int busname_add_extras(BusName *n) { assert(n); if (!n->name) { - n->name = unit_name_to_prefix(u->id); - if (!n->name) - return -ENOMEM; + r = unit_name_to_prefix(u->id, &n->name); + if (r < 0) + return r; } if (!u->description) { |