chiark / gitweb /
pam-module: treat "cron" in PAM_TTY as empty tty
[elogind.git] / src / pam-module.c
index e65088638b6de4d99683f9252a8776f8f28ac916..46b7becc5d04480d7ea5ef79f5e61dc975620fb7 100644 (file)
@@ -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))