Your message dated Mon, 07 Aug 2017 05:36:49 +0000
with message-id <e1deaif-000gum...@fasolo.debian.org>
and subject line Bug#836334: fixed in pwgen 2.08-1
has caused the Debian Bug report #836334,
regarding pwgen: Patch for adding an option to remove/avoid an arbitrary char 
group
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
836334: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836334
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: pwgen
Version: 2.07-1
Severity: wishlist
Tags: patch


Hi,
see the attached patch. It adds an option "-r chars" 
for removing an arbitrary char group.

Flo

commit acc97baf11505b5b741b3dde23b5855bf4eb8c88
Author: Florian Lohoff <f...@zz.de>
Date:   Thu Sep 1 21:12:28 2016 +0200

    Add -r chars option for removing chars from password.
    
    The biggest annoyance on German Keyboards is the swap
    of y and z to the American Keyboard layout. Sometimes
    it cant be avoided to use American Keyboard e.g. on
    LOM/BMC/IPMI access. It would be nice to be able to
    avoid yYzZ in passwords because of this problem.
    As there will definitly be other Keyboard layouts
    which have the same problem add an option to avoid
    an arbitrary group of chars.

diff --git a/pw_phonemes.c b/pw_phonemes.c
index f9de869..8705ffc 100644
--- a/pw_phonemes.c
+++ b/pw_phonemes.c
@@ -56,7 +56,7 @@ struct pw_element elements[] = {
 
 #define NUM_ELEMENTS (sizeof(elements) / sizeof (struct pw_element))
 
-void pw_phonemes(char *buf, int size, int pw_flags)
+void pw_phonemes(char *buf, int size, int pw_flags, char *remove)
 {
        int             c, i, len, flags, feature_flags;
        int             prev, should_be, first;
diff --git a/pw_rand.c b/pw_rand.c
index 240f173..2d28915 100644
--- a/pw_rand.c
+++ b/pw_rand.c
@@ -20,7 +20,7 @@ const char *pw_symbols = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
 const char *pw_ambiguous = "B8G6I1l0OQDS5Z2";
 const char *pw_vowels = "01aeiouyAEIOUY";
 
-void pw_rand(char *buf, int size, int pw_flags)
+void pw_rand(char *buf, int size, int pw_flags, char *remove)
 {
        char            ch, *chars, *wchars;
        int             i, len, feature_flags;
@@ -65,6 +65,8 @@ try_again:
                        continue;
                if ((pw_flags & PW_NO_VOWELS) && strchr(pw_vowels, ch))
                        continue;
+               if (remove != NULL && strchr(remove, ch))
+                       continue;
                buf[i++] = ch;
                if (strchr(pw_digits, ch))
                        feature_flags &= ~PW_DIGITS;
diff --git a/pwgen.1 b/pwgen.1
index 4aa8e60..0e61d29 100644
--- a/pwgen.1
+++ b/pwgen.1
@@ -101,6 +101,9 @@ Also, note that the name of the file may be easily 
available from the
 .B \-h, --help
 Print a help message.
 .TP
+.B \-r "chars"
+Dont use characters in password.
+.TP
 .B \-s, --secure
 Generate completely random, hard-to-memorize passwords.  These should
 only be used for machine passwords, since otherwise it's almost
diff --git a/pwgen.c b/pwgen.c
index d92579f..0da35e5 100644
--- a/pwgen.c
+++ b/pwgen.c
@@ -46,7 +46,7 @@ struct option pwgen_options[] = {
 };
 #endif
 
-const char *pw_options = "01AaBCcnN:shH:vy";
+const char *pw_options = "01AaBCcnN:sr:hH:vy";
 
 static void usage(void)
 {
@@ -66,6 +66,8 @@ static void usage(void)
        fputs("  -y or --symbols\n", stderr);
        fputs("\tInclude at least one special symbol in the password\n", 
              stderr);
+       fputs("  -r chars\n", stderr);
+       fputs("\tRemove characters from password\n", stderr);
        fputs("  -s or --secure\n", stderr);
        fputs("\tGenerate completely random passwords\n", stderr);
        fputs("  -B or --ambiguous\n", stderr);
@@ -92,7 +94,8 @@ int main(int argc, char **argv)
        int     c, i;
        int     num_cols = -1;
        char    *buf, *tmp;
-       void    (*pwgen)(char *inbuf, int size, int pw_flags);
+       char    *remove=NULL;
+       void    (*pwgen)(char *inbuf, int size, int pw_flags, char *remove);
 
        pwgen = pw_phonemes;
        pw_number = pw_random_number;
@@ -156,6 +159,10 @@ int main(int argc, char **argv)
                        pwgen = pw_rand;
                        pwgen_flags |= PW_NO_VOWELS | PW_DIGITS | PW_UPPERS;
                        break;
+               case 'r':
+                       remove = strdup(optarg);
+                       pwgen = pw_rand;
+                       break;
                case 'h':
                case '?':
                        usage();
@@ -201,7 +208,7 @@ int main(int argc, char **argv)
                exit(1);
        }
        for (i=0; i < num_pw; i++) {
-               pwgen(buf, pw_length, pwgen_flags);
+               pwgen(buf, pw_length, pwgen_flags, remove);
                if (!do_columns || ((i % num_cols) == (num_cols-1)))
                        printf("%s\n", buf);
                else
diff --git a/pwgen.h b/pwgen.h
index be7d76b..f408fe3 100644
--- a/pwgen.h
+++ b/pwgen.h
@@ -38,10 +38,10 @@ extern const char *pw_ambiguous;
 /* Function prototypes */
 
 /* pw_phonemes.c */
-extern void pw_phonemes(char *buf, int size, int pw_flags);
+extern void pw_phonemes(char *buf, int size, int pw_flags, char *remove);
 
 /* pw_rand.c */
-extern void pw_rand(char *buf, int size, int pw_flags);
+extern void pw_rand(char *buf, int size, int pw_flags, char *remove);
 
 /* randnum.c */
 extern int pw_random_number(int max_num);

-- System Information:
Debian Release: 8.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.6.0-0.bpo.1-rt-amd64 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pwgen depends on:
ii  libc6  2.19-18+deb8u4

pwgen recommends no packages.

pwgen suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: pwgen
Source-Version: 2.08-1

We believe that the bug you reported is fixed in the latest version of
pwgen, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 836...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Theodore Y. Ts'o <ty...@mit.edu> (supplier of updated pwgen package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 07 Aug 2017 00:51:45 -0400
Source: pwgen
Binary: pwgen pwgen-udeb
Architecture: source
Version: 2.08-1
Distribution: unstable
Urgency: medium
Maintainer: Theodore Y. Ts'o <ty...@mit.edu>
Changed-By: Theodore Y. Ts'o <ty...@mit.edu>
Description:
 pwgen      - Automatic Password generation
 pwgen-udeb - Automatic Password generation (udeb)
Closes: 454500 666725 695148 791908 794635 836334 846517 855495
Changes:
 pwgen (2.08-1) unstable; urgency=medium
 .
   * New upstream version
   * Suppress trailing space after the last password (Closes: #794635)
   * Make pwgen -s more "secure" for 1 and 2 character passwords
     (Closes: #666725)
   * Fix option parsing of "pwgen --no-capitalize --no-vowels" (Closes: #791908)
   * Add new option --remove-chars which removes chars from the set of
     characters used to generate passwords (Closes: #836334)
   * Add cross-compilation to debian/rules (Closes: #695148)
   * Update control and copyright files to point at pwgen at github for
     the home directory and primary git repository
     (Closes: #454500, #855495, #846517)
   * Update Debian policy compliance to 4.0.0
Checksums-Sha1:
 3cba9e034d6380e23784290b5fb50b5850e14fd8 1708 pwgen_2.08-1.dsc
 6406deba61297784888c2ec0c14e3c735a85a2b6 54884 pwgen_2.08.orig.tar.gz
 024d8245b0745d5aaeac60bd098edd6419e402ac 488 pwgen_2.08.orig.tar.gz.asc
 468f887afe8aaa09fd4fa5c5232f319683404d08 5656 pwgen_2.08-1.debian.tar.xz
 eeb71a0f3520d36e60e0388df3e9020bf71ab05a 5633 pwgen_2.08-1_i386.buildinfo
Checksums-Sha256:
 8ba952876ced56465dff1cdae42b61756b13a66656716a37bebd905857e4fee7 1708 
pwgen_2.08-1.dsc
 dab03dd30ad5a58e578c5581241a6e87e184a18eb2c3b2e0fffa8a9cf105c97b 54884 
pwgen_2.08.orig.tar.gz
 b16dde245d7153f261ebc8de6d5226c4cd7bccd9f880e66697f17903fcad3b6c 488 
pwgen_2.08.orig.tar.gz.asc
 3d2ebdf3b6692e9daabf30f334127bc1aea82228a5d8bcf2cce15bfd0cd76fdc 5656 
pwgen_2.08-1.debian.tar.xz
 ff47e66efe28deb4e82c6f896f4d998fa66235f6600020d70eecdc2e7199a89d 5633 
pwgen_2.08-1_i386.buildinfo
Files:
 8fd7df94642dfb98d5b2f622ed6f307a 1708 admin optional pwgen_2.08-1.dsc
 6cfba450ac6ff72d11e88a6b0b049165 54884 admin optional pwgen_2.08.orig.tar.gz
 5b3b27cc93f7b14c546a1f1abfece383 488 admin optional pwgen_2.08.orig.tar.gz.asc
 9ba3c88c4e447472ec889a90972f3ec5 5656 admin optional pwgen_2.08-1.debian.tar.xz
 0e1cec16f7ad6efb0ed6f14b95c7f0cd 5633 admin optional 
pwgen_2.08-1_i386.buildinfo

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEK2m5VNv+CHkogTfJ8vlZVpUNgaMFAlmH9i8ACgkQ8vlZVpUN
gaO7sggAnS4o0C3BI0+s4x+al/rpb9TcguZzGkx4y/GxdvaJ+RaMBmxmng9aUkJC
q7CAOhdGmFxyfd+R59PnhB4CRP5OK3DYQ+7NStCCXWe+fpGnF98y/YHmZ7sQNoXA
+CRpOkxrnSvmnNCYZ959+1C0YToodntxHpN9Ggrw72huTSXEnHgYxN/mRRjyVP8q
NwS0wEmlpUI7Kv6TIU1hq9dw1En26lZ4OQgOacOjWPNqClmstseG8x4m1ma0D1vC
65RTGwXgWqNa7E8xPWMiuzgqfJYAN5lIgoRLcchPBq89mjuyNK+OLKXYpgLL6DfH
w2UaRJZJpmYhmoFjGV7TOY7zHBFWdQ==
=WAG7
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to