Subject: Bug#3730: improper lookup of window managers by /etc/X11/Xsession

From: [email-masked]
Date: Tue, 9 Jul 1996 08:58:30 -0400 (EDT)

Package: xbase
Version: 3.1.2-9

Xsession searches for a window manager to run using

for i in `cat /etc/X11/window-managers`
...

Unfortunately, window-managers contains comment lines, beginning with #.
The above line causes the # signs and all words of the comment to be
tested as possible window managers.  If a user invoking startx had one
of those words as a command in their search path, bad things would
happen.  This can be easily fixed by changing the line to

for i in `grep -v \# /etc/X11/window-managers`

I am using Debian 1.1.

Andrew Booker
[email-masked]

---

From: Stephen Early <[email-masked]>
Date: Tue, 9 Jul 1996 15:37:56 +0100 (BST)

> Unfortunately, window-managers contains comment lines, beginning with #.

Good point. I was being lazy when I wrote that. I will incorporate your
change.

Steve Early
[email-masked]

---

From: Dan Stromberg <[email-masked]>
Date: Wed, 10 Jul 1996 10:53:45 -0700

Or even:

for i in `sed -e 's/#.*$//' -e '/^$/d' < /etc/X11/window-managers`

...this allows window-managers to have entries like:

/usr/X11R6/bin/fvwm # formerly "feeble virtual window manager"

---

From: [email-masked]
Date: Thu, 11 Jul 1996 08:22:06 -0400 (EDT)

> /usr/X11R6/bin/fvwm # formerly "feeble virtual window manager"

Sure, although this could be shortened to

for i in `sed 's/#.*//' /etc/X11/window-managers`

since the shell will skip blank lines anyway.

I imagine most people would be happy with just grep -v \#.  :)

Andrew Booker
[email-masked]