File: clear-option-error.patch

package info (click to toggle)
makepasswd 1.10-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 328 kB
  • sloc: perl: 4,063; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 1,188 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 8487acbc3476e4511e57d0641418f197ab810746 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javier=20Fernandez-Sanguino=20Pe=C3=B1a?= <jfs@computer.org>
Date: Sat, 17 Dec 2022 12:16:15 +0000
Subject: Exit with error if old --clear option is used

Bug-Debian: https://bugs.debian.org/50885
Forwarded: no
Last-Update: 2022-12-17

Patch-Name: clear-option-error.patch
---
 makepasswd | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/makepasswd b/makepasswd
index 6b69757..6180c97 100755
--- a/makepasswd
+++ b/makepasswd
@@ -91,6 +91,7 @@ $SaltList="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
 &GetOptions
 (
 	'chars=i'		=> \$Chars,
+	'clear=s'		=> \$OldClear,
 	'clearfrom=s'		=> \$Clear,
 	'count=i'		=> \$Count,
 	'crypt!'		=> \$Crypt,
@@ -114,6 +115,17 @@ $#ARGV != -1 and do
 	$Error = 1;
 };
 
+#
+# If password generation option was specified with the old --clear,
+# warn the user and exit
+#
+$OldClear ne "" and do
+{
+	print STDERR "$Program:  Option --clear is no longer present \n".
+			"please use --clearfrom and supply a file for it.\n";
+	$Error = 1;
+};
+
 #
 # If password generation option was specified with --clearfrom, flag it.
 #