1.0

Table Of Contents
www.vmware.com
256
VMware ACE Administrator’s Manual
descriptor = getenv("VMWARE_NQ_DESCRIPTOR");
if (descriptor == NULL) {
fprintf(stderr, "VMWARE_NQ_DESCRIPTOR not set\n");
goto exit;
}
result = 0;
counter = 0;
while (descriptorList[counter].descriptor != NULL) {
if (strcmp(descriptorList[counter].descriptor, descriptor) == 0 {
/* Found the right descriptor */
printf("%s", descriptorList[counter].uptodate);
goto exit;
}
counter++;
}
/* No match found */
printf("REJECT");
exit:
return result;
}
Sample Network Quarantine Script 2
The following sample script is written in Perl. It is installed by VMware ACE Manager as
sampleQuarantine.pl. You need a Perl interpreter to run this script.
#
# VMware Sample Script
#
# This is a sample network quarantine script for VMware ACE.
#
# Notes About this sample:
# The NQ Script does 2 things, (1) verifies that the string in
# VMWARE_NQ_DESCRIPTOR is valid, and (2) returns wether the guest
# operating system that this descriptor is from should be given
# normal access (YES), or should be given restricted access (NO)
#
# For testing purposes 2 lists of NQ_DESCRIPTORS are stored
# statically in this file: an approved list and an unapproved
# list. This sample script will match the value in
# VMWARE_NQ_DESCRIPTOR to a stored string, and output YES if it
# came from the approved list, NO if it came from the unapproved
# list, and REJECT otherwise.