Re: without shell

2005-06-10 Thread Terry Hancock
On Friday 10 June 2005 05:30 am, Tomasz Rola wrote: > On Sun, 12 Jun 2005, km wrote: > > > hi all, > > > > can any linux command be invoked/ executed without using shell (bash) ? > > what abt security concerns ? > > Ops, I missed the word "command" when reading your mail for the first > time, an

Re: without shell

2005-06-10 Thread Reinhold Birkenfeld
Donn Cave wrote: >> Not according the the docs: >> >> Also, for each of these variants, on Unix, cmd may be a >> sequence, in which case arguments will be passed directly to >> the program without shell intervention (as with os.spawnv()). >> If cmd is a string it will be passed to the she

Re: without shell

2005-06-10 Thread Grant Edwards
On 2005-06-10, Donn Cave <[EMAIL PROTECTED]> wrote: >> Also, for each of these variants, on Unix, cmd may be a >> sequence, in which case arguments will be passed directly to >> the program without shell intervention (as with os.spawnv()). >> If cmd is a string it will be passed to the she

Re: without shell

2005-06-10 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: ... > According to the current module reference, that's the behavior > of the os.popen*() functions: > > http://docs.python.org/lib/os-newstreams.html#os-newstreams > > > On UNIX, os.popen is posix.popen, is a simple wrappe

Re: without shell

2005-06-10 Thread David M. Cooke
Donn Cave <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2005-06-10, Mage <[EMAIL PROTECTED]> wrote: >> >> >>py> file_list = os.popen("ls").read() >> >> >> >>Stores the output of ls into file_list. >> >> >> > These commands invoke

Re: without shell

2005-06-10 Thread Grant Edwards
On 2005-06-10, Donn Cave <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2005-06-10, Mage <[EMAIL PROTECTED]> wrote: >> >> >>py> file_list = os.popen("ls").read() >> >> >> >>Stores the output of ls into file_list. >> >> >> > These co

RE: without shell

2005-06-10 Thread Michael Chermside
KM writes: > can any linux command be invoked/ executed without using shell (bash) ? > what abt security concerns ? Yes. See: http://docs.python.org/lib/module-subprocess.html An exerpt: > On Unix, with shell=False (default): In this case, the Popen class uses > os.execvp() to execute the child

Re: without shell

2005-06-10 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-06-10, Mage <[EMAIL PROTECTED]> wrote: > > >>py> file_list = os.popen("ls").read() > >> > >>Stores the output of ls into file_list. > >> > > These commands invoke shell indeed. > > Under Unix, popen will not invo

Re: without shell

2005-06-10 Thread Steven D'Aprano
On Fri, 10 Jun 2005 14:13:05 +, Grant Edwards wrote: > On 2005-06-10, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> On Sun, 12 Jun 2005 23:16:35 +0530, km wrote: >> >>> hi all, >>> >>> can any linux command be invoked/ executed without using shell (bash) ? >> >> py> import os >> py> status =

Re: without shell

2005-06-10 Thread Grant Edwards
On 2005-06-10, Mage <[EMAIL PROTECTED]> wrote: >>py> file_list = os.popen("ls").read() >> >>Stores the output of ls into file_list. >> > These commands invoke shell indeed. Under Unix, popen will not invoke a shell if it's passed a sequence rather than a single string. -- Grant Edwards

Re: without shell

2005-06-10 Thread Mage
Steven D'Aprano wrote: >On Sun, 12 Jun 2005 23:16:35 +0530, km wrote: > > > >>hi all, >> >>can any linux command be invoked/ executed without using shell (bash) ? >> >> > >py> import os >py> status = os.system("ls") > >Prints the output of ls and stores the exit code into status. > >py> fil

Re: without shell

2005-06-10 Thread Grant Edwards
On 2005-06-10, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 12 Jun 2005 23:16:35 +0530, km wrote: > >> hi all, >> >> can any linux command be invoked/ executed without using shell (bash) ? > > py> import os > py> status = os.system("ls") > > Prints the output of ls and stores the exit cod

Re: without shell

2005-06-10 Thread Grant Edwards
On 2005-06-12, km <[EMAIL PROTECTED]> wrote: > can any linux command be invoked/executed without using shell (bash)? Yes -- for some values of "linux command". You can execute anything that's not a bash internal or a bash script without using bash. > what abt security concerns? What about them

Re: without shell

2005-06-10 Thread Steven D'Aprano
On Sun, 12 Jun 2005 23:16:35 +0530, km wrote: > hi all, > > can any linux command be invoked/ executed without using shell (bash) ? py> import os py> status = os.system("ls") Prints the output of ls and stores the exit code into status. py> file_list = os.popen("ls").read() Stores the output

Re: without shell

2005-06-10 Thread Tomasz Rola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, 12 Jun 2005, km wrote: > hi all, > > can any linux command be invoked/ executed without using shell (bash) ? > what abt security concerns ? Ops, I missed the word "command" when reading your mail for the first time, and this changes some p

Re: without shell

2005-06-10 Thread Tomasz Rola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, 12 Jun 2005, km wrote: > hi all, > > can any linux command be invoked/ executed without using shell (bash) ? > what abt security concerns ? To answer your question fast, yes it is possible. Just pull every "bad" block from the OS, and put