[systemd-commits] 17 commits - Makefile-man.am make-man-rules.py man/loginctl.xml man/systemctl.xml man/systemd-bus-proxyd at .service.xml man/systemd-bus-proxyd.xml shell-completion/bash shell-completion/zsh src/bus-proxyd src/core src/delta src/journal src/login src/shared src/tmpfiles TODO
Zbigniew JÄdrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Sat Dec 21 15:42:25 PST 2013
Makefile-man.am | 162 ++++++++++++++++++++++++++++++++++++
TODO | 1
make-man-rules.py | 22 +++-
man/loginctl.xml | 10 ++
man/systemctl.xml | 2
man/systemd-bus-proxyd.xml | 121 ++++++++++++++++++++++++++
man/systemd-bus-proxyd at .service.xml | 81 ++++++++++++++++++
shell-completion/bash/loginctl | 6 -
shell-completion/zsh/_loginctl | 6 -
src/bus-proxyd/bus-proxyd.c | 149 ++++++++++++++-------------------
src/core/load-dropin.c | 7 -
src/delta/delta.c | 8 -
src/journal/journal-vacuum.c | 9 --
src/journal/journald-server.c | 8 -
src/journal/sd-journal.c | 24 ++++-
src/login/loginctl.c | 30 ++++--
src/login/sd-login.c | 8 -
src/shared/conf-files.c | 8 -
src/shared/install.c | 22 ++--
src/shared/util.c | 37 +++-----
src/shared/util.h | 6 -
src/tmpfiles/tmpfiles.c | 8 -
22 files changed, 557 insertions(+), 178 deletions(-)
New commits:
commit 4ff4ebb1fbb7296f67b89b66d2d7f720b49b51c5
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 12:44:10 2013 +0100
util: remove union dirent_storage
diff --git a/TODO b/TODO
index 6caa020..3a00eb1 100644
--- a/TODO
+++ b/TODO
@@ -48,7 +48,6 @@ Features:
- ensure scope units may be started only a single time
* code cleanup
- - get rid of readdir_r/dirent_storage stuff, it's unnecessary on Linux
- we probably should replace the left-over uses of strv_append() and replace them by strv_push() or strv_extend()
* switch to SipHash for hashmaps/sets?
diff --git a/src/shared/util.h b/src/shared/util.h
index 3e0a6d5..488ce3b 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -44,12 +44,6 @@
#include "macro.h"
#include "time-util.h"
-union dirent_storage {
- struct dirent de;
- uint8_t storage[offsetof(struct dirent, d_name) +
- ((NAME_MAX + 1 + sizeof(long)) & ~(sizeof(long) - 1))];
-};
-
/* What is interpreted as whitespace? */
#define WHITESPACE " \t\n\r"
#define NEWLINE "\n\r"
commit bde1fdd773c5bc036370922e67ff3550a1f5cded
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 12:42:32 2013 +0100
journal: replace readdir_r with readdir
This commit also adds error handling for failures during
directory reading.
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index bb116df..283d593 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -1442,10 +1442,16 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
for (;;) {
struct dirent *de;
- union dirent_storage buf;
- r = readdir_r(d, &buf.de, &de);
- if (r != 0 || !de)
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0) {
+ r = -errno;
+ log_debug("Failed to read directory %s: %s",
+ m->path, strerror(errno));
+ return r;
+ }
+ if (!de)
break;
if (dirent_is_file_with_suffix(de, ".journal") ||
@@ -1526,11 +1532,17 @@ static int add_root_directory(sd_journal *j, const char *p) {
for (;;) {
struct dirent *de;
- union dirent_storage buf;
sd_id128_t id;
- r = readdir_r(d, &buf.de, &de);
- if (r != 0 || !de)
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0) {
+ r = -errno;
+ log_debug("Failed to read directory %s: %s",
+ m->path, strerror(errno));
+ return r;
+ }
+ if (!de)
break;
if (dirent_is_file_with_suffix(de, ".journal") ||
commit a2be63f9223ed1503ffc1e99bf21eee25e4ae014
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 11:33:09 2013 +0100
conf-files: replace readdir_r with readdir
diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index 92204a6..c86bb03 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -53,13 +53,13 @@ static int files_add(Hashmap *h, const char *root, const char *path, const char
for (;;) {
struct dirent *de;
- union dirent_storage buf;
char *p;
int r;
- r = readdir_r(dir, &buf.de, &de);
- if (r != 0)
- return -r;
+ errno = 0;
+ de = readdir(dir);
+ if (!de && errno != 0)
+ return -errno;
if (!de)
break;
commit 0371ca0dac1d70b2e5060a3c4e6fbbc2bdbd8671
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 12:23:12 2013 +0100
journald/server: replace readdir_r with readdir
The available_space function now returns 0 if reading the directory
fails. Previously, such errors were silently ignored.
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 3f8b95d..a3bacda 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -135,11 +135,11 @@ static uint64_t available_space(Server *s, bool verbose) {
for (;;) {
struct stat st;
struct dirent *de;
- union dirent_storage buf;
- r = readdir_r(d, &buf.de, &de);
- if (r != 0)
- break;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0)
+ return 0;
if (!de)
break;
commit 78a5d04dd61e4a4708c5c017b05724561639e657
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 12:15:58 2013 +0100
journal/vacuum: replace readdir_r with readdir
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c
index d4a1c6c..b2b47d6 100644
--- a/src/journal/journal-vacuum.c
+++ b/src/journal/journal-vacuum.c
@@ -180,9 +180,7 @@ int journal_directory_vacuum(
return -errno;
for (;;) {
- int k;
struct dirent *de;
- union dirent_storage buf;
size_t q;
struct stat st;
char *p;
@@ -190,9 +188,10 @@ int journal_directory_vacuum(
sd_id128_t seqnum_id;
bool have_seqnum;
- k = readdir_r(d, &buf.de, &de);
- if (k != 0) {
- r = -k;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0) {
+ r = -errno;
goto finish;
}
commit 3fd11280e82f590eaeda1e3945dafadf82cd8727
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 12:05:41 2013 +0100
util: replace readdir_r with readdir
This fixes rm_rf_children_dangerous to detect errors during directory
reading. Previously, it could dereference an uninitialized pointer.
diff --git a/src/shared/util.c b/src/shared/util.c
index f598971..481c172 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -2306,7 +2306,6 @@ bool is_device_path(const char *path) {
int dir_is_empty(const char *path) {
_cleanup_closedir_ DIR *d;
- int r;
d = opendir(path);
if (!d)
@@ -2314,11 +2313,11 @@ int dir_is_empty(const char *path) {
for (;;) {
struct dirent *de;
- union dirent_storage buf;
- r = readdir_r(d, &buf.de, &de);
- if (r > 0)
- return -r;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0)
+ return -errno;
if (!de)
return 1;
@@ -2660,14 +2659,15 @@ int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, struct
for (;;) {
struct dirent *de;
- union dirent_storage buf;
bool is_dir, keep_around;
struct stat st;
int r;
- r = readdir_r(d, &buf.de, &de);
- if (r != 0 && ret == 0) {
- ret = -r;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0) {
+ if (ret == 0)
+ ret = -errno;
break;
}
@@ -4485,13 +4485,11 @@ int get_files_in_directory(const char *path, char ***list) {
for (;;) {
struct dirent *de;
- union dirent_storage buf;
- int k;
- k = readdir_r(d, &buf.de, &de);
- assert(k >= 0);
- if (k > 0)
- return -k;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0)
+ return -errno;
if (!de)
break;
@@ -5617,15 +5615,14 @@ int on_ac_power(void) {
for (;;) {
struct dirent *de;
- union dirent_storage buf;
_cleanup_close_ int fd = -1, device = -1;
char contents[6];
ssize_t n;
- int k;
- k = readdir_r(d, &buf.de, &de);
- if (k != 0)
- return -k;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0)
+ return -errno;
if (!de)
break;
commit 4d993c8cb75aef0f4293e0b9e8f249dd0530b5d8
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 11:59:19 2013 +0100
install: replace readdir_r with readdir
The old code incorrectly assumed that readdir_r updates errno.
diff --git a/src/shared/install.c b/src/shared/install.c
index 17e8a75..5001ad4 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -212,11 +212,10 @@ static int remove_marked_symlinks_fd(
for (;;) {
struct dirent *de;
- union dirent_storage buf;
- int k;
- k = readdir_r(d, &buf.de, &de);
- if (k != 0) {
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0) {
r = -errno;
break;
}
@@ -373,12 +372,11 @@ static int find_symlinks_fd(
}
for (;;) {
- int k;
struct dirent *de;
- union dirent_storage buf;
- k = readdir_r(d, &buf.de, &de);
- if (k != 0)
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0)
return -errno;
if (!de)
@@ -1938,12 +1936,12 @@ int unit_file_get_list(
for (;;) {
struct dirent *de;
- union dirent_storage buffer;
_cleanup_unitfilelist_free_ UnitFileList *f = NULL;
- r = readdir_r(d, &buffer.de, &de);
- if (r != 0)
- return -r;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0)
+ return -errno;
if (!de)
break;
commit 9fa3006323e86962ceaa3171b906cf2b1c2cf525
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 11:25:08 2013 +0100
core: replace readdir_r with readdir
diff --git a/src/core/load-dropin.c b/src/core/load-dropin.c
index a877e66..3504009 100644
--- a/src/core/load-dropin.c
+++ b/src/core/load-dropin.c
@@ -63,12 +63,13 @@ static int iterate_dir(
for (;;) {
struct dirent *de;
- union dirent_storage buf;
_cleanup_free_ char *f = NULL;
int k;
- k = readdir_r(d, &buf.de, &de);
- if (k != 0) {
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0) {
+ k = errno;
log_error("Failed to read directory %s: %s", path, strerror(k));
return -k;
}
commit 66c7a5332a9ef33143ab57f5f0d1cff0dc4d6ac5
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 11:14:09 2013 +0100
login: replace readdir_r with readdir
diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index c9a2e8a..2930b87 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -555,13 +555,13 @@ _public_ int sd_get_uids(uid_t **users) {
for (;;) {
struct dirent *de;
- union dirent_storage buf;
int k;
uid_t uid;
- k = readdir_r(d, &buf.de, &de);
- if (k != 0)
- return -k;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0)
+ return -errno;
if (!de)
break;
commit 6887ec4f00d7c10cd70da3e10d570684bf32d28d
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 11:16:12 2013 +0100
delta: replace readdir_r with readdir
diff --git a/src/delta/delta.c b/src/delta/delta.c
index 0785e7b..a26af02 100644
--- a/src/delta/delta.c
+++ b/src/delta/delta.c
@@ -280,13 +280,13 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch
for (;;) {
struct dirent *de;
- union dirent_storage buf;
int k;
char *p;
- k = readdir_r(d, &buf.de, &de);
- if (k != 0)
- return -k;
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0)
+ return -errno;
if (!de)
break;
commit d78096b343400d7a9f513a55b76c8de28adb2e08
Author: Florian Weimer <fweimer at redhat.com>
Date: Thu Dec 19 12:26:07 2013 +0100
tmpfiles: replace readdir_r with readdir
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index b7f6a2e..e83a73e 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -543,15 +543,15 @@ static int recursive_relabel_children(Item *i, const char *path) {
for (;;) {
struct dirent *de;
- union dirent_storage buf;
bool is_dir;
int r;
_cleanup_free_ char *entry_path = NULL;
- r = readdir_r(d, &buf.de, &de);
- if (r != 0) {
+ errno = 0;
+ de = readdir(d);
+ if (!de && errno != 0) {
if (ret == 0)
- ret = -r;
+ ret = -errno;
break;
}
commit 016284c352084cdbf856905704070c1f30970f58
Author: Djalal Harouni <tixxdz at opendz.org>
Date: Sat Dec 21 15:49:46 2013 +0100
loginctl: correctly show session IDs on session-status
Commit f8f14b3654bcd introduced a regression that makes
loginctl session-status to not show the correct session ID(s)
In print_session_status_info() the map[] array, element "Seat" receives
the offset of the "id" in "SessionStatusInfo" struct instead of the
offset of the "seat" member.
This will cause prop_map_first_of_struct() function to overwrite the
SessionStatusInfo.id memory with seats if there are any.
Fix this typo by using the "seat" member.
Before:
- tixxdz (1000)
Since: Sat 2013-12-21 10:07:23 CET; 5h 26min ago
Leader: 1265 (sshd)
After:
1 - tixxdz (1000)
Since: Sat 2013-12-21 10:07:23 CET; 5h 26min ago
Leader: 1265 (sshd)
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 7e64066..914f316 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -372,7 +372,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li
{ "Remote", "b", NULL, offsetof(SessionStatusInfo, remote) },
{ "Timestamp", "t", NULL, offsetof(SessionStatusInfo, timestamp) },
{ "User", "(uo)", prop_map_first_of_struct, offsetof(SessionStatusInfo, uid) },
- { "Seat", "(so)", prop_map_first_of_struct, offsetof(SessionStatusInfo, id) },
+ { "Seat", "(so)", prop_map_first_of_struct, offsetof(SessionStatusInfo, seat) },
{}
};
@@ -419,7 +419,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li
printf("\n");
}
- if (i.seat) {
+ if (!isempty(i.seat)) {
printf("\t Seat: %s", i.seat);
if (i.vtnr > 0)
commit 841aa8c0b484b96654b95d3c4e936e37da4c7dda
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Sat Dec 21 14:20:29 2013 -0500
loginctl,shell-completions: fix listing of sessions/users/seats
diff --git a/man/loginctl.xml b/man/loginctl.xml
index eb4a2fd..100ce49 100644
--- a/man/loginctl.xml
+++ b/man/loginctl.xml
@@ -94,6 +94,16 @@
</varlistentry>
<varlistentry>
+ <term><option>--no-legend</option></term>
+
+ <listitem>
+ <para>Do not print the legend,
+ i.e. the column headers and
+ the footer.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>--no-ask-password</option></term>
<listitem><para>Do not query the user
diff --git a/man/systemctl.xml b/man/systemctl.xml
index 5e55f29..8ce8661 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -294,7 +294,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<term><option>--no-legend</option></term>
<listitem>
- <para>Do not print a legend, i.e. the column headers and
+ <para>Do not print the legend, i.e. the column headers and
the footer with hints.</para>
</listitem>
</varlistentry>
diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl
index b0816a3..7263f7f 100644
--- a/shell-completion/bash/loginctl
+++ b/shell-completion/bash/loginctl
@@ -24,9 +24,9 @@ __contains_word () {
done
}
-__get_all_sessions () { loginctl list-sessions | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
-__get_all_users () { loginctl list-users | { while read -r a b; do printf "%s\n" "$b"; done; } ; }
-__get_all_seats () { loginctl list-seats | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
+__get_all_sessions () { loginctl --no-legend list-sessions | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
+__get_all_users () { loginctl --no-legend list-users | { while read -r a b; do printf "%s\n" "$b"; done; } ; }
+__get_all_seats () { loginctl --no-legend list-seats | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
_loginctl () {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
diff --git a/shell-completion/zsh/_loginctl b/shell-completion/zsh/_loginctl
index a22fc99..740629d 100644
--- a/shell-completion/zsh/_loginctl
+++ b/shell-completion/zsh/_loginctl
@@ -1,8 +1,8 @@
#compdef loginctl
-_loginctl_all_sessions(){_sys_all_sessions=($(loginctl list-sessions | { while read a b; do echo " $a"; done; }) )}
-_loginctl_all_users() {_sys_all_users=( $(loginctl list-users | { while read a b; do echo " $a"; done; }) )}
-_loginctl_all_seats() {_sys_all_seats=( $(loginctl list-seats | { while read a b; do echo " $a"; done; }) )}
+_loginctl_all_sessions(){_sys_all_sessions=($(loginctl --no-legend list-sessions | { while read a b; do echo " $a"; done; }) )}
+_loginctl_all_users() {_sys_all_users=( $(loginctl --no-legend list-users | { while read a b; do echo " $a"; done; }) )}
+_loginctl_all_seats() {_sys_all_seats=( $(loginctl --no-legend list-seats | { while read a b; do echo " $a"; done; }) )}
# Completion functions for SESSIONS
for fun in session-status show-session activate lock-session unlock-session terminate-session kill-session ; do
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 5f3221e..7e64066 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -45,6 +45,7 @@ static char **arg_property = NULL;
static bool arg_all = false;
static bool arg_full = false;
static bool arg_no_pager = false;
+static bool arg_legend = true;
static const char *arg_kill_who = NULL;
static int arg_signal = SIGTERM;
static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
@@ -99,7 +100,8 @@ static int list_sessions(sd_bus *bus, char **args, unsigned n) {
if (r < 0)
return bus_log_parse_error(r);
- printf("%10s %10s %-16s %-16s\n", "SESSION", "UID", "USER", "SEAT");
+ if (arg_legend)
+ printf("%10s %10s %-16s %-16s\n", "SESSION", "UID", "USER", "SEAT");
while ((r = sd_bus_message_read(reply, "(susso)", &id, &uid, &user, &seat, &object)) > 0) {
printf("%10s %10u %-16s %-16s\n", id, (unsigned) uid, user, seat);
@@ -108,7 +110,8 @@ static int list_sessions(sd_bus *bus, char **args, unsigned n) {
if (r < 0)
return bus_log_parse_error(r);
- printf("\n%u sessions listed.\n", k);
+ if (arg_legend)
+ printf("\n%u sessions listed.\n", k);
return 0;
}
@@ -140,7 +143,8 @@ static int list_users(sd_bus *bus, char **args, unsigned n) {
if (r < 0)
return bus_log_parse_error(r);
- printf("%10s %-16s\n", "UID", "USER");
+ if (arg_legend)
+ printf("%10s %-16s\n", "UID", "USER");
while ((r = sd_bus_message_read(reply, "(uso)", &uid, &user, &object)) > 0) {
printf("%10u %-16s\n", (unsigned) uid, user);
@@ -149,7 +153,8 @@ static int list_users(sd_bus *bus, char **args, unsigned n) {
if (r < 0)
return bus_log_parse_error(r);
- printf("\n%u users listed.\n", k);
+ if (arg_legend)
+ printf("\n%u users listed.\n", k);
return 0;
}
@@ -180,7 +185,8 @@ static int list_seats(sd_bus *bus, char **args, unsigned n) {
if (r < 0)
return bus_log_parse_error(r);
- printf("%-16s\n", "SEAT");
+ if (arg_legend)
+ printf("%-16s\n", "SEAT");
while ((r = sd_bus_message_read(reply, "(so)", &seat, &object)) > 0) {
printf("%-16s\n", seat);
@@ -189,7 +195,8 @@ static int list_seats(sd_bus *bus, char **args, unsigned n) {
if (r < 0)
return bus_log_parse_error(r);
- printf("\n%u seats listed.\n", k);
+ if (arg_legend)
+ printf("\n%u seats listed.\n", k);
return 0;
}
@@ -1040,6 +1047,7 @@ static int help(void) {
" -h --help Show this help\n"
" --version Show package version\n"
" --no-pager Do not pipe output into a pager\n"
+ " --no-legend Do not show the headers and footers\n"
" --no-ask-password Don't prompt for password\n"
" -H --host=[USER@]HOST Operate on remote host\n"
" -M --machine=CONTAINER Operate on local container\n"
@@ -1082,6 +1090,7 @@ static int parse_argv(int argc, char *argv[]) {
enum {
ARG_VERSION = 0x100,
ARG_NO_PAGER,
+ ARG_NO_LEGEND,
ARG_KILL_WHO,
ARG_NO_ASK_PASSWORD,
};
@@ -1093,6 +1102,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "all", no_argument, NULL, 'a' },
{ "full", no_argument, NULL, 'l' },
{ "no-pager", no_argument, NULL, ARG_NO_PAGER },
+ { "no-legend", no_argument, NULL, ARG_NO_LEGEND },
{ "kill-who", required_argument, NULL, ARG_KILL_WHO },
{ "signal", required_argument, NULL, 's' },
{ "host", required_argument, NULL, 'H' },
@@ -1142,6 +1152,10 @@ static int parse_argv(int argc, char *argv[]) {
arg_no_pager = true;
break;
+ case ARG_NO_LEGEND:
+ arg_legend = false;
+ break;
+
case ARG_NO_ASK_PASSWORD:
arg_ask_password = false;
break;
commit 40be878abb86308f1aa025f5bbc77dff16383025
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Sat Dec 21 18:11:35 2013 -0500
build-sys: add xml sources to EXTRA_DIST
Apparently automake does not include the sources if they are under
a conditional that is disabled when making dist. This means that
everything would have to be enabled to make distcheck work.
diff --git a/Makefile-man.am b/Makefile-man.am
index bdfecb3..d25d642 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -1056,3 +1056,153 @@ MANPAGES_ALIAS += \
endif
+
+EXTRA_DIST += \
+ man/binfmt.d.xml \
+ man/bootchart.conf.xml \
+ man/bootctl.xml \
+ man/bootup.xml \
+ man/crypttab.xml \
+ man/daemon.xml \
+ man/halt.xml \
+ man/hostname.xml \
+ man/hostnamectl.xml \
+ man/journalctl.xml \
+ man/journald.conf.xml \
+ man/kernel-command-line.xml \
+ man/kernel-install.xml \
+ man/locale.conf.xml \
+ man/localectl.xml \
+ man/localtime.xml \
+ man/loginctl.xml \
+ man/logind.conf.xml \
+ man/machine-id.xml \
+ man/machine-info.xml \
+ man/machinectl.xml \
+ man/modules-load.d.xml \
+ man/nss-myhostname.xml \
+ man/os-release.xml \
+ man/pam_systemd.xml \
+ man/runlevel.xml \
+ man/sd-daemon.xml \
+ man/sd-id128.xml \
+ man/sd-journal.xml \
+ man/sd-login.xml \
+ man/sd-readahead.xml \
+ man/sd_booted.xml \
+ man/sd_bus_request_name.xml \
+ man/sd_get_seats.xml \
+ man/sd_id128_get_machine.xml \
+ man/sd_id128_randomize.xml \
+ man/sd_id128_to_string.xml \
+ man/sd_is_fifo.xml \
+ man/sd_journal_add_match.xml \
+ man/sd_journal_get_catalog.xml \
+ man/sd_journal_get_cursor.xml \
+ man/sd_journal_get_cutoff_realtime_usec.xml \
+ man/sd_journal_get_data.xml \
+ man/sd_journal_get_fd.xml \
+ man/sd_journal_get_realtime_usec.xml \
+ man/sd_journal_get_usage.xml \
+ man/sd_journal_next.xml \
+ man/sd_journal_open.xml \
+ man/sd_journal_print.xml \
+ man/sd_journal_query_unique.xml \
+ man/sd_journal_seek_head.xml \
+ man/sd_journal_stream_fd.xml \
+ man/sd_listen_fds.xml \
+ man/sd_login_monitor_new.xml \
+ man/sd_notify.xml \
+ man/sd_pid_get_session.xml \
+ man/sd_readahead.xml \
+ man/sd_seat_get_active.xml \
+ man/sd_session_is_active.xml \
+ man/sd_uid_get_state.xml \
+ man/shutdown.xml \
+ man/sysctl.d.xml \
+ man/systemctl.xml \
+ man/systemd-activate.xml \
+ man/systemd-analyze.xml \
+ man/systemd-ask-password-console.service.xml \
+ man/systemd-ask-password.xml \
+ man/systemd-backlight at .service.xml \
+ man/systemd-binfmt.service.xml \
+ man/systemd-bootchart.xml \
+ man/systemd-bus-proxyd.xml \
+ man/systemd-bus-proxyd at .service.xml \
+ man/systemd-cat.xml \
+ man/systemd-cgls.xml \
+ man/systemd-cgtop.xml \
+ man/systemd-coredumpctl.xml \
+ man/systemd-cryptsetup-generator.xml \
+ man/systemd-cryptsetup at .service.xml \
+ man/systemd-delta.xml \
+ man/systemd-detect-virt.xml \
+ man/systemd-efi-boot-generator.xml \
+ man/systemd-fsck at .service.xml \
+ man/systemd-fstab-generator.xml \
+ man/systemd-getty-generator.xml \
+ man/systemd-gpt-auto-generator.xml \
+ man/systemd-halt.service.xml \
+ man/systemd-hostnamed.service.xml \
+ man/systemd-inhibit.xml \
+ man/systemd-initctl.service.xml \
+ man/systemd-journal-gatewayd.service.xml \
+ man/systemd-journald.service.xml \
+ man/systemd-localed.service.xml \
+ man/systemd-logind.service.xml \
+ man/systemd-machine-id-setup.xml \
+ man/systemd-machined.service.xml \
+ man/systemd-modules-load.service.xml \
+ man/systemd-networkd.service.xml \
+ man/systemd-notify.xml \
+ man/systemd-nspawn.xml \
+ man/systemd-quotacheck.service.xml \
+ man/systemd-random-seed.service.xml \
+ man/systemd-readahead-replay.service.xml \
+ man/systemd-remount-fs.service.xml \
+ man/systemd-rfkill at .service.xml \
+ man/systemd-run.xml \
+ man/systemd-shutdownd.service.xml \
+ man/systemd-sleep.conf.xml \
+ man/systemd-socket-proxyd.xml \
+ man/systemd-suspend.service.xml \
+ man/systemd-sysctl.service.xml \
+ man/systemd-system-update-generator.xml \
+ man/systemd-system.conf.xml \
+ man/systemd-timedated.service.xml \
+ man/systemd-tmpfiles.xml \
+ man/systemd-tty-ask-password-agent.xml \
+ man/systemd-udevd.service.xml \
+ man/systemd-update-utmp.service.xml \
+ man/systemd-user-sessions.service.xml \
+ man/systemd-vconsole-setup.service.xml \
+ man/systemd.automount.xml \
+ man/systemd.device.xml \
+ man/systemd.directives.xml \
+ man/systemd.exec.xml \
+ man/systemd.index.xml \
+ man/systemd.journal-fields.xml \
+ man/systemd.kill.xml \
+ man/systemd.mount.xml \
+ man/systemd.path.xml \
+ man/systemd.preset.xml \
+ man/systemd.resource-control.xml \
+ man/systemd.scope.xml \
+ man/systemd.service.xml \
+ man/systemd.slice.xml \
+ man/systemd.snapshot.xml \
+ man/systemd.socket.xml \
+ man/systemd.special.xml \
+ man/systemd.swap.xml \
+ man/systemd.target.xml \
+ man/systemd.time.xml \
+ man/systemd.timer.xml \
+ man/systemd.unit.xml \
+ man/systemd.xml \
+ man/telinit.xml \
+ man/timedatectl.xml \
+ man/tmpfiles.d.xml \
+ man/udev.xml \
+ man/udevadm.xml \
+ man/vconsole.conf.xml
diff --git a/make-man-rules.py b/make-man-rules.py
index ad601f8..0d1ca24 100644
--- a/make-man-rules.py
+++ b/make-man-rules.py
@@ -20,6 +20,7 @@
from __future__ import print_function
import collections
import sys
+import os.path
from xml_helper import *
SECTION = '''\
@@ -50,9 +51,18 @@ HTML_ALIAS_RULE = '''\
$(html-alias)
'''
+FOOTER = '''\
+
+EXTRA_DIST += \\
+ {files}
+'''
+
def man(page, number):
return 'man/{}.{}'.format(page, number)
+def xml(file):
+ return 'man/{}'.format(os.path.basename(file))
+
def add_rules(rules, name):
xml = xml_parse(name)
# print('parsing {}'.format(name), file=sys.stderr)
@@ -72,7 +82,7 @@ def add_rules(rules, name):
rulegroup[alias] = target
# print('{} => {} [{}]'.format(alias, target, conditional), file=sys.stderr)
-def create_rules(*xml_files):
+def create_rules(xml_files):
" {conditional => {alias-name => source-name}} "
rules = collections.defaultdict(dict)
for name in xml_files:
@@ -82,7 +92,7 @@ def create_rules(*xml_files):
def mjoin(files):
return ' \\\n\t'.join(sorted(files) or '#')
-def make_makefile(rules):
+def make_makefile(rules, files):
return HEADER + '\n'.join(
(CONDITIONAL if conditional else SECTION).format(
manpages=mjoin(set(rulegroup.values())),
@@ -94,8 +104,10 @@ def make_makefile(rules):
for k,v in sorted(rulegroup.items())
if k != v),
conditional=conditional)
- for conditional,rulegroup in sorted(rules.items()))
+ for conditional,rulegroup in sorted(rules.items())
+ ) + FOOTER.format(files=mjoin(sorted(files)))
if __name__ == '__main__':
- rules = create_rules(*sys.argv[1:])
- print(make_makefile(rules), end='')
+ rules = create_rules(sys.argv[1:])
+ files = (xml(file) for file in sys.argv[1:])
+ print(make_makefile(rules, files), end='')
commit 2dc38ed00fe5c9179721411ba068b53ea127d476
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Sat Dec 21 13:58:14 2013 -0500
man: add systemd-dbus-proxy at .service(8) and systemd-dbus.proxy(8)
diff --git a/Makefile-man.am b/Makefile-man.am
index c5f73d4..bdfecb3 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -48,6 +48,7 @@ MANPAGES += \
man/systemd-analyze.1 \
man/systemd-ask-password-console.service.8 \
man/systemd-ask-password.1 \
+ man/systemd-bus-proxyd.8 \
man/systemd-cat.1 \
man/systemd-cgls.1 \
man/systemd-cgtop.1 \
@@ -683,6 +684,17 @@ man/systemd-hostnamed.html: man/systemd-hostnamed.service.html
endif
+if ENABLE_KDBUS
+MANPAGES += \
+ man/systemd-bus-proxyd at .service.8
+MANPAGES_ALIAS += \
+ man/systemd-bus-proxyd.socket.8
+man/systemd-bus-proxyd.socket.8: man/systemd-bus-proxyd at .service.8
+man/systemd-bus-proxyd.socket.html: man/systemd-bus-proxyd at .service.html
+ $(html-alias)
+
+endif
+
if ENABLE_LOCALED
MANPAGES += \
man/localectl.1 \
diff --git a/man/systemd-bus-proxyd.xml b/man/systemd-bus-proxyd.xml
new file mode 100644
index 0000000..c90ae12
--- /dev/null
+++ b/man/systemd-bus-proxyd.xml
@@ -0,0 +1,121 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+This file is part of systemd.
+
+Copyright 2013 Zbigniew JÄdrzejewski-Szmek
+
+systemd is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+systemd is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="systemd-bus-proxyd">
+
+ <refentryinfo>
+ <title>systemd-bus-proxyd</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>Developer</contrib>
+ <firstname>Lennart</firstname>
+ <surname>Poettering</surname>
+ <email>lennart at poettering.net</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>systemd-bus-proxyd</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>systemd-bus-proxyd</refname>
+ <refpurpose>Connect STDIO or a socket to a given bus address</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>/usr/lib/systemd/systemd-bus-proxyd</command>
+ <arg choice="opt" rep="repeat">OPTIONS</arg>
+ <arg choice="opt"><replaceable>PLACEHOLDER</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><command>systemd-bus-proxyd</command> will proxy D-Bus
+ messages to and from a bus. The will be either the system bus or
+ the bus specified with <option>--address</option> when that option
+ is given. Messages will be proxied to/from stdin and stdout, or
+ the socket received through socket activation.</para>
+
+ <para>This program can be used to connect a program using classic
+ D-Bus to kdbus.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options and Arguments</title>
+
+ <para>The following options are understood:</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><option>--address=<replaceable>ADDRESS</replaceable><optional>:<replaceable>ADDRESS...</replaceable></optional></option></term>
+
+ <listitem>
+ <para>Connect to the bus specified by
+ <replaceable>ADDRESS</replaceable>. Multiple colon-seperated
+ addresses can be specified, in which case
+ <command>systemd-bus-proxyd</command> will attempt to
+ connect to them in turn.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--version</option></term>
+
+ <listitem>
+ <para>Prints a short version string and exits.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-h</option></term>
+ <term><option>--help</option></term>
+
+ <listitem><para>Prints a short help
+ text and exits.</para></listitem>
+ </varlistentry>
+ </variablelist>
+
+ <para><replaceable>PLACEHOLDER</replaceable> if given must be a string
+ of <literal>x</literal> and will be used to display information about
+ the process that <command>systemd-bus-proxyd</command> is forwarding
+ messages for.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <para>
+ <citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ <ulink url="http://freedesktop.org/wiki/Software/dbus">D-Bus</ulink>
+ <ulink url="https://code.google.com/p/d-bus/">kdbus</ulink>
+ </para>
+ </refsect1>
+</refentry>
diff --git a/man/systemd-bus-proxyd at .service.xml b/man/systemd-bus-proxyd at .service.xml
new file mode 100644
index 0000000..75a3c8b
--- /dev/null
+++ b/man/systemd-bus-proxyd at .service.xml
@@ -0,0 +1,81 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+This file is part of systemd.
+
+Copyright 2013 Zbigniew JÄdrzejewski-Szmek
+
+systemd is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+systemd is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="systemd-bus-proxyd at .service" conditional='ENABLE_KDBUS'>
+
+ <refentryinfo>
+ <title>systemd-bus-proxyd at .service</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>Developer</contrib>
+ <firstname>Lennart</firstname>
+ <surname>Poettering</surname>
+ <email>lennart at poettering.net</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>systemd-bus-proxyd at .service</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>systemd-bus-proxyd at .service</refname>
+ <refname>systemd-bus-proxyd.socket</refname>
+ <refpurpose>Proxy classic D-Bus clients to kdbus</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <para><filename>systemd-bus-proxyd at .service</filename></para>
+ <para><filename>systemd-bus-proxyd.socket</filename></para>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><filename>systemd-bus-proxyd.socket</filename> will launch
+ <filename>systemd-bus-proxyd at .service</filename> for connections
+ to the classic D-Bus socket in
+ <filename>/run/dbus/system_bus_socket</filename>.</para>
+
+ <para><filename>systemd-bus-proxyd at .service</filename> is launched
+ for an existing D-Bus connection and will use
+ <command>systemd-bus-proxyd</command> to proxy messages from this
+ connection to the system bus (either kdbus or classic D-Bus).
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <para>
+ <citerefentry><refentrytitle>systemd-bus-proxyd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ <ulink url="http://freedesktop.org/wiki/Software/dbus">D-Bus</ulink>
+ <ulink url="https://code.google.com/p/d-bus/">kdbus</ulink>
+ </para>
+ </refsect1>
+</refentry>
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 2944596..80d2120 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -85,7 +85,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "hsup:", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) {
switch (c) {
commit 9818fa6d6d32d87a3e1b96934a54523ea6b02879
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Sat Dec 21 11:23:08 2013 -0500
bus-proxyd: use a loop instead of c&p
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 059f3f6..2944596 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -268,103 +268,77 @@ int main(int argc, char *argv[]) {
for (;;) {
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
- int events_a, events_b, fd;
- uint64_t timeout_a, timeout_b, t;
+ uint64_t t;
struct timespec _ts, *ts;
struct pollfd *pollfd;
- int k;
-
- r = sd_bus_process(a, &m);
- if (r < 0) {
- /* treat 'connection reset by peer' as clean exit condition */
- if (r == -ECONNRESET)
- r = 0;
- else
- log_error("Failed to process bus a: %s", strerror(-r));
-
- goto finish;
- }
+ int k, i, fd;
+
+ struct bus_bus {
+ sd_bus *bus;
+ const char *name;
+ int events;
+ uint64_t timeout;
+ } busses[2] = {
+ {a, "a"},
+ {b, "b"},
+ };
- if (m) {
- /* We officially got EOF, let's quit */
- if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected")) {
- r = 0;
+ for (i = 0; i < 2; i ++) {
+ r = sd_bus_process(busses[i].bus, &m);
+ if (r < 0) {
+ /* treat 'connection reset by peer' as clean exit condition */
+ if (r == -ECONNRESET)
+ r = 0;
+ else
+ log_error("Failed to process bus %s: %s",
+ busses[i].name, strerror(-r));
goto finish;
}
- k = sd_bus_send(b, m, NULL);
- if (k < 0) {
- r = k;
- log_error("Failed to send message: %s", strerror(-r));
- goto finish;
+ if (m) {
+ /* We officially got EOF, let's quit */
+ if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected")) {
+ r = 0;
+ goto finish;
+ }
+
+ k = sd_bus_send(busses[1-i].bus, m, NULL);
+ if (k < 0) {
+ r = k;
+ log_error("Failed to send message to bus %s: %s",
+ busses[1-i].name, strerror(-r));
+ goto finish;
+ }
}
- }
-
- if (r > 0)
- continue;
- r = sd_bus_process(b, &m);
- if (r < 0) {
- /* treat 'connection reset by peer' as clean exit condition */
- if (r == -ECONNRESET)
- r = 0;
- else
- log_error("Failed to process bus b: %s", strerror(-r));
-
- goto finish;
+ if (r > 0)
+ continue;
}
- if (m) {
- /* We officially got EOF, let's quit */
- if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected")) {
- r = 0;
- goto finish;
- }
-
- k = sd_bus_send(a, m, NULL);
- if (k < 0) {
- r = k;
- log_error("Failed to send message: %s", strerror(-r));
- goto finish;
- }
- }
-
- if (r > 0)
- continue;
-
fd = sd_bus_get_fd(a);
if (fd < 0) {
log_error("Failed to get fd: %s", strerror(-r));
goto finish;
}
- events_a = sd_bus_get_events(a);
- if (events_a < 0) {
- log_error("Failed to get events mask: %s", strerror(-r));
- goto finish;
- }
-
- r = sd_bus_get_timeout(a, &timeout_a);
- if (r < 0) {
- log_error("Failed to get timeout: %s", strerror(-r));
- goto finish;
- }
-
- events_b = sd_bus_get_events(b);
- if (events_b < 0) {
- log_error("Failed to get events mask: %s", strerror(-r));
- goto finish;
- }
+ for (i = 0; i < 2; i ++) {
+ busses[i].events = sd_bus_get_events(a);
+ if (busses[i].events < 0) {
+ log_error("Failed to get events mask: %s", strerror(-r));
+ goto finish;
+ }
- r = sd_bus_get_timeout(b, &timeout_b);
- if (r < 0) {
- log_error("Failed to get timeout: %s", strerror(-r));
- goto finish;
+ r = sd_bus_get_timeout(a, &busses[i].timeout);
+ if (r < 0) {
+ log_error("Failed to get timeout: %s", strerror(-r));
+ goto finish;
+ }
}
- t = timeout_a;
- if (t == (uint64_t) -1 || (timeout_b != (uint64_t) -1 && timeout_b < timeout_a))
- t = timeout_b;
+ t = busses[0].timeout;
+ if (t == (uint64_t) -1 ||
+ (busses[1].timeout != (uint64_t) -1 && busses[1].timeout < t))
+ t = busses[1].timeout;
if (t == (uint64_t) -1)
ts = NULL;
@@ -381,9 +355,9 @@ int main(int argc, char *argv[]) {
}
pollfd = (struct pollfd[3]) {
- {.fd = fd, .events = events_a, },
- {.fd = in_fd, .events = events_b & POLLIN, },
- {.fd = out_fd, .events = events_b & POLLOUT, }
+ {.fd = fd, .events = busses[0].events },
+ {.fd = in_fd, .events = busses[1].events & POLLIN },
+ {.fd = out_fd, .events = busses[1].events & POLLOUT },
};
r = ppoll(pollfd, 3, ts, NULL);
commit cc4e8b6f70a42b7bf8f6761006ab95fcd195a3be
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Sat Dec 21 10:26:55 2013 -0500
bus-proxyd: show address nicely in --help
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 91472d9..059f3f6 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -41,12 +41,16 @@
#include "build.h"
#include "strv.h"
+#define UNIX_BUS_PATH "unix:path=/run/dbus/system_bus_socket"
+#define KERNEL_BUS_PATH "kernel:path=/dev/kdbus/0-system/bus"
+
#ifdef ENABLE_KDBUS
-static const char *arg_address = "kernel:path=/dev/kdbus/0-system/bus;unix:path=/run/dbus/system_bus_socket";
+# define DEFAULT_BUS_PATH KERNEL_BUS_PATH ";" UNIX_BUS_PATH
#else
-static const char *arg_address = "unix:path=/run/dbus/system_bus_socket";
+# define DEFAULT_BUS_PATH UNIX_BUS_PATH
#endif
+static const char *arg_address = DEFAULT_BUS_PATH;
static char *arg_command_line_buffer = NULL;
static int help(void) {
@@ -55,7 +59,8 @@ static int help(void) {
"Connect STDIO or a socket to a given bus address.\n\n"
" -h --help Show this help\n"
" --version Show package version\n"
- " --address=ADDRESS Connect to bus specified by address\n",
+ " --address=ADDRESS Connect to the bus specified by ADDRESS\n"
+ " (default: " DEFAULT_BUS_PATH ")\n",
program_invocation_short_name);
return 0;
More information about the systemd-commits
mailing list