· Apr 20, 2021

What determines the environment for $ZF(-1)?


I'm using $ZF(-1) in a class method which will be invoked from a csp page.

What determines the environment of the spawned process?  If I use $ZF(-1,"echo hello world > output.txt"), the resulting file is owned by cacheusr:cacheusr.  However, when I use $ZF(-1,"printenv > output.txt"), the environment is from my personal unix account, no matter which Cache username I'm logged in under when running the web application.  


Product version: Caché 2017.1
$ZV: Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2017.1
Discussion (9)0
Log in or sign up to continue

Yes, agreed.  The thing that puzzles me is that the shell environment variables pertain to my personal account, even though when the $ZF command is invoked from the csp page, and I'm logged into an unrelated cache account.  How is it getting the USER vrogers?

If I use $ZF(-1,"whoami > output.txt"), the output is "cacheusr"

But when I use $ZF(-1,"printenv > output.txt"), the output includes:


Thank you.

Thank you Eduard, I appreciate your time on this.  

Maybe I'm just dense, but I still don't get it.  I'm not logged into the server at all.  I'm only connecting to the server through a CSP application.  In order to access the CSP application, I have to log into one of the cache user accounts.  It doesn't seem to matter which cache account I use -- even if I log in as _SYSTEM to run the CSP application, the $ZF shell is executing under user vrogers.