int MGOinitialize (char *file)
The MGOinitialize() function sets the rules used for establishing a connection to the Mango server. Rules appear one per line, in the form "rule=(value)", in the configuration file file. If file is NULL, or if MGOinitialize() is not called, the "default" set of rules will apply (see /usr/local/lib/mango/cconfig). The rules are as follows:
Prior to authentication, defoptions are in effect. It must match the server's value exactly. You can ding Mango with a 'q' datagram to determine what this value should be, or set the usedgram option to a value greater than 0 (the number of seconds to wait for a server response before giving up). After authentication, options are in effect (look here for a discussion on option naggling).
method controls the authentication method. It can be one of:
pwdfile is the location of the password file. pwdkey is the key name used for authentication (look here). A "%s" directive inserts the client's host address into the name. pwdsrvkey is the server's key name used for authentication. A "%s" directive inserts the server's host address into the name. pwdsalt is the encryption salt value (hexidecimal).
lscfile is the location of the LSC key file. lsckey is the key name used for authentication (look here). A "%s" directive inserts the client's host address into the name. lscsrvkey is the server's key name used for authentication. A "%s" directive inserts the server's host address into the name.
krbfile is the location of kerberos keytab file. krbkey is the principal key name used for authentication (look here). A "%s" directive inserts the client's host address into the name. krbsrvkey is the server's principal name used for authentication. A "%s"directive inserts the server's host address into the name. krbusecc determines which type of kerberos ticket to use. It can be one of:
user is the name you wish to connect as. This can be either a user name, program name, or whatever. A "%s" directive inserts the client's user name, as determined by getlogin()/getuwuid(getuid()). If not specified, the default name is "anonymous".
Each rule can also be modified through its associated global variable MGOrule. Just remember that MGOinitialize() has to be called prior to changing any global variables. Subsequent calls to MGOinitialize() will change only the rules appearing in file.
# Mango client configuration file # defoptions=0 host=mango.u.washington.edu method=2 options=2 port=645 socket=/dev/mgosock usedgram=10 user=%s # krbfile=FILE:/usr/local/lib/mango/keytab krbkey=pmango/%s krbsrvkey=mango/%s krbusecc=1 lscfile=/usr/local/lib/mango/ckeys lsckey=pmango lscsrvkey=mango pwdfile=/usr/local/lib/mango/ckeys pwdkey=pmango pwdsalt=0xdeadbeef pwdsrvkey=mango
Returns 1 upon success or -1 if an error occurred (in which case MGOerrno and MGOerrmsg are set appropriately).