summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bus-proxyd/proxy.c8
-rw-r--r--src/journal/test-journal-interleaving.c9
-rw-r--r--src/journal/test-journal-stream.c9
-rw-r--r--src/libudev/libudev-device.c2
-rw-r--r--src/shared/acl-util.c13
-rw-r--r--src/shared/acl-util.h2
-rw-r--r--src/udev/udevd.c1
7 files changed, 33 insertions, 11 deletions
diff --git a/src/bus-proxyd/proxy.c b/src/bus-proxyd/proxy.c
index aa5010c1ac..28ab1c97fc 100644
--- a/src/bus-proxyd/proxy.c
+++ b/src/bus-proxyd/proxy.c
@@ -275,12 +275,16 @@ int proxy_set_policy(Proxy *p, SharedPolicy *sp, char **configuration) {
return log_error_errno(r, "Couldn't determine bus scope: %m");
if (streq(scope, "system"))
- strv = strv_new("/etc/dbus-1/system.conf",
+ strv = strv_new("/usr/share/dbus-1/system.conf",
+ "/etc/dbus-1/system.conf",
+ "/usr/share/dbus-1/system.d/",
"/etc/dbus-1/system.d/",
"/etc/dbus-1/system-local.conf",
NULL);
else if (streq(scope, "user"))
- strv = strv_new("/etc/dbus-1/session.conf",
+ strv = strv_new("/usr/share/dbus-1/session.conf",
+ "/etc/dbus-1/session.conf",
+ "/usr/share/dbus-1/session.d/",
"/etc/dbus-1/session.d/",
"/etc/dbus-1/session-local.conf",
NULL);
diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c
index c2fc123e42..adefa1b026 100644
--- a/src/journal/test-journal-interleaving.c
+++ b/src/journal/test-journal-interleaving.c
@@ -62,10 +62,19 @@ static void test_close(JournalFile *f) {
static void append_number(JournalFile *f, int n, uint64_t *seqnum) {
char *p;
dual_timestamp ts;
+ static dual_timestamp previous_ts = {};
struct iovec iovec[1];
dual_timestamp_get(&ts);
+ if (ts.monotonic <= previous_ts.monotonic)
+ ts.monotonic = previous_ts.monotonic + 1;
+
+ if (ts.realtime <= previous_ts.realtime)
+ ts.realtime = previous_ts.realtime + 1;
+
+ previous_ts = ts;
+
assert_se(asprintf(&p, "NUMBER=%d", n) >= 0);
iovec[0].iov_base = p;
iovec[0].iov_len = strlen(p);
diff --git a/src/journal/test-journal-stream.c b/src/journal/test-journal-stream.c
index e1146c692d..b5ecf2f375 100644
--- a/src/journal/test-journal-stream.c
+++ b/src/journal/test-journal-stream.c
@@ -80,6 +80,7 @@ int main(int argc, char *argv[]) {
char *z;
const void *data;
size_t l;
+ dual_timestamp previous_ts = DUAL_TIMESTAMP_NULL;
/* journal_file_open requires a valid machine id */
if (access("/etc/machine-id", F_OK) != 0)
@@ -101,6 +102,14 @@ int main(int argc, char *argv[]) {
dual_timestamp_get(&ts);
+ if (ts.monotonic <= previous_ts.monotonic)
+ ts.monotonic = previous_ts.monotonic + 1;
+
+ if (ts.realtime <= previous_ts.realtime)
+ ts.realtime = previous_ts.realtime + 1;
+
+ previous_ts = ts;
+
assert_se(asprintf(&p, "NUMBER=%u", i) >= 0);
iovec[0].iov_base = p;
iovec[0].iov_len = strlen(p);
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index c27b01db96..9a8d682107 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -871,7 +871,7 @@ _public_ struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_
udev_list_cleanup(&udev_device->sysattrs);
FOREACH_DEVICE_SYSATTR(udev_device->device, sysattr)
- udev_list_entry_add(&udev_device->properties, sysattr, NULL);
+ udev_list_entry_add(&udev_device->sysattrs, sysattr, NULL);
udev_device->sysattrs_read = true;
}
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c
index 466f9aa601..bd8c988751 100644
--- a/src/shared/acl-util.c
+++ b/src/shared/acl-util.c
@@ -223,7 +223,7 @@ int acl_search_groups(const char *path, char ***ret_groups) {
return ret;
}
-int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask) {
+int parse_acl(const char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask) {
_cleanup_free_ char **a = NULL, **d = NULL; /* strings are not be freed */
_cleanup_strv_free_ char **split;
char **entry;
@@ -232,7 +232,7 @@ int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask)
split = strv_split(text, ",");
if (!split)
- return log_oom();
+ return -ENOMEM;
STRV_FOREACH(entry, split) {
char *p;
@@ -245,9 +245,9 @@ int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask)
r = strv_push(&d, p);
else
r = strv_push(&a, *entry);
+ if (r < 0)
+ return r;
}
- if (r < 0)
- return r;
if (!strv_isempty(a)) {
_cleanup_free_ char *join;
@@ -258,7 +258,7 @@ int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask)
a_acl = acl_from_text(join);
if (!a_acl)
- return -EINVAL;
+ return -errno;
if (want_mask) {
r = calc_acl_mask_if_needed(&a_acl);
@@ -276,7 +276,7 @@ int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask)
d_acl = acl_from_text(join);
if (!d_acl)
- return -EINVAL;
+ return -errno;
if (want_mask) {
r = calc_acl_mask_if_needed(&d_acl);
@@ -288,6 +288,7 @@ int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask)
*acl_access = a_acl;
*acl_default = d_acl;
a_acl = d_acl = NULL;
+
return 0;
}
diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h
index c8bcc266d0..cf612e8722 100644
--- a/src/shared/acl-util.h
+++ b/src/shared/acl-util.h
@@ -33,7 +33,7 @@ int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
int calc_acl_mask_if_needed(acl_t *acl_p);
int add_base_acls_if_needed(acl_t *acl_p, const char *path);
int acl_search_groups(const char* path, char ***ret_groups);
-int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask);
+int parse_acl(const char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask);
int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl);
/* acl_free takes multiple argument types.
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 11f1f6372e..c205f1d5ec 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -436,7 +436,6 @@ static void worker_spawn(Manager *manager, struct event *event) {
if (fd_lock >= 0 && flock(fd_lock, LOCK_SH|LOCK_NB) < 0) {
log_debug_errno(errno, "Unable to flock(%s), skipping event handling: %m", udev_device_get_devnode(d));
fd_lock = safe_close(fd_lock);
- r = -EAGAIN;
goto skip;
}
}