LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-11-2009, 04:29 AM   #1
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Rep: Reputation: 15
Problem about noexec option in /etc/fstab


Hi all,
I set the noexec option in the /etc/fstab and then mount the nfs directory. I copied an rpm package from dvd to nfs server shared folder. Then I executed the rpm package from cilent. But it did work!
Who can explain that strange phenomenon?
Thanks in advance!
 
Old 09-11-2009, 07:16 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,472

Rep: Reputation: 189Reputation: 189
The executable was on the client, not the NTFS server. The rpm command is on the client box, not the server so you are not running an executable on the server.
 
Old 09-11-2009, 10:07 AM   #3
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Original Poster
Rep: Reputation: 15
Hi ,
I made you misunderstood. I used executable command on the client but not server.

Last edited by jcky; 09-11-2009 at 08:02 PM.
 
Old 09-11-2009, 11:51 AM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
Quote:
Originally Posted by jcky View Post
Hi ,
I made you understood. I used executable command on the client but not server.
you failed to understand the point, the package itself isn't an executable, RPM was used on the client and is stored on the client, all you did was point RPM to USE the package the package itself did nothing and did NOT execute as the RPM executable on the client did all the work. If the RPM executable was on the server and you tried executing that, then that is what would not work, but that's not what you are doing. Your using RPM on a client machine where executables are allowed.
 
Old 09-11-2009, 08:01 PM   #5
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by r3sistance View Post
you failed to understand the point, the package itself isn't an executable, RPM was used on the client and is stored on the client, all you did was point RPM to USE the package the package itself did nothing and did NOT execute as the RPM executable on the client did all the work. If the RPM executable was on the server and you tried executing that, then that is what would not work, but that's not what you are doing. Your using RPM on a client machine where executables are allowed.
Hi,
But the rpm package was in the nfs shared directory!(meant on the server). And I mounted the shared directory and then execute the rpm package...
 
Old 09-11-2009, 08:15 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,930

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Let me try...
A file called filename.rpm is a data file not an application. Just like windows associations when you click on a file.xls your not executing file.xls but actually excel file.xls. The same is true when you click on a filename.rpm. The actual application that starts when you click on the rpm file is running on your local computer not the share.

http://en.wikipedia.org/wiki/RPM_Package_Manager
 
Old 09-11-2009, 08:19 PM   #7
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Original Poster
Rep: Reputation: 15
Hi michaelk,
What you meant was that the rpm package was not a binary file? If it was, then why I could execute it with noexec option? Thanks for your help!
 
Old 09-11-2009, 08:37 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,930

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Not all binary files are executable. Here is another example, a windows word document is a binary file. When you click on it the actual program that starts and runs is word not the file.doc. Once again, its not the rpm file that is running.

FYI an RPM is a collection of files not all binary.
 
Old 09-11-2009, 08:44 PM   #9
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Original Poster
Rep: Reputation: 15
Hi Michaelk,
I understood your meaning that the rpm package was managed by rpm. When you wanted to install the rpm package, actually you ran rpm but not rpm binary package. Was I right? So with noexec options, it would not take effect.
Then I had another question. How can I verify the noexec option which did work? In other words, how could I make the experiment succsessful?
Thanks for your help!
 
Old 09-11-2009, 09:08 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,930

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
You got it. Create a simple bash script and try to run it from the server.
 
Old 09-11-2009, 09:10 PM   #11
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Original Poster
Rep: Reputation: 15
Thanks!
 
Old 09-12-2009, 03:47 AM   #12
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Original Poster
Rep: Reputation: 15
I tried a script made by bash language with noexec option when the shared directory was mounted. But I could exectue the script with right permission (x access).
So I really got confused.
Who could help me
 
Old 09-12-2009, 06:44 AM   #13
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
how did you start the script? did you start the script, did you try to call on the script directly or did you use the sh command? Also can you confirm the filesystem has actually been remounted since you made the change to fstab or the machine rebooted.

Last edited by r3sistance; 09-12-2009 at 06:45 AM.
 
Old 09-12-2009, 07:26 PM   #14
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by r3sistance View Post
how did you start the script? did you start the script, did you try to call on the script directly or did you use the sh command? Also can you confirm the filesystem has actually been remounted since you made the change to fstab or the machine rebooted.
I did run the script by sh command. But it really could work! Also I used mount command to check the mount status which was noexec.
So strange...
 
Old 09-13-2009, 10:31 PM   #15
jcky
Member
 
Registered: Feb 2008
Location: China-Shanghai
Distribution: Rhel&Suse
Posts: 82

Original Poster
Rep: Reputation: 15
Who could help me????
 
  


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
Fstab not mounting a subdir with the bind option JosipBroz Linux - Software 2 03-11-2009 05:44 PM
Forcing noexec as a HAL mount option rahrah Slackware 2 06-26-2008 02:42 PM
new fstab mount option guide for fixed drives - suggestions/mistakes? gregconquest Linux - General 3 04-21-2007 09:55 PM
strange problem with smb mount -> noexec ? poison Slackware 2 01-06-2004 03:48 AM


All times are GMT -5. The time now is 11:47 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration