return 1;
}
+static int pr_sd_seat(char *restrict const outbuf, const proc_t *restrict const pp){
+ int r;
+ size_t len;
+ char *session;
+ char *seat;
+ r = sd_pid_get_session(pp->tgid, &session);
+ if(r<0) goto fail;
+ r = sd_session_get_seat(session, &seat);
+ free(session);
+ if(r<0) goto fail;
+ len = snprintf(outbuf, COLWID, "%s", seat);
+ free(seat);
+ return len;
+
+fail:
+ outbuf[0] = '-';
+ outbuf[1] = '\0';
+ return 1;
+}
+
#endif
/****************** FLASK & seLinux security stuff **********************/
// move the bulk of this to libproc sometime
#ifdef WITH_SYSTEMD
{"sd_machine","MACHINE", pr_sd_machine, sr_nop, 31, 0, LNX, ET|LEFT},
{"sd_ouid", "OWNER", pr_sd_ouid, sr_nop, 5, 0, LNX, ET|LEFT},
+{"sd_seat", "SEAT", pr_sd_seat, sr_nop, 11, 0, LNX, ET|LEFT},
{"sd_session","SESSION", pr_sd_session, sr_nop, 11, 0, LNX, ET|LEFT},
{"sd_unit", "UNIT", pr_sd_unit, sr_nop, 31, 0, LNX, ET|LEFT},
{"sd_uunit", "UUNIT", pr_sd_uunit, sr_nop, 31, 0, LNX, ET|LEFT},