Syntax
int hashtable_import ( int hid, string filename )
Description
hashtable_import reads a specified file and uses the contents to create a hash table containing hash table entries, one per line, consisting of a single hash key, a colon, and a comma-separated list of hash values. The file may also contain comments delimited by the # character.
If successfully imported, it returns the number of entries in the hash table.
Example
#File admgroups.txt contains the formatted text
unxadm:john,bob,fred,jane
winadm:mary,chris,henry
#policy loads this file into a hashtable that identifies the group permissions,
hid=hashtable_create();
count=hashtable_import(hid, "/etc/opt/quest/qpm4u/tables/admgroups.txt");
printf("Import loaded %d groups\n", count);
unxadm=hashtable_lookup(hid, "unxadm");
if (user !in unxadm)
{
reject "You are not authorized to run this command";
}