diff options
-rw-r--r-- | src/logind-session.c | 4 | ||||
-rw-r--r-- | src/pam-module.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/logind-session.c b/src/logind-session.c index b0a09e3d37..63ee75808b 100644 --- a/src/logind-session.c +++ b/src/logind-session.c @@ -536,7 +536,7 @@ int session_start(Session *s) { if (r < 0) return r; - log_full(s->display || s->tty ? LOG_INFO : LOG_DEBUG, + log_full(s->type == SESSION_TTY || s->type == SESSION_X11 ? LOG_INFO : LOG_DEBUG, "New session %s of user %s.", s->id, s->user->name); /* Create cgroup */ @@ -659,7 +659,7 @@ int session_stop(Session *s) { assert(s); if (s->started) - log_full(s->display || s->tty ? LOG_INFO : LOG_DEBUG, + log_full(s->type == SESSION_TTY || s->type == SESSION_X11 ? LOG_INFO : LOG_DEBUG, "Removed session %s.", s->id); /* Kill cgroup */ diff --git a/src/pam-module.c b/src/pam-module.c index e65088638b..46b7becc5d 100644 --- a/src/pam-module.c +++ b/src/pam-module.c @@ -463,6 +463,10 @@ _public_ PAM_EXTERN int pam_sm_open_session( if (isempty(display)) display = tty; tty = ""; + } else if (streq(tty, "cron")) { + /* cron has been setting PAM_TTY to "cron" for a very long time + * and it cannot stop doing that for compatibility reasons. */ + tty = ""; } if (!isempty(cvtnr)) |