[klibc] klibc insmod for recent kernels

H. Peter Anvin hpa@zytor.com
Sun, 05 Jan 2003 15:41:10 -0800


Rusty Russell wrote:
>>
>>Sure, but why spawn /bin/sh to do it?  It seems doing it internally 
> would be both cleaner and faster.
> 
> Loading modules is hardly speed sensitive.  "install foo
> /sbin/modprobe pre-foo && /sbin/modprobe foo" for example.  You may
> want to do arbitrary things, and forcing you to write a shell script
> isn't a really gread idea.
> 

It isn't, but it creates lots of unwanted dependencies and quite 
possible security holes (bash is big and complex and uses environment 
variables in unsundry ways.)

Perl, for example, only invokes /bin/sh if the command presented to it 
includes shell special operators (like your && above.)  Another variant 
-- which is probably better -- is to simply make the user make use of 
"sh -c" if that's what they really want to do.

(By the way, you realize the example above creates an infinite loop, and 
that would be much better handled by giving modprobe a way to introduce 
dependencies directly, right?)

	-hpa