X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Fcondition.c;h=dcbf9a7e86a52f2ef089339550b6da4f02eba41f;hp=ae23599410600b32461478bdc8eb5b9512b21d92;hb=2822da4fb7f891e5320f02f1d00f64b72221ced4;hpb=b5884878a2874447b2a9f07f324a7cd909d96d48 diff --git a/src/shared/condition.c b/src/shared/condition.c index ae2359941..dcbf9a7e8 100644 --- a/src/shared/condition.c +++ b/src/shared/condition.c @@ -33,13 +33,13 @@ #include "fileio.h" #include "unit.h" #include "architecture.h" -#include "virt.h" #include "smack-util.h" #include "apparmor-util.h" #include "ima-util.h" #include "selinux-util.h" #include "audit.h" #include "condition.h" +#include "cap-list.h" Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate) { Condition *c; @@ -101,7 +101,7 @@ static int condition_test_kernel_command_line(Condition *c) { _cleanup_free_ char *word = NULL; bool found; - r = unquote_first_word(&p, &word); + r = unquote_first_word(&p, &word, true); if (r < 0) return r; if (r == 0) @@ -236,7 +236,7 @@ static int condition_test_security(Condition *c) { static int condition_test_capability(Condition *c) { _cleanup_fclose_ FILE *f = NULL; - cap_value_t value; + int value; char line[LINE_MAX]; unsigned long long capabilities = -1; @@ -245,8 +245,8 @@ static int condition_test_capability(Condition *c) { assert(c->type == CONDITION_CAPABILITY); /* If it's an invalid capability, we don't have it */ - - if (cap_from_name(c->parameter, &value) < 0) + value = capability_from_name(c->parameter); + if (value < 0) return -EINVAL; /* If it's a valid capability we default to assume