diff --git a/tperimeter.py b/tperimeter.py index 261e5dd..237c655 100644 --- a/tperimeter.py +++ b/tperimeter.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "perimiter.py" -RCSID = "$Id: tperimeter.py,v 1.100 2006/04/28 21:29:13 tundra Exp $" +RCSID = "$Id: tperimeter.py,v 1.101 2006/04/29 07:35:53 tundra Exp $" import os, re, sys @@ -88,11 +88,18 @@ Error("You Must Specify Address In IP Quad Format") +# Make sure each quad element is in range + +for q in address.split("."): + if not (0 <= int(q) <= 255): + Error("IP Address Component Is Out Of Range (%s Not Between 0-255)" % q) + # Make sure address is not on the forbidden list if address in Forbidden: Error("You Are Not Permitted To Enable Access For Address: %s" % address) + ##### # Output Content #####