* limitations under the License.
*/
-#if defined(WITH_DBUS_TRANSPARENCY)
+#if WITH_DBUS_TRANSPARENCY
#define _GNU_SOURCE
#include <afb/afb-event-x2.h>
-#include "afb-systemd.h"
-
#include "afb-session.h"
#include "afb-msg-json.h"
#include "afb-api.h"
#include "afb-cred.h"
#include "afb-evt.h"
#include "afb-xreq.h"
-#include "verbose.h"
+#include "verbose.h"
+#include "systemd.h"
+#include "jobs.h"
static const char DEFAULT_PATH_PREFIX[] = "/org/agl/afb/api/";
}
/* choose the bus */
- sdbus = (system ? afb_systemd_get_system_bus : afb_systemd_get_user_bus)();
+ jobs_acquire_event_manager();
+ sdbus = (system ? systemd_get_system_bus : systemd_get_user_bus)();
if (sdbus == NULL)
goto error2;
struct afb_cred *cred;
/* the origin */
- char name[1];
+ char name[];
};
/* get the credentials for the message */
}
/* not found, create it */
- origin = malloc(strlen(sender) + sizeof *origin);
+ origin = malloc(strlen(sender) + 1 + sizeof *origin);
if (origin == NULL)
errno = ENOMEM;
else {