From a C++ application how to find if a hpux host is in standard mode or trusted mode

is there a way for my C++ application to find out which mode the hpux OS is running in?

standard mode or trusted mode.

/usr/lbin/getprpw -l

can be called from the standard library

system()
/.secure/etc/passwd

exists on trusted systems. You can test existence with

access()

You did not
mention your OS version - so there may be a better approach for it.

1 Like

Thanks jim, I am using 1131 version. Is there a possibility for /.secure/etc/passwd existence when the hpux is converted to standard mode?

Not sure because I did once only back more than 15 years... Are you wondering if you could have reminiscence of the tree structure though you have the crypted password in /etc/passwd ? you could have a situation in between ( was an option at one time...) to have password removed and replaced by * and put in /etc/shadow but you cant call that trusted...