Bump to v21-2

Do not exit on failed directory access.
This commit is contained in:
Tom Gundersen 2019-05-03 14:25:47 +02:00
parent 476dfa95ab
commit 64b1698ab0
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,47 @@
From f42d5e38859c65a186acd0da94bbeeca12faf7a2 Mon Sep 17 00:00:00 2001
From: David Rheinsberg <david.rheinsberg@gmail.com>
Date: Thu, 2 May 2019 17:33:34 +0200
Subject: [PATCH] launch: improve error handling for opendir()
This improves the error-handling of opendir() by always printing
diagnostics. Furthermore, it aligns the behavior with dbus-deamon and
ignores EACCES.
Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
---
src/launch/launcher.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/launch/launcher.c b/src/launch/launcher.c
index 31a5364..2ec4bda 100644
--- a/src/launch/launcher.c
+++ b/src/launch/launcher.c
@@ -749,10 +749,23 @@ static int launcher_load_service_dir(Launcher *launcher, const char *dirpath, NS
dir = opendir(dirpath);
if (!dir) {
- if (errno == ENOENT || errno == ENOTDIR)
+ if (errno == ENOENT || errno == ENOTDIR) {
return 0;
- else
+ } else if (errno == EACCES) {
+ log_append_here(&launcher->log, LOG_ERR, 0, NULL);
+ r = log_commitf(&launcher->log, "Access denied to service directory '%s'\n", dirpath);
+ if (r)
+ return error_fold(r);
+
+ return 0;
+ } else {
+ log_append_here(&launcher->log, LOG_ERR, errno, NULL);
+ r = log_commitf(&launcher->log, "Unable to open service directory '%s': %m\n", dirpath);
+ if (r)
+ return error_fold(r);
+
return error_origin(-errno);
+ }
}
r = dirwatch_add(launcher->dirwatch, dirpath);
--
2.20.1

View File

@ -2,12 +2,13 @@
Name: dbus-broker
Version: 21
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Linux D-Bus Message Broker
License: ASL 2.0
URL: https://github.com/bus1/dbus-broker
Source0: https://github.com/bus1/dbus-broker/releases/download/v%{version}/dbus-broker-%{version}.tar.xz
Patch0: 0001-units-system-add-messagebus-alias.patch
Patch1: 0001-launch-improve-error-handling-for-opendir.patch
Provides: bundled(c-dvar) = 1
Provides: bundled(c-ini) = 1
Provides: bundled(c-list) = 3
@ -145,6 +146,9 @@ fi
%{_userunitdir}/dbus-broker.service
%changelog
* Fri May 3 2019 Tom Gundersen <teg@jklm.no> - 21-1
- Don't fail on EACCESS when reading config, fixes #1704920
* Thu May 2 2019 Tom Gundersen <teg@jklm.no> - 21-1
- Minor bugfixes related to config reload for #1704488