mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 18:27:04 +03:00
pam: fix up tty if it is actually a display
This commit is contained in:
parent
a91e4e5337
commit
ee8545b06c
@ -382,6 +382,16 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
|||||||
remote_host = strempty(remote_host);
|
remote_host = strempty(remote_host);
|
||||||
seat = strempty(seat);
|
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 */
|
||||||
|
|
||||||
|
if (isempty(display))
|
||||||
|
display = tty;
|
||||||
|
tty = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
type = !isempty(display) ? "x11" :
|
type = !isempty(display) ? "x11" :
|
||||||
!isempty(tty) ? "tty" : "other";
|
!isempty(tty) ? "tty" : "other";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user