~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to scripts/snmp-proxy/net-radius-freeradius-dictionary.diff

  • Committer: Bazaar Package Importer
  • Author(s): Josip Rodin
  • Date: 2009-11-23 03:57:37 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20091123035737-zsgtzhfych8hir68
Tags: 2.1.7+dfsg-1
* Adopting the package, closes: #536623.
* New upstream version, closes: #513484.
  + Fixes the blooper in unlang evaluation logic, closes: #526175.
* Used quilt (and added README.source), and moved upstream file patching
  into debian/patches/. The source is no longer in collab-maint git
  (to make it simpler for me to finally get this out the door), but
  kept the .gitignore should we need that again.
* Dropped the dialup_admin/bin/backup_radacct patch (integrated upstream).
* Dropped the raddb/Makefile patch (problem no longer exists upstream).
* Dropped the lib/packet.c lib/radius.c main/listen.c patches (was from
  upstream 2.0.5 anyway).
* Dropped references to otp.conf, it no longer exists upstream.
  Keep removing the conffile statoverride in prerm.
* Dropped references to snmp.conf, it no longer exists upstream.
  Keep removing the conffile statoverride in prerm.
* Ship /etc/freeradius/modules/* in the freeradius package.
* Stop shipping sites-enabled symlinks in the package and instead create
  them only on initial install, thanks to Matej Vela, closes: #533396.
* Add export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" to the init script
  at the request of John Morrissey, closes: #550143.
* Stop installing /var/run/freeradius in the package to silence Lintian.
  The init script already recreates it at will.
* Remove executable bit from example.pl to silence Lintian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- Net-Radius-1.56.orig/Radius/Dictionary.pm   2008-06-20 14:08:57.000000000 +0100
 
2
+++ Net-Radius-1.56.1/Radius/Dictionary.pm      2008-06-20 15:54:33.000000000 +0100
 
3
@@ -30,14 +30,23 @@
 
4
 
 
5
 sub readfile {
 
6
   my ($self, $filename) = @_;
 
7
+  my $dict;
 
8
 
 
9
-  open DICT, "<$filename";
 
10
+  open $dict, "<$filename";
 
11
 
 
12
-  while (defined(my $l = <DICT>)) {
 
13
+  my @in_vendor = ();
 
14
+
 
15
+  while (defined(my $l = <$dict>)) {
 
16
     next if $l =~ /^\#/;
 
17
     next unless my @l = split /\s+/, $l;
 
18
 
 
19
-    if ($l[0] =~ m/^vendor$/i) 
 
20
+    if ($l[0] =~ m/^\$include$/i)
 
21
+    {
 
22
+        my @fn = split /\//, $filename;
 
23
+        $fn[$#fn] = $l[1];
 
24
+        $self->readfile(join '/', @fn);
 
25
+    }
 
26
+    elsif ($l[0] =~ m/^vendor$/i) 
 
27
     {
 
28
        if (defined $l[1] and defined $l[2] and $l[2] =~ /^[xo0-9]+$/)
 
29
        {
 
30
@@ -53,8 +62,42 @@
 
31
            warn "Garbled VENDOR line $l\n";
 
32
        }
 
33
     }
 
34
+    elsif ($l[0] =~ m/^begin-vendor$/i)
 
35
+    {
 
36
+    if ( defined $l[1] )
 
37
+    {
 
38
+        push @in_vendor, $l[1];
 
39
+    }
 
40
+    else
 
41
+    {
 
42
+           warn "Garbled BEGIN-VENDOR line $l\n";
 
43
+    }
 
44
+    }
 
45
+    elsif ($l[0] =~ m/^end-vendor$/i)
 
46
+    {
 
47
+    if ( defined $l[1] )
 
48
+    {
 
49
+        if ( $in_vendor[$#in_vendor] eq $l[1] ) {
 
50
+            pop @in_vendor;
 
51
+        }else {
 
52
+            warn "mismatched END-VENDOR line $l\n";
 
53
+        }
 
54
+    }
 
55
+    else
 
56
+    {
 
57
+           warn "Garbled END-VENDOR line $l\n";
 
58
+    }
 
59
+    }
 
60
     elsif ($l[0] =~ m/^attribute$/i) 
 
61
     {
 
62
+    if (@l == 5) {
 
63
+        my @tags = grep { not ( m/^encrypt=\d$/ or m/^has_tag$/ ) } split /,/, pop @l;
 
64
+        push @l, join ',', @tags if scalar @tags;
 
65
+    }
 
66
+    if (@l == 4 and scalar @in_vendor) {
 
67
+        push @l, $in_vendor[$#in_vendor];
 
68
+    }
 
69
+
 
70
        if (@l == 4)
 
71
        {
 
72
            $self->{attr}->{$l[1]}  = [@l[2,3]];
 
73
@@ -166,7 +209,7 @@
 
74
       warn "Warning: Weird dictionary line: $l\n";
 
75
     }
 
76
   }
 
77
-  close DICT;
 
78
+  close $dict;
 
79
 }
 
80
 
 
81
 # Accessors for standard attributes