login: fix user@.service case, so we don't allow nested sessions (#8051)
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Thu, 22 Feb 2018 20:38:44 +0000 (20:38 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 22 Feb 2018 20:38:44 +0000 (21:38 +0100)
commite8a3144ec4ff332bd63644e468a98e1a7e06e7e4
treef6a35c6eea6d694387695d2745f57ae5ed4e00f9
parent5547c12503a683290eaed47954ffcfb2d1bc03cd
login: fix user@.service case, so we don't allow nested sessions (#8051)

> logind sessions are mostly bound to the audit session concept, and audit
> sessions remain unaffected by "su", in fact they are defined to be
> "sealed off", i.e. in a way that if a process entered a session once, it
> will always stay with it, and so will its children, i.e. the only way to
> get a new session is by forking off something off PID 1 (or something
> similar) that never has been part of a session.

The code had a gap.  user@.service is a special case PAM session which does
not create a logind session.  Let's remember to check for it.

Fixes #8021
src/login/logind-dbus.c