chiark / gitweb /
make-secnet-sites: Crash if complain() is called too late
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Oct 2019 14:04:19 +0000 (15:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Oct 2019 18:16:16 +0000 (19:16 +0100)
Every call to complain() is supposed to occurs before the code in the
main program which checks `complaints'.  But maybe there is an
erroneous late call, or one may be introduced.  In this case it is
important to crash, because otherwise bad data might end up being
written into our output.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
make-secnet-sites

index a24c06f6abe555e31902ffa83bc1b1c2b55040bd..ab125ffaed3f7de5e44c136266efdf8eef6753c1 100755 (executable)
@@ -585,6 +585,7 @@ if complaints>0:
        if complaints==1: print("There was 1 problem.")
        else: print("There were %d problems."%(complaints))
        sys.exit(1)
+complaints=None # arranges to crash if we complain later
 
 if service:
        # Put the user's input into their group file, and rebuild the main