Refuse to operate on files with dash prefix

Fixes #6.
Dieser Commit ist enthalten in:
Axel Svensson 2024-06-03 10:51:13 +02:00
Ursprung 0a0c7c9e13
Commit 3eed74e1ef

Datei anzeigen

@ -19,6 +19,9 @@ def main(args):
filePath=args.input
if not isPdfFilename(filePath):
die("Input file must end with .pdf (case insensitive)")
if filePath.startswith('-'):
# A cheap solution to a rare problem
die("Input file may not start with a dash (-)")
with tempfile.TemporaryDirectory() as tempdir:
intmp=lambda fileName: Volatile(os.path.join(tempdir, fileName))
# Maybe flatten (make forms non-editable) before signing