- if (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_STRUCT) {
- r = -EIO;
- goto finish;
- }
-
- dbus_message_iter_recurse(&sub, &sub2);
-
- if (bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &what, true) < 0 ||
- bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &who, true) < 0 ||
- bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &why, true) < 0 ||
- bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &mode, true) < 0 ||
- bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_UINT32, &uid, true) < 0 ||
- bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_UINT32, &pid, false) < 0) {
- r = -EIO;
- goto finish;
- }
-
- ewho = ellipsize(who, 20, 66);
- ewhy = ellipsize(why, 20, 66);
-
- printf("%-21s %-20s %-20s %-5s %6lu %6lu\n",
- what, ewho ? ewho : who, ewhy ? ewhy : why, mode, (unsigned long) uid, (unsigned long) pid);
-
- free(ewho);
- free(ewhy);
-
- dbus_message_iter_next(&sub);
+ printf(" Who: %s (UID %lu/%s, PID %lu/%s)\n"
+ " What: %s\n"
+ " Why: %s\n"
+ " Mode: %s\n\n",
+ who, (unsigned long) uid, strna(u), (unsigned long) pid, strna(comm),
+ what,
+ why,
+ mode);