[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /home as noexec and X



*-Avery Pennarun <apenwarr@worldvisions.ca>
|
| On Wed, Dec 09, 1998 at 08:23:46AM -0800, Ben Gertzfield wrote:
| 
| > Well, there does remain the fact that ~/.xsession does not need to be
| > an sh script, but I totally agree; Debian should not require
| > ~/.xsession to be executable. I don't think any other Unixes do.
| 
| The session start script at U Waterloo uses logic something like this:
| 
| 	if [ -e ~/.xsession ]; then
| 		if [ -x ~/.xsession ]; then
| 			exec ~/.xession
| 		else
| 			sh ~/.xsession
| 		fi
| 	fi

I though I made a wishlist bug against xbase about this, but I can't
find it. Probably forgot... Anyway, I think my suggestion was quite
similar:

if [ -f $startup ] && grep -q ^allow-user-xsession /etc/X11/config
then
  if [ -x $startup ]
  then
    exec $startup
  else
    exec /bin/sh $startup
  fi
fi

This should correctly handle shell scripts with execute perm, shell
scripts without execute perm and other types of files with execute
perm. (If we don't count the numerous gross errors that I probably
have made :-)

-- 
...Unix, MS-DOS, and MS Windows (also known as the Good, the Bad,
and the Ugly).                                       (Matt Welsh)
olet@ifi.uio.no   [-: .elOle. :-]   olet@debian.org


Reply to: