Looking for config file in home directory first??

hi,

i have written a shell script inside which i am using a pgp command to encrypt a file. when pgp command is run , there is a /.pgp/pgp.cfg file in my home directory.
i logged into the unix server with my userid, when i run the script from the command prompt, pgp is successful, since i am logged in with my username.

but when i run the script from a web interface , pgp command fails. since a different user is running the script.

error in the log file is

"Error: Unable to open config file /var/www/.pgp/pgp.cfg, No such file or directory."

this is because i have not set the pgppath in the shell script.

so my question is, when i ran it from command prompt after loggin in with my username, it read the pgp.cfg file from /.pgp/pgp.cfg in my home directory.

but when i tried running from web interface as a different use , it tried to search for pgp.cfg in /var/www/.pgp/ directory.

1) From command prompt after loggin in with my userid
why it didnot tried to look for the pgp.cfg file in /var/www/.pgp/ directory , why did it looked into my home directory for pgp.cfg file?

2) From web interface , calling the script as a different user,

why did it try to look for pgp.cfg in /var/www/.pgp/ directory.

You might want to add few path settings... also if possible copy the .pgp keys onto the path

 
#at start
ORI_PATH=$LD_LIBRARY_PATH
unset LD_LIBRARY_PATH
export PATH=$PATH:/opt/pgp/bin
 
#at end
set LD_LIBRARY_PATH=$ORI_PATH
echo $LD_LIBRARY_PATH

but , is it like 1st it will try to search for the file in home directory and if it is not found then it will search in /var/www/ directory?

can you please post the way you used pgp with in your script?

pgp --encrypt --text filename --user "pgp_user_id" --output filename.pgp

i used it like this.

I used pgp long back..However I am pretty sure the key (private) is user specific so if you created the key pair from user1 and trying to decrypt it from user2 it will fail.

Whenever you try to generate pgp key pair it will store it under /home/username/.pgp/pgp.cfg this means its user specific files and stored under home directory of individual user.

---------- Post updated at 02:41 PM ---------- Previous update was at 02:34 PM ----------

also.. is it error or warning?