LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-10-2011, 05:40 PM   #1
clifford227
Member
 
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282

Rep: Reputation: 64
Why is it a bad idea to enable scripts to be run from a usb drive?


Sorry about the title, I didnt know how else to put it.

I've got a 1TB external usb hard drive, that I'd like to run some scripts from, but I think I remember reading somewhere that its not a good idea, and that that practice was actually disabled at some point in the past, I was just wondering why?

Last edited by clifford227; 04-10-2011 at 05:42 PM.
 
Old 04-10-2011, 06:18 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,564

Rep: Reputation: 658Reputation: 658Reputation: 658Reputation: 658Reputation: 658Reputation: 658
The potential problem is that an external drive could contain binaries or scripts intended for a different operating system, and accidentally executing one could have unfortunate results.

For just running the occasional script, you can directly invoke the shell (or perl, or python, or whatever other interpreter the script requires) and pass it the name of the script file. As far as the OS is concerned, the interpreter is just reading that file, and execute permission is irrelevant.
Code:
bash some_script_file arg1 arg2 ...
This isn't going to work, though, if that script tries to execute other programs or scripts from that noexec file system.
 
1 members found this post helpful.
Old 04-10-2011, 06:19 PM   #3
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
As a security measure, executable files are often disabled on removable devices. Otherwise it could be possible for a user to unknowingly run a piece of malicious software simply by plugging in a removable drive.

I am not aware of any other reason they would be blocked, though your question is somewhat vague in general (I.E. what are these "scripts" in the first place).
 
1 members found this post helpful.
Old 04-10-2011, 06:52 PM   #4
clifford227
Member
 
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282

Original Poster
Rep: Reputation: 64
Thanks guys,

basically the scripts I want to run just display a .jpg of a comedy programme in feh, and then have mplayer shuffle through a list of favorite comedy shows which are on the external usb drive.

Last edited by clifford227; 04-10-2011 at 06:54 PM.
 
  


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
Disable/enable USB storage device @ run time Mr.J Linux - Security 1 09-08-2008 11:16 AM
Disable/enable USB storage device @ run time Mr.J Linux - Kernel 3 08-03-2008 09:14 AM
reformatting external drive... bad idea? tommytomthms5 Linux - Hardware 5 05-19-2008 06:28 AM
usb drive won't mount - error: wrong fs type, bad option, bad superblock on /dev/sda1 bluecog6 Linux - Hardware 4 01-27-2007 10:07 AM
Good idea/bad idea: interface colors introuble General 5 10-30-2006 02:33 PM


All times are GMT -5. The time now is 07:50 PM.

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