PATH manipulation

I have a requirement like this:

I have modified versions of certain internal/external commands that I am putting into some directory say /mydir.

All the users will go an authentication check once they log in and based on the outcome there are two possibilities:

  1. User passes authentication - No action required.
  2. User fails authentication - Any command user executes will be looked upon in /mydir first and if modified version of the command is available there it is

executed else normal command will be executed.

I have taken a simple logical approach to achieve this. Change PATH to PATH=/mydir:$PATH from within /etc/profile. Now I want to restrict the users to

revert back to original path. Is there any way to do this?

Also ideally I don't want users to view this modified PATH and allow them to change the PATH but the change should not take place.
Basically I want to achieve something like this:

  1. User logs in - PATH gets changed to new PATH - User issues PATH command - Original PATH is displayed even though actually PATH is changed and new PATH is

in effect.
2. User tries to change PATH - PATH command is executed - user issues �echo $PATH� to verify - he gets modified PATH displayed but actually PATH is not

changed.

I summary I want to change user's PATH but don't want him to know that this has happened.

Is this possible? Ideally I want to achieve what I have described but if it is not at all possible then at least I want to restrict user from executing

PATH command.

Any ideas?

Thanks in advance and look forward know your thoughts on this.

Regards,
Ramesh

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.