chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tmpfiles: do not bump access times of directories we are cleaning up
[elogind.git]
/
src
/
shared
/
condition.c
diff --git
a/src/shared/condition.c
b/src/shared/condition.c
index 59f262244b202a3f7aa6bc72ed13e5ea023bea18..4faca2b8dceb232b4098492345a541fcb6d86f37 100644
(file)
--- a/
src/shared/condition.c
+++ b/
src/shared/condition.c
@@
-31,7
+31,6
@@
#include "virt.h"
#include "path-util.h"
#include "fileio.h"
#include "virt.h"
#include "path-util.h"
#include "fileio.h"
-#include "unit.h"
#include "architecture.h"
#include "smack-util.h"
#include "apparmor-util.h"
#include "architecture.h"
#include "smack-util.h"
#include "apparmor-util.h"
@@
-39,6
+38,7
@@
#include "selinux-util.h"
#include "audit.h"
#include "condition.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;
Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate) {
Condition *c;
@@
-72,11
+72,13
@@
void condition_free(Condition *c) {
free(c);
}
free(c);
}
-
void
condition_free_list(Condition *first) {
+
Condition*
condition_free_list(Condition *first) {
Condition *c, *n;
LIST_FOREACH_SAFE(conditions, c, n, first)
condition_free(c);
Condition *c, *n;
LIST_FOREACH_SAFE(conditions, c, n, first)
condition_free(c);
+
+ return NULL;
}
static int condition_test_kernel_command_line(Condition *c) {
}
static int condition_test_kernel_command_line(Condition *c) {
@@
-235,7
+237,7
@@
static int condition_test_security(Condition *c) {
static int condition_test_capability(Condition *c) {
_cleanup_fclose_ FILE *f = NULL;
static int condition_test_capability(Condition *c) {
_cleanup_fclose_ FILE *f = NULL;
-
cap_value_
t value;
+
in
t value;
char line[LINE_MAX];
unsigned long long capabilities = -1;
char line[LINE_MAX];
unsigned long long capabilities = -1;
@@
-244,8
+246,8
@@
static int condition_test_capability(Condition *c) {
assert(c->type == CONDITION_CAPABILITY);
/* If it's an invalid capability, we don't have it */
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
return -EINVAL;
/* If it's a valid capability we default to assume