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

Re: Security Implications of running startx from command line - was Re: Startx: was Great Debian experience



On 2014-03-21 13:35:37 -0400, Steve Litt of Troubleshooters.Com wrote:
> To cure my paranoia of having stdout going to an unknown place, I made
> the following executable /usr/local/bin/exx:
> 
> ==========================
> #!/bin/bash
> startx > /dev/null & exit
> ==========================
> 
> I invoke it like this:
> 
> . exx
> 
> I think that dot space before the command is similar to "exec", which
> runs it in the current process, so the current process, rather than a
> spawned process, is what gets exited. It appears to work perfectly,
> logging out tty1 the instant X is up and running.
> 
> I didn't plan this, but this 2 line shellscript has the added benefit
> that if I forget the dot, and forgetting it would leave the bash
> session open, it tells me I don't have privileges to run X, and refuses
> to run X. So I can't make a dumb mistake.

It might be a bug and the behavior might change in the future.

To really make sure that X won't run if you forget the dot:

#!/bin/false
startx > /dev/null & exit

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: