Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


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

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


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?

firefox $1

How can this be misused?

Thank you very much.

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

Rep: Reputation: 47
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, 08:33 AM   #3
LQ Newbie
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0

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

Old 02-14-2006, 08:58 AM   #4
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

Old 02-14-2006, 09:05 AM   #5
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, 09:08 AM   #6
LQ Newbie
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0

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.



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 02:06 AM
bash script, line1 #!/bin/sh - what does it mean? ombill Linux - Newbie 5 07-05-2004 12:38 PM
script #!/bin/bash, problem with space in file names existent Linux - General 3 06-17-2004 09:13 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 07:42 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 03:30 AM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 04:40 AM.

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