Visit Our UNIX and Linux User Community


over ride scripts?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting over ride scripts?
# 1  
Old 08-07-2009
over ride scripts?

I was trying aliases, but basically I want to know how to make a user have to use my script (ie my configure script) instead of whatever one they are trying to use. I want to use this to protect them from installing things globally, so in this case, whenever they try running '/.configure', I want it to refer to my configure script, which then calls theirs, but adds the --prefix=$HOME/bin option.

I wanted to make this a more broad question, but I am not sure exactly which unix property I am refering to. I tried setting a configure alias, but of course that didn't work. I tried pre-pending my own bin directory with the configure script into PATH and doing an export, but it doesn't cover cases like if they run ./configure

Thanks much.
# 2  
Old 08-07-2009
Hi.

IMO: If users on your system are allowed to "install things globally" then them running a "configure" script is the least of your worries.

What makes you think any user could install anything globally?
# 3  
Old 08-07-2009
Well, perhaps I need to rephrase that. I don't want them to install things where ./configure will normally install things. I want to keep the installs going into a special directory. It is part of a package manager app that keeps track of old installs, etc, so multiple version of say perl can be used. So if the user says:
./configure
make
make install

-> that needs to install in $HOME/apps/metapackage/packagename/packageversion

--so it is not particularly the user say, but the application used by that user, that needs to set all this up for them. The application take conf files the user specifies, and interprets how to do installs for them, by the user specifying install commands in the conf file (./configure, make, make install, etc). When using the app, the user will then lose their power to install anywhere. The application makes them install in a particular area. Otherwise, they need to not use the app.

Last edited by myriad360; 08-07-2009 at 03:49 PM..
# 4  
Old 08-07-2009
The only place a "normal user" should be able to install software, is in their own home directories or to other directories where they have priviliges.

I think it's best when only the sys admin, or selected users control what's installed on the system, not any user.

I was hoping someone else would chip in here with a solution, because I don't know how you could do what you're asking using shell scripting. At least not securely.

Yes the application, if not the admin (and certainly not the user) should set this up and control the install. You could, for example, chmod the application to allow the user to run it as root. Then the install could write the files it needs, as well as update any system information. But this is no good as soon as you allow the user to run his own configure scripts, etc., as they would also run as root. I really think it's best that only admins and selected users control software installations.
# 5  
Old 08-07-2009
Agreed. I guess, don't look at it as a security standpoint. Look at it as a convenience standpoint. During application run, the only place installs are allow to go are the directories specified by the application. This is for accounting by the application only, so it doesn't have to search the entire system for installs; the application will only care about the ones in the apps directory.
# 6  
Old 08-07-2009
i there's little you can do to prevent your users to use:

./configure --prefix=/some/path

or ./configure alone...

wouldn't be easier to instruct your users to alwasy use --prefix=$HOME/apps/metapackage/packagename/packageversion ?

perhaps you could add in the .profile a shortcut for that like:

export PREFIX=$HOME/apps/metapackage/packagename/packageversion

so they can issue

./configure --prefix=$PREFIX
# 7  
Old 08-07-2009
Quote:
Originally Posted by rugdog
i there's little you can do to prevent your users to use:

./configure --prefix=/some/path

or ./configure alone...

wouldn't be easier to instruct your users to alwasy use --prefix=$HOME/apps/metapackage/packagename/packageversion ?

perhaps you could add in the .profile a shortcut for that like:

export PREFIX=$HOME/apps/metapackage/packagename/packageversion

so they can issue

./configure --prefix=$PREFIX
I would actually count on the users getting this part wrong almost consistently. Smilie Sorry, but that is what I have to say about the users.

However, what I can count on them is saying some sort of command like this -
python update_packages.py -p package_name -v version# -m metapackage_name -c

(-> -c equals 'create')

-and having this in their config file for the package:
configure (or for perl packages: perl Makefile.pl)
make
make install

Paths are something they will probably be sure to get wrong.

Thanks guys.

---------- Post updated at 02:10 PM ---------- Previous update was at 02:08 PM ----------

To add to that, I am have currently just made sure to send all commands through a python function which does this check for me. But if the use of commands gets widespread through the package manager program, then this could add more redundancy, than say setting something on the environment level.

Previous Thread | Next Thread
Test Your Knowledge in Computers #208
Difficulty: Medium
Open Shortest Path First (OSPF) was designed as an exterior gateway protocol (EGP) for use in an autonomous systems such as a local area network (LAN).
True or False?

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

2. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

3. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

4. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

5. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

6. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies

7. UNIX for Dummies Questions & Answers

How to get ride of the BEEP in Solaris

Hello, I did a search on this forum and a global search to try and find out how to disable that annoying beep that you get when you mistype or hit the esc key in VI and i didn't have that problem last week. I'm using Solaris and bash shell and i've put these commands into my .profile file: ... (2 Replies)
Discussion started by: bobk544
2 Replies

Featured Tech Videos