flaws in xinitrc-ng

Jan Rękorajski baggins at pld-linux.org
Sun Jan 29 16:34:14 CET 2012


On Sun, 29 Jan 2012, Elan Ruusamäe wrote:

> hi
> 
> our latest and greatest release
> <http://svn.pld-linux.org/trac/svn/browser/xinitrc-ng/trunk/xinitdefs?annotate=blame>http://svn.pld-linux.org/trac/svn/browser/xinitrc-ng/trunk/xinitdefs?annotate=blame&rev=12296 
> <http://svn.pld-linux.org/trac/svn/browser/xinitrc-ng/trunk/xinitdefs?annotate=blame&rev=12296>
> 
> 
> 78    # Run all system xinitrc shell scripts.
				^^^^^^^
> 79    for i in /etc/X11/xinit/xinitrc.d/* ; do
> 80            if [ -x "$i" ]; then
> 81                    . "$i"
> 82            fi
> 83    done
> 
> this code has several flaws:
> 
> 1) what if script sourced writes "exit 1"?
> 
> * for first, it will prevent further scripts being executed as they are 
> sourced
> * for second, WM will consider startup failed and will exit
> * for third, the scripts must be written in /bin/sh compatible way! (no 
> .csh, no .pl)
> 
> so whole session is aborted, user is not logged in, and rather hard to 
> diagnose why log in failed!
> 
> 2) common backups should be excluded, or only known file extensions 
> processed
> otherwise you end up easily running same script twice.
> 
> how to proceed here?
> for first problem, make all -x scripts executed, not sourced?
> for second problem allow only known extensions, or build blacklist of 
> backup files?

See underlined text. Fixed in SVN.
And I checked, there are only .sh files there.

-- 
Jan Rękorajski            |  ALL SUSPECTS ARE GUILTY. PERIOD!
baggins<at>mimuw.edu.pl   |  OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY?
BOFH, MANIAC              |                   -- TROOPS by Kevin Rubio


More information about the pld-devel-en mailing list