UGN Security

help: IFS in /bin/sh

Posted By: bellini

help: IFS in /bin/sh - 07/07/03 11:57 PM

i've ben trying to make something work but still havent figured something out.
I do the following:
[[email protected] ~]$ IFS=/
[[email protected] ~]$ export IFS
[[email protected] ~]$ PATH=.:$PATH
[[email protected] ~]$ echo "/bin/sh" > bin
[[email protected] ~]$ chmod 755 bin

Now the problem is:
if I execute 'sh -c "/bin/ls"' it just does a simple ls
But if i do 'sh -c "sh -c \"/bin/ls\""' it does what i expected (it executes the file 'bin')

Why doesn't it does the same in the first example??

thank's for your spent time.
Posted By: pergesu

Re: help: IFS in /bin/sh - 07/08/03 01:57 AM

You don't need the quotes...

$ sh -c /bin/ls
filea fileb filec filed
Posted By: bellini

Re: help: IFS in /bin/sh - 07/08/03 03:10 AM

Yes i know that gives me the list of files in the directory, but what i was expecting is to execute with that very same command line the program bin,due to my configuration of my IFS in sh.
© 2018 UGN Security Forum