![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Finding files in current directory when 100,000's files in current directory | kewong007 | Shell Programming and Scripting | 2 | 02-26-2009 03:13 PM |
| filename in current directory | calgone337 | Shell Programming and Scripting | 2 | 04-15-2007 03:21 PM |
| cannot determine current directory | axes | UNIX for Advanced & Expert Users | 15 | 11-13-2006 07:39 AM |
| Question about Restricting Search path of FIND to current directory | super_duper_guy | UNIX for Dummies Questions & Answers | 2 | 10-17-2005 10:10 AM |
| Using tar for current directory, but not subs | beilstwh | UNIX for Dummies Questions & Answers | 3 | 09-13-2004 10:33 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Question on Verifying root's current directory
From a script how would I verify that the current directory (.) is not in root's path. Now when the script is going to be run the auditor wil not be signed in as root, but rather running it via sudo, so I'm thinking the standard $path won't work for that case.
Derek ![]() |
|
||||
|
The problem I am having is that the $PATH variable for the process running under sudo does not reflect the “run as” user’s $PATH, rather it remains set to the calling user’s $PATH.
For example roots actual $PATH when logged in is: /usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin But, when a script is run as root, using sudo, the value of $PATH is the calling user’s $PATH: /usr/bin:/etc:/usr/sbin:/usr/ucb:/home/dcjones/bin:/usr/bin/X11:/sbin:. What the script is checking for is that the root user does not have the current directory “.” in its $PATH; what the script is seeing is not root’s $PATH |
|
||||
|
I think he means that he is sitting in a filesystem - say
/audit (so if you issued say "bdf ." it would be the same as "bdf /audit" and he wants to make sure that /audit is not in root's $PATH but if the auditor is signed on via sudo - will the $PATH command work properly to answer the question? (I have no idea if that's the same as what you said Jim, but that's how I read the question) |
![]() |
| Bookmarks |
| Tags |
| path, root, script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|