2 # fixscript will replace this line with require innshellvars.pl
4 # Example wrapper nnrpd_access.pl for support of old perl authentication
5 # scripts, by Erik Klavon.
7 # This file contains a sample perl script which can be used to
8 # duplicate the behavior of the old nnrpperlauth functionality. This
9 # script only supports access control.
11 # How to use this wrapper:
12 # - append your old script to this file with two changes:
13 # - rename the old "auth_init" sub to "old_auth_init"
14 # - rename the old "authenticate" sub to "old_authenticate"
18 # This sub modifies the global hash attributes so that it has all the
19 # entries required in the old way of doing things, calls
20 # old_authenticate, and creates a return hash with the right attributes.
23 # Comment this out if you don't need auth_init.
26 $attributes{type} = "connect";
27 my @connect_array = old_authenticate();
31 if ($connect_array[4]) {
32 # Force perl to make a C string out of this integer,
33 # or else bad things will happen. Sigh.
34 $hash{"max_rate"} = $connect_array[4] . "\0";
37 # handle read boolean, set to wildmat
38 if ($connect_array[1]) {
39 $hash{"read"} = $connect_array[3];
42 # handle post boolean, set to wildmat
43 if ($connect_array[2]) {
44 $hash{"post"} = $connect_array[3];