summaryrefslogtreecommitdiff
path: root/daemon/gdm-display.c
Commit message (Collapse)AuthorAgeFilesLines
* gdm-display: Use g_auto*Alessandro Bono2023-04-281-64/+25
|
* gdm-display: Plug a memory leakAlessandro Bono2023-04-281-2/+1
| | | | error was not freed in the second if branch. While at it use g_autoptr.
* gdm-display: Add missing guards in public functionsAlessandro Bono2022-10-291-0/+13
|
* gdm-display: Simplify codeAlessandro Bono2022-10-271-5/+1
| | | | | | | | | Just pass the error we received from the caller. While this doesn't change much, it avoids a scan-build warning: ../daemon/gdm-display.c:213:73: warning: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error') [core.NullDereference] g_critical ("could not create display access file: %s", error->message); ^~~~~~~~~~~~~~
* gdm-display: Remove dead codeAlessandro Bono2022-10-271-1/+0
| | | | Value stored to 'ret' is never read
* gdm-display: Use g_clear_handle_idAlessandro Bono2022-10-271-8/+3
|
* gdm-display: Plug a memory leakAlessandro Bono2022-09-271-8/+3
| | | | | | | Use g_autofree to avoid manual memory handling. While at it use g_strdup_printf which is safer since it avoid us to calculate how much memory we need to allocate. Fixes: 08eee2ae1175cc43015329a00230f38066130c57
* daemon: Provide more flexibility for configuring display serverRay Strode2021-07-221-0/+36
| | | | | | | | | | | | | | | | | | | There's currently a way to disable wayland, but no way to disable Xorg. We currently prefer wayland if it's not disabled, but have no way to prefer Xorg without disabling wayland entirely. There's currently no way use legacy Xorg support at all if user display server support is enabled at a build time. This commit adds more flexibility to display server selection. It adds two new keys: XorgEnable and and PreferredDisplayServer. XorgEnable=false disables Xorg support entirely on seat 0. PreferredDisplayServer can be set to "wayland", "xorg", "legacy-xorg" or "none" to select which display server is used by default. If it's set to "wayland", it will fall back to "xorg". If it's set to "xorg" it will fall back to "wayland".
* display: Handle failure before display registrationRay Strode2021-07-221-5/+3
| | | | | | | | | | | | Normally, e.g., gdm-wayland-session would register its display before starting the session. This display registration is how the display moves to the "managed" state. We currently detect session failure in gdm_display_unmanage. If gdm-wayland-session is killed before it registers the display, gdm_display_unmanage won't run, and failure won't be detected. This commit make gdm_display_unmanage get called, even if the display isn't yet fully managed.
* display: Use autoptr to handle errors in look for existing usersMarco Trevisan (Treviño)2020-11-031-10/+7
| | | | It will make things just cleaner
* display: Exit with failure if loading existing users failsMarco Trevisan (Treviño)2020-11-031-4/+7
| | | | | | | | | | | | Given not having users may make GDM to launch initial setup, that allows to create new users (potentially with sudo capabilities), it's better to make look_for_existing_users() to return its status and only if it didn't fail continue the gdm execution. GHSL-2020-202 CVE-2020-16125 Fixes #642
* display: fix "forceing" typo in debug messageWill Thompson2019-09-041-1/+1
|
* GdmDisplay: Remove an unused GErrorIain Lane2019-05-291-1/+0
|
* Allow sessions to register with GDMIain Lane2019-05-291-14/+2
| | | | | | | | | | | | | | | | | | | | | | Recording when sessions start, for Wayland → Xorg fallback or transitioning to the user session, is currently done with timeouts. This isn't ideal, because on some very slow machines the timeout can be hit before the session has had a chance to fail: if gnome-session takes more than 3 seconds to fail then the session will be considered to have exited rather than failed, and so we don't do Xorg fallback. We can do this more reliably if we allow sessions to optionally register themselves with GDM. Then we will know when they've started, so can shut down the greeter or fall back to Xorg as appropriate. The mechanism is that they specify X-GDM-SessionRegisters=true in their file, and then call RegsterSession on the DisplayManager interface on the bus (added in the previous commit) to say that they've started up. If X-GDM-SessionRegisters is missing or false, GDM will call the same method for them after 10 seconds. Closes: #483
* GdmManager, GdmDisplay: Add RegisterSession methodIain Lane2019-05-291-0/+27
| | | | | Window managers can use this to register with GDM when they've finished starting up and started displaying.
* Use G_PARAM_STATIC_STRIGS on propertiesNiels De Graef2019-01-071-18/+18
| | | | This prevents strings from being unnecessarily copied.
* display: use G_DECLARE_DERIVABLE_TYPENiels De Graef2018-12-231-213/+351
|
* manager: do initial-setup post work in manager codeRay Strode2018-10-061-132/+0
| | | | | | | | | | | | Right now we do the initial-setup related post work when stopping the greeter, but the problem is we delay stopping the greeter now until after the user session is started. That post-work needs to be done before the user session is started. This commit moves the code to a more logical place.
* display: tie skeleton handlers to object lifetimeRay Strode2018-08-131-12/+12
| | | | | | | | | | | | | | | | | Right now we assume a display skeleton object won't outlive its associated display object. In theory that should be true, but if we accidentally leak the skeleton it could erroneously happen. If that does happen then we'll end accessing free'd memory, so the leak will turn into a crasher. This commit addresses this problem by ensuring the skeleton signal handlers are disconnected when the associated display object goes away. CVE-2018-14424
* Remove unused variableRobert Ancell2017-12-041-2/+0
|
* display: don't mark initial-setup ran until it ranRay Strode2017-10-241-10/+12
| | | | | | | | | | We don't want to skip running initial setup if wayland fell back or something. This commit makes sure we only stop trying to start initial-setup after it's completed. https://bugzilla.gnome.org/show_bug.cgi?id=789434
* Use standard exit codes.Robert Ancell2017-10-031-1/+1
| | | | | | | | | Use EXIT_ defines for readibility. There were some exit codes > 1, but they don't seem to be checked by any of the parent process code. This does mean that the logs might have changed, but modern logging techniques have probably made this obsolete. https://bugzilla.gnome.org/show_bug.cgi?id=788307
* display: Allow user to set gnome.initial-setup=(0|1)Sam Spilsbury2017-10-031-0/+119
| | | | | | This will either force the initial setup to run or not to run Fixes #787286
* daemon: Remove obsolete module gdm-xerrorsRobert Ancell2017-09-281-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=788303
* slave: kill off clients from display when finishedRay Strode2016-12-131-0/+29
| | | | | | | | | | When we're done with the display we need to kill off any clients that are lingering and close our own connection to the display. This is so, for instance, processes from the session don't stick around on a -noreset Xvnc server (or something) https://bugzilla.gnome.org/show_bug.cgi?id=776059
* display: port GdmDisplay to xcbRay Strode2016-12-131-97/+120
| | | | | | | | | | Xlib will kill the process if it notices the display connection has gone away. This is suboptimal for the main gdm process! This commit ports the Xlib code to xcb, so it won't have the above fragility. https://bugzilla.gnome.org/show_bug.cgi?id=776059
* display: close X11 connectionRay Strode2016-12-131-0/+8
| | | | | | | We're opening an X11 connection but never closing it, this commit fixes that. https://bugzilla.gnome.org/show_bug.cgi?id=776059
* daemon: update X11DisplayName on register displayMathias Reck2016-11-101-1/+1
| | | | | | | | | When a display registered, the sessions 'display-name' was already updated. The displays 'x11-display-name' however was not, so I've just added that. Of course that also meant that the 'x11-display-name' could no longer be constructor only. https://bugzilla.gnome.org/show_bug.cgi?id=752341
* display: don't complain if we dispose PREPARED displayRay Strode2015-09-141-1/+0
| | | | | | | | It's expected now that we may dispose a display when it's prepared (if it was prepared but then we determined we were going to autologin instead). https://bugzilla.gnome.org/show_bug.cgi?id=749418
* display: move gdm_display_get_timed_login_details to managerRay Strode2015-03-191-92/+0
| | | | | | | | | The function is no longer virtualized among the display types, and it doesn't actually have a full picture of whether or not the display should do automatic/timed login so move it up to the manager, where all the information is. https://bugzilla.gnome.org/show_bug.cgi?id=746492
* display: move timed login g_debug up a littleRay Strode2015-03-101-12/+12
| | | | | This way we aren't printing gibberish from the already freed username.
* display: add more debug spewRay Strode2015-03-061-0/+8
|
* display: include seat in debug messageRay Strode2015-03-061-4/+6
| | | | | This will help make it more clear why autologin goes one way or the other.
* display: drop set_up_greeter_session functionRay Strode2015-03-021-13/+0
| | | | | | | | The function is ill named and ill placed. It really just returns the username of the client that's allowed to connect to the display. This commit moves the function to gdm-manager.c
* display: improve autologin debug messageRay Strode2015-02-271-6/+11
|
* display: invert g_warn_if_fail conditionalsRay Strode2015-02-271-2/+2
| | | | | | I got them inverted in my head when I did commit 678ac9657d3166dcdeadbccb7ad9427ba0677339
* display: turn some assertions into warningsRay Strode2015-02-261-4/+4
| | | | | | It's clear there's a bug if they're hit, but we shouldn't tank, since it's not a fatal bug.
* display: determine whether or not initial-setup should run earlierRay Strode2015-02-211-2/+3
| | | | | We consult whether or not to run initial-setup before we figure it out.
* display: contact accountsservice up frontRay Strode2015-02-201-42/+36
| | | | | | | | | | We need to know if there are any user accounts before the display is prepared, since we use that information to figure out how to prepare the display. Fixes gnome-shell tanking on start up with wayland. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: add session-type propertyRay Strode2015-02-181-0/+23
| | | | | | | | | | | The session-type property is analagous to the sd_login session type. It can be either "x11" or "wayland". This helps us decide whether to start a wayland session or an X session. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: only add user authorization if connected to displayRay Strode2015-02-181-0/+15
| | | | | | | | | | | If we aren't connected to the display then we can't give the user access to it,(and we don't need to anyway) This commit adds a new is-connected property to GdmDisplay and changes the code to never give a user authorization if we aren't connected. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: only create Xauth file for legacy code pathsRay Strode2015-02-181-12/+11
| | | | | | GdmLocalDisplay doesn't need it, so don't bother doing it then. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: add new session-class propertyRay Strode2015-02-181-1/+32
| | | | | | | | | | | | | | The session-class property is analagous to the sd_login session class. It can be either "greeter" or "user". This helps us decide whether or not to add a launch environment to the display. We need this because some displays go straight to a user session. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* session: forward is-initial from display to workerRay Strode2015-02-181-0/+6
| | | | | | | | The worker needs to know if a display should be forced on vt1 or not when deciding which vt to allocate for the logind session. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: don't export so much stuff over system busRay Strode2015-02-181-122/+0
| | | | | | | | | | When the slave was in a different process we needed to interact with the display in the manager process remotely. Now it's all one process and we don't, so clean up what gets exported over the bus. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: don't make d-bus object path require display numberRay Strode2015-02-181-8/+2
| | | | | | | | Going forward we aren't always going to know the display number ahead of time, so don't use it for encoding the display id. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: drop base class implementation of manage vfuncRay Strode2015-02-181-7/+0
| | | | | | | All it does is set the managed state, which the subclasses can do just as easily, so cut out some code. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* slave: drop the slavesRay Strode2015-02-181-82/+43
| | | | | | | At this point the slaves do nothing useful, so we can get rid of them. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: get rid of more simple slave code.Ray Strode2015-02-181-8/+1
| | | | | | | This commit moves GdmServer to GdmLocalDisplay, and XDMCP connection retries to GdmXdmcpDisplay. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: add back manage vfuncRay Strode2015-02-181-1/+10
| | | | | | | This function will be overridden by GdmLocalDisplay to start the X server. https://bugzilla.gnome.org/show_bug.cgi?id=744764