Re: sys_execve() from kernelspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Try using call_usermodehelper() instead, that is what it is there for.
> 
> Good luck,
> 
> greg k-h

i tried calling it with the correct parameters, i copied some of the bluetooth code from the kernel.
well, the return value of the function is zero but i dont see the program run.

as a test i executed /bin/ping to a certain ip with wait as 0.
there was nothing to be seen by tcpdump and/or 'ps'.
i am using a 2.6 kernel, the comment above the call_usermodehelper function is as follows:

232  * Runs a user-space application.  The application is started
233  * asynchronously if wait is not set, and runs as a child of keventd.
234  * (ie. it runs with full root capabilities).

as far as i know, i do not have keventd running on my system. (or at least it doesnt show up by ps aux)
is that required anyway?
what else could be a problem with my function call?

heres how i have done it:

#define PROGRAM_TO_RUN "/bin/ping"
char *argv[] = { "192.168.0.1", NULL };
char *envp[] = { "HOME=/", "TERM=linux", "PATH=/bin:/usr/bin:/usr/local/bin:/sbin/:/usr/sbin/:/usr/local/sbin:/usr/bin/X11", NULL };

error = call_usermodehelper(PROGRAM_TO_RUN, argv, envp, wait);
printk("<1>error for call_usermodehelper() = %d\n", error);

thanks & best regards,
threadhead
________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux