Hello community,
here is the log from the commit of package pwgen
checked in at Thu Jul 5 10:25:14 CEST 2007.
--------
--- pwgen/pwgen.changes 2006-01-25 21:40:42.000000000 +0100
+++ /mounts/work_src_done/STABLE/pwgen/pwgen.changes 2007-07-05 10:10:45.568847000 +0200
@@ -1,0 +2,8 @@
+Thu Jul 5 10:09:48 CEST 2007 - kssingvo@suse.de
+
+- update to version 2.06:
+ * Fix spelling mistakes in the man page pwgen.1
+ * Fix bug which would cause pwgen to loop forever if the password
+ length specified is 1
+
+-------------------------------------------------------------------
Old:
----
pwgen-2.05.tar.bz2
New:
----
pwgen-2.06.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ pwgen.spec ++++++
--- /var/tmp/diff_new_pack.W24544/_old 2007-07-05 10:24:59.000000000 +0200
+++ /var/tmp/diff_new_pack.W24544/_new 2007-07-05 10:24:59.000000000 +0200
@@ -1,21 +1,21 @@
#
-# spec file for package pwgen (Version 2.05)
+# spec file for package pwgen (Version 2.06)
#
-# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
-# Please submit bugfixes or comments via http://bugs.opensuse.org
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: pwgen
URL: http://sourceforge.net/projects/pwgen/
-License: GPL
+License: GPL v2 or later
Group: Productivity/Security
Autoreqprov: on
-Version: 2.05
+Version: 2.06
Release: 1
Summary: Password generator
Source: http://belnet.dl.sourceforge.net/sourceforge/pwgen/pwgen-%{version}.tar.bz2
@@ -70,7 +70,12 @@
/usr/bin/makepasswd
/usr/bin/pwgen
-%changelog -n pwgen
+%changelog
+* Thu Jul 05 2007 - kssingvo@suse.de
+- update to version 2.06:
+ * Fix spelling mistakes in the man page pwgen.1
+ * Fix bug which would cause pwgen to loop forever if the password
+ length specified is 1
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Jan 16 2006 - kssingvo@suse.de
@@ -84,7 +89,7 @@
*.* syntax
* Tue May 13 2003 - poeml@suse.de
- update to 2.03
-- pw_phonemes.c (pw_phonemes): Fix bug in how we call
+ - pw_phonemes.c (pw_phonemes): Fix bug in how we call
pw_random_number() so that we generate passwords that start
with vowels, and insert numbers from 0-9, not just 0-8. (Oops!)
Addresses Debian bug #176688.
++++++ pwgen-2.05.tar.bz2 -> pwgen-2.06.tar.bz2 ++++++
++++ 5432 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/debian/changelog new/pwgen-2.06/debian/changelog
--- old/pwgen-2.05/debian/changelog 2006-01-16 05:19:39.000000000 +0100
+++ new/pwgen-2.06/debian/changelog 2007-07-05 01:42:19.000000000 +0200
@@ -1,3 +1,15 @@
+pwgen (2.06-1) unstable; urgency=low
+
+ * New upstream version
+ * Fix pwgen -Bs so that this option combination works correctly
+ (Closes: #368010)
+ * Fix the pwgen -Bc option combination (Closes: #355153)
+ * Fix typo in pwgen man page (Closes: #376147)
+ * Make the -s option imply the -nc options (Closes: #427969)
+ * Add -v option to generate passwords without vowels (Closes: #387461)
+
+ -- Theodore Y. Ts'o Wed, 4 Jul 2007 19:19:26 -0400
+
pwgen (2.05-1) unstable; urgency=low
* Add a udeb for debian-installer. Thanks to Martin Michlmayr for the
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/debian/control new/pwgen-2.06/debian/control
--- old/pwgen-2.05/debian/control 2006-01-16 04:29:44.000000000 +0100
+++ new/pwgen-2.06/debian/control 2007-07-05 01:42:19.000000000 +0200
@@ -3,7 +3,7 @@
Priority: optional
Build-Depends: debhelper (>= 4)
Maintainer: Theodore Y. Ts'o
-Standards-Version: 3.6.1.1
+Standards-Version: 3.7.2.2
Package: pwgen
Architecture: any
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/debian/control~ new/pwgen-2.06/debian/control~
--- old/pwgen-2.05/debian/control~ 1970-01-01 01:00:00.000000000 +0100
+++ new/pwgen-2.06/debian/control~ 2007-07-05 01:42:19.000000000 +0200
@@ -0,0 +1,31 @@
+Source: pwgen
+Section: admin
+Priority: optional
+Build-Depends: debhelper (>= 4)
+Maintainer: Theodore Y. Ts'o
+Standards-Version: 3.6.1.1
+
+Package: pwgen
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Automatic Password generation
+ pwgen generates random, meaningless but pronounceable passwords.
+ These passwords contain either only lowercase letters, or upper
+ and lower case mixed, or digits thrown in.
+ Uppercase letters and digits are placed in a way that eases
+ remembering their position when memorizing only the word.
+
+Package: pwgen-udeb
+Architecture: any
+Depends: ${shlibs:Depends}
+Section: debian-installer
+XC-Package-Type: udeb
+Description: Automatic Password generation
+ pwgen generates random, meaningless but pronounceable passwords.
+ These passwords contain either only lowercase letters, or upper
+ and lower case mixed, or digits thrown in.
+ Uppercase letters and digits are placed in a way that eases
+ remembering their position when memorizing only the word.
+ .
+ pwgen-udeb is a minimal package used by debian-installer.
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/debian/rules new/pwgen-2.06/debian/rules
--- old/pwgen-2.05/debian/rules 2006-01-16 04:29:44.000000000 +0100
+++ new/pwgen-2.06/debian/rules 2007-07-05 01:42:19.000000000 +0200
@@ -16,7 +16,7 @@
dh_testroot
rm -f build-stamp
- -$(MAKE) distclean
+ if test -f Makefile ; then $(MAKE) distclean ; fi
-rm -f `find . -name "*~"` pwgen *.o
dh_clean
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/debian/rules~ new/pwgen-2.06/debian/rules~
--- old/pwgen-2.05/debian/rules~ 1970-01-01 01:00:00.000000000 +0100
+++ new/pwgen-2.06/debian/rules~ 2007-07-05 01:42:19.000000000 +0200
@@ -0,0 +1,70 @@
+#!/usr/bin/make -f
+# Made with the aid of debmake, by Christoph Lameter,
+# based on the sample debian/rules file for GNU hello by Ian Jackson.
+
+package=pwgen
+
+build: build-stamp
+build-stamp:
+ dh_testdir
+ ./configure --prefix=/usr --mandir=/usr/share/man
+ $(MAKE) CFLAGS="-O2 -g -Wall"
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+
+ $(MAKE) distclean
+ -rm -f `find . -name "*~"` pwgen *.o
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ $(MAKE) install DESTDIR=`pwd`/debian/pwgen
+ dh_install -ppwgen-udeb pwgen /usr/bin
+
+binary-indep: build install
+ dh_testdir
+ dh_testroot
+# There are no architecture-independent files to be uploaded
+# generated by this package. If there were any they would be
+# made here.
+
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+# dh_installdebconf
+ dh_installdocs
+ dh_installexamples
+ dh_installmenu
+# dh_installemacsen
+# dh_installpam
+# dh_installinit
+# dh_installcron
+ dh_installman
+# dh_installinfo
+# dh_undocumented
+ dh_installchangelogs ChangeLog
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ # You may want to make some executables suid here.
+# dh_makeshlibs
+ dh_installdeb
+# dh_perl
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+
+.PHONY: binary binary-arch binary-indep clean
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/.gitignore new/pwgen-2.06/.gitignore
--- old/pwgen-2.05/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/pwgen-2.06/.gitignore 2007-07-05 01:42:19.000000000 +0200
@@ -0,0 +1,7 @@
+Makefile
+config.cache
+config.log
+config.status
+configure
+pwgen
+*.o
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/Makefile new/pwgen-2.06/Makefile
--- old/pwgen-2.05/Makefile 2006-01-16 05:27:18.000000000 +0100
+++ new/pwgen-2.06/Makefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,134 +0,0 @@
-PWGEN_VERSION=2.05
-
-srcdir = .
-top_srcdir = .
-
-top_builddir = .
-my_dir = .
-prefix = /usr/local
-mandir = ${prefix}/man
-INSTALL = /usr/bin/install -c
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
-
-WALL_OPTS = -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
- -Wshadow -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align \
- -pedantic
-CC = gcc
-DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_DRAND48=1 -DHAVE_GETOPT_LONG=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_GETOPT_H=1
-CFLAGS = -g -O2 $(WALL_OPTS)
-CPPFLAGS =
-ALL_CFLAGS = $(CPPFLAGS) $(DEFS) $(USE_WFLAGS) $(CFLAGS) $(XTRA_CFLAGS)
-LDFLAGS =
-RM = /bin/rm
-MV = /bin/mv
-SED = /bin/sed
-PERL = /usr/bin/perl
-TAR = tar
-
-all:: pwgen
-
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $< -o $@
-
-OBJS= pwgen.o pw_phonemes.o pw_rand.o randnum.o sha1.o sha1num.o
-
-SRCS= pwgen.c pw_phonemes.c pw_rand.c randnum.c sha1.c sha1num.c
-
-
-pwgen: $(OBJS)
- $(CC) $(LDFLAGS) -o pwgen $(OBJS)
-
-install: pwgen pwgen.1
- mkdir -p $(DESTDIR)$(prefix)/bin $(DESTDIR)$(mandir)/man1
- $(INSTALL_PROGRAM) pwgen $(DESTDIR)$(prefix)/bin/pwgen
- $(INSTALL_DATA) $(srcdir)/pwgen.1 $(DESTDIR)$(mandir)/man1/pwgen.1
-
-clean:
- $(RM) -f $(OBJS) pwgen *~
-
-distclean: clean
- $(RM) -rf config.status config.log config.cache Makefile \
- $(srcdir)/Makefile.in.old $(srcdir)/.exclude-file \
- $(srcdir)/autom4te.cache
-
-#
-# Build source tar ball...
-#
-
-SRCROOT = pwgen-$(PWGEN_VERSION)
-
-$(srcdir)/.exclude-file:
- a=$(SRCROOT); \
- (cd $(srcdir)/.. && find src \( -name \*~ -o -name \*.orig \
- -o -name CVS -o -name \*.rej \
- -o -name TAGS -o -name \*.old -o -name \*.gmo \
- -o -name changed-files -o -name .#\* \) \
- -print) | sed -e "s/src/$$a/" > $(srcdir)/.exclude-file
- echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
- echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
- echo "$(SRCROOT)/config.log" >> $(srcdir)/.exclude-file
- echo "$(SRCROOT)/config.status" >> $(srcdir)/.exclude-file
- echo "$(SRCROOT)/config.cache" >> $(srcdir)/.exclude-file
- echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file
- echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
- >> $(srcdir)/.exclude-file
-
-source_tar_file: $(srcdir)/.exclude-file
- cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf src $$a ; \
- $(TAR) -c -h -v -f - \
- -X $$a/.exclude-file $$a | \
- gzip -9 > pwgen-$(PWGEN_VERSION).tar.gz
- rm -f $(srcdir)/.exclude-file
-#
-# Autoconf magic...
-#
-
-$(top_builddir)/config.status: $(top_srcdir)/configure
- cd $(top_builddir); ./config.status --recheck
-
-Makefile: $(srcdir)/Makefile.in $(DEP_MAKEFILE) $(top_builddir)/config.status
- cd $(top_builddir); CONFIG_FILES=$(my_dir)/Makefile ./config.status
-
-$(top_srcdir)/configure: $(top_srcdir)/configure.in
- cd $(top_srcdir) && autoconf
-
-#
-# Make depend magic...
-#
-
-.depend: Makefile $(SRCS) $(top_srcdir)/depfix.sed $(top_srcdir)/wordwrap.pl
- if test -n "$(SRCS)" ; then \
- $(CC) -M $(ALL_CFLAGS) $(SRCS) | \
- $(SED) -f $(top_srcdir)/depfix.sed \
- -e 's; $(srcdir)/; $$(srcdir)/;g' \
- -e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \
- -e 's; $(top_builddir)/; $$(top_builddir)/;g' \
- -e 's; \./; ;g' \
- -e '/^ *\\$$/d' | \
- $(PERL) $(top_srcdir)/wordwrap.pl > .depend; \
- else :; fi
-
-depend:: .depend
- if test -n "$(SRCS)" ; then \
- sed -e '/^# +++ Dependency line eater +++/,$$d' \
- < $(srcdir)/Makefile.in | cat - .depend \
- > $(srcdir)/Makefile.in.new; \
- if cmp -s $(srcdir)/Makefile.in $(srcdir)/Makefile.in.new ; then \
- $(RM) $(srcdir)/Makefile.in.new ; \
- else \
- $(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \
- $(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
- fi ; else :; fi
-
-# +++ Dependency line eater +++
-#
-# Makefile dependencies follow. This must be the last section in
-# the Makefile.in file
-#
-pwgen.o: pwgen.c pwgen.h
-pw_phonemes.o: pw_phonemes.c pwgen.h
-pw_rand.o: pw_rand.c pwgen.h
-randnum.o: randnum.c pwgen.h
-sha1.o: sha1.c sha1.h
-sha1num.o: sha1num.c sha1.h pwgen.h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/pwgen.1 new/pwgen-2.06/pwgen.1
--- old/pwgen-2.05/pwgen.1 2006-01-16 05:18:57.000000000 +0100
+++ new/pwgen-2.06/pwgen.1 2007-07-05 01:42:19.000000000 +0200
@@ -31,26 +31,38 @@
.B pwgen
program is designed
to be used both interactively, and in shell scripts. Hence,
-its default behavior is differs depending on whether the standard output
+its default behavior differs depending on whether the standard output
is a tty device or a pipe to another program. Used interactively,
.B pwgen
will display a screenful of passwords, allowing the user to pick a single
password, and then quickly erase the screen. This prevents someone from
-being able to "shoulder-surf" the user's chosen password.
+being able to "shoulder surf" the user's chosen password.
.PP
-When standard output is not a tty,
+When standard output (stdout) is not a tty,
.B pwgen
will only generate one password, as this tends to be much more convenient
for shell scripts, and in order to be
-compatible with previous versions of this program. In addition, for
-backwards compatibility reasons,
+compatible with previous versions of this program.
+.PP
+In addition, for
+backwards compatibility reasons, when stdout is not a tty and secure
+password generation mode has not been requested,
+.B pwgen
+will generate less secure passwords, as
+if the
+.B \-0A
+options had been passed to it on the command line. This can be
+overriden using the
+.B \-nc
+options. In the future, the behavior when stdout is a tty may change, so
+shell scripts using
.B pwgen
-will not use upper case letters or numbers by default in this mode,
-although this can be overridden using the
-.B \-n
-and
-.B \-c
-options.
+should explicitly specify the
+.B \-nc
+or
+.B \-0A
+options. The latter is not recommended for security reasons, since
+such passwords are far too easy to guess.
.B
.SH OPTIONS
.TP
@@ -115,6 +127,12 @@
guaranteed that users will simply write the password on a piece of
paper taped to the monitor...
.TP
+.B \-v, --no-vowels
+Generate random passwords that do not contain vowels or numbers that
+might be mistaken for vowels. It provides less secure passwords to
+allow system administrators to not have to worry with random passwords
+accidentally contain offensive substrings.
+.TP
.B \-y, --symbols
Include at least one special character in the password.
.SH AUTHOR
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/pwgen.c new/pwgen-2.06/pwgen.c
--- old/pwgen-2.05/pwgen.c 2006-01-16 04:59:04.000000000 +0100
+++ new/pwgen-2.06/pwgen.c 2007-07-05 01:42:19.000000000 +0200
@@ -41,11 +41,12 @@
{ "no-capitalize", no_argument, 0, 'A' },
{ "sha1", required_argument, 0, 'H' },
{ "ambiguous", no_argument, 0, 'B' },
+ { "no-vowels", no_argument, 0, 'v' },
{ 0, 0, 0, 0}
};
#endif
-const char *pw_options = "01AaBCcnN:shH:y";
+const char *pw_options = "01AaBCcnN:shH:vy";
static void usage(void)
{
@@ -78,6 +79,9 @@
fputs(" -C\n\tPrint the generated passwords in columns\n", stderr);
fputs(" -1\n\tDon't print the generated passwords in columns\n",
stderr);
+ fputs(" -v or --no-vowels\n", stderr);
+ fputs("\tDo not use any vowels so as to avoid accidental nasty words\n",
+ stderr);
exit(1);
}
@@ -134,6 +138,7 @@
break;
case 's':
pwgen = pw_rand;
+ pwgen_flags = PW_DIGITS | PW_UPPERS;
break;
case 'C':
do_columns = 1;
@@ -148,6 +153,10 @@
case 'y':
pwgen_flags |= PW_SYMBOLS;
break;
+ case 'v':
+ pwgen = pw_rand;
+ pwgen_flags |= PW_NO_VOWELS | PW_DIGITS | PW_UPPERS;
+ break;
case 'h':
case '?':
usage();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/pwgen.h new/pwgen-2.06/pwgen.h
--- old/pwgen-2.05/pwgen.h 2005-06-15 06:32:59.000000000 +0200
+++ new/pwgen-2.06/pwgen.h 2007-07-05 01:42:19.000000000 +0200
@@ -27,6 +27,7 @@
#define PW_UPPERS 0x0002 /* At least one upper letter */
#define PW_SYMBOLS 0x0004
#define PW_AMBIGUOUS 0x0008
+#define PW_NO_VOWELS 0x0010
/* pointer to choose between random or sha1 pseudo random number generator */
extern int (*pw_number)(int max_num);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/pw_phonemes.c new/pwgen-2.06/pw_phonemes.c
--- old/pwgen-2.05/pw_phonemes.c 2005-06-15 04:47:46.000000000 +0200
+++ new/pwgen-2.06/pw_phonemes.c 2007-07-05 01:42:19.000000000 +0200
@@ -90,6 +90,14 @@
/* Don't allow us to overflow the buffer */
if (len > size-c)
continue;
+
+ /* Handle the AMBIGUOUS flag */
+ if (pw_flags & PW_AMBIGUOUS) {
+ cp = strpbrk(str, pw_ambiguous);
+ if (cp)
+ continue;
+ }
+
/*
* OK, we found an element which matches our criteria,
* let's do it!
@@ -107,15 +115,6 @@
c += len;
- /* Handle the AMBIGUOUS flag */
- if (pw_flags & PW_AMBIGUOUS) {
- cp = strpbrk(buf, pw_ambiguous);
- if (cp) {
- *cp = 0;
- c = strlen(buf);
- }
- }
-
/* Time to stop? */
if (c >= size)
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pwgen-2.05/pw_rand.c new/pwgen-2.06/pw_rand.c
--- old/pwgen-2.05/pw_rand.c 2005-06-15 02:18:36.000000000 +0200
+++ new/pwgen-2.06/pw_rand.c 2007-07-05 01:42:19.000000000 +0200
@@ -18,6 +18,7 @@
const char *pw_lowers = "abcdefghijklmnopqrstuvwxyz";
const char *pw_symbols = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
const char *pw_ambiguous = "B8G6I1l0OQDS5Z2";
+const char *pw_vowels = "01aeiouyAEIOUY";
void pw_rand(char *buf, int size, int pw_flags)
{
@@ -57,14 +58,14 @@
try_again:
len = strlen(chars);
feature_flags = pw_flags;
- for (i = 0; i < size; i++) {
+ i = 0;
+ while (i < size) {
ch = chars[pw_number(len)];
- if (pw_flags & PW_AMBIGUOUS) {
- if (strchr(pw_ambiguous,ch)) {
- continue;
- }
- }
- buf[i] = ch;
+ if ((pw_flags & PW_AMBIGUOUS) && strchr(pw_ambiguous,ch))
+ continue;
+ if ((pw_flags & PW_NO_VOWELS) && strchr(pw_vowels, ch))
+ continue;
+ buf[i++] = ch;
if (strchr(pw_digits, ch))
feature_flags &= ~PW_DIGITS;
if (strchr(pw_uppers, ch))
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org