Validate input file name
Dieser Commit ist enthalten in:
Ursprung
216d9c2668
Commit
e8c77cfedd
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
2
pdf-sign
2
pdf-sign
|
@ -9,6 +9,8 @@ signatureDir=os.path.expanduser(os.environ['PDF_SIGNATURE_DIR'] if 'PDF_SIGNATUR
|
||||||
# Inspired by https://unix.stackexchange.com/a/141496
|
# Inspired by https://unix.stackexchange.com/a/141496
|
||||||
def main(args):
|
def main(args):
|
||||||
filePath=args.input
|
filePath=args.input
|
||||||
|
if not m("^.*\.(pdf|PDF)$", filePath):
|
||||||
|
die("Input file must end with .pdf or .PDF")
|
||||||
with tempfile.TemporaryDirectory() as tempdir:
|
with tempfile.TemporaryDirectory() as tempdir:
|
||||||
intmp=lambda fileName: os.path.join(tempdir, fileName)
|
intmp=lambda fileName: os.path.join(tempdir, fileName)
|
||||||
# Maybe flatten (make forms non-editable) before signing
|
# Maybe flatten (make forms non-editable) before signing
|
||||||
|
|
Laden …
Tabelle hinzufügen
In neuem Issue referenzieren