removing modules as a user (linux) 
Author Message
 removing modules as a user (linux)

Moin,

I'd like to have a program in userspace remove a module from
the kernel but I just can't figure out how.

This is, what I tried:

A little program that calls a shellscript. Owner and group
are set to root and the s-bit is given.
---------------8<----------
    #include <stdlib.h>
    #include <stdio.h>

int main()
{
  execlp("/bin/sh", "-e", "/local/pci-mio-e/restart_comedi");

Quote:
}

-------------->8---------
This seems to be allowed to execute the root-only shell script,
but removeing the module fails ---> "rmmod: comedi: permission denied"

I also tried to run rmmod directly via execlp .
This produced the error:
"  The insmod/rmmod combined binary is having an identity crisis.
   Please give it a proper name."
Seems strange to me. How do I give a name to a programm I am calling?

Any hints welcome.

                  ---<(kama)>---



Fri, 23 Aug 2002 03:00:00 GMT  
 removing modules as a user (linux)
: I'd like to have a program in userspace remove a module from
: the kernel but I just can't figure out how.

Try asking this is comp.os.linux.development.system or possibly
comp.os.linux.development.apps

: Any hints welcome.

See above.

Paul

--
Paul D. Boyle

North Carolina State University
http://laue.chem.ncsu.edu/web/xray.welcome.html



Fri, 23 Aug 2002 03:00:00 GMT  
 removing modules as a user (linux)

(kai-martin) wrote in comp.lang.c:

Quote:

> Moin,

> I'd like to have a program in userspace remove a module from
> the kernel but I just can't figure out how.

> This is, what I tried:

The C language does not have any functions which can do this.

Quote:
> A little program that calls a shellscript. Owner and group
> are set to root and the s-bit is given.
> ---------------8<----------
>     #include <stdlib.h>
>     #include <stdio.h>

> int main()
> {
>   execlp("/bin/sh", "-e", "/local/pci-mio-e/restart_comedi");

There is no execlp() function in the C language or it's library.  It
is an operating system specific extension.

BTW, you forgot the return 0; here.

Quote:
> }
> -------------->8---------
> This seems to be allowed to execute the root-only shell script,
> but removeing the module fails ---> "rmmod: comedi: permission denied"

> I also tried to run rmmod directly via execlp .
> This produced the error:
> "  The insmod/rmmod combined binary is having an identity crisis.
>    Please give it a proper name."
> Seems strange to me. How do I give a name to a programm I am calling?

> Any hints welcome.

>                   ---<(kama)>---

Ask this in a group for your particular UNIX flavor, or perhaps

your OS specific question.

Jack Klein
--
Home: http://jackklein.home.att.net



Sat, 24 Aug 2002 03:00:00 GMT  
 removing modules as a user (linux)


Quote:

>: I'd like to have a program in userspace remove a module from
>: the kernel but I just can't figure out how.

> Try asking this is comp.os.linux.development.system or possibly
> comp.os.linux.development.apps

Ok, Paul and Jack, I'll ask the linux people.

                ---<(kama)>---



Sat, 24 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. linux Loadable kernel module programming help!!!!!!!

2. Linux module code question

3. how to remove CIL library( CIL module) dependancies

4. C++ (text user interface) compiler+editor for unix/linux

5. OnLine Linux User/Support Group

6. LINUX Users: Head Count

7. How Do I Remove a User with Jet 3.5 and VC++

8. How can I remove a user breakpoint?

9. Window Message when the user remove the stylus in a control

10. Directory Services Remove User Group

11. adding and removing users from groups on an NT Domain

12. Add/ Remove User to/ From Group using System.DirectoryServices ADSI interface

 

 
Powered by phpBB® Forum Software