Problem loading module as not-root

Thread Solved

Join Date: Oct 2006
Posts: 113
Reputation: edek is an unknown quantity at this point 
Solved Threads: 0
edek's Avatar
edek edek is offline Offline
Junior Poster

Problem loading module as not-root

 
0
  #1
Apr 6th, 2008
Hi,
I need to load modules to connect to the internet, so I've created a script.

Script file is called 'connect.sh' is owned by root and has permissions set to 4755, so it is executed as root, even if run by non-root user (at least I think so). I still get errors:

When script comes to line '/sbin/modprobe pppoatm' it gives:
WARNING: Error inserting slhc (/lib/modules/2.6.24.4-64.fc8/kernel/drivers/net/slhc.ko): Operation not permitted
WARNING: Error inserting ppp_generic (/lib/modules/2.6.24.4-64.fc8/kernel/drivers/net/ppp_generic.ko): Operation not permitted
FATAL: Error inserting pppoatm (/lib/modules/2.6.24.4-64.fc8/kernel/net/atm/pppoatm.ko): Operation not permitted


Any idea?

PS: I really would like to avoid changing any other files than the script file 'connect.sh' if possible...
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Problem loading module as not-root

 
2
  #2
Apr 6th, 2008
Funnily enough, just last week I wrote a little howto on this (see my website in my signature for more info). The reason for the problem you're experiencing is that while most *nix distributions work fine when the setuid bit on a binary is turned on, the distributions specifically disable the use of setuid bits on shell scripts, due to their insecure nature.

There are two possible workarounds: a) edit the sudoers file so that sudo doesn't require a password for the commands that you need to execute in your shell script, or b) call the script from a C program using the system() call.
"Technological progress is like an axe in the hands of a pathological criminal."

All my posts may be freely redistributed under the terms of the MIT license.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 113
Reputation: edek is an unknown quantity at this point 
Solved Threads: 0
edek's Avatar
edek edek is offline Offline
Junior Poster

Re: Problem loading module as not-root

 
0
  #3
Apr 7th, 2008
Thank you very much for your help! I will check if it works later, but I think it will. Thanks!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Kernels and Modules Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC