LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 02-14-2006, 06:39 AM   #1
ROBERT483599
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Rep: Reputation: 0
What is dangerous about this script: #!/bin/bash firefox $1 ???


Hi,

I am newbie to Linux in general and have decided to pick up more on this subject. Please, could anyone of you give me brief, yet clear explanation on this issue?

What is dangerous abou this script?

#!/bin/bash
firefox $1

How can this be misused?


Thank you very much.

Robert
 
Old 02-14-2006, 07:17 AM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 46
Well, for starters, it doesn't point to the full location of firefox, such as /usr/bin/firefox - so somebody could name a different executable as "firefox" and this script would run it
 
Old 02-14-2006, 07:33 AM   #3
ROBERT483599
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Hi,

what exactly is "somebody could name diff. executable"??

Thanks.
 
Old 02-14-2006, 07:58 AM   #4
_KDF
Member
 
Registered: Oct 2003
Distribution: FC4/5 & RHEL4
Posts: 133

Rep: Reputation: 15
He means the script might have root priviledges (or another users priviledges for that matter) and technically one could create a script to do anything, call it firefox and your script would execute it.

Using absolute would help eg

/usr/bin/firefox
 
Old 02-14-2006, 08:05 AM   #5
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
This smells an awful lot like homework to me...
 
Old 02-14-2006, 08:08 AM   #6
ROBERT483599
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Hi,

thank you all it helps me to make my baby steps around in linux.


No, I can guarantee that I am not misusing it for any type of work.

Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change /bin/bash to /bin/zsh Smokey Slackware 12 07-14-2004 01:06 AM
bash script, line1 #!/bin/sh - what does it mean? ombill Linux - Newbie 5 07-05-2004 11:38 AM
script #!/bin/bash, problem with space in file names existent Linux - General 3 06-17-2004 08:13 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM


All times are GMT -5. The time now is 06:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration