![Netscape ENTERPRISE SERVER 6.1 Скачать руководство пользователя страница 225](http://html1.mh-extra.com/html/netscape/enterprise-server-6-1/enterprise-server-6-1_manual_1674653225.webp)
PathCheck Example
Chapter
6
Examples of Custom SAFs
225
/*
Check usage. Note that Init functions have special
error logging */
if(!acf_file) {
util_sprintf(err, "missing parameter to acf_init
(need file)");
pblock_nvinsert("error", err, pb);
return REQ_ABORTED;
}
f = fopen(acf_file, "r");
/* Did we open it? */
if(!f) {
util_sprintf(err, "can't open access control file %s (%s)",
acf_file, system_errmsg());
pblock_nvinsert("error", err, pb);
return REQ_ABORTED;
}
/* Initialize hosts array */
num_hosts = 0;
hosts = (char **) MALLOC(1 * sizeof(char *));
hosts[0] = NULL;
while(fgets(buf, MAX_ACF_LINE, f)) {
/* Blast linefeed that stdio helpfully leaves on there */
buf[strlen(buf) - 1] = '\0';
hosts = (char **) REALLOC(hosts, (num 2) *
sizeof(char *));
hosts[nu+] = STRDUP(buf);
hosts[num_hosts] = NULL;
}
fclose(f);
/* At restart, free hosts array */
daemon_atrestart(acf_free, NULL);
return REQ_PROCEED
}
#ifdef __cplusplus
extern "C"
#endif
NSAPI_PUBLIC int restrict_by_acf(pblock *pb, Session *sn, Request
*rq)
{
/* No parameters */
Содержание ENTERPRISE SERVER 6.1
Страница 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 1 April 2002 Draft...
Страница 18: ...Where to Find Related Information 18 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 138: ...CGI to NSAPI Conversion 138 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 214: ...NSAPI Functions in Alphabetical Order 214 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 290: ...Miscellaneous 290 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 310: ...The Netscape LDAP Schema 310 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 318: ...cinfo 318 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 324: ...Sample MIME Types File 324 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 336: ...Buffered Streams 336 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 344: ...344 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 350: ...350 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 356: ...356 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...