-------- Original Message --------
Subject: ExtUtils::MakeMaker and user-command binary wrappers to a module
Date: Thu, 22 Apr 2010 10:55:13 +0100
From: David Lee <[email protected]>
Organization: ECMWF
To: [email protected]

Could you point me in the right direction with the following MakeMaker
problem, please?  (For a wide variety of local environmental reasons, it
would awkward to switch to 'Module::Build'.)

I've made good progress with a suite of locally written Perl modules.
The end-point is to achieve a set of user-invokable commands (say,
"cmd1", "cmd2", etc.), but these have to end up at those modules in a
setuid state.  (Don't ask!)

So I am heading towards those user-invokable "cmd1", "cmd2" things being
links to a little setuid C wrapper, which in turn invokes equivalent
perl commands (say, "perl-cmd1", "perl-cmd2", etc.) which are actually
links to a single perl script that detects its 'basename(__FILE__)' to
know which of the various "cmd<n>" it came from.  (All this binary,
wrapper, user-comamnd stuff is encapsulated within one module to avoid
polluting the other modules with its details.)

[Possible aside:  This needs to run on a variety of UNIX-like
architectures including Linux, AIX and Solaris.  Could I safely and
importantly, portably, use setuid directly on that multiply linked
"[perl-]cmd1", "[perl-]cmd2"  perl-script, thus bypassing the wrapper?
But would I still be able to do 'basename(__FILE__)' to determine which
"cmd<n>" it came from?]

Anyway back to MakeMaker.  I couldn't see in the documentation how to
include the simple C wrapper program and its building in my 'Command'
module.  Ultimately I would want that C wrapper somewhere (where?) in
the module source tree, so that "make" automatically builds it and "make
install" installs it.

Any hints?  If I am heading in a very bad direction, do feel free to say
and point me onto a safer route!

Reply via email to