Hello

The files read by getProfiles must have every entry in one single line
which makes it horrible to look at. I patched it so that it can now
handle the normal UNIX line wrapping standart with a '\' as last char
on a line:
        westend-dynamic-dialup:ascend:  \
                ramed-Protocol=PPP, \
                Framed-Routing=None, \
                ...
bye,

 -christian-

--- hook.getProfiles.orig       Fri Jul 28 13:30:06 2000
+++ hook.getProfiles    Fri Jul 28 13:40:05 2000
@@ -34,8 +34,11 @@
 
     my $record;
 
+    $/ = "\n\n";
     while (<FILE>)
     {
+       # Join input to one line
+       s/\\\n//g;
 
         # Skip comment lines and blank lines
         next if /^#/ || /^\s*$/;
@@ -44,7 +47,7 @@
 
        # Format: $profile:$identifier:$attributes
        # We cannot use split due to ':' in attributes like cisco-avpair
-       if ($record =~ /^([^:]+):([^:]+):(.*)/) 
+       if ($record =~ /^([^:]+)\s*:\s*([^:]+)\s*:\s*(.*)/) 
        {
            # add Profile to GlobalVars for use by PostAuthHook
            &main::log($main::LOG_DEBUG,"setVariable |$1|.|$2|=|$3|");
@@ -52,6 +55,10 @@
        }
     }
     close(FILE);
+       
+    # reset $INPUT_RECORD_SEPERATOR. Don't know if necessary but at least safe.
+    $/ = "\n";
+
     return;
 }
 


-- 
Christian Hammers    WESTEND GmbH - Aachen und Dueren     Tel 0241/701333-0
[EMAIL PROTECTED]     Internet & Security for Professionals    Fax 0241/911879
           WESTEND ist CISCO Systems Partner - Premium Certified

===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to