Pathcheck Example; Installing The Example - Netscape ENTERPRISE SERVER 6.0 - NSAPI PROGRAMMER GUIDE Manual

Nsapi
Table of Contents

Advertisement

/* If there is an alternate document specified, use it. */
if(alt) {
}
/* Else do nothing */
return REQ_NOACTION;
}

PathCheck Example

The example in this section demonstrates how to implement a custom SAF for
performing path checks. This example simply checks if the requesting host is on a
list of allowed hosts.
The
Init
with one IP address per line. The
address of the host that is making the request and checks if it is on the list. If the
host is on the list, it is allowed access otherwise access is denied.
For simplicity, the stdio library is used to scan the IP addresses from the file.

Installing the Example

To load the shared object containing your functions add the following line in the
Init
Init fn=load-modules
To call
Init
library containing
Init fn=acf-init file=
To execute your custom SAF during the request-response process for some object,
add the following line to that object in the
PathCheck fn=restrict-by-acf
pb_param *pp = pblock_find("ppath", rq->vars);
/* Trash the old value */
FREE(pp->value);
/* We must dup it because the library will later free
this pblock */
pp->value = STRDUP(alt);
return REQ_PROCEED;
function
acf-init
section of the
magnus.conf
yourlibrary
to read the list of allowable hosts, add the following line to the
acf-init
section in
magnus.conf
acf-init
loads a file containing a list of allowable IP addresses
function
PathCheck
file:
funcs=acf-init,restrict-by-acf
. (This line must come after the one that loads the
).
fileContainingHostsList
obj.conf
PathCheck Example
restrict_by_acf
file:
Chapter 6
Examples of Custom SAFs
gets the IP
219

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise server 6.0

Table of Contents