Mark Lakata, Staff Engineer 1225 Charleston Road voice 650-567-5170
MIPS Technologies Mountain View CA 94043 fax 650-567-5002
On Tue, 23 Apr 2002, R.K. Owen Ph.D. wrote:
> On Mon, 22 Apr 2002, Edward Arthur wrote:
>
> > Hi,
> >
> > Just thought I'd pass it on...
> >
> > /home/installs/modules-3.1.6/utility.c:764: the use of `tempnam' is
> > dangerous, better use `mkstemp'
>
> I have tried to eliminating this message by trying out the some
> other versions, but they didn't have quite the right properties
> (like using TMPDIR or /tmp, there were other issues), but opted
> to stick with the StdC routine for maximum availability.
I tried it too. The temp file in this case is the file that is created on the
fly for aliases, which is then 'source'd by the parent shell. That means that
the temp file has to persist after the modulecmd process has finished, and
unfortunately the "recommended" alternatives to tempnam() automatically delete
the file as the program quits.
The only alternative would be to write our own tempnam generator that also
removes the remote possibility of a race condition (that is the reason that
tempnam is "dangerous"). Maybe I'll take a crack at it.
> Perhaps, another more pedestrian approach would be to put the modulecmd
> in /usr/local/bin/, forget the versions modulefile dir,
> with man files in /usr/local/man/, the init files in /usr/local/Modules/init/
> and /usr/local/Modules/modulefiles. Would still need the rc file
> mods and /etc/custom as described in INSTALL.RH7x. (Editing the
> /etc/csh.login,csh.cshrc,bashrc,profile files.)
I vote for this approach. As I said, I am working removing the need for the
init/ directory, so that you can just init the modules by doing (assuming
modulecmd is in /usr/local/bin)
eval `modulecmd $shell bootstrap`
The only extern thing that definitely needs to be installed are the module
files of course, but there is no way around that.
(If anyone has a more astheticly pleasing command name to replace "bootstrap"
speak now.)
-Mark
> Most sysadms don't care about modules development and just
> want to install module binaries and trust that they work as advertized.
>
> What do the other module list think?
>
> >
> > Thanks,
> > /Ed
> >
>
> R.K.
>
> +------------------+---------------------+
> | R.K.Owen,PhD | rk...@ow... |
> | KooZ Software | Environment Modules |
> | NERSC/LBNL | rk...@ne... |
> +------------------+---------------------+
>
>
|