2.0

Table Of Contents
VMware ACE Administrator’s Manual
160 VMware, Inc.
Sample Scripts
Thefollowingsectionscontainsamplepolicyscripts.
Sample Authentication Script
ThefollowingsamplescriptiswritteninC.ItisinstalledbyWorkstationACEEdition
assampleAuth.c.YoumaycompileitwithaCcompilerifyouwanttorunit.
#
# VMware Sample Script
#
# Sample script for ACE script authentication
#
# Description:
# This sample script lookups the user as defined in the environment
variable
# TEST_USERNAME and returns seed data that is used to make a key for
authentication
# purposes.
#
# It assumes that the username is defined in the environment variable
TEST_USERNAME
# (a ficticious environment variable used for this sample) and returns the
seed data
# from a harcoded map of username to seed data.
#
# Input to script:
# None.
#
# Returns:
# 0 if successful (user is correctly authenticated).
# -1 if TEST_USERNAME is not set, or the user is unrecognized.
#
# Expected output:
# Seed data for creating script authentication key on stdout.
#
Whereshouldtheoutputofthe
scriptgo?
ThescriptshouldsenditsoutputtoStdOut.
Whatshouldtheexitcodeof
thescriptbe?
Ifaccessisgranted,theexitcodeshouldbe0.Ifaccessis
denied,theexitcodeshouldbenonzero.
Note:Thisisareferencetothe
exitcode,nottheoutput
value.
Table 6-2. Writing Authentication Scripts (Continued)
Question Explanation