LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 03: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, 06:16 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
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, 09: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 07:02 PM.
 
Old 09-11-2009, 10:51 AM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
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, 07: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, 07:15 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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, 07: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, 07:37 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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, 07: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, 08:08 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
You got it. Create a simple bash script and try to run it from the server.
 
Old 09-11-2009, 08: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, 02: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, 05:44 AM   #13
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
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 05:45 AM.
 
Old 09-12-2009, 06: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, 09: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



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 04:44 PM
Forcing noexec as a HAL mount option rahrah Slackware 2 06-26-2008 01:42 PM
new fstab mount option guide for fixed drives - suggestions/mistakes? gregconquest Linux - General 3 04-21-2007 08:55 PM
strange problem with smb mount -> noexec ? poison Slackware 2 01-06-2004 02:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration