Chat now with support
Chat with Support

Safeguard for Sudo 2.0 - Administrators Guide

One Identity Privileged Access Suite for Unix Introducing Privilege Manager for Unix Introducing Privilege Manager for Sudo Planning Deployment Installation and Configuration
Download Privilege Manager for Unix Software Packages Download Privilege Manager for Sudo Software Packages Quick Start and Evaluation Configure a Primary Policy Server Configure a Secondary Policy Server Install PM Agent or Sudo Plugin on a Remote Host Remove Configurations
Upgrading Privilege Manager System Administration Managing Security Policy The Privilege Manager for Unix Security Policy Advanced Privilege Manager for Unix Configuration Administering Log and Keystroke Files InTrust Plug-in for Privilege Manager Troubleshooting Privilege Manager for Unix Policy File Components Privilege Manager Variables Privilege Manager for Unix Flow Control Statements Privilege Manager for Unix Built-in Functions and Procedures Privilege Manager Programs Installation Packages Unsupported Sudo Options Sudo Plugin Policy Evaluation About us

substr

Syntax
string substr ( string str, int start, int length )
Description

substr returns the substring of a given length starting at a given position in the string.

Example
printf("%s\n",substr ("xxxfooxxx",3,3))

Returns "foo".

printf(%s\n",substr (xxxfooxxx",3,-1))

-1 returns the remainder of the string, "fooxxx".

User Information Functions

These are the built-in user information functions available to use within the policy file:

Table 48: User information functions
Name Description
getfullname Get a user’s full name from the policy server.
getgroup Get a user’s primary group from the policy server.
getgroups Get the list of groups for a user from the policy server.
gethome Get a user’s home directory from the policy server.
getshell Get a user’s login shell from the policy server.

getfullname

Syntax
string getfullname ( string user )
Description

getfullname returns the specified user’s full name from the policy server (or from the client host if getpasswordfromrun is set to yes in the policy server's pm.settings file).

Example
# print the fullname of root on the policy server 
print(getfullname("root")); 

getgroup

Syntax
string getgroup ( string user )
Description

getgroup returns the specified user’s primary group name from the policy server (or from the client host if getpasswordfromrun is set to yes in the policy server's pm.settings file). If no user is specified, it returns the submituser’s primary group.

Example
# print root user's primary group on the policy server 
print(getgroup("root")); 
Related Documents