summaryrefslogtreecommitdiff
path: root/src/userdb/userdbctl.c
diff options
context:
space:
mode:
authorAlin Popa <alin.popa@bmw.de>2020-02-14 09:33:43 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-02-16 02:09:26 +0900
commitad5555b42e9f6c01314df9e11432f0bf90cd909d (patch)
tree5b74c13aca0c5768f898cd9c6ce84efc09a5a7f4 /src/userdb/userdbctl.c
parentbec31cf5f0037dd049299e8665e03fc74024e357 (diff)
downloadsystemd-ad5555b42e9f6c01314df9e11432f0bf90cd909d.tar.gz
systemd: Fix busctl crash on aarch64 when setting output table format
The enum used for column names is integer type while table_set_display() is parsing arguments on size_t alignment which may result in assert in table_set_display() if the size between types missmatch. This patch cast the enums to size_t. It also fixes all other occurences for table_set_display() and table_set_sort().
Diffstat (limited to 'src/userdb/userdbctl.c')
-rw-r--r--src/userdb/userdbctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/userdb/userdbctl.c b/src/userdb/userdbctl.c
index 9083797856..f085eb232c 100644
--- a/src/userdb/userdbctl.c
+++ b/src/userdb/userdbctl.c
@@ -112,8 +112,8 @@ static int display_user(int argc, char *argv[], void *userdata) {
(void) table_set_align_percent(table, table_get_cell(table, 0, 2), 100);
(void) table_set_align_percent(table, table_get_cell(table, 0, 3), 100);
(void) table_set_empty_string(table, "-");
- (void) table_set_sort(table, 7, 2, (size_t) -1);
- (void) table_set_display(table, 0, 1, 2, 3, 4, 5, 6, (size_t) -1);
+ (void) table_set_sort(table, (size_t) 7, (size_t) 2, (size_t) -1);
+ (void) table_set_display(table, (size_t) 0, (size_t) 1, (size_t) 2, (size_t) 3, (size_t) 4, (size_t) 5, (size_t) 6, (size_t) -1);
}
if (argc > 1) {
@@ -260,8 +260,8 @@ static int display_group(int argc, char *argv[], void *userdata) {
return log_oom();
(void) table_set_align_percent(table, table_get_cell(table, 0, 2), 100);
- (void) table_set_sort(table, 3, 2, (size_t) -1);
- (void) table_set_display(table, 0, 1, 2, (size_t) -1);
+ (void) table_set_sort(table, (size_t) 3, (size_t) 2, (size_t) -1);
+ (void) table_set_display(table, (size_t) 0, (size_t) 1, (size_t) 2, (size_t) -1);
}
if (argc > 1) {
@@ -400,7 +400,7 @@ static int display_memberships(int argc, char *argv[], void *userdata) {
if (!table)
return log_oom();
- (void) table_set_sort(table, 0, 1, (size_t) -1);
+ (void) table_set_sort(table, (size_t) 0, (size_t) 1, (size_t) -1);
}
if (argc > 1) {
@@ -489,7 +489,7 @@ static int display_services(int argc, char *argv[], void *userdata) {
if (!t)
return log_oom();
- (void) table_set_sort(t, 0, (size_t) -1);
+ (void) table_set_sort(t, (size_t) 0, (size_t) -1);
FOREACH_DIRENT(de, d, return -errno) {
_cleanup_free_ char *j = NULL, *no = NULL;