+ if (sd_bus_get_peer_creds(b, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM, &creds) >= 0 &&
+ sd_bus_creds_get_uid(creds, &uid) >= 0 &&
+ sd_bus_creds_get_pid(creds, &pid) >= 0 &&
+ sd_bus_creds_get_cmdline(creds, &cmdline) >= 0 &&
+ sd_bus_creds_get_comm(creds, &comm) >= 0) {
+ _cleanup_free_ char *p = NULL, *name = NULL;
+
+ name = uid_to_name(uid);
+ if (!name) {
+ r = log_oom();
+ goto finish;
+ }
+
+ p = strv_join(cmdline, " ");
+ if (!p) {
+ r = log_oom();
+ goto finish;
+ }
+
+ /* The status string gets the full command line ... */
+ sd_notifyf(false,
+ "STATUS=Processing requests from client PID %lu (%s); UID %lu (%s)",
+ (unsigned long) pid, p,
+ (unsigned long) uid, name);
+
+ /* ... and the argv line only the short comm */
+ if (arg_command_line_buffer) {
+ size_t m, w;
+
+ m = strlen(arg_command_line_buffer);
+ w = snprintf(arg_command_line_buffer, m,
+ "[PID %lu/%s; UID %lu/%s]",
+ (unsigned long) pid, comm,
+ (unsigned long) uid, name);
+
+ if (m > w)
+ memset(arg_command_line_buffer + w, 0, m - w);
+
+ }
+ }
+