#include "bus-internal.h"
#include "bus-message.h"
#include "bus-socket.h"
+#include "escape.h"
#include "fd-util.h"
#include "format-util.h"
#include "fs-util.h"
#include "path-util.h"
#include "process-util.h"
#include "rlimit-util.h"
-#include "selinux-util.h"
#include "signal-util.h"
#include "stdio-util.h"
#include "string-util.h"
if (!d)
return 0;
- e = memmem(d + 2, b->rbuffer_size - (d - (char*) b->rbuffer) - 2, "\r\n", 2);
+ e = memmem_safe(d + 2, b->rbuffer_size - (d - (char*) b->rbuffer) - 2, "\r\n", 2);
if (!e)
return 0;
if (b->accept_fd) {
- f = memmem(e + 2, b->rbuffer_size - (e - (char*) b->rbuffer) - 2, "\r\n", 2);
+ f = memmem_safe(e + 2, b->rbuffer_size - (e - (char*) b->rbuffer) - 2, "\r\n", 2);
if (!f)
return 0;
for (;;) {
/* Check if line is complete */
line = (char*) b->rbuffer + b->auth_rbegin;
- e = memmem(line, b->rbuffer_size - b->auth_rbegin, "\r\n", 2);
+ e = memmem_safe(line, b->rbuffer_size - b->auth_rbegin, "\r\n", 2);
if (!e)
return processed;
assert(b->exec_path);
assert(b->busexec_pid == 0);
- log_debug("sd-bus: starting bus%s%s with %s...",
- b->description ? " " : "", strempty(b->description), b->exec_path);
+ if (DEBUG_LOGGING) {
+ _cleanup_free_ char *line = NULL;
+
+ if (b->exec_argv)
+ line = quote_command_line(b->exec_argv);
+
+ log_debug("sd-bus: starting bus%s%s with %s%s",
+ b->description ? " " : "", strempty(b->description),
+ line ?: b->exec_path,
+ b->exec_argv && !line ? "…" : "");
+ }
r = socketpair(AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0, s);
if (r < 0)
if (b->exec_argv)
execvp(b->exec_path, b->exec_argv);
- else {
- const char *argv[] = { b->exec_path, NULL };
- execvp(b->exec_path, (char**) argv);
- }
+ else
+ execvp(b->exec_path, STRV_MAKE(b->exec_path));
_exit(EXIT_FAILURE);
}