Skip to content

WIP: Xorg user session - #673

Closed
plfiorini wants to merge 2 commits into
sddm:developfrom
plfiorini:feature/xorguser
Closed

plfiorini wants to merge 2 commits into
sddm:developfrom
plfiorini:feature/xorguser

Conversation

@plfiorini

Copy link
Copy Markdown
Member

No description provided.

@plfiorini

Copy link
Copy Markdown
Member Author

Status: Xorg starts as a user, the logs in ~sddm/.local/share/xorg/Xorg.0.log reports that it has started with logind but for some reason the devices are paused in fact I can't use the keyboard and even if the greeter is started I can't see anything.

@davidedmundson can you give me a hand to figure out what's going on here?

Comment thread src/daemon/VirtualTerminal.cpp Outdated
qDebug() << "VT mode didn't need to be fixed";
}

int openVt(int vt) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename this to openTty

@davidedmundson

Copy link
Copy Markdown
Contributor

Found what's wrong.

X starts goes through PAM and gets its own logind session.
The greeter starts, goes through PAM and gets its own logind session.

The session with X then gets the pauseDevices signal from logind.
This stops the devices working

(weirdly no attempt to activate later sends the resumeDevice signal)

Solution will be to spawn the greeter from the same sddm-helper as the display manager.
(or conversely to start X from the same sddm-helper as the greeter)

Which seems to be what GDM does

@plfiorini

Copy link
Copy Markdown
Member Author

@davidedmundson thanks! it should be fairly easy to implement it. will get back to work asap

@plfiorini

Copy link
Copy Markdown
Member Author

Note to self: Xorg user session might break existing workflows such as Xvnc; consider adding a Privileged=false property under the X11 section that would allow people to revert to privileged X11

@plfiorini
plfiorini changed the base branch from master to develop February 26, 2017 18:46
We are already in a if that checks whether is in test mode or not.
Changes to settings:
 * Change `ServerPath` setting on `X11` section.
 * Add boolean `Unprivileged` setting to `X11` section, runs Xorg
   user session when `true`.

Move code to run display server and greeter into a separate program called
sddm-display that is executed:
 * as the same user as the daemon in test mode
 * as sddm when `Unprivileged` is `true`
 * as root when `Unprivileged` is `false`

With this change, Xorg server and greeter are executed within the same session.

The daemon allocates a virtual terminal for the greeter, meaning that it's no
longer possible to configure the minimum virtual terminal.

A new virtual terminal is always allocated for each user session.

X11 user sessions always run a separate Xorg server without root privileges.

TODO: in Display implement running in test mode
TODO: in Display use QProcess when not unprivileged
TODO: Implement Auth::stop() and use it to stop Display
TODO: return display name and cookie from sddm-display to daemon via socket
FIXME: when unprivileged, display setup and display stop scripts are executed as sddm

TESTED USE CASES:
- [ ] one xorg server as root that does greeter and user session
- [X] xorg server as sddm, xorg server as plfiorini user with a desktop
- [ ] one xorg server as root for greeter, wayland user session
- [ ] xorg server as sddm, wayland user session

[ChangeLog][Daemon] Add Xorg user session support.
@Sunderland93

Copy link
Copy Markdown

Any progress?

@xlmnxp xlmnxp left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good 👍

@majkrzak majkrzak mentioned this pull request Jul 27, 2018
6 tasks done
@sandy-8925

Copy link
Copy Markdown

Is there any remaining work that needs to be done for this PR? Are you guys planning to merge this in at any time?

@ghost

ghost commented Sep 29, 2018

Copy link
Copy Markdown

Is there any remaining work that needs to be done for this PR? Are you guys planning to merge this in at any time?

I really hope so! Running the login manager and consequently the entire desktop environment without root privileges should not be considered a secondary, optional thing, expecially considering the state of Xorg security.

@Ryujinra

Copy link
Copy Markdown

Is there any plan going forward to merge this PR at this point? Are there any unmentioned problems blocking this?

@davidedmundson

Copy link
Copy Markdown
Contributor

There are mentioned problems.

@Ryujinra

Copy link
Copy Markdown

There are mentioned problems.

@plfiorini made several commits in Feb 2017 which added the new greeter/server structure and appear to address the issues raised in Oct 2016 regarding the ability to continue to run a privileged xorg instance. Evidently, wayland user sessions have not been tested but if the conflicts can be resolved we can start testing the untested cases described in #673 91a8143.

@ariasuni

Copy link
Copy Markdown

Any news on this?

@plfiorini plfiorini closed this Aug 29, 2019
@plfiorini
plfiorini deleted the feature/xorguser branch August 29, 2019 06:13
@devurandom

devurandom commented Oct 6, 2019 •

Copy link
Copy Markdown

@plfiorini You closed this PR, but according to GitHub it was not merged. What is the plan for this and #246?

@Myrddin-Wyllt

Myrddin-Wyllt commented Oct 20, 2019 •

Copy link
Copy Markdown

@devurandom It looks like he's working on it in the xorguser2019 branch.

@devurandom

Copy link
Copy Markdown

@devurandom It looks like he's working on it in the xorguser2019 branch.

Thank you, @Myrddin-Wyllt, for figuring that out. I do not see any PR for this and the branch is still live. Any idea when this might be coming?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants