[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: quanta [POSSIBLY UNSAFE]
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2002-12-09 2:03:58
[Download RAW message or body]

On Sun, Dec 08, 2002 at 09:50:26PM +0200, Andras Mantia wrote:
> [...]
> > > I made a simple shell script:
> > > #!/bin/sh
> > > ls -l $1
> > >
> > >  Saved in a file, and set it to executable. Now, if I run without shell,
> > > it does not run, but running inside a shell runs well. Of course, this
> > > has $1 inside, but we need such things.
> >
> > this must have another reason. the sript is executed by the shell in
> > either case (how else?).
> 
> Don't know.... The fact is that  the above files is executed if I use 
> setUserShell(true) and it isn't if I don't use.
> 
probably because the arguments you supply to kprocess are simply
unsuitable for execution without a shell. with a shell all args are
simply concatenated and then word-split and substituted by the shell
(that's why they need to be quoted), while without a shell every
argument is sort of automatically quoted - entering "echo hallo" (with
the quotes) on the command line does not work, either. especially, if
you additionally quote it - then it's something like "'echo hallo'".

greetings

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic