April 5th, 2017, 10:24 AM
An odd CPAN issue...
A bit of background: I use NFS automounts for home directories, with root-squashed. I have cloud systems which use this configuration.
As an alternative to giving the users full root authority, I've written a program to do certain software installs for them. This program has the setuid bit set so that the program runs as root. This works great as a front-end to yum and several other commands, but I'm having a problem with CPAN. Specifically, the cpan command attempts to create the directory $HOME/.local in the user's directory. But, since root is squashed, it has no access to the directory, and the command fails.
./cloudSoftware cpan foobar
mkdir /home/auto/usernamehere/.local: Permission denied at /usr/share/perl5/CPAN/HandleConfig.pm line 589.
Is there a parameter I can specify for the cpan command which would allow it to use some other base path for its files? I'd like to be able to allow a non-priv'ed user to run cpan for the host, and yet keep the root-squash parameter for the home directory mounts.
April 5th, 2017, 11:11 AM
April 6th, 2017, 08:06 AM
Received an answer on stack overflow: Set the $HOME environment variable to whatever is necessary before running the cpan command, and it will create the .local directory there.
Comments on this post
April 6th, 2017, 09:45 AM