From e5e5fd4ed8fd13cbeb5b4b10aae18a65c586e664 Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 19 Sep 1999 20:05:44 +0000 Subject: [PATCH] Discard alloc stuff. --- ipif/Makefile | 17 +++++++---- ipif/alloc.pl | 81 ------------------------------------------------- ipif/config | 3 -- ipif/ipif | 2 +- ipif/ipif-alloc | 10 ------ ipif/x.gdb | 2 -- 6 files changed, 12 insertions(+), 103 deletions(-) delete mode 100644 ipif/alloc.pl delete mode 100644 ipif/config delete mode 100644 ipif/ipif-alloc delete mode 100644 ipif/x.gdb diff --git a/ipif/Makefile b/ipif/Makefile index c8f6673..c5e3a37 100644 --- a/ipif/Makefile +++ b/ipif/Makefile @@ -3,16 +3,21 @@ CFLAGS= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith \ -Wwrite-strings -g -D_GNU_SOURCE -etc= /etc +etcdir= /etc prefix= /usr/local -libipif= $(prefix)/lib/userv-ipif -etcipif= $(etc)/userv/ipif + +libdir= $(prefix)/lib +libuserv= $(libdir)/userv + +etcuserv= $(etcdir)/userv +services= $(etcuserv)/services.d TARGETS= service all: $(TARGETS) install: all - mkdir -p $(libipif) $(etcipif) - cp service alloc.pl $(libdir)/. - touch $(etcipif)/networks + mkdir -p $(libuserv) $(services) + cp service $(libdir)/ipif + cp ipif $(services)/ipif:new + set -e; cd $(services); test -f ipif || mv ipif:new ipif diff --git a/ipif/alloc.pl b/ipif/alloc.pl deleted file mode 100644 index 15d7615..0000000 --- a/ipif/alloc.pl +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl - -$etcdir= '/etc/userv/ipif'; -chdir($etcdir) or die "$0: chdir $etcdir: $!\n"; - -$descallowd= '-][()+_\'":=;,./|'; - -sub usage () { - die < []/ - may contain alphanums, spaces and $descallowed -END -} - -@ARGV==3 or usage(); -($group, $pfxsize, $desc) = @ARGV; - -$super= 0; - -open X, "config" or die "$0: open config: $!\n"; -while () { - next if m/^\#/; - next if !m/\S/; - chomp; s/\s+$//; - if (m/^supergroup\s+(\w+)$/) { - $super= am_gid($1); - } elsif (m/^maxpergid\s+(\d+)$/) { - $maxpergid= $1; - } elsif (m,^range\s+([.0-9]+)/(\d+)$,) { - ($allow_p, $allow_m, $allow_l) = parse_range($1,$2); - } else { - die "$0: config:$.: unknown directive: $_\n"; - } -} -close X or die "$0: read config: $!\n"; - -if ($pfxsize =~ m,^([.0-9]+)/(\d+)$,) { - ($want_p, $want_m, $want_l) = parse_range($1,$2); - if (!$super && !overlap($want_p,$want_m, $allow_p,$allow_m)) { - die "$0: permission denied (out of required range)\n"; - } -} elsif ($pfxsize =~ m,^/(\d+)$,) { - undef $want_p; - undef $want_m; - $want_l= $1; -} else { - die "$0: bad request: $pfxsize\n"; -} - -$gid= get_gid($group); -if (!am_gid($gid)) { - die "$0: you are not gid $gid\n"; -} - -$op.= ''; -$max_p= 0; $max_m= 0; - -open Y, "auto-nets" or die "$0: open auto-nets: $!\n"; -for (;;) { - $!= 0; chomp($_= ); - length or die "$0: read auto-nets: $!\n"; - last if m/^\#end/; - next if m/^\#/; - $op.= $_."\n"; - m:^(\d+),([.0-9]+)/(\d+),.*: or die "$0: auto-nets:$.: syntax error: $_\n"; - $this_gid= $1; - ($this_p, $this_m, $this_l) = parse_range($2,$3); - if (defined($want_p)) { - if (overlap($want_p,$want_m, $this_p,$this_m)) { - die "$0: overlaps with existing allocation (auto-nets:$.)\n"; - } - } else { - if ($this_p > $max_p) { - ($this_p,$this_m) = ($max_p,$max_m); - } - } - - - next if $1 ne $gid; - diff --git a/ipif/config b/ipif/config deleted file mode 100644 index 52a3958..0000000 --- a/ipif/config +++ /dev/null @@ -1,3 +0,0 @@ -supergroup 0 -maxpergid 256 -range 10.232.0.0/15 diff --git a/ipif/ipif b/ipif/ipif index a019469..6d283bc 100644 --- a/ipif/ipif +++ b/ipif/ipif @@ -5,5 +5,5 @@ if ( grep calling-user-shell /etc/shells no-set-environment no-suppress-args no-disconnect-hup - execute /usr/local/lib/userv/ipif /etc/userv/ipif/networks -- + execute /usr/local/lib/userv/ipif /etc/userv/ipif-networks -- fi diff --git a/ipif/ipif-alloc b/ipif/ipif-alloc deleted file mode 100644 index 4bfa131..0000000 --- a/ipif/ipif-alloc +++ /dev/null @@ -1,10 +0,0 @@ -if ( grep calling-user-shell /etc/shells - & glob service-user root - ) - reset - no-set-environment - no-suppress-args - no-disconnect-hup - execute with-lock-ex -w /etc/userv/ipif/lockfile \ - /usr/local/lib/userv-ipif/alloc.pl -fi diff --git a/ipif/x.gdb b/ipif/x.gdb deleted file mode 100644 index 1f705ed..0000000 --- a/ipif/x.gdb +++ /dev/null @@ -1,2 +0,0 @@ -set environment USERV_GID="5000 5001" -set args "*" -- 10.232.40.0,10.232.40.1,1500,debug 10.232.40.0/28 -- 2.30.2