Bug 211624

Summary: x11/xdm: Use MIT-MAGIC-COOKIE-1 by default
Product: Ports & Packages Reporter: Tobias Kortkamp <tobik>
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Many People CC: cy, gerrit.kuehn, koobs, olgeni, pi, x11
Priority: Normal Keywords: easy, patch
Version: LatestFlags: pi: maintainer-feedback+
pi: merge-quarterly+
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 154502, 191296    
Attachments:
Description Flags
xdm.diff tobik: maintainer-approval? (x11)

Description Tobias Kortkamp freebsd_committer freebsd_triage 2016-08-06 11:42:49 UTC
Created attachment 173356 [details]
xdm.diff

xdm has issues on FreeBSD in the default configuration.  I've had errors where I was successfully logged in and then my X session died immediately.  With xdm's default config SDL2 clients cannot be run, quitting with:

XDM authorization key matches an existing client!

There are other related issues (see linked bugs).  All of these issues seem to boil down to XDM-AUTHORIZATION-1 being broken.  Adding 

DisplayManager.*.authName:     MIT-MAGIC-COOKIE-1

in xdm-config solves all of these problems.  I would like to see this in xdm in the default configuration.

OpenBSD has done this since OpenBSD 2.4: http://cvsweb.openbsd.org/cgi-bin/cvsweb/xenocara/app/xdm/config/xdm-config.cpp?rev=1.5&content-type=text/x-cvsweb-markup

There is a related issue on the Debian bug tracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=486606
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2016-08-06 11:59:58 UTC
@Tobias, if this issues proposed change fixes bug 191296 and bug 154502, please add those bug ID's to blocks (and remove them from See Also)

Thank you for your report, we need more of these default config improvements :)
Comment 2 gerrit.kuehn 2016-08-08 06:33:53 UTC
Please make this important change. I intended to write a bug report like this a couple of times, but never managed to actually do it.
Comment 3 Jimmy Olgeni freebsd_committer freebsd_triage 2016-08-08 07:47:46 UTC
I had to do the same thing to make mate work with xdm - seems pretty general.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2016-08-08 12:18:34 UTC
Pending maintainer timeout

@Tobias can you confirm this passes QA please
Comment 5 Tobias Kortkamp freebsd_committer freebsd_triage 2016-08-08 14:00:59 UTC
(In reply to Kubilay Kocak from comment #4)
It builds fine in Poudriere@FreeBSD 10.3/am64, but portlint gives some warnings (patches not being generated by `make makepatch` and some plist problems. See http://paste2.org/WysWXAyD).  These were pre-existing issues though.
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-08-26 13:57:23 UTC
A commit references this bug:

Author: pi
Date: Fri Aug 26 13:57:14 UTC 2016
New revision: 420921
URL: https://svnweb.freebsd.org/changeset/ports/420921

Log:
  x11/xdm: Use MIT-MAGIC-COOKIE-1 by default

  - It is more useful that way
  - pet portlint for the patches

  PR:		211624
  MFH:		2016Q3
  Submitted by:	Tobias Kortkamp <t@tobik.me>

Changes:
  head/x11/xdm/Makefile
  head/x11/xdm/files/patch-config-Makefile.in
  head/x11/xdm/files/patch-config-Xresources.cpp
  head/x11/xdm/files/patch-config_xdm-config.cpp
  head/x11/xdm/files/patch-greeter-greet.c
  head/x11/xdm/files/patch-xdm_session.c
Comment 7 Kurt Jaeger freebsd_committer freebsd_triage 2016-08-26 13:57:30 UTC
Committed, pending MFH
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-08-26 15:32:30 UTC
A commit references this bug:

Author: pi
Date: Fri Aug 26 15:32:16 UTC 2016
New revision: 420926
URL: https://svnweb.freebsd.org/changeset/ports/420926

Log:
  x11/xdm: minimize the patch to config/xdm-config.cpp

  PR:		211624
  MFH:		2016Q3
  Reported by:	ak

Changes:
  head/x11/xdm/Makefile
  head/x11/xdm/files/patch-config_xdm-config.cpp
Comment 9 commit-hook freebsd_committer freebsd_triage 2016-08-26 16:19:38 UTC
A commit references this bug:

Author: pi
Date: Fri Aug 26 16:19:05 UTC 2016
New revision: 420929
URL: https://svnweb.freebsd.org/changeset/ports/420929

Log:
  x11/xdm: remove part of files/patch-greeter-greet.c that no longer applies

  PR:		211624
  Reported by:	ak

Changes:
  head/x11/xdm/Makefile
  head/x11/xdm/files/patch-greeter-greet.c
Comment 10 Cy Schubert freebsd_committer freebsd_triage 2016-08-27 00:08:57 UTC
The commits broke xdm.

Protocol not supported by server
Protocol not supported by server
xhost:  unable to open display ":0"
Protocol not supported by server
xmodmap:  unable to open display ':0'
Protocol not supported by server
Can't open display :0
Protocol not supported by server
xrdb: Resource temporarily unavailable
xrdb: Can't open display ':0'
Protocol not supported by server
Error: Can't open display: :0
Protocol not supported by server
xmodmap:  unable to open display ':0'
Protocol not supported by server
xrdb: Resource temporarily unavailable
xrdb: Can't open display ':0'
Protocol not supported by server
xmodmap:  unable to open display ':0'
Protocol not supported by server
/usr/local/bin/xset:  unable to open display ":0"
Protocol not supported by server
/usr/local/bin/xsetroot:  unable to open display ':0'
Protocol not supported by server
Error: Can't open display: :0
Protocol not supported by server
Error: Can't open display: :0
Protocol not supported by server
xscreensaver: 16:23:02: Can't open display: :0
xscreensaver: 16:23:02: initial effective uid/gid was root/schubert (0/1000)
xscreensaver: 16:23:02: running as cy/schubert (1000/1000)

xscreensaver: 16:23:02: This is probably because you're logging in as root.  You
              shouldn't log in as root: you should log in as a normal user,
              and then `su' as needed.  If you insist on logging in as
              root, you will have to turn off X's security features before
              xscreensaver will work.

              Please read the manual and FAQ for more information:

              https://www.jwz.org/xscreensaver/faq.html
              https://www.jwz.org/xscreensaver/man.html

Protocol not supported by server
mwm: Could not open display.
Comment 11 Kubilay Kocak freebsd_committer freebsd_triage 2016-08-27 08:03:14 UTC
(In reply to Cy Schubert from comment #10)

Can you isolate which commit caused the issue/regression?
Comment 12 Cy Schubert freebsd_committer freebsd_triage 2016-08-27 17:27:19 UTC
It appeared that files/patch-xdm_session.c in r420921 might have been the cause. But that was not the problem. I was performing a buildworld/installworld (-current) at the time I was building the port. Rebuilding the port again after installworld seems to have resolved the problem.
Comment 13 commit-hook freebsd_committer freebsd_triage 2016-08-30 17:55:38 UTC
A commit references this bug:

Author: pi
Date: Tue Aug 30 17:55:04 UTC 2016
New revision: 421126
URL: https://svnweb.freebsd.org/changeset/ports/421126

Log:
  x11/xdm: Use MIT-MAGIC-COOKIE-1 by default

  MFH: r420921 r420926 r420929

  - It is more useful that way
  - pet portlint for the patches

  PR:		211624
  Submitted by:	Tobias Kortkamp <t@tobik.me>
  Reported by:	ak
  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2016Q3/
  branches/2016Q3/x11/xdm/Makefile
  branches/2016Q3/x11/xdm/files/patch-config-Makefile.in
  branches/2016Q3/x11/xdm/files/patch-config-Xresources.cpp
  branches/2016Q3/x11/xdm/files/patch-config_xdm-config.cpp
  branches/2016Q3/x11/xdm/files/patch-greeter-greet.c
  branches/2016Q3/x11/xdm/files/patch-xdm_session.c
Comment 14 Kurt Jaeger freebsd_committer freebsd_triage 2016-08-30 17:58:02 UTC
MFH done.