s->remote,
s->kill_processes);
+ if (s->type >= 0)
+ fprintf(f,
+ "TYPE=%s\n",
+ session_type_to_string(s->type));
+
if (s->cgroup_path)
fprintf(f,
"CGROUP=%s\n",
*seat = NULL,
*vtnr = NULL,
*leader = NULL,
- *audit_id = NULL;
+ *audit_id = NULL,
+ *type = NULL;
int k, r;
"SERVICE", &s->service,
"VTNR", &vtnr,
"LEADER", &leader,
+ "TYPE", &type,
NULL);
if (r < 0)
}
}
+ if (type) {
+ SessionType t;
+
+ t = session_type_from_string(type);
+ if (t >= 0)
+ s->type = t;
+ }
+
finish:
free(remote);
free(kill_processes);
static const char* const session_type_table[_SESSION_TYPE_MAX] = {
[SESSION_TTY] = "tty",
[SESSION_X11] = "x11",
- [SESSION_OTHER] = "other"
+ [SESSION_UNSPECIFIED] = "unspecified"
};
DEFINE_STRING_TABLE_LOOKUP(session_type, SessionType);