}
static int get_seat_from_display(const char *display, const char **seat, uint32_t *vtnr) {
- char _cleanup_free_ *p = NULL;
+ _cleanup_free_ char *p = NULL;
int r;
- int _cleanup_close_ fd = -1;
+ _cleanup_close_ int fd = -1;
union sockaddr_union sa = {
.un.sun_family = AF_UNIX,
};
struct ucred ucred;
socklen_t l;
- char _cleanup_free_ *tty = NULL;
+ _cleanup_free_ char *tty = NULL;
int v;
assert(display);
seat = strempty(seat);
if (strchr(tty, ':')) {
- /* A tty with a colon is usually an X11 display, place
- * there to show up in utmp. We rearrange things and
- * don't pretend that an X display was a tty */
+ /* A tty with a colon is usually an X11 display,
+ * placed there to show up in utmp. We rearrange
+ * things and don't pretend that an X display was a
+ * tty. */
if (isempty(display))
display = tty;
if (isempty(class))
class = class_pam;
if (isempty(class))
- class = "user";
+ class = streq(type, "unspecified") ? "background" : "user";
remote = !isempty(remote_host) &&
!streq(remote_host, "localhost") &&