chiark / gitweb /
Import release 0.1.4 v0.1.4
authorStephen Early <steve@greenend.org.uk>
Wed, 10 Oct 2001 23:37:00 +0000 (00:37 +0100)
committerStephen Early <steve@greenend.org.uk>
Wed, 18 May 2011 12:33:01 +0000 (13:33 +0100)
Makefile.in
example.conf
make-secnet-sites.py

index a3ad397ecfe166ad40ce4bf8917aa9191bedfbd6..f53957e0cc98f9c3d55c8a874d109f2e7203d77e 100644 (file)
@@ -18,7 +18,7 @@
 .PHONY:        all clean realclean dist install
 
 PACKAGE:=secnet
-VERSION:=0.1.3
+VERSION:=0.1.4
 
 @SET_MAKE@
 
index 3b4a32f60e4c8d66e682e89026d433b88f0bd51b..0d7a546684df550603f4bcca17624aae7c4aff48 100644 (file)
@@ -119,7 +119,7 @@ transform serpent256-cbc {
        max-sequence-skew 10;
 };
 
-include /etc/secnet/sites
+include /etc/secnet/sites.conf
 
 # Here you must list all the VPN sites that you wish to communicate with.
 # The /etc/secnet/sites file contains information on all reachable sites;
@@ -128,11 +128,15 @@ include /etc/secnet/sites
 # contains public keys for all sites.
 
 sites
-       site(example-vpn/some-site),
-       site(example-vpn/some-other-site),
-       site(example-vpn/a-third-site);
+       site(vpn-data/example/location1/site1),
+       site(vpn-data/example/location2/site1),
+       site(vpn-data/example/location2/site2);
 
 # If you want to communicate with all the VPN sites, you can use something
 # like the following instead:
 
-# sites map(site,makelist(example-vpn));
+# sites map(site,vpn/example/all-sites);
+
+# If you want to communicate with a subset of locations, try the following:
+
+# sites map(site,vpn/example/location1,vpn/example/location2);
index 8a6433875ad0e11d7f12cf4ee3ae3d8dc562796a..8479aaa0f9554841dfe1c8625f6aa9d0fd6e85d0 100755 (executable)
@@ -42,7 +42,7 @@ reset
 no-disconnect-hup
 no-suppress-args
 cd ~/secnet/sites-test/
-execute ~/secnet/secnet/make-secnet-sites.py -u vpnheader groupfiles sites
+execute ~/secnet/make-secnet-sites.py -u vpnheader groupfiles sites
 
 This program is part of secnet. It relies on the "ipaddr" library from
 Cendio Systems AB.
@@ -55,7 +55,7 @@ import sys
 import os
 import ipaddr
 
-VERSION="0.1.3"
+VERSION="0.1.4"
 
 class vpn:
        def __init__(self,name):
@@ -146,7 +146,7 @@ class mobileoption:
        def __init__(self,w):
                self.w=w
        def out(self):
-               return 'netlink-options "soft";'
+               return 'netlink-options "soft";'
 
 def complain(msg):
        global complaints
@@ -385,8 +385,9 @@ else:
                        print "caller not in group %s"%group
                        sys.exit(1)
                f=open(header)
-               pfile(header,f.readlines())
+               headerinput=f.readlines()
                f.close()
+               pfile(header,headerinput)
                userinput=sys.stdin.readlines()
                pfile("user input",userinput)
        else:
@@ -456,14 +457,29 @@ if complaints>0:
 if service:
        # Put the user's input into their group file, and rebuild the main
        # sites file
-       f=open(groupfiledir+"-tmp/"+group,'w')
+       f=open(groupfiledir+"/T"+group,'w')
        f.write("# Section submitted by user %s, %s\n"%
                (user,time.asctime(time.localtime(time.time()))))
        f.write("# Checked by make-secnet-sites.py version %s\n\n"%VERSION)
        for i in userinput: f.write(i)
        f.write("\n")
        f.close()
-       os.rename(groupfiledir+"-tmp/"+group,groupfiledir+"/"+group)
-       # XXX rebuild main sites file!
+       os.rename(groupfiledir+"/T"+group,groupfiledir+"/R"+group)
+       f=open(sitesfile+"-tmp",'w')
+       f.write("# sites file autogenerated by make-secnet-sites.py\n")
+       f.write("# generated %s, invoked by %s\n"%
+               (time.asctime(time.localtime(time.time())),user))
+       f.write("# use make-secnet-sites.py to turn this file into a\n")
+       f.write("# valid /etc/secnet/sites.conf file\n\n")
+       for i in headerinput: f.write(i)
+       files=os.listdir(groupfiledir)
+       for i in files:
+               if i[0]=='R':
+                       j=open(groupfiledir+"/"+i)
+                       f.write(j.read())
+                       j.close()
+       f.write("# end of sites file\n")
+       f.close()
+       os.rename(sitesfile+"-tmp",sitesfile)
 else:
        outputsites(of)