Bug 19234 - MCC: Set up autologin with "default" DE writes corrupted "Session=.desktop" in /etc/sddm.conf, causing X to fail
Summary: MCC: Set up autologin with "default" DE writes corrupted "Session=.desktop" i...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker major
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-08-22 21:57 CEST by Ulrich Beckmann
Modified: 2017-03-06 08:29 CET (History)
9 users (show)

See Also:
Source RPM: drakxtools, desktop-common-data
CVE:
Status comment: needs a fix in chksession


Attachments
Correctly leave Session empty in sddm.conf if no desktop is selected (806 bytes, patch)
2017-03-06 00:39 CET, Frédéric "LpSolit" Buclin
Details | Diff

Description Ulrich Beckmann 2016-08-22 21:57:02 CEST
Description of problem:
Activation of autologin in MCC writes a section [Autologin] to /etc/sddm.conf

[Autologin]
User=bequimao
Session=.desktop

That leads to the so called "good luck" error at reboot.
The error message in journal reads:
Unable to find autologin session entry ".desktop"

Fixed:
[Autologin]
User=bequimao
Session=01plasma.desktop

The name 01plasma.desktop refers to the filename in /usr/share/xsession.
I did not test with different display managers, and I do not know if autologin can be selected in the installer.

Version-Release number of selected component (if applicable):


How reproducible:
Tested with a fresh installation of Mageia-6-RC-x86_64-DVD
See my original comment https://bugs.mageia.org/show_bug.cgi?id=19216#c19

Ulrich

Steps to Reproduce:
1.
2.
3.
Ulrich Beckmann 2016-08-22 22:23:48 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=17617

Comment 1 Marja Van Waes 2016-08-25 06:40:36 CEST
Not sure I'm correctly assigning, please reassign if needed.

CC: (none) => marja11, neoclust
Assignee: bugsquad => thierry.vignaud
Summary: MCC: Set up autologin corrupts file /etc/sddm.conf => MCC: Set up autologin corrupts file /etc/sddm.conf, causing X to fail
Source RPM: (none) => drakxtools

Comment 2 Ulrich Beckmann 2016-08-25 08:14:16 CEST
The fix of desktop-common-data and xdg-compliance
https://bugs.mageia.org/show_bug.cgi?id=17617#c16
didn't change anything. The directory /etc/X11/wmsession.d/ is empty.

Further info:
-----------------------------------------------
[root@localhost ~]# cat /etc/sysconfig/desktop
DISPLAYMANAGER=sddm
[root@localhost ~]#
[root@localhost ~]# ls /usr/share/xsessions/
01plasma.desktop  icewm.desktop  xfce.desktop
[root@localhost ~]#
-----------------------------------------------

There should be a validation before updating /etc/sddm.conf.

Ulrich
Comment 3 Thierry Vignaud 2016-08-25 10:47:52 CEST
1) vmwsessions files have been obsoleted by Colin.
2) You validated the changes by pressing "Ok".
3) I just tested, it correctly writes "Session=01plasma.desktop" to /etc/sddm.conf

Keywords: (none) => NEEDINFO
CC: (none) => mageia

William Kenney 2016-08-25 21:30:04 CEST

CC: (none) => wilcal.int

Comment 4 Ulrich Beckmann 2016-08-26 14:53:50 CEST
I understand now what has happened.
I marked 'Yes, I want autologin ...' and let the selection Default desktop free. Autologin works now, if I choose Plasma as default desktop. The selection 'default' still leads to the 'good luck' error.

There should be really a validation of the entries.

The bright side is
- Other users than me were also trapped into this issue.
- I am really confident that the 'good luck' error is solved (including autologin) on my AMD/ATI hardware after rebuild of all isos.

Switched severity from critical to enhancement.

Thanks,
Ulrich

Severity: critical => enhancement

Comment 5 Rémi Verschelde 2016-08-29 11:29:38 CEST
So if I understand correctly setting up autologin with the "default" desktop entry leads to an empty `.desktop` link and a non-booting DM? That's still pretty critical to me, but I'll let Thierry evaluate.

Keywords: NEEDINFO => (none)
Severity: enhancement => normal

Rémi Verschelde 2016-08-29 11:36:09 CEST

Summary: MCC: Set up autologin corrupts file /etc/sddm.conf, causing X to fail => MCC: Set up autologin with "default" DE writes corrupted "Session=.desktop" in /etc/sddm.conf, causing X to fail

Comment 6 Thierry Vignaud 2016-08-29 11:57:21 CEST
The question is should chksession -l still print out "default"?
Also someone should review the different DE in order to have a global view on what value each DE expects.
Comment 7 Rémi Verschelde 2016-08-29 14:00:55 CEST
Increasing priority as this can easily lead to a non-working DE.

Priority: Normal => release_blocker
Blocks: (none) => 15527
Severity: normal => major

Thierry Vignaud 2016-08-29 15:13:02 CEST

Source RPM: drakxtools => drakxtools, desktop-common-data

Comment 8 David Walser 2016-08-29 15:25:28 CEST
chksession should not print out 'default', but that should be fixed now.

BTW, chksession's lack of an ordering mechanism so that it prints out the correct desktop when none is listed in /etc/sysconfig/desktop, is a different issue than this bug.

CC: (none) => luigiwalser

Comment 9 Bit Twister 2016-08-30 00:56:21 CEST
(In reply to David Walser from comment #8)
> chksession should not print out 'default', but that should be fixed now.

$ chksession -l
Plasma GNOMEClassic GNOME IceWM XfceSession default failsafe


> BTW, chksession's lack of an ordering mechanism so that it prints out the
> correct desktop when none is listed in /etc/sysconfig/desktop, is a
> different issue than this bug.

Speaking of ordering:

$ chksession -L
Plasma=01 GNOMEClassic= GNOME= IceWM= XfceSession=

$ env | grep _DESKTOP | grep XDG
XDG_SESSION_DESKTOP=XFCE
XDG_CURRENT_DESKTOP=XFCE

$ cat /etc/sysconfig/desktop
DISPLAYMANAGER=sddm

CC: (none) => bittwister2

Comment 10 David Walser 2016-08-30 02:03:16 CEST
(In reply to Bit Twister from comment #9)
> (In reply to David Walser from comment #8)
> > chksession should not print out 'default', but that should be fixed now.
> 
> $ chksession -l
> Plasma GNOMEClassic GNOME IceWM XfceSession default failsafe

That's not what I meant; that's not new behavior.  chksession -F should not print default anymore.

> > BTW, chksession's lack of an ordering mechanism so that it prints out the
> > correct desktop when none is listed in /etc/sysconfig/desktop, is a
> > different issue than this bug.
> 
> Speaking of ordering:
> 
> $ chksession -L
> Plasma=01 GNOMEClassic= GNOME= IceWM= XfceSession=

Yep, it no longer has anything to give it that ordering information.

> $ env | grep _DESKTOP | grep XDG
> XDG_SESSION_DESKTOP=XFCE
> XDG_CURRENT_DESKTOP=XFCE
> 
> $ cat /etc/sysconfig/desktop
> DISPLAYMANAGER=sddm

Yes, currently you should have DESKTOP set for it to work correctly.  I also just remembered that regular users have ~/.dmrc files; those aren't going to be read correctly anymore either.
Samuel Verschelde 2016-09-12 16:52:51 CEST

CC: (none) => thierry.vignaud
Assignee: thierry.vignaud => mageiatools

Marja Van Waes 2016-09-22 15:59:55 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=19440

Comment 11 Rémi Verschelde 2016-10-17 14:23:33 CEST
Given:

(In reply to Thierry Vignaud from comment #6)
> The question is should chksession -l still print out "default"?

(In reply to Bit Twister from comment #9)
> $ chksession -l
> Plasma GNOMEClassic GNOME IceWM XfceSession default failsafe

(In reply to David Walser from comment #10)
> That's not what I meant; that's not new behavior.  chksession -F should not
> print default anymore.

What's the status on this bug report? Does the MCC rely on `chksession -l` when it should rely on `chksession -F`?

This bug report lacks a proper debugging of what the issue is that a cauldron user could face now when setting up autologin in MCC.

Whiteboard: (none) => NEEDINFO

Helge Hielscher 2016-11-15 14:50:11 CET

CC: (none) => hhielscher

Comment 12 Thierry Vignaud 2017-01-16 11:15:10 CET
We cannot use -F as it only returns one element so the pull down menu wouldn't have any purpose again.
chksession should not return default or failsafe anymore...
Samuel Verschelde 2017-01-16 11:17:12 CET

Status comment: (none) => needs a fix in chksession

Comment 13 Mageia Robot 2017-01-16 11:22:58 CET
commit 1662a261a3d928e572c7c91bc0d11ce9524a7b01
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Mon Jan 16 11:20:38 2017 +0100

    do not show "default"/"failsafe" in session list
    
    when there's at least one session (mga#19234)
---
 Commit Link:
   http://gitweb.mageia.org/software/desktop/common-data/commit/?id=1662a261a3d928e572c7c91bc0d11ce9524a7b01
Comment 14 Thierry Vignaud 2017-01-16 11:27:47 CET
(In reply to David Walser from comment #8)
> chksession should not print out 'default', but that should be fixed now.

Yes it still does...
Should be fixed in common-data-6.5.tar.xz
Comment 15 David Walser 2017-01-16 15:13:32 CET
(In reply to Thierry Vignaud from comment #14)
> (In reply to David Walser from comment #8)
> > chksession should not print out 'default', but that should be fixed now.
> 
> Yes it still does...
> Should be fixed in common-data-6.5.tar.xz

Again, that's not what I meant.  Please read Comment 10.  I don't think this commit was correct.
Comment 16 Thierry Vignaud 2017-01-16 15:30:53 CET
As I wrote, I'm referring to your comment #8.
I don't care about comment #10 as we don't use the "-F" option that doesn't make any sense for filling a pull down menu
Comment 17 David Walser 2017-01-16 15:33:23 CET
What I was saying is it was wrong for chksession -F to be printing default and we already fixed that.  It's *not* wrong for chksession -l to print default, but you just clobbered that.
Comment 18 Thierry Vignaud 2017-01-16 15:45:50 CET
B/c some people decided to not use wmsessions and thus broke the chksession output and thus its users in drakx.
As nobody is stepping to fix chksession, I'm fixing the existing issues the best way I find.
I don't know how much chksession users were silently broken that way...
Comment 19 David Walser 2017-01-16 15:49:10 CET
OK, but we'll need to see what impact not having default available has.  failsafe probably isn't strictly necessary.  We'll need to make sure that whatever session each individual user chooses continues to be automatically selected on subsequent logins.
Samuel Verschelde 2017-01-17 10:29:39 CET

Blocks: 15527 => (none)

Comment 20 Frédéric "LpSolit" Buclin 2017-03-06 00:39:47 CET
Created attachment 9024 [details]
Correctly leave Session empty in sddm.conf if no desktop is selected

The problem is in any::adapt_desktop_for_plasma() which always append '.desktop' even if no desktop is selected. If I read the SDDM code correctly, it will use the last session used to connect the user, but only if Session in /etc/sddm.conf is left empty. Of course, ".desktop" should not be there.

With the code that Thierry already uploaded, this shouldn't be an issue already, but I think my patch still makes sense to make sure this cannot happen again.

I think that this bug can then be closed.
Comment 21 Rémi Verschelde 2017-03-06 07:38:02 CET
The patch looks good to me.

Keywords: (none) => PATCH
Whiteboard: NEEDINFO => (none)

Comment 22 Mageia Robot 2017-03-06 08:28:55 CET
commit dd985ad2d5d8743e33507017b23100a43876d5d0
Author: Frédéric Buclin <LpSolit@...>
Date:   Mon Mar 6 00:31:55 2017 +0100

    Make sure to leave Session empty in sddm.conf if no desktop is selected (mga#19234)
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=dd985ad2d5d8743e33507017b23100a43876d5d0
Comment 23 Nicolas Lécureuil 2017-03-06 08:29:17 CET
i just pushed it as it seems OK for me too.

Status: NEW => RESOLVED
Resolution: (none) => FIXED
CC: (none) => mageia


Note You need to log in before you can comment on or make changes to this bug.