From a6352fc137604dc63253a48e88ff09bf656c4846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Gonz=C3=A1lez?= Date: Wed, 15 Jun 2005 00:25:55 +0000 Subject: [PATCH] Lots of changes on the password dialog and a bit of a performance improvement on the main dialog while instant applying the changes to the EDS database. --- capplets/about-me/ChangeLog | 11 + capplets/about-me/Makefile.am | 17 +- capplets/about-me/cracklib/fascist.c | 782 +++++++++++++++++ capplets/about-me/cracklib/packer.h | 60 ++ capplets/about-me/cracklib/packlib.c | 356 ++++++++ capplets/about-me/cracklib/rules.c | 824 ++++++++++++++++++ capplets/about-me/cracklib/stringlib.c | 52 ++ capplets/about-me/eel-alert-dialog.c | 470 ++++++++++ capplets/about-me/eel-alert-dialog.h | 61 ++ capplets/about-me/eel-gtk-macros.h | 178 ++++ capplets/about-me/gnome-about-me-bulb-off.png | Bin 0 -> 3192 bytes capplets/about-me/gnome-about-me-bulb-on.png | Bin 0 -> 3211 bytes capplets/about-me/gnome-about-me-password.c | 498 +++++++---- capplets/about-me/gnome-about-me.c | 44 +- .../about-me/gnome-about-me.desktop.in.in | 15 + capplets/about-me/gnome-about-me.glade | 302 ++++++- 16 files changed, 3495 insertions(+), 175 deletions(-) create mode 100644 capplets/about-me/cracklib/fascist.c create mode 100644 capplets/about-me/cracklib/packer.h create mode 100644 capplets/about-me/cracklib/packlib.c create mode 100644 capplets/about-me/cracklib/rules.c create mode 100644 capplets/about-me/cracklib/stringlib.c create mode 100644 capplets/about-me/eel-alert-dialog.c create mode 100644 capplets/about-me/eel-alert-dialog.h create mode 100644 capplets/about-me/eel-gtk-macros.h create mode 100644 capplets/about-me/gnome-about-me-bulb-off.png create mode 100644 capplets/about-me/gnome-about-me-bulb-on.png create mode 100644 capplets/about-me/gnome-about-me.desktop.in.in diff --git a/capplets/about-me/ChangeLog b/capplets/about-me/ChangeLog index d6f4c833d..d8b6daeae 100644 --- a/capplets/about-me/ChangeLog +++ b/capplets/about-me/ChangeLog @@ -1,3 +1,14 @@ +2005-06-15 Diego Gonzalez + + * gnome-about-me.glade: Change the look of the "change Password" + dialog. + * gnome-about-me-password.c: Change completely the inner workings + and add a way to meausure the quality of the password. + * cracklib/*: code from cracklib2 to check the quality of the + password. + + Several other changes... + 2005-05-16 Olav Vitters * gnome-about-me.glade: Remove garbage text. Patch by Benjamin diff --git a/capplets/about-me/Makefile.am b/capplets/about-me/Makefile.am index 3133d05f2..87d61958e 100644 --- a/capplets/about-me/Makefile.am +++ b/capplets/about-me/Makefile.am @@ -1,15 +1,20 @@ +SUBDIRS = cracklib + bin_PROGRAMS = gnome-about-me pixmapdir = $(GNOMECC_PIXMAPS_DIR) -pixmap_DATA = \ - gnome-about-me.png +pixmap_DATA = \ + gnome-about-me.png \ + gnome-about-me-bulb-on.png \ + gnome-about-me-bulb-off.png -gnome_about_me_LDADD = $(GNOMECC_CAPPLETS_LIBS) $(LIBEBOOK_LIBS) -lutil +gnome_about_me_LDADD = $(GNOMECC_CAPPLETS_LIBS) $(LIBEBOOK_LIBS) -lutil cracklib/libcracklib.a gnome_about_me_SOURCES = \ - e-util-marshal.c \ - e-util-marshal.h \ + eel-alert-dialog.c \ + e-util-marshal.c \ + e-util-marshal.h \ gnome-about-me-password.c \ - e-image-chooser.c \ + e-image-chooser.c \ gnome-about-me.c e-util-marshal.h: e-util-marshal.list diff --git a/capplets/about-me/cracklib/fascist.c b/capplets/about-me/cracklib/fascist.c new file mode 100644 index 000000000..9bbdfd72e --- /dev/null +++ b/capplets/about-me/cracklib/fascist.c @@ -0,0 +1,782 @@ +/* + * This program is copyright Alec Muffett 1993. The author disclaims all + * responsibility or liability with respect to it's usage or its effect + * upon hardware or computer systems, and maintains copyright as set out + * in the "LICENCE" document which accompanies distributions of Crack v4.0 + * and upwards. + */ + +/* Diego Gonzalez + * 13-06-2005: Modify funcions to use gettext + */ + +static char vers_id[] = "fascist.c : v2.3p3 Alec Muffett 14 dec 1997"; + +#include "packer.h" +#include +#include +#include +#include + +#define ISSKIP(x) (isspace(x) || ispunct(x)) + +#define MINDIFF 5 +#define MINLEN 6 +#define MAXSTEP 4 + +#undef DEBUG +#undef DEBUG2 + +extern char *Reverse(); +extern char *Lowercase(); + +static char *r_destructors[] = { + ":", /* noop - must do this to test raw word. */ + +#ifdef DEBUG2 + (char *) 0, +#endif + + "[", /* trimming leading/trailing junk */ + "]", + "[[", + "]]", + "[[[", + "]]]", + + "/?p@?p", /* purging out punctuation/symbols/junk */ + "/?s@?s", + "/?X@?X", + + /* attempt reverse engineering of password strings */ + + "/$s$s", + "/$s$s/0s0o", + "/$s$s/0s0o/2s2a", + "/$s$s/0s0o/2s2a/3s3e", + "/$s$s/0s0o/2s2a/3s3e/5s5s", + "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1i", + "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1l", + "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1i/4s4a", + "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1i/4s4h", + "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1l/4s4a", + "/$s$s/0s0o/2s2a/3s3e/5s5s/1s1l/4s4h", + "/$s$s/0s0o/2s2a/3s3e/5s5s/4s4a", + "/$s$s/0s0o/2s2a/3s3e/5s5s/4s4h", + "/$s$s/0s0o/2s2a/3s3e/5s5s/4s4a", + "/$s$s/0s0o/2s2a/3s3e/5s5s/4s4h", + "/$s$s/0s0o/2s2a/3s3e/1s1i", + "/$s$s/0s0o/2s2a/3s3e/1s1l", + "/$s$s/0s0o/2s2a/3s3e/1s1i/4s4a", + "/$s$s/0s0o/2s2a/3s3e/1s1i/4s4h", + "/$s$s/0s0o/2s2a/3s3e/1s1l/4s4a", + "/$s$s/0s0o/2s2a/3s3e/1s1l/4s4h", + "/$s$s/0s0o/2s2a/3s3e/4s4a", + "/$s$s/0s0o/2s2a/3s3e/4s4h", + "/$s$s/0s0o/2s2a/3s3e/4s4a", + "/$s$s/0s0o/2s2a/3s3e/4s4h", + "/$s$s/0s0o/2s2a/5s5s", + "/$s$s/0s0o/2s2a/5s5s/1s1i", + "/$s$s/0s0o/2s2a/5s5s/1s1l", + "/$s$s/0s0o/2s2a/5s5s/1s1i/4s4a", + "/$s$s/0s0o/2s2a/5s5s/1s1i/4s4h", + "/$s$s/0s0o/2s2a/5s5s/1s1l/4s4a", + "/$s$s/0s0o/2s2a/5s5s/1s1l/4s4h", + "/$s$s/0s0o/2s2a/5s5s/4s4a", + "/$s$s/0s0o/2s2a/5s5s/4s4h", + "/$s$s/0s0o/2s2a/5s5s/4s4a", + "/$s$s/0s0o/2s2a/5s5s/4s4h", + "/$s$s/0s0o/2s2a/1s1i", + "/$s$s/0s0o/2s2a/1s1l", + "/$s$s/0s0o/2s2a/1s1i/4s4a", + "/$s$s/0s0o/2s2a/1s1i/4s4h", + "/$s$s/0s0o/2s2a/1s1l/4s4a", + "/$s$s/0s0o/2s2a/1s1l/4s4h", + "/$s$s/0s0o/2s2a/4s4a", + "/$s$s/0s0o/2s2a/4s4h", + "/$s$s/0s0o/2s2a/4s4a", + "/$s$s/0s0o/2s2a/4s4h", + "/$s$s/0s0o/3s3e", + "/$s$s/0s0o/3s3e/5s5s", + "/$s$s/0s0o/3s3e/5s5s/1s1i", + "/$s$s/0s0o/3s3e/5s5s/1s1l", + "/$s$s/0s0o/3s3e/5s5s/1s1i/4s4a", + "/$s$s/0s0o/3s3e/5s5s/1s1i/4s4h", + "/$s$s/0s0o/3s3e/5s5s/1s1l/4s4a", + "/$s$s/0s0o/3s3e/5s5s/1s1l/4s4h", + "/$s$s/0s0o/3s3e/5s5s/4s4a", + "/$s$s/0s0o/3s3e/5s5s/4s4h", + "/$s$s/0s0o/3s3e/5s5s/4s4a", + "/$s$s/0s0o/3s3e/5s5s/4s4h", + "/$s$s/0s0o/3s3e/1s1i", + "/$s$s/0s0o/3s3e/1s1l", + "/$s$s/0s0o/3s3e/1s1i/4s4a", + "/$s$s/0s0o/3s3e/1s1i/4s4h", + "/$s$s/0s0o/3s3e/1s1l/4s4a", + "/$s$s/0s0o/3s3e/1s1l/4s4h", + "/$s$s/0s0o/3s3e/4s4a", + "/$s$s/0s0o/3s3e/4s4h", + "/$s$s/0s0o/3s3e/4s4a", + "/$s$s/0s0o/3s3e/4s4h", + "/$s$s/0s0o/5s5s", + "/$s$s/0s0o/5s5s/1s1i", + "/$s$s/0s0o/5s5s/1s1l", + "/$s$s/0s0o/5s5s/1s1i/4s4a", + "/$s$s/0s0o/5s5s/1s1i/4s4h", + "/$s$s/0s0o/5s5s/1s1l/4s4a", + "/$s$s/0s0o/5s5s/1s1l/4s4h", + "/$s$s/0s0o/5s5s/4s4a", + "/$s$s/0s0o/5s5s/4s4h", + "/$s$s/0s0o/5s5s/4s4a", + "/$s$s/0s0o/5s5s/4s4h", + "/$s$s/0s0o/1s1i", + "/$s$s/0s0o/1s1l", + "/$s$s/0s0o/1s1i/4s4a", + "/$s$s/0s0o/1s1i/4s4h", + "/$s$s/0s0o/1s1l/4s4a", + "/$s$s/0s0o/1s1l/4s4h", + "/$s$s/0s0o/4s4a", + "/$s$s/0s0o/4s4h", + "/$s$s/0s0o/4s4a", + "/$s$s/0s0o/4s4h", + "/$s$s/2s2a", + "/$s$s/2s2a/3s3e", + "/$s$s/2s2a/3s3e/5s5s", + "/$s$s/2s2a/3s3e/5s5s/1s1i", + "/$s$s/2s2a/3s3e/5s5s/1s1l", + "/$s$s/2s2a/3s3e/5s5s/1s1i/4s4a", + "/$s$s/2s2a/3s3e/5s5s/1s1i/4s4h", + "/$s$s/2s2a/3s3e/5s5s/1s1l/4s4a", + "/$s$s/2s2a/3s3e/5s5s/1s1l/4s4h", + "/$s$s/2s2a/3s3e/5s5s/4s4a", + "/$s$s/2s2a/3s3e/5s5s/4s4h", + "/$s$s/2s2a/3s3e/5s5s/4s4a", + "/$s$s/2s2a/3s3e/5s5s/4s4h", + "/$s$s/2s2a/3s3e/1s1i", + "/$s$s/2s2a/3s3e/1s1l", + "/$s$s/2s2a/3s3e/1s1i/4s4a", + "/$s$s/2s2a/3s3e/1s1i/4s4h", + "/$s$s/2s2a/3s3e/1s1l/4s4a", + "/$s$s/2s2a/3s3e/1s1l/4s4h", + "/$s$s/2s2a/3s3e/4s4a", + "/$s$s/2s2a/3s3e/4s4h", + "/$s$s/2s2a/3s3e/4s4a", + "/$s$s/2s2a/3s3e/4s4h", + "/$s$s/2s2a/5s5s", + "/$s$s/2s2a/5s5s/1s1i", + "/$s$s/2s2a/5s5s/1s1l", + "/$s$s/2s2a/5s5s/1s1i/4s4a", + "/$s$s/2s2a/5s5s/1s1i/4s4h", + "/$s$s/2s2a/5s5s/1s1l/4s4a", + "/$s$s/2s2a/5s5s/1s1l/4s4h", + "/$s$s/2s2a/5s5s/4s4a", + "/$s$s/2s2a/5s5s/4s4h", + "/$s$s/2s2a/5s5s/4s4a", + "/$s$s/2s2a/5s5s/4s4h", + "/$s$s/2s2a/1s1i", + "/$s$s/2s2a/1s1l", + "/$s$s/2s2a/1s1i/4s4a", + "/$s$s/2s2a/1s1i/4s4h", + "/$s$s/2s2a/1s1l/4s4a", + "/$s$s/2s2a/1s1l/4s4h", + "/$s$s/2s2a/4s4a", + "/$s$s/2s2a/4s4h", + "/$s$s/2s2a/4s4a", + "/$s$s/2s2a/4s4h", + "/$s$s/3s3e", + "/$s$s/3s3e/5s5s", + "/$s$s/3s3e/5s5s/1s1i", + "/$s$s/3s3e/5s5s/1s1l", + "/$s$s/3s3e/5s5s/1s1i/4s4a", + "/$s$s/3s3e/5s5s/1s1i/4s4h", + "/$s$s/3s3e/5s5s/1s1l/4s4a", + "/$s$s/3s3e/5s5s/1s1l/4s4h", + "/$s$s/3s3e/5s5s/4s4a", + "/$s$s/3s3e/5s5s/4s4h", + "/$s$s/3s3e/5s5s/4s4a", + "/$s$s/3s3e/5s5s/4s4h", + "/$s$s/3s3e/1s1i", + "/$s$s/3s3e/1s1l", + "/$s$s/3s3e/1s1i/4s4a", + "/$s$s/3s3e/1s1i/4s4h", + "/$s$s/3s3e/1s1l/4s4a", + "/$s$s/3s3e/1s1l/4s4h", + "/$s$s/3s3e/4s4a", + "/$s$s/3s3e/4s4h", + "/$s$s/3s3e/4s4a", + "/$s$s/3s3e/4s4h", + "/$s$s/5s5s", + "/$s$s/5s5s/1s1i", + "/$s$s/5s5s/1s1l", + "/$s$s/5s5s/1s1i/4s4a", + "/$s$s/5s5s/1s1i/4s4h", + "/$s$s/5s5s/1s1l/4s4a", + "/$s$s/5s5s/1s1l/4s4h", + "/$s$s/5s5s/4s4a", + "/$s$s/5s5s/4s4h", + "/$s$s/5s5s/4s4a", + "/$s$s/5s5s/4s4h", + "/$s$s/1s1i", + "/$s$s/1s1l", + "/$s$s/1s1i/4s4a", + "/$s$s/1s1i/4s4h", + "/$s$s/1s1l/4s4a", + "/$s$s/1s1l/4s4h", + "/$s$s/4s4a", + "/$s$s/4s4h", + "/$s$s/4s4a", + "/$s$s/4s4h", + "/0s0o", + "/0s0o/2s2a", + "/0s0o/2s2a/3s3e", + "/0s0o/2s2a/3s3e/5s5s", + "/0s0o/2s2a/3s3e/5s5s/1s1i", + "/0s0o/2s2a/3s3e/5s5s/1s1l", + "/0s0o/2s2a/3s3e/5s5s/1s1i/4s4a", + "/0s0o/2s2a/3s3e/5s5s/1s1i/4s4h", + "/0s0o/2s2a/3s3e/5s5s/1s1l/4s4a", + "/0s0o/2s2a/3s3e/5s5s/1s1l/4s4h", + "/0s0o/2s2a/3s3e/5s5s/4s4a", + "/0s0o/2s2a/3s3e/5s5s/4s4h", + "/0s0o/2s2a/3s3e/5s5s/4s4a", + "/0s0o/2s2a/3s3e/5s5s/4s4h", + "/0s0o/2s2a/3s3e/1s1i", + "/0s0o/2s2a/3s3e/1s1l", + "/0s0o/2s2a/3s3e/1s1i/4s4a", + "/0s0o/2s2a/3s3e/1s1i/4s4h", + "/0s0o/2s2a/3s3e/1s1l/4s4a", + "/0s0o/2s2a/3s3e/1s1l/4s4h", + "/0s0o/2s2a/3s3e/4s4a", + "/0s0o/2s2a/3s3e/4s4h", + "/0s0o/2s2a/3s3e/4s4a", + "/0s0o/2s2a/3s3e/4s4h", + "/0s0o/2s2a/5s5s", + "/0s0o/2s2a/5s5s/1s1i", + "/0s0o/2s2a/5s5s/1s1l", + "/0s0o/2s2a/5s5s/1s1i/4s4a", + "/0s0o/2s2a/5s5s/1s1i/4s4h", + "/0s0o/2s2a/5s5s/1s1l/4s4a", + "/0s0o/2s2a/5s5s/1s1l/4s4h", + "/0s0o/2s2a/5s5s/4s4a", + "/0s0o/2s2a/5s5s/4s4h", + "/0s0o/2s2a/5s5s/4s4a", + "/0s0o/2s2a/5s5s/4s4h", + "/0s0o/2s2a/1s1i", + "/0s0o/2s2a/1s1l", + "/0s0o/2s2a/1s1i/4s4a", + "/0s0o/2s2a/1s1i/4s4h", + "/0s0o/2s2a/1s1l/4s4a", + "/0s0o/2s2a/1s1l/4s4h", + "/0s0o/2s2a/4s4a", + "/0s0o/2s2a/4s4h", + "/0s0o/2s2a/4s4a", + "/0s0o/2s2a/4s4h", + "/0s0o/3s3e", + "/0s0o/3s3e/5s5s", + "/0s0o/3s3e/5s5s/1s1i", + "/0s0o/3s3e/5s5s/1s1l", + "/0s0o/3s3e/5s5s/1s1i/4s4a", + "/0s0o/3s3e/5s5s/1s1i/4s4h", + "/0s0o/3s3e/5s5s/1s1l/4s4a", + "/0s0o/3s3e/5s5s/1s1l/4s4h", + "/0s0o/3s3e/5s5s/4s4a", + "/0s0o/3s3e/5s5s/4s4h", + "/0s0o/3s3e/5s5s/4s4a", + "/0s0o/3s3e/5s5s/4s4h", + "/0s0o/3s3e/1s1i", + "/0s0o/3s3e/1s1l", + "/0s0o/3s3e/1s1i/4s4a", + "/0s0o/3s3e/1s1i/4s4h", + "/0s0o/3s3e/1s1l/4s4a", + "/0s0o/3s3e/1s1l/4s4h", + "/0s0o/3s3e/4s4a", + "/0s0o/3s3e/4s4h", + "/0s0o/3s3e/4s4a", + "/0s0o/3s3e/4s4h", + "/0s0o/5s5s", + "/0s0o/5s5s/1s1i", + "/0s0o/5s5s/1s1l", + "/0s0o/5s5s/1s1i/4s4a", + "/0s0o/5s5s/1s1i/4s4h", + "/0s0o/5s5s/1s1l/4s4a", + "/0s0o/5s5s/1s1l/4s4h", + "/0s0o/5s5s/4s4a", + "/0s0o/5s5s/4s4h", + "/0s0o/5s5s/4s4a", + "/0s0o/5s5s/4s4h", + "/0s0o/1s1i", + "/0s0o/1s1l", + "/0s0o/1s1i/4s4a", + "/0s0o/1s1i/4s4h", + "/0s0o/1s1l/4s4a", + "/0s0o/1s1l/4s4h", + "/0s0o/4s4a", + "/0s0o/4s4h", + "/0s0o/4s4a", + "/0s0o/4s4h", + "/2s2a", + "/2s2a/3s3e", + "/2s2a/3s3e/5s5s", + "/2s2a/3s3e/5s5s/1s1i", + "/2s2a/3s3e/5s5s/1s1l", + "/2s2a/3s3e/5s5s/1s1i/4s4a", + "/2s2a/3s3e/5s5s/1s1i/4s4h", + "/2s2a/3s3e/5s5s/1s1l/4s4a", + "/2s2a/3s3e/5s5s/1s1l/4s4h", + "/2s2a/3s3e/5s5s/4s4a", + "/2s2a/3s3e/5s5s/4s4h", + "/2s2a/3s3e/5s5s/4s4a", + "/2s2a/3s3e/5s5s/4s4h", + "/2s2a/3s3e/1s1i", + "/2s2a/3s3e/1s1l", + "/2s2a/3s3e/1s1i/4s4a", + "/2s2a/3s3e/1s1i/4s4h", + "/2s2a/3s3e/1s1l/4s4a", + "/2s2a/3s3e/1s1l/4s4h", + "/2s2a/3s3e/4s4a", + "/2s2a/3s3e/4s4h", + "/2s2a/3s3e/4s4a", + "/2s2a/3s3e/4s4h", + "/2s2a/5s5s", + "/2s2a/5s5s/1s1i", + "/2s2a/5s5s/1s1l", + "/2s2a/5s5s/1s1i/4s4a", + "/2s2a/5s5s/1s1i/4s4h", + "/2s2a/5s5s/1s1l/4s4a", + "/2s2a/5s5s/1s1l/4s4h", + "/2s2a/5s5s/4s4a", + "/2s2a/5s5s/4s4h", + "/2s2a/5s5s/4s4a", + "/2s2a/5s5s/4s4h", + "/2s2a/1s1i", + "/2s2a/1s1l", + "/2s2a/1s1i/4s4a", + "/2s2a/1s1i/4s4h", + "/2s2a/1s1l/4s4a", + "/2s2a/1s1l/4s4h", + "/2s2a/4s4a", + "/2s2a/4s4h", + "/2s2a/4s4a", + "/2s2a/4s4h", + "/3s3e", + "/3s3e/5s5s", + "/3s3e/5s5s/1s1i", + "/3s3e/5s5s/1s1l", + "/3s3e/5s5s/1s1i/4s4a", + "/3s3e/5s5s/1s1i/4s4h", + "/3s3e/5s5s/1s1l/4s4a", + "/3s3e/5s5s/1s1l/4s4h", + "/3s3e/5s5s/4s4a", + "/3s3e/5s5s/4s4h", + "/3s3e/5s5s/4s4a", + "/3s3e/5s5s/4s4h", + "/3s3e/1s1i", + "/3s3e/1s1l", + "/3s3e/1s1i/4s4a", + "/3s3e/1s1i/4s4h", + "/3s3e/1s1l/4s4a", + "/3s3e/1s1l/4s4h", + "/3s3e/4s4a", + "/3s3e/4s4h", + "/3s3e/4s4a", + "/3s3e/4s4h", + "/5s5s", + "/5s5s/1s1i", + "/5s5s/1s1l", + "/5s5s/1s1i/4s4a", + "/5s5s/1s1i/4s4h", + "/5s5s/1s1l/4s4a", + "/5s5s/1s1l/4s4h", + "/5s5s/4s4a", + "/5s5s/4s4h", + "/5s5s/4s4a", + "/5s5s/4s4h", + "/1s1i", + "/1s1l", + "/1s1i/4s4a", + "/1s1i/4s4h", + "/1s1l/4s4a", + "/1s1l/4s4h", + "/4s4a", + "/4s4h", + "/4s4a", + "/4s4h", + + /* done */ + (char *) 0 +}; + +static char *r_constructors[] = { + ":", + +#ifdef DEBUG2 + (char *) 0, +#endif + + "r", + "d", + "f", + "dr", + "fr", + "rf", + (char *) 0 +}; + +int +GTry(char *rawtext, char *password) +{ + int i; + int len; + char *mp; + + /* use destructors to turn password into rawtext */ + /* note use of Reverse() to save duplicating all rules */ + + len = strlen(password); + + for (i = 0; r_destructors[i]; i++) + { + if (!(mp = Mangle(password, r_destructors[i]))) + { + continue; + } + +#ifdef DEBUG + printf("%-16s = %-16s (destruct %s)\n", mp, rawtext, r_destructors[i]); +#endif + + if (!strncmp(mp, rawtext, len)) + { + return (1); + } + +#ifdef DEBUG + printf("%-16s = %-16s (destruct %s reversed)\n", Reverse(mp), rawtext, r_destructors[i]); +#endif + + if (!strncmp(Reverse(mp), rawtext, len)) + { + return (1); + } + } + + for (i = 0; r_constructors[i]; i++) + { + if (!(mp = Mangle(rawtext, r_constructors[i]))) + { + continue; + } + +#ifdef DEBUG + printf("%-16s = %-16s (construct %s)\n", mp, password, r_constructors[i]); +#endif + + if (!strncmp(mp, password, len)) + { + return (1); + } + } + + return (0); +} + +char * +FascistGecos(char *password, int uid) +{ + int i; + int j; + int wc; + char *ptr; + int gwords; + struct passwd *pwp; + char gbuffer[STRINGSIZE]; + char tbuffer[STRINGSIZE]; + char *uwords[STRINGSIZE]; + char longbuffer[STRINGSIZE * 2]; + + if (!(pwp = getpwuid(uid))) + { + return (g_strdup (_("You are not registered in the password file"))); + } + + /* lets get really paranoid and assume a dangerously long gecos entry */ + + strncpy(tbuffer, pwp->pw_name, STRINGSIZE); + tbuffer[STRINGSIZE-1] = '\0'; + if (GTry(tbuffer, password)) + { + return (g_strdup (_("Password based on your username"))); + } + + /* it never used to be that you got passwd strings > 1024 chars, but now... */ + + strncpy(tbuffer, pwp->pw_gecos, STRINGSIZE); + tbuffer[STRINGSIZE-1] = '\0'; + strcpy(gbuffer, Lowercase(tbuffer)); + + wc = 0; + ptr = gbuffer; + gwords = 0; + uwords[0] = (char *)0; + + while (*ptr) + { + while (*ptr && ISSKIP(*ptr)) + { + ptr++; + } + + if (ptr != gbuffer) + { + ptr[-1] = '\0'; + } + + gwords++; + uwords[wc++] = ptr; + + if (wc == STRINGSIZE) + { + uwords[--wc] = (char *) 0; /* to hell with it */ + break; + } else + { + uwords[wc] = (char *) 0; + } + + while (*ptr && !ISSKIP(*ptr)) + { + ptr++; + } + + if (*ptr) + { + *(ptr++) = '\0'; + } + } + +#ifdef DEBUG + for (i = 0; uwords[i]; i++) + { + printf ("gecosword %s\n", uwords[i]); + } +#endif + + for (i = 0; uwords[i]; i++) + { + if (GTry(uwords[i], password)) + { + return (g_strdup (_("Password based upon your password entry"))); + } + } + + /* since uwords are taken from gbuffer, no uword can be longer than gbuffer */ + + for (j = 1; (j < gwords) && uwords[j]; j++) + { + for (i = 0; i < j; i++) + { + strcpy(longbuffer, uwords[i]); + strcat(longbuffer, uwords[j]); + + if (GTry(longbuffer, password)) + { + return (g_strdup (_("Password derived from your password entry"))); + } + + strcpy(longbuffer, uwords[j]); + strcat(longbuffer, uwords[i]); + + if (GTry(longbuffer, password)) + { + return (g_strdup (_("Password derived from your password entry"))); + } + + longbuffer[0] = uwords[i][0]; + longbuffer[1] = '\0'; + strcat(longbuffer, uwords[j]); + + if (GTry(longbuffer, password)) + { + return (g_strdup (_("Password derivable from your password entry"))); + } + + longbuffer[0] = uwords[j][0]; + longbuffer[1] = '\0'; + strcat(longbuffer, uwords[i]); + + if (GTry(longbuffer, password)) + { + return (g_strdup (_("Password derivable from your password entry"))); + } + } + } + + return ((char *) 0); +} + +char * +FascistLook(PWDICT *pwp, char *instring) +{ + int i; + char *ptr; + char *jptr; + char junk[STRINGSIZE]; + char *password; + char rpassword[STRINGSIZE]; + int32 notfound; + + notfound = PW_WORDS(pwp); + /* already truncated if from FascistCheck() */ + /* but pretend it wasn't ... */ + strncpy(rpassword, instring, TRUNCSTRINGSIZE); + rpassword[TRUNCSTRINGSIZE - 1] = '\0'; + password = rpassword; + + if (strlen(password) < 4) + { + return (g_strdup (_("Password is way too short"))); + } + + if (strlen(password) < MINLEN) + { + return (g_strdup (_("Password is too short"))); + } + + jptr = junk; + *jptr = '\0'; + + for (i = 0; i < STRINGSIZE && password[i]; i++) + { + if (!strchr(junk, password[i])) + { + *(jptr++) = password[i]; + *jptr = '\0'; + } + } + + if (strlen(junk) < MINDIFF) + { + return (g_strdup (_("Password does not contain enough different characters"))); + } + + strcpy(password, Lowercase(password)); + + Trim(password); + + while (*password && isspace(*password)) + { + password++; + } + + if (!*password) + { + return (g_strdup (_("Password is all whitespace"))); + } + + i = 0; + ptr = password; + while (ptr[0] && ptr[1]) + { + if ((ptr[1] == (ptr[0] + 1)) || (ptr[1] == (ptr[0] - 1))) + { + i++; + } + ptr++; + } + + if (i > MAXSTEP) + { + return (g_strdup (_("Password is too simplistic/systematic"))); + } + + if (PMatch("aadddddda", password)) /* smirk */ + { + return (g_strdup (_("Password looks like a National Insurance number."))); + } + + if (ptr = FascistGecos(password, getuid())) + { + return (ptr); + } + + /* it should be safe to use Mangle with its reliance on STRINGSIZE + since password cannot be longer than TRUNCSTRINGSIZE; + nonetheless this is not an elegant solution */ + + for (i = 0; r_destructors[i]; i++) + { + char *a; + + if (!(a = Mangle(password, r_destructors[i]))) + { + continue; + } + +#ifdef DEBUG + printf("%-16s (dict)\n", a); +#endif + + if (FindPW(pwp, a) != notfound) + { + return (g_strdup (_("Password based on a dictionary word"))); + } + } + + strcpy(password, Reverse(password)); + + for (i = 0; r_destructors[i]; i++) + { + char *a; + + if (!(a = Mangle(password, r_destructors[i]))) + { + continue; + } +#ifdef DEBUG + printf("%-16s (reversed dict)\n", a); +#endif + if (FindPW(pwp, a) != notfound) + { + return (g_strdup (_("it is based on a (reversed) dictionary word"))); + } + } + + return ((char *) 0); +} + +char * +FascistCheck (char *password, char *path) +{ + static char lastpath[STRINGSIZE]; + static PWDICT *pwp; + char pwtrunced[STRINGSIZE]; + + /* security problem: assume we may have been given a really long + password (buffer attack) and so truncate it to a workable size; + try to define workable size as something from which we cannot + extend a buffer beyond its limits in the rest of the code */ + + strncpy(pwtrunced, password, TRUNCSTRINGSIZE); + pwtrunced[TRUNCSTRINGSIZE - 1] = '\0'; /* enforce */ + + /* perhaps someone should put something here to check if password + is really long and syslog() a message denoting buffer attacks? */ + + if (pwp && strncmp(lastpath, path, STRINGSIZE)) + { + PWClose(pwp); + pwp = (PWDICT *)0; + } + + if (!pwp) + { + if (!(pwp = PWOpen(path, "r"))) + { + perror("PWOpen"); + exit(-1); + } + strncpy(lastpath, path, STRINGSIZE); + } + + return (FascistLook(pwp, pwtrunced)); +} diff --git a/capplets/about-me/cracklib/packer.h b/capplets/about-me/cracklib/packer.h new file mode 100644 index 000000000..32fd3b39e --- /dev/null +++ b/capplets/about-me/cracklib/packer.h @@ -0,0 +1,60 @@ +/* + * This program is copyright Alec Muffett 1993. The author disclaims all + * responsibility or liability with respect to it's usage or its effect + * upon hardware or computer systems, and maintains copyright as set out + * in the "LICENCE" document which accompanies distributions of Crack v4.0 + * and upwards. + */ + +#include +#include + +#define STRINGSIZE 1024 +#define TRUNCSTRINGSIZE (STRINGSIZE/4) + +typedef unsigned char int8; +typedef unsigned short int int16; +typedef unsigned long int int32; +#ifndef NUMWORDS +#define NUMWORDS 16 +#endif +#define MAXWORDLEN 32 +#define MAXBLOCKLEN (MAXWORDLEN * NUMWORDS) + +struct pi_header +{ + int32 pih_magic; + int32 pih_numwords; + int16 pih_blocklen; + int16 pih_pad; +}; + +typedef struct +{ + FILE *ifp; + FILE *dfp; + FILE *wfp; + + int32 flags; +#define PFOR_WRITE 0x0001 +#define PFOR_FLUSH 0x0002 +#define PFOR_USEHWMS 0x0004 + + int32 hwms[256]; + + struct pi_header header; + + int count; + char data[NUMWORDS][MAXWORDLEN]; +} PWDICT; + +#define PW_WORDS(x) ((x)->header.pih_numwords) +#define PIH_MAGIC 0x70775631 + +extern PWDICT *PWOpen(); +extern char *Mangle(); +extern char *FascistCheck(); + +#define CRACK_TOLOWER(a) (isupper(a)?tolower(a):(a)) +#define CRACK_TOUPPER(a) (islower(a)?toupper(a):(a)) +#define STRCMP(a,b) strcmp((a),(b)) diff --git a/capplets/about-me/cracklib/packlib.c b/capplets/about-me/cracklib/packlib.c new file mode 100644 index 000000000..2f923622b --- /dev/null +++ b/capplets/about-me/cracklib/packlib.c @@ -0,0 +1,356 @@ +/* + * This program is copyright Alec Muffett 1993. The author disclaims all + * responsibility or liability with respect to it's usage or its effect + * upon hardware or computer systems, and maintains copyright as set out + * in the "LICENCE" document which accompanies distributions of Crack v4.0 + * and upwards. + */ + +#include "packer.h" + +static char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993"; + +PWDICT * +PWOpen(prefix, mode) + char *prefix; + char *mode; +{ + int32 i; + static PWDICT pdesc; + char iname[STRINGSIZE]; + char dname[STRINGSIZE]; + char wname[STRINGSIZE]; + char buffer[STRINGSIZE]; + FILE *dfp; + FILE *ifp; + FILE *wfp; + + if (pdesc.header.pih_magic == PIH_MAGIC) + { + fprintf(stderr, "%s: another dictionary already open\n", prefix); + return ((PWDICT *) 0); + } + + memset(&pdesc, '\0', sizeof(pdesc)); + + sprintf(iname, "%s.pwi", prefix); + sprintf(dname, "%s.pwd", prefix); + sprintf(wname, "%s.hwm", prefix); + + if (!(pdesc.dfp = fopen(dname, mode))) + { + perror(dname); + return ((PWDICT *) 0); + } + + if (!(pdesc.ifp = fopen(iname, mode))) + { + fclose(pdesc.dfp); + perror(iname); + return ((PWDICT *) 0); + } + + if (pdesc.wfp = fopen(wname, mode)) + { + pdesc.flags |= PFOR_USEHWMS; + } + + ifp = pdesc.ifp; + dfp = pdesc.dfp; + wfp = pdesc.wfp; + + if (mode[0] == 'w') + { + pdesc.flags |= PFOR_WRITE; + pdesc.header.pih_magic = PIH_MAGIC; + pdesc.header.pih_blocklen = NUMWORDS; + pdesc.header.pih_numwords = 0; + + fwrite((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp); + } else + { + pdesc.flags &= ~PFOR_WRITE; + + if (!fread((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp)) + { + fprintf(stderr, "%s: error reading header\n", prefix); + + pdesc.header.pih_magic = 0; + fclose(ifp); + fclose(dfp); + return ((PWDICT *) 0); + } + + if (pdesc.header.pih_magic != PIH_MAGIC) + { + fprintf(stderr, "%s: magic mismatch\n", prefix); + + pdesc.header.pih_magic = 0; + fclose(ifp); + fclose(dfp); + return ((PWDICT *) 0); + } + + if (pdesc.header.pih_blocklen != NUMWORDS) + { + fprintf(stderr, "%s: size mismatch\n", prefix); + + pdesc.header.pih_magic = 0; + fclose(ifp); + fclose(dfp); + return ((PWDICT *) 0); + } + + if (pdesc.flags & PFOR_USEHWMS) + { + if (fread(pdesc.hwms, 1, sizeof(pdesc.hwms), wfp) != sizeof(pdesc.hwms)) + { + pdesc.flags &= ~PFOR_USEHWMS; + } + } + } + + return (&pdesc); +} + +int +PWClose(pwp) + PWDICT *pwp; +{ + if (pwp->header.pih_magic != PIH_MAGIC) + { + fprintf(stderr, "PWClose: close magic mismatch\n"); + return (-1); + } + + if (pwp->flags & PFOR_WRITE) + { + pwp->flags |= PFOR_FLUSH; + PutPW(pwp, (char *) 0); /* flush last index if necess */ + + if (fseek(pwp->ifp, 0L, 0)) + { + fprintf(stderr, "index magic fseek failed\n"); + return (-1); + } + + if (!fwrite((char *) &pwp->header, sizeof(pwp->header), 1, pwp->ifp)) + { + fprintf(stderr, "index magic fwrite failed\n"); + return (-1); + } + + if (pwp->flags & PFOR_USEHWMS) + { + int i; + for (i=1; i<=0xff; i++) + { + if (!pwp->hwms[i]) + { + pwp->hwms[i] = pwp->hwms[i-1]; + } +#ifdef DEBUG + printf("hwm[%02x] = %d\n", i, pwp->hwms[i]); +#endif + } + fwrite(pwp->hwms, 1, sizeof(pwp->hwms), pwp->wfp); + } + } + + fclose(pwp->ifp); + fclose(pwp->dfp); + + pwp->header.pih_magic = 0; + + return (0); +} + +int +PutPW(pwp, string) + PWDICT *pwp; + char *string; +{ + if (!(pwp->flags & PFOR_WRITE)) + { + return (-1); + } + + if (string) + { + strncpy(pwp->data[pwp->count], string, MAXWORDLEN); + pwp->data[pwp->count][MAXWORDLEN - 1] = '\0'; + + pwp->hwms[string[0] & 0xff]= pwp->header.pih_numwords; + + ++(pwp->count); + ++(pwp->header.pih_numwords); + + } else if (!(pwp->flags & PFOR_FLUSH)) + { + return (-1); + } + + if ((pwp->flags & PFOR_FLUSH) || !(pwp->count % NUMWORDS)) + { + int i; + int32 datum; + register char *ostr; + + datum = (int32) ftell(pwp->dfp); + + fwrite((char *) &datum, sizeof(datum), 1, pwp->ifp); + + fputs(pwp->data[0], pwp->dfp); + putc(0, pwp->dfp); + + ostr = pwp->data[0]; + + for (i = 1; i < NUMWORDS; i++) + { + register int j; + register char *nstr; + nstr = pwp->data[i]; + + if (nstr[0]) + { + for (j = 0; ostr[j] && nstr[j] && (ostr[j] == nstr[j]); j++); + putc(j & 0xff, pwp->dfp); + fputs(nstr + j, pwp->dfp); + } + putc(0, pwp->dfp); + + ostr = nstr; + } + + memset(pwp->data, '\0', sizeof(pwp->data)); + pwp->count = 0; + } + return (0); +} + +char * +GetPW(pwp, number) + PWDICT *pwp; + int32 number; +{ + int32 datum; + register int i; + register char *ostr; + register char *nstr; + register char *bptr; + char buffer[NUMWORDS * MAXWORDLEN]; + static char data[NUMWORDS][MAXWORDLEN]; + static int32 prevblock = 0xffffffff; + int32 thisblock; + + thisblock = number / NUMWORDS; + + if (prevblock == thisblock) + { + return (data[number % NUMWORDS]); + } + + if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(int32)), 0)) + { + perror("(index fseek failed)"); + return ((char *) 0); + } + + if (!fread((char *) &datum, sizeof(datum), 1, pwp->ifp)) + { + perror("(index fread failed)"); + return ((char *) 0); + } + + if (fseek(pwp->dfp, datum, 0)) + { + perror("(data fseek failed)"); + return ((char *) 0); + } + + if (!fread(buffer, 1, sizeof(buffer), pwp->dfp)) + { + perror("(data fread failed)"); + return ((char *) 0); + } + + prevblock = thisblock; + + bptr = buffer; + + for (ostr = data[0]; *(ostr++) = *(bptr++); /* nothing */ ); + + ostr = data[0]; + + for (i = 1; i < NUMWORDS; i++) + { + nstr = data[i]; + strcpy(nstr, ostr); + + ostr = nstr + *(bptr++); + while (*(ostr++) = *(bptr++)); + + ostr = nstr; + } + + return (data[number % NUMWORDS]); +} + +int32 +FindPW(pwp, string) + PWDICT *pwp; + char *string; +{ + register int32 lwm; + register int32 hwm; + register int32 middle; + register char *this; + int idx; + + if (pwp->flags & PFOR_USEHWMS) + { + idx = string[0] & 0xff; + lwm = idx ? pwp->hwms[idx - 1] : 0; + hwm = pwp->hwms[idx]; + } else + { + lwm = 0; + hwm = PW_WORDS(pwp) - 1; + } + +#ifdef DEBUG + printf("---- %lu, %lu ----\n", lwm, hwm); +#endif + + for (;;) + { + int cmp; + +#ifdef DEBUG + printf("%lu, %lu\n", lwm, hwm); +#endif + + middle = lwm + ((hwm - lwm + 1) / 2); + + if (middle == hwm) + { + break; + } + + this = GetPW(pwp, middle); + cmp = strcmp(string, this); /* INLINE ? */ + + if (cmp < 0) + { + hwm = middle; + } else if (cmp > 0) + { + lwm = middle; + } else + { + return (middle); + } + } + + return (PW_WORDS(pwp)); +} diff --git a/capplets/about-me/cracklib/rules.c b/capplets/about-me/cracklib/rules.c new file mode 100644 index 000000000..9d899f6b7 --- /dev/null +++ b/capplets/about-me/cracklib/rules.c @@ -0,0 +1,824 @@ +/* + * This program is copyright Alec Muffett 1993. The author disclaims all + * responsibility or liability with respect to it's usage or its effect + * upon hardware or computer systems, and maintains copyright as set out + * in the "LICENCE" document which accompanies distributions of Crack v4.0 + * and upwards. + */ + +static char vers_id[] = "rules.c : v5.0p3 Alec Muffett 20 May 1993"; + + +#include "packer.h" + +static void +Debug(val, a, b, c, d, e, f, g) + int val; + char *a, *b, *c, *d, *e, *f, *g; +{ + fprintf(stderr, a, b, c, d, e, f); +} + + +#define RULE_NOOP ':' +#define RULE_PREPEND '^' +#define RULE_APPEND '$' +#define RULE_REVERSE 'r' +#define RULE_UPPERCASE 'u' +#define RULE_LOWERCASE 'l' +#define RULE_PLURALISE 'p' +#define RULE_CAPITALISE 'c' +#define RULE_DUPLICATE 'd' +#define RULE_REFLECT 'f' +#define RULE_SUBSTITUTE 's' +#define RULE_MATCH '/' +#define RULE_NOT '!' +#define RULE_LT '<' +#define RULE_GT '>' +#define RULE_EXTRACT 'x' +#define RULE_OVERSTRIKE 'o' +#define RULE_INSERT 'i' +#define RULE_EQUALS '=' +#define RULE_PURGE '@' +#define RULE_CLASS '?' /* class rule? socialist ethic in cracker? */ + +#define RULE_DFIRST '[' +#define RULE_DLAST ']' +#define RULE_MFIRST '(' +#define RULE_MLAST ')' + +int +Suffix(myword, suffix) + char *myword; + char *suffix; +{ + register int i; + register int j; + i = strlen(myword); + j = strlen(suffix); + + if (i > j) + { + return (STRCMP((myword + i - j), suffix)); + } else + { + return (-1); + } +} + +char * +Reverse(str) /* return a pointer to a reversal */ + register char *str; +{ + register int i; + register int j; + static char area[STRINGSIZE]; + j = i = strlen(str); + while (*str) + { + area[--i] = *str++; + } + area[j] = '\0'; + return (area); +} + +char * +Uppercase(str) /* return a pointer to an uppercase */ + register char *str; +{ + register char *ptr; + static char area[STRINGSIZE]; + ptr = area; + while (*str) + { + *(ptr++) = CRACK_TOUPPER(*str); + str++; + } + *ptr = '\0'; + + return (area); +} + +char * +Lowercase(str) /* return a pointer to an lowercase */ + register char *str; +{ + register char *ptr; + static char area[STRINGSIZE]; + ptr = area; + while (*str) + { + *(ptr++) = CRACK_TOLOWER(*str); + str++; + } + *ptr = '\0'; + + return (area); +} + +char * +Capitalise(str) /* return a pointer to an capitalised */ + register char *str; +{ + register char *ptr; + static char area[STRINGSIZE]; + ptr = area; + + while (*str) + { + *(ptr++) = CRACK_TOLOWER(*str); + str++; + } + + *ptr = '\0'; + area[0] = CRACK_TOUPPER(area[0]); + return (area); +} + +char * +Pluralise(string) /* returns a pointer to a plural */ + register char *string; +{ + register int length; + static char area[STRINGSIZE]; + length = strlen(string); + strcpy(area, string); + + if (!Suffix(string, "ch") || + !Suffix(string, "ex") || + !Suffix(string, "ix") || + !Suffix(string, "sh") || + !Suffix(string, "ss")) + { + /* bench -> benches */ + strcat(area, "es"); + } else if (length > 2 && string[length - 1] == 'y') + { + if (strchr("aeiou", string[length - 2])) + { + /* alloy -> alloys */ + strcat(area, "s"); + } else + { + /* gully -> gullies */ + strcpy(area + length - 1, "ies"); + } + } else if (string[length - 1] == 's') + { + /* bias -> biases */ + strcat(area, "es"); + } else + { + /* catchall */ + strcat(area, "s"); + } + + return (area); +} + +char * +Substitute(string, old, new) /* returns pointer to a swapped about copy */ + register char *string; + register char old; + register char new; +{ + register char *ptr; + static char area[STRINGSIZE]; + ptr = area; + while (*string) + { + *(ptr++) = (*string == old ? new : *string); + string++; + } + *ptr = '\0'; + return (area); +} + +char * +Purge(string, target) /* returns pointer to a purged copy */ + register char *string; + register char target; +{ + register char *ptr; + static char area[STRINGSIZE]; + ptr = area; + while (*string) + { + if (*string != target) + { + *(ptr++) = *string; + } + string++; + } + *ptr = '\0'; + return (area); +} +/* -------- CHARACTER CLASSES START HERE -------- */ + +/* + * this function takes two inputs, a class identifier and a character, and + * returns non-null if the given character is a member of the class, based + * upon restrictions set out below + */ + +int +MatchClass(class, input) + register char class; + register char input; +{ + register char c; + register int retval; + retval = 0; + + switch (class) + { + /* ESCAPE */ + + case '?': /* ?? -> ? */ + if (input == '?') + { + retval = 1; + } + break; + + /* ILLOGICAL GROUPINGS (ie: not in ctype.h) */ + + case 'V': + case 'v': /* vowels */ + c = CRACK_TOLOWER(input); + if (strchr("aeiou", c)) + { + retval = 1; + } + break; + + case 'C': + case 'c': /* consonants */ + c = CRACK_TOLOWER(input); + if (strchr("bcdfghjklmnpqrstvwxyz", c)) + { + retval = 1; + } + break; + + case 'W': + case 'w': /* whitespace */ + if (strchr("\t ", input)) + { + retval = 1; + } + break; + + case 'P': + case 'p': /* punctuation */ + if (strchr(".`,:;'!?\"", input)) + { + retval = 1; + } + break; + + case 'S': + case 's': /* symbols */ + if (strchr("$%%^&*()-_+=|\\[]{}#@/~", input)) + { + retval = 1; + } + break; + + /* LOGICAL GROUPINGS */ + + case 'L': + case 'l': /* lowercase */ + if (islower(input)) + { + retval = 1; + } + break; + + case 'U': + case 'u': /* uppercase */ + if (isupper(input)) + { + retval = 1; + } + break; + + case 'A': + case 'a': /* alphabetic */ + if (isalpha(input)) + { + retval = 1; + } + break; + + case 'X': + case 'x': /* alphanumeric */ + if (isalnum(input)) + { + retval = 1; + } + break; + + case 'D': + case 'd': /* digits */ + if (isdigit(input)) + { + retval = 1; + } + break; + + default: + Debug(1, "MatchClass: unknown class %c\n", class); + return (0); + break; + } + + if (isupper(class)) + { + return (!retval); + } + return (retval); +} + +char * +PolyStrchr(string, class) + register char *string; + register char class; +{ + while (*string) + { + if (MatchClass(class, *string)) + { + return (string); + } + string++; + } + return ((char *) 0); +} + +char * +PolySubst(string, class, new) /* returns pointer to a swapped about copy */ + register char *string; + register char class; + register char new; +{ + register char *ptr; + static char area[STRINGSIZE]; + ptr = area; + while (*string) + { + *(ptr++) = (MatchClass(class, *string) ? new : *string); + string++; + } + *ptr = '\0'; + return (area); +} + +char * +PolyPurge(string, class) /* returns pointer to a purged copy */ + register char *string; + register char class; +{ + register char *ptr; + static char area[STRINGSIZE]; + ptr = area; + while (*string) + { + if (!MatchClass(class, *string)) + { + *(ptr++) = *string; + } + string++; + } + *ptr = '\0'; + return (area); +} +/* -------- BACK TO NORMALITY -------- */ + +int +Char2Int(character) + char character; +{ + if (isdigit(character)) + { + return (character - '0'); + } else if (islower(character)) + { + return (character - 'a' + 10); + } else if (isupper(character)) + { + return (character - 'A' + 10); + } + return (-1); +} + +char * +Mangle(input, control) /* returns a pointer to a controlled Mangle */ + char *input; + char *control; +{ + int limit; + register char *ptr; + static char area[STRINGSIZE]; + char area2[STRINGSIZE]; + area[0] = '\0'; + strcpy(area, input); + + for (ptr = control; *ptr; ptr++) + { + switch (*ptr) + { + case RULE_NOOP: + break; + case RULE_REVERSE: + strcpy(area, Reverse(area)); + break; + case RULE_UPPERCASE: + strcpy(area, Uppercase(area)); + break; + case RULE_LOWERCASE: + strcpy(area, Lowercase(area)); + break; + case RULE_CAPITALISE: + strcpy(area, Capitalise(area)); + break; + case RULE_PLURALISE: + strcpy(area, Pluralise(area)); + break; + case RULE_REFLECT: + strcat(area, Reverse(area)); + break; + case RULE_DUPLICATE: + strcpy(area2, area); + strcat(area, area2); + break; + case RULE_GT: + if (!ptr[1]) + { + Debug(1, "Mangle: '>' missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + limit = Char2Int(*(++ptr)); + if (limit < 0) + { + Debug(1, "Mangle: '>' weird argument in '%s'\n", control); + return ((char *) 0); + } + if (strlen(area) <= limit) + { + return ((char *) 0); + } + } + break; + case RULE_LT: + if (!ptr[1]) + { + Debug(1, "Mangle: '<' missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + limit = Char2Int(*(++ptr)); + if (limit < 0) + { + Debug(1, "Mangle: '<' weird argument in '%s'\n", control); + return ((char *) 0); + } + if (strlen(area) >= limit) + { + return ((char *) 0); + } + } + break; + case RULE_PREPEND: + if (!ptr[1]) + { + Debug(1, "Mangle: prepend missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + area2[0] = *(++ptr); + strcpy(area2 + 1, area); + strcpy(area, area2); + } + break; + case RULE_APPEND: + if (!ptr[1]) + { + Debug(1, "Mangle: append missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + register char *string; + string = area; + while (*(string++)); + string[-1] = *(++ptr); + *string = '\0'; + } + break; + case RULE_EXTRACT: + if (!ptr[1] || !ptr[2]) + { + Debug(1, "Mangle: extract missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + register int i; + int start; + int length; + start = Char2Int(*(++ptr)); + length = Char2Int(*(++ptr)); + if (start < 0 || length < 0) + { + Debug(1, "Mangle: extract: weird argument in '%s'\n", control); + return ((char *) 0); + } + strcpy(area2, area); + for (i = 0; length-- && area2[start + i]; i++) + { + area[i] = area2[start + i]; + } + /* cant use strncpy() - no trailing NUL */ + area[i] = '\0'; + } + break; + case RULE_OVERSTRIKE: + if (!ptr[1] || !ptr[2]) + { + Debug(1, "Mangle: overstrike missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + register int i; + i = Char2Int(*(++ptr)); + if (i < 0) + { + Debug(1, "Mangle: overstrike weird argument in '%s'\n", + control); + return ((char *) 0); + } else + { + ++ptr; + if (area[i]) + { + area[i] = *ptr; + } + } + } + break; + case RULE_INSERT: + if (!ptr[1] || !ptr[2]) + { + Debug(1, "Mangle: insert missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + register int i; + register char *p1; + register char *p2; + i = Char2Int(*(++ptr)); + if (i < 0) + { + Debug(1, "Mangle: insert weird argument in '%s'\n", + control); + return ((char *) 0); + } + p1 = area; + p2 = area2; + while (i && *p1) + { + i--; + *(p2++) = *(p1++); + } + *(p2++) = *(++ptr); + strcpy(p2, p1); + strcpy(area, area2); + } + break; + /* THE FOLLOWING RULES REQUIRE CLASS MATCHING */ + + case RULE_PURGE: /* @x or @?c */ + if (!ptr[1] || (ptr[1] == RULE_CLASS && !ptr[2])) + { + Debug(1, "Mangle: delete missing arguments in '%s'\n", control); + return ((char *) 0); + } else if (ptr[1] != RULE_CLASS) + { + strcpy(area, Purge(area, *(++ptr))); + } else + { + strcpy(area, PolyPurge(area, ptr[2])); + ptr += 2; + } + break; + case RULE_SUBSTITUTE: /* sxy || s?cy */ + if (!ptr[1] || !ptr[2] || (ptr[1] == RULE_CLASS && !ptr[3])) + { + Debug(1, "Mangle: subst missing argument in '%s'\n", control); + return ((char *) 0); + } else if (ptr[1] != RULE_CLASS) + { + strcpy(area, Substitute(area, ptr[1], ptr[2])); + ptr += 2; + } else + { + strcpy(area, PolySubst(area, ptr[2], ptr[3])); + ptr += 3; + } + break; + case RULE_MATCH: /* /x || /?c */ + if (!ptr[1] || (ptr[1] == RULE_CLASS && !ptr[2])) + { + Debug(1, "Mangle: '/' missing argument in '%s'\n", control); + return ((char *) 0); + } else if (ptr[1] != RULE_CLASS) + { + if (!strchr(area, *(++ptr))) + { + return ((char *) 0); + } + } else + { + if (!PolyStrchr(area, ptr[2])) + { + return ((char *) 0); + } + ptr += 2; + } + break; + case RULE_NOT: /* !x || !?c */ + if (!ptr[1] || (ptr[1] == RULE_CLASS && !ptr[2])) + { + Debug(1, "Mangle: '!' missing argument in '%s'\n", control); + return ((char *) 0); + } else if (ptr[1] != RULE_CLASS) + { + if (strchr(area, *(++ptr))) + { + return ((char *) 0); + } + } else + { + if (PolyStrchr(area, ptr[2])) + { + return ((char *) 0); + } + ptr += 2; + } + break; + /* + * alternative use for a boomerang, number 1: a standard throwing + * boomerang is an ideal thing to use to tuck the sheets under + * the mattress when making your bed. The streamlined shape of + * the boomerang allows it to slip easily 'twixt mattress and + * bedframe, and it's curve makes it very easy to hook sheets + * into the gap. + */ + + case RULE_EQUALS: /* =nx || =n?c */ + if (!ptr[1] || !ptr[2] || (ptr[2] == RULE_CLASS && !ptr[3])) + { + Debug(1, "Mangle: '=' missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + register int i; + if ((i = Char2Int(ptr[1])) < 0) + { + Debug(1, "Mangle: '=' weird argument in '%s'\n", control); + return ((char *) 0); + } + if (ptr[2] != RULE_CLASS) + { + ptr += 2; + if (area[i] != *ptr) + { + return ((char *) 0); + } + } else + { + ptr += 3; + if (!MatchClass(*ptr, area[i])) + { + return ((char *) 0); + } + } + } + break; + + case RULE_DFIRST: + if (area[0]) + { + register int i; + for (i = 1; area[i]; i++) + { + area[i - 1] = area[i]; + } + area[i - 1] = '\0'; + } + break; + + case RULE_DLAST: + if (area[0]) + { + register int i; + for (i = 1; area[i]; i++); + area[i - 1] = '\0'; + } + break; + + case RULE_MFIRST: + if (!ptr[1] || (ptr[1] == RULE_CLASS && !ptr[2])) + { + Debug(1, "Mangle: '(' missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + if (ptr[1] != RULE_CLASS) + { + ptr++; + if (area[0] != *ptr) + { + return ((char *) 0); + } + } else + { + ptr += 2; + if (!MatchClass(*ptr, area[0])) + { + return ((char *) 0); + } + } + } + case RULE_MLAST: + if (!ptr[1] || (ptr[1] == RULE_CLASS && !ptr[2])) + { + Debug(1, "Mangle: ')' missing argument in '%s'\n", control); + return ((char *) 0); + } else + { + register int i; + + for (i = 0; area[i]; i++); + + if (i > 0) + { + i--; + } else + { + return ((char *) 0); + } + + if (ptr[1] != RULE_CLASS) + { + ptr++; + if (area[i] != *ptr) + { + return ((char *) 0); + } + } else + { + ptr += 2; + if (!MatchClass(*ptr, area[i])) + { + return ((char *) 0); + } + } + } + + default: + Debug(1, "Mangle: unknown command %c in %s\n", *ptr, control); + return ((char *) 0); + break; + } + } + if (!area[0]) /* have we deweted de poor widdle fing away? */ + { + return ((char *) 0); + } + return (area); +} + +int +PMatch(control, string) +register char *control; +register char *string; +{ + while (*string && *control) + { + if (!MatchClass(*control, *string)) + { + return(0); + } + + string++; + control++; + } + + if (*string || *control) + { + return(0); + } + + return(1); +} diff --git a/capplets/about-me/cracklib/stringlib.c b/capplets/about-me/cracklib/stringlib.c new file mode 100644 index 000000000..f03a52395 --- /dev/null +++ b/capplets/about-me/cracklib/stringlib.c @@ -0,0 +1,52 @@ +/* + * This program is copyright Alec Muffett 1993. The author disclaims all + * responsibility or liability with respect to it's usage or its effect + * upon hardware or computer systems, and maintains copyright as set out + * in the "LICENCE" document which accompanies distributions of Crack v4.0 + * and upwards. + */ + +#include "packer.h" + +static char vers_id[] = "stringlib.c : v2.3p2 Alec Muffett 18 May 1993"; + +char +Chop(register char *string) +{ + register char c; + register char *ptr; + c = '\0'; + + for (ptr = string; *ptr; ptr++); + if (ptr != string) + { + c = *(--ptr); + *ptr = '\0'; + } + return (c); +} + +char * +Trim(register char *string) +{ + register char *ptr; + for (ptr = string; *ptr; ptr++); + + while ((--ptr >= string) && isspace(*ptr)); + + *(++ptr) = '\0'; + + return (ptr); +} + +char * +Clone (char *string) +{ + register char *retval; + retval = (char *) malloc(strlen(string) + 1); + if (retval) + { + strcpy(retval, string); + } + return (retval); +} diff --git a/capplets/about-me/eel-alert-dialog.c b/capplets/about-me/eel-alert-dialog.c new file mode 100644 index 000000000..6d06f7c21 --- /dev/null +++ b/capplets/about-me/eel-alert-dialog.c @@ -0,0 +1,470 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* eel-alert-dialog.c: An HIG compliant alert dialog. + + The Gnome Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Gnome Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Gnome Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#include "eel-alert-dialog.h" +#include "eel-gtk-macros.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +enum { + PROP_0, + PROP_ALERT_TYPE, + PROP_BUTTONS +}; + +struct _EelAlertDialogDetails { + GtkWidget *image; + GtkWidget *primary_label; + GtkWidget *secondary_label; + GtkWidget *details_expander; + GtkWidget *details_label; + GtkMessageType type; +}; + + +static gpointer parent_class; + +static void eel_alert_dialog_finalize (GObject *object); +static void eel_alert_dialog_class_init (EelAlertDialogClass *klass); +static void eel_alert_dialog_init (EelAlertDialog *dialog); +static void eel_alert_dialog_style_set (GtkWidget *widget, + GtkStyle *prev_style); +static void eel_alert_dialog_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void eel_alert_dialog_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void eel_alert_dialog_add_buttons (EelAlertDialog *alert_dialog, + GtkButtonsType buttons); + +GType +eel_alert_dialog_get_type (void) +{ + static GType dialog_type = 0; + + if (!dialog_type) { + + static const GTypeInfo dialog_info = + { + sizeof (EelAlertDialogClass), + NULL, + NULL, + (GClassInitFunc) eel_alert_dialog_class_init, + NULL, + NULL, + sizeof (EelAlertDialog), + 0, + (GInstanceInitFunc) eel_alert_dialog_init, + }; + + dialog_type = g_type_register_static (GTK_TYPE_DIALOG, "EelAlertDialog", + &dialog_info, 0); + } + return dialog_type; +} + +static void +eel_alert_dialog_class_init (EelAlertDialogClass *class) +{ + GtkWidgetClass *widget_class; + GObjectClass *gobject_class; + + widget_class = GTK_WIDGET_CLASS (class); + gobject_class = G_OBJECT_CLASS (class); + + parent_class = g_type_class_peek_parent (class); + + G_OBJECT_CLASS (class)->finalize = eel_alert_dialog_finalize; + + widget_class->style_set = eel_alert_dialog_style_set; + + gobject_class->set_property = eel_alert_dialog_set_property; + gobject_class->get_property = eel_alert_dialog_get_property; + + gtk_widget_class_install_style_property (widget_class, + g_param_spec_int ("alert_border", + _("Image/label border"), + _("Width of border around the label and image in the alert dialog"), + 0, + G_MAXINT, + 5, + G_PARAM_READABLE)); + + g_object_class_install_property (gobject_class, + PROP_ALERT_TYPE, + g_param_spec_enum ("alert_type", + _("Alert Type"), + _("The type of alert"), + GTK_TYPE_MESSAGE_TYPE, + GTK_MESSAGE_INFO, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (gobject_class, + PROP_BUTTONS, + g_param_spec_enum ("buttons", + _("Alert Buttons"), + _("The buttons shown in the alert dialog"), + GTK_TYPE_BUTTONS_TYPE, + GTK_BUTTONS_NONE, + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + +static void +eel_alert_dialog_finalize (GObject *object) +{ + EelAlertDialog *dialog; + + dialog = EEL_ALERT_DIALOG (object); + + g_free (dialog->details); + + EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); +} + + +static void +eel_alert_dialog_init (EelAlertDialog *dialog) +{ + GtkWidget *hbox; + GtkWidget *vbox; + GtkWidget *expander; + + dialog->details = g_new0 (EelAlertDialogDetails, 1); + + dialog->details->primary_label = gtk_label_new (NULL); + dialog->details->secondary_label = gtk_label_new (NULL); + dialog->details->details_label = gtk_label_new (NULL); + dialog->details->image = gtk_image_new_from_stock (NULL, GTK_ICON_SIZE_DIALOG); + gtk_misc_set_alignment (GTK_MISC (dialog->details->image), 0.5, 0.0); + + gtk_label_set_line_wrap (GTK_LABEL (dialog->details->primary_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (dialog->details->primary_label), TRUE); + gtk_label_set_use_markup (GTK_LABEL (dialog->details->primary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (dialog->details->primary_label), 0.0, 0.5); + + gtk_label_set_line_wrap (GTK_LABEL (dialog->details->secondary_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (dialog->details->secondary_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (dialog->details->secondary_label), 0.0, 0.5); + + gtk_label_set_line_wrap (GTK_LABEL (dialog->details->details_label), TRUE); + gtk_label_set_selectable (GTK_LABEL (dialog->details->details_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (dialog->details->details_label), 0.0, 0.5); + + hbox = gtk_hbox_new (FALSE, 12); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); + + gtk_box_pack_start (GTK_BOX (hbox), dialog->details->image, + FALSE, FALSE, 0); + + vbox = gtk_vbox_new (FALSE, 12); + + gtk_box_pack_start (GTK_BOX (hbox), vbox, + FALSE, FALSE, 0); + + gtk_box_pack_start (GTK_BOX (vbox), dialog->details->primary_label, + FALSE, FALSE, 0); + + gtk_box_pack_start (GTK_BOX (vbox), dialog->details->secondary_label, + FALSE, FALSE, 0); + + expander = gtk_expander_new_with_mnemonic (_("Show more _details")); + dialog->details->details_expander = expander; + gtk_expander_set_spacing (GTK_EXPANDER (expander), 6); + gtk_container_add (GTK_CONTAINER (expander), dialog->details->details_label); + + gtk_box_pack_start (GTK_BOX (vbox), expander, + FALSE, FALSE, 0); + + + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, + FALSE, FALSE, 0); + + gtk_widget_show_all (hbox); + gtk_widget_hide (expander); + +} + +static void +setup_type (EelAlertDialog *dialog, + GtkMessageType type) +{ + const gchar *stock_id = NULL; + GtkStockItem item; + + switch (type) { + case GTK_MESSAGE_INFO: + stock_id = GTK_STOCK_DIALOG_INFO; + break; + case GTK_MESSAGE_QUESTION: + stock_id = GTK_STOCK_DIALOG_QUESTION; + break; + case GTK_MESSAGE_WARNING: + stock_id = GTK_STOCK_DIALOG_WARNING; + break; + case GTK_MESSAGE_ERROR: + stock_id = GTK_STOCK_DIALOG_ERROR; + break; + default: + g_warning ("Unknown GtkMessageType %d", type); + break; + } + + if (stock_id == NULL) { + stock_id = GTK_STOCK_DIALOG_INFO; + } + + if (gtk_stock_lookup (stock_id, &item)) { + gtk_image_set_from_stock (GTK_IMAGE (dialog->details->image), stock_id, + GTK_ICON_SIZE_DIALOG); + } else { + g_warning ("Stock dialog ID doesn't exist?"); + } +} + +static void +eel_alert_dialog_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + EelAlertDialog *dialog; + + dialog = EEL_ALERT_DIALOG (object); + + switch (prop_id) { + case PROP_ALERT_TYPE: + dialog->details->type = g_value_get_enum (value); + setup_type (dialog, dialog->details->type); + break; + case PROP_BUTTONS: + eel_alert_dialog_add_buttons (dialog, g_value_get_enum (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +eel_alert_dialog_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + EelAlertDialog *dialog; + + dialog = EEL_ALERT_DIALOG (object); + + switch (prop_id) { + case PROP_ALERT_TYPE: + g_value_set_enum (value, dialog->details->type); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +void +eel_alert_dialog_set_primary_label (EelAlertDialog *dialog, + const gchar *message) +{ + gchar *markup_str; + char *escaped_message; + + if (message != NULL) { + escaped_message = g_markup_escape_text (message, -1); + markup_str = g_strconcat ("", escaped_message, "", NULL); + gtk_label_set_markup (GTK_LABEL (EEL_ALERT_DIALOG (dialog)->details->primary_label), + markup_str); + g_free (markup_str); + g_free (escaped_message); + } +} + +void +eel_alert_dialog_set_secondary_label (EelAlertDialog *dialog, + const gchar *message) +{ + if (message != NULL) { + gtk_label_set_text (GTK_LABEL (EEL_ALERT_DIALOG (dialog)->details->secondary_label), + message); + } else { + gtk_widget_hide (EEL_ALERT_DIALOG (dialog)->details->secondary_label); + } +} + +void +eel_alert_dialog_set_details_label (EelAlertDialog *dialog, + const gchar *message) +{ + if (message != NULL) { + gtk_widget_show (dialog->details->details_expander); + gtk_label_set_text (GTK_LABEL (dialog->details->details_label), message); + } else { + gtk_widget_hide (dialog->details->details_expander); + } +} + + +GtkWidget* +eel_alert_dialog_new (GtkWindow *parent, + GtkDialogFlags flags, + GtkMessageType type, + GtkButtonsType buttons, + const gchar *primary_message, + const gchar *secondary_message, + const gchar *title) +{ + GtkWidget *widget; + GtkDialog *dialog; + + g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL); + + widget = g_object_new (EEL_TYPE_ALERT_DIALOG, + "alert_type", type, + "buttons", buttons, + NULL); + atk_object_set_role (gtk_widget_get_accessible (widget), ATK_ROLE_ALERT); + + dialog = GTK_DIALOG (widget); + + gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); + gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14); + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + gtk_dialog_set_has_separator (dialog, FALSE); + + gtk_window_set_title (GTK_WINDOW (dialog), + (title != NULL) ? title : ""); + + eel_alert_dialog_set_primary_label (EEL_ALERT_DIALOG (dialog), + primary_message); + + eel_alert_dialog_set_secondary_label (EEL_ALERT_DIALOG (dialog), + secondary_message); + + if (parent != NULL) { + gtk_window_set_transient_for (GTK_WINDOW (widget), + GTK_WINDOW (parent)); + } + + if (flags & GTK_DIALOG_MODAL) { + gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + } + + if (flags & GTK_DIALOG_DESTROY_WITH_PARENT) { + gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); + } + return widget; +} + +static void +eel_alert_dialog_add_buttons (EelAlertDialog* alert_dialog, + GtkButtonsType buttons) +{ + GtkDialog* dialog; + + dialog = GTK_DIALOG (alert_dialog); + + switch (buttons) { + case GTK_BUTTONS_NONE: + break; + case GTK_BUTTONS_OK: + gtk_dialog_add_button (dialog, + GTK_STOCK_OK, + GTK_RESPONSE_OK); + gtk_dialog_set_default_response (dialog, + GTK_RESPONSE_OK); + break; + case GTK_BUTTONS_CLOSE: + gtk_dialog_add_button (dialog, + GTK_STOCK_CLOSE, + GTK_RESPONSE_CLOSE); + gtk_dialog_set_default_response (dialog, + GTK_RESPONSE_CLOSE); + break; + case GTK_BUTTONS_CANCEL: + gtk_dialog_add_button (dialog, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + gtk_dialog_set_default_response (dialog, + GTK_RESPONSE_CANCEL); + break; + case GTK_BUTTONS_YES_NO: + gtk_dialog_add_button (dialog, + GTK_STOCK_NO, + GTK_RESPONSE_NO); + gtk_dialog_add_button (dialog, + GTK_STOCK_YES, + GTK_RESPONSE_YES); + gtk_dialog_set_default_response (dialog, + GTK_RESPONSE_YES); + break; + case GTK_BUTTONS_OK_CANCEL: + gtk_dialog_add_button (dialog, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + gtk_dialog_add_button (dialog, + GTK_STOCK_OK, + GTK_RESPONSE_OK); + gtk_dialog_set_default_response (dialog, + GTK_RESPONSE_OK); + break; + default: + g_warning ("Unknown GtkButtonsType"); + break; + } + g_object_notify (G_OBJECT (alert_dialog), "buttons"); +} + +static void +eel_alert_dialog_style_set (GtkWidget *widget, + GtkStyle *prev_style) +{ + GtkWidget *parent; + gint border_width; + + border_width = 0; + + parent = GTK_WIDGET (EEL_ALERT_DIALOG (widget)->details->image->parent); + + if (parent != NULL) { + gtk_widget_style_get (widget, "alert_border", + &border_width, NULL); + + gtk_container_set_border_width (GTK_CONTAINER (parent), + border_width); + } + + if (GTK_WIDGET_CLASS (parent_class)->style_set) { + (GTK_WIDGET_CLASS (parent_class)->style_set) (widget, prev_style); + } +} diff --git a/capplets/about-me/eel-alert-dialog.h b/capplets/about-me/eel-alert-dialog.h new file mode 100644 index 000000000..4e947f135 --- /dev/null +++ b/capplets/about-me/eel-alert-dialog.h @@ -0,0 +1,61 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ + +/* eel-alert-dialog.h: An HIG compliant alert dialog. + + The Gnome Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Gnome Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Gnome Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#ifndef EEL_ALERT_DIALOG_H +#define EEL_ALERT_DIALOG_H + +#include + +#define EEL_TYPE_ALERT_DIALOG (eel_alert_dialog_get_type ()) +#define EEL_ALERT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_ALERT_DIALOG, EelAlertDialog)) + +typedef struct _EelAlertDialog EelAlertDialog; +typedef struct _EelAlertDialogClass EelAlertDialogClass; +typedef struct _EelAlertDialogDetails EelAlertDialogDetails; + +struct _EelAlertDialog +{ + GtkDialog parent_instance; + EelAlertDialogDetails *details; +}; + +struct _EelAlertDialogClass +{ + GtkDialogClass parent_class; +}; + +GType eel_alert_dialog_get_type (void); + +GtkWidget* eel_alert_dialog_new (GtkWindow *parent, + GtkDialogFlags flags, + GtkMessageType type, + GtkButtonsType buttons, + const gchar *primary_message, + const gchar *secondary_message, + const gchar *title); +void eel_alert_dialog_set_primary_label (EelAlertDialog *dialog, + const gchar *message); +void eel_alert_dialog_set_secondary_label (EelAlertDialog *dialog, + const gchar *message); +void eel_alert_dialog_set_details_label (EelAlertDialog *dialog, + const gchar *message); + +#endif /* EEL_ALERT_DIALOG_H */ diff --git a/capplets/about-me/eel-gtk-macros.h b/capplets/about-me/eel-gtk-macros.h new file mode 100644 index 000000000..c47453f1c --- /dev/null +++ b/capplets/about-me/eel-gtk-macros.h @@ -0,0 +1,178 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- + + eel-gtk-macros.h: Macros to reduce boilerplate when using GTK. + + Copyright (C) 1999, 2000, 2001 Eazel, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + Authors: Darin Adler + Ramiro Estrugo +*/ + +#ifndef EEL_GTK_MACROS_H +#define EEL_GTK_MACROS_H + +#ifndef EEL_DISABLE_DEPRECATED + +/* Define a parent_class global and a get_type function for a GTK class. + Since this is boilerplate, it's better not to repeat it over and over again. + Called like this: + + EEL_CLASS_BOILERPLATE (EelBookmark, eel_bookmark, GTK_TYPE_OBJECT) + + The parent_class_type parameter is guaranteed to be evaluated only once + so it can be an expression, even an expression that contains a function call. +*/ + +#define EEL_CLASS_BOILERPLATE(class_name, prefix, parent_class_type) \ + EEL_BOILERPLATE (class_name, class_name, prefix, parent_class_type, \ + EEL_REGISTER_TYPE) +#define EEL_REGISTER_TYPE(class_name, corba_name) \ + g_type_register_static (parent_type, #class_name, &info, 0) + +#define EEL_BOILERPLATE(class_name, corba_name, prefix, parent_class_type, \ + register_type) \ + \ +static gpointer parent_class; \ + \ +GtkType \ +prefix##_get_type (void) \ +{ \ + GtkType parent_type; \ + static GtkType type; \ + \ + if (type == 0) { \ + static GTypeInfo info = { \ + sizeof (class_name##Class), \ + NULL, NULL, \ + (GClassInitFunc) prefix##_class_init, \ + NULL, NULL, \ + sizeof (class_name), 0, \ + (GInstanceInitFunc) prefix##_init, \ + NULL \ + }; \ + \ + parent_type = (parent_class_type); \ + type = register_type (class_name, corba_name); \ + parent_class = g_type_class_ref (parent_type); \ + } \ + \ + return type; \ +} + +/* Call a parent class version of a virtual function (or default + * signal handler since that's the same thing). Nice because it + * documents what it's doing and there is less chance for a + * typo. Depends on the parent class pointer having the conventional + * name "parent_class" as the boilerplate macro above does it. + */ +#define EEL_CALL_PARENT(parent_class_cast_macro, signal, parameters) \ + \ +G_STMT_START { \ + if (parent_class_cast_macro (parent_class)->signal != NULL) { \ + (* parent_class_cast_macro (parent_class)->signal) parameters;\ + } \ +} G_STMT_END + +/* Same thing, for functions with a return value. */ +#define EEL_CALL_PARENT_WITH_RETURN_VALUE(parent_class_cast_macro, signal, \ + parameters) \ + \ +(parent_class_cast_macro (parent_class)->signal == NULL) \ + ? 0 \ + : ((* parent_class_cast_macro (parent_class)->signal) parameters) + +#endif /* EEL_DISABLE_DEPRECATED */ + +/* Call a virtual function. Useful when the virtual function is not a + * signal, otherwise you want to gtk_signal emit. Nice because it + * documents what it's doing and there is less chance for a typo. + */ +#define EEL_CALL_METHOD(class_cast_macro, object, signal, parameters) \ + \ +G_STMT_START { \ + if (class_cast_macro (G_OBJECT_GET_CLASS (object))->signal != NULL) { \ + (* class_cast_macro (G_OBJECT_GET_CLASS (object))->signal) \ + parameters; \ + } \ +} G_STMT_END + +/* Same thing, for functions with a return value. */ +#define EEL_CALL_METHOD_WITH_RETURN_VALUE(class_cast_macro, object, signal, \ + parameters) \ + \ +(class_cast_macro (G_OBJECT_GET_CLASS (object))->signal == NULL) \ + ? 0 \ + : ((* class_cast_macro (G_OBJECT_GET_CLASS (object))->signal) \ + parameters) \ + +#ifndef G_DISABLE_ASSERT + +/* Define a signal that is not implemented by this class but must be + * implemented by subclasses. This macro should be used inside the + * class initialization function. The companion macro EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL + * must be used earlier in the file. Called like this: + * + * EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, + * fm_directory_view, + * clear); + */ +#define EEL_ASSIGN_MUST_OVERRIDE_SIGNAL(class_pointer, prefix, signal) \ + \ +* (void (**)(void)) & (class_pointer)->signal = prefix##_unimplemented_##signal + +/* Provide a debug-only implementation of a signal that must be implemented + * by subclasses. The debug-only implementation fires a warning if it is called. + * This macro should be placed as if it were a function, earlier in the file + * than the class initialization function. Called like this: + * + * EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, clear); + */ +#define EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL(prefix, signal) \ + \ +static void \ +prefix##_unimplemented_##signal (void) \ +{ \ + g_warning ("failed to override signal " #prefix "->" #signal); \ +} + +#else /* G_DISABLE_ASSERT */ + +#define EEL_DEFINE_MUST_OVERRIDE_SIGNAL(class_cast_macro, class_pointer, prefix, signal) +#define EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL(prefix, signal) +#define EEL_ASSIGN_MUST_OVERRIDE_SIGNAL(class_pointer, prefix, signal) + +#endif /* G_DISABLE_ASSERT */ + +/* Access a method. */ +#define EEL_ACCESS_METHOD(class_cast_macro, object, method) \ +(class_cast_macro (G_OBJECT_GET_CLASS (object))->method) + +/* Invoke a method for a given object. */ +#define EEL_INVOKE_METHOD(class_cast_macro, object, method, parameters) \ +((* EEL_ACCESS_METHOD (class_cast_macro, object, method)) parameters) + +/* Assert the non-nullness of a method for a given object. */ +#define EEL_ASSERT_METHOD(class_cast_macro, object, method) \ +g_assert (EEL_ACCESS_METHOD (class_cast_macro, object, method) != NULL) + +/* Invoke a method if it ain't null. */ +#define EEL_INVOKE_METHOD_IF(class_cast_macro, object, method, parameters) \ +(EEL_ACCESS_METHOD (class_cast_macro, object, method) ? 0 : \ + EEL_INVOKE_METHOD (class_cast_macro, object, method, parameters)) + +#endif /* EEL_GTK_MACROS_H */ diff --git a/capplets/about-me/gnome-about-me-bulb-off.png b/capplets/about-me/gnome-about-me-bulb-off.png new file mode 100644 index 0000000000000000000000000000000000000000..502f53d4bdaeb46c2184d1758f53be75b6e11b0d GIT binary patch literal 3192 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 #include +#include #include #include #include #include #include +#include #include #include +#include #include "capplet-util.h" +#include "eel-alert-dialog.h" typedef struct { - GtkWidget *dialog; + GladeXML *xml; + GtkWidget *old_password; GtkWidget *new_password; GtkWidget *retyped_password; - /* Communication with the passwd program */ - FILE *backend_stream; - int backend_master_fd; - int backend_pid; guint timeout_id; + guint check_password_timeout_id; + + gboolean good_password; + + /* Communication with the passwd program */ + int backend_pid; + + int write_fd; + int read_fd; + + FILE *write_stream; + FILE *read_stream; + } PasswordDialog; enum @@ -63,57 +77,62 @@ static void passdlg_set_busy (PasswordDialog *dlg, gboolean busy); static gboolean wait_child (PasswordDialog *pdialog) { - GtkWidget *dialog; gint status, pid; - gchar *primary_text = NULL; - gchar *secondary_text = NULL; + gchar *msg, *details, *title; + GladeXML *dialog; + GtkWidget *wmessage, *wbulb; + GtkWidget *wedialog; + dialog = pdialog->xml; + + wmessage = WID ("message"); + wbulb = WID ("bulb"); + pid = waitpid (pdialog->backend_pid, &status, WNOHANG); + passdlg_set_busy (pdialog, FALSE); if (pid > 0) { if (WIFEXITED (status) && (WEXITSTATUS(status) == 0)) { - passdlg_set_busy (pdialog, FALSE); - primary_text = g_strdup (_("Password changed successfully")); - - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_CLOSE, - primary_text, secondary_text); - g_signal_connect (G_OBJECT (dialog), "response", - G_CALLBACK (gtk_widget_destroy), NULL); - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - gtk_widget_show (dialog); + gtk_main_quit (); return FALSE; } else if ((WIFEXITED (status)) && (WEXITSTATUS (status)) && (WEXITSTATUS(status) < 255)) { - /* the proccess was running su */ - primary_text = g_strdup (_("The entered password is invalid")); - secondary_text = g_strdup (_("Check that you typed it correctly " - "and that you haven't activated the \"caps lock\" key")); + msg = g_strdup (_("Old password is incorret, please retype it")); + + gtk_label_set_markup (GTK_LABEL (wmessage), msg); + g_free (msg); + + gtk_image_set_from_file (GTK_IMAGE (wbulb), + GNOMECC_DATA_DIR "/pixmaps/gnome-about-me-bulb-off.png"); + + + return FALSE; } else if ((WIFEXITED (status)) && (WEXITSTATUS (status)) && (WEXITSTATUS (status) == 255)) { - primary_text = g_strdup (_("Could not run passwd")); - secondary_text = g_strdup (_("Check that you have permissions to run this command")); + msg = g_strdup (_("Symtem error has ocurred")); + details = g_strdup (_("Could not run /usr/bin/passwd")); + title = g_strdup (_("Unable to launch backend")); } else { - primary_text = g_strdup (_("An unexpected error has ocurred")); + msg = g_strdup (_("Unexpected error has ocurred")); + title = g_strdup (_("Unexpected error has ocurred")); + details = NULL; } - if (primary_text) { - passdlg_set_busy (pdialog, FALSE); - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - primary_text, secondary_text); + wedialog = eel_alert_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + msg, NULL, title); - g_signal_connect (G_OBJECT (dialog), "response", + if (details != NULL) + eel_alert_dialog_set_details_label (EEL_ALERT_DIALOG (wedialog), details); + + g_signal_connect (G_OBJECT (wedialog), "response", G_CALLBACK (gtk_widget_destroy), NULL); - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - gtk_widget_show (dialog); - g_free (primary_text); - g_free (secondary_text); - } + gtk_window_set_resizable (GTK_WINDOW (wedialog), FALSE); + gtk_widget_show (wedialog); + + g_free (msg); + g_free (title); + g_free (details); return FALSE; } @@ -130,57 +149,59 @@ is_string_complete (gchar *str, GSList *list) return FALSE; for (elem = list; elem; elem = g_slist_next (elem)) - if (g_strrstr (str, elem->data) != NULL) + if (g_strrstr (str, elem->data) != NULL) { return TRUE; + } return FALSE; } +static gchar* +read_everything (PasswordDialog *pdialog, gchar *needle, va_list ap) +{ + GString *str = g_string_new (""); + GSList *list = NULL; + gchar*arg, *ptr, c; + + list = g_slist_prepend (list, needle); + + while ((arg = va_arg (ap, char*)) != NULL) + list = g_slist_prepend (list, arg); + + va_end (ap); + + while (!is_string_complete (str->str, list)) { + c = fgetc (pdialog->read_stream); + + if (c != EOF) + g_string_append_c (str, c); + } + + ptr = str->str; + g_string_free (str, FALSE); + + return ptr; +} + +static void +poll_backend (PasswordDialog *pdialog) +{ + struct pollfd fd; + + fd.fd = pdialog->read_fd; + fd.events = POLLIN || POLLPRI; + + while (poll (&fd, 1, 100) <= 0) { + while (gtk_events_pending ()) + gtk_main_iteration (); + } +} + static char * read_from_backend_va (PasswordDialog *pdialog, gchar *needle, va_list ap) { - GString *str = g_string_new (""); - gboolean may_exit = FALSE; - gint i = 0; - gchar c, *ptr, *arg; - GSList *list = NULL; - - list = g_slist_prepend (list, needle); - - while ((arg = va_arg (ap, char*)) != NULL) - list = g_slist_prepend (list, arg); - va_end (ap); - - while (!is_string_complete (str->str, list)) { - c = fgetc (pdialog->backend_stream); - i++; - - if (*str->str) - g_string_append_c (str, c); - else { - /* the string is still empty, read with O_NONBLOCK until - * it gets a char, this is done for not blocking the UI - */ - if (c != EOF) { - g_string_append_c (str, c); - fcntl (pdialog->backend_master_fd, F_SETFL, 0); - } - usleep (500); - } - - /* ugly hack for redrawing UI without too much overload */ - if (i == REDRAW_NCHARS) { - while (gtk_events_pending ()) - gtk_main_iteration (); - i = 0; - } - } - - fcntl (pdialog->backend_master_fd, F_SETFL, O_NONBLOCK); - ptr = str->str; - g_string_free (str, FALSE); - - return ptr; + poll_backend (pdialog); + return read_everything (pdialog, needle, ap); } static gchar* @@ -198,11 +219,10 @@ write_to_backend (PasswordDialog *pdialog, char *str) gint nread = 0; int ret; - /* turn the descriptor blocking for writing the configuration */ - fcntl (pdialog->backend_master_fd, F_SETFL, 0); - do { - ret = fputc (str [nread], pdialog->backend_stream); + ret = fputc (str [nread], pdialog->write_stream); + + usleep (1000); if (ret != EOF) nread++; @@ -213,23 +233,25 @@ write_to_backend (PasswordDialog *pdialog, char *str) gtk_main_iteration (); } while (nread < strlen (str)); - while (fflush (pdialog->backend_stream) != 0); - - fcntl (pdialog->backend_master_fd, F_SETFL, O_NONBLOCK); + while (fflush (pdialog->write_stream) != 0); } static void passdlg_set_busy (PasswordDialog *pdialog, gboolean busy) { - GtkWindow *toplevel = GTK_WINDOW (pdialog->dialog); + GladeXML *dialog; + GtkWidget *toplevel; GdkCursor *cursor = NULL; GdkDisplay *display; - - display = gtk_widget_get_display (GTK_WIDGET (toplevel)); + + dialog = pdialog->xml; + toplevel = WID ("change-password"); + + display = gtk_widget_get_display (toplevel); if (busy) cursor = gdk_cursor_new_for_display (display, GDK_WATCH); - gdk_window_set_cursor (GTK_WIDGET (toplevel)->window, cursor); + gdk_window_set_cursor (toplevel->window, cursor); gdk_display_flush (display); if (busy) @@ -237,97 +259,263 @@ passdlg_set_busy (PasswordDialog *pdialog, gboolean busy) } -static void -passdlg_button_clicked_cb (GtkDialog *dialog, gint response_id, PasswordDialog *pdialog) +static gint +update_password (PasswordDialog *pdialog) { - + GtkWidget *wopasswd, *wnpasswd, *wrnpasswd; char *new_password; char *retyped_password; char *old_password; - char *args[2]; gchar *s; + GladeXML *dialog; + + dialog = pdialog->xml; + + wopasswd = WID ("old-password"); + wnpasswd = WID ("new-password"); + wrnpasswd = WID ("retyped-password"); + + /* */ + old_password = g_strdup_printf ("%s\n", gtk_entry_get_text (GTK_ENTRY (wopasswd))); + new_password = g_strdup_printf ("%s\n", gtk_entry_get_text (GTK_ENTRY (wnpasswd))); + retyped_password = g_strdup_printf ("%s\n", gtk_entry_get_text (GTK_ENTRY (wrnpasswd))); + + /* Set the busy cursor as this can be a long process */ + passdlg_set_busy (pdialog, TRUE); + + s = read_from_backend (pdialog, "assword: ", NULL); + g_free (s); + + write_to_backend (pdialog, old_password); + + /* New password */ + s = read_from_backend (pdialog, "assword: ", "failure", NULL); + if (g_strrstr (s, "failure") != NULL) { + g_free (s); + return -1; + } + g_free (s); + + write_to_backend (pdialog, new_password); + + /* Retype password */ + s = read_from_backend (pdialog, "assword: ", NULL); + g_free (s); + + write_to_backend (pdialog, retyped_password); + + s = read_from_backend (pdialog, "successfully", "Bad:", "recovered", NULL); + if (g_strrstr (s, "recovered") != NULL) { + return -2; + } else if (g_strrstr (s, "Bad") != NULL) { + return -3; + } + + return 0; +} + +static void +spawn_passwd (PasswordDialog *pdialog) +{ + char *args[2]; + int p[2]; + + /* Prepare the execution environment of passwd */ + args[0] = "/usr/bin/passwd"; + args[1] = NULL; + + pipe (p); + pdialog->backend_pid = forkpty (&pdialog->write_fd, NULL, NULL, NULL); + if (pdialog->backend_pid < 0) { + g_warning ("could not fork to backend"); + gtk_main_quit (); + } else if (pdialog->backend_pid == 0) { + dup2 (p[1], 1); + dup2 (p[1], 2); + close (p[0]); + + unsetenv("LC_ALL"); + unsetenv("LC_MESSAGES"); + unsetenv("LANG"); + unsetenv("LANGUAGE"); + + execv (args[0], args); + exit (255); + } else { + close (p[1]); + pdialog->read_fd = p[0]; + pdialog->timeout_id = g_timeout_add (4000, (GSourceFunc) wait_child, pdialog); + + pdialog->read_stream = fdopen (pdialog->read_fd, "r");; + pdialog->write_stream = fdopen (pdialog->write_fd, "w"); + + setvbuf (pdialog->read_stream, NULL, _IONBF, 0); + fcntl (pdialog->read_fd, F_SETFL, 0); + } +} + +static void +passdlg_button_clicked_cb (GtkDialog *widget, gint response_id, PasswordDialog *pdialog) +{ + GladeXML *dialog; + GtkWidget *wmessage, *wbulb; + gchar *msg; + gint ret; + + dialog = pdialog->xml; + + wmessage = WID ("message"); + wbulb = WID ("bulb"); if (response_id == GTK_RESPONSE_OK) { - /* */ - old_password = g_strdup_printf ("%s\n", gtk_entry_get_text (GTK_ENTRY (pdialog->old_password))); - new_password = g_strdup_printf ("%s\n", gtk_entry_get_text (GTK_ENTRY (pdialog->new_password))); - retyped_password = g_strdup_printf ("%s\n", gtk_entry_get_text (GTK_ENTRY (pdialog->retyped_password))); + spawn_passwd (pdialog); - /* Set the busy cursor as this can be a long process */ - passdlg_set_busy (pdialog, TRUE); + ret = update_password (pdialog); + passdlg_set_busy (pdialog, FALSE); - /* Prepare the execution environment of passwd */ - args[0] = "/usr/bin/passwd"; - args[1] = NULL; + /* No longer need the wait_child fallback, remove the timeout */ + g_source_remove (pdialog->timeout_id); - pdialog->backend_pid = forkpty (&pdialog->backend_master_fd, NULL, NULL, NULL); - if (pdialog->backend_pid < 0) { - g_warning ("could not fork to backend"); + if (ret == -1) { + msg = g_strdup (_("Old password is incorret, please retype it")); + gtk_label_set_markup (GTK_LABEL (wmessage), msg); + g_free (msg); + + gtk_image_set_from_file (GTK_IMAGE (wbulb), + GNOMECC_DATA_DIR "/pixmaps/gnome-about-me-bulb-off.png"); + + } + + /* This is the standard way of returning from the dialog with passwd + * If we return this way we can safely kill passwd as it has completed + * its task. In case of problems we still have the wait_child fallback + */ + fclose (pdialog->write_stream); + fclose (pdialog->read_stream); + + close (pdialog->read_fd); + close (pdialog->write_fd); + + kill (pdialog->backend_pid, 9); + + if (ret == 0) gtk_main_quit (); - } else if (pdialog->backend_pid == 0) { - execv (args[0], args); - exit (255); - } else { - fcntl (pdialog->backend_master_fd, F_SETFL, O_NONBLOCK); - pdialog->timeout_id = g_timeout_add (1000, (GSourceFunc) wait_child, pdialog); - pdialog->backend_stream = fdopen (pdialog->backend_master_fd, "a+"); - } - - /* Send current password to backend */ - s = read_from_backend (pdialog, "assword:", ": ", NULL); - write_to_backend (pdialog, old_password); - - s = read_from_backend (pdialog, "assword:", ": ", "\n", NULL); - while (strlen(s) < 4) { - usleep(1000); - s = read_from_backend (pdialog, "assword:", ": ", "\n", NULL); - } - - /* Send new password to backend */ - write_to_backend (pdialog, new_password); - - s = read_from_backend (pdialog, "assword:", ": ", "\n", NULL); - while (strlen(s) < 4) { - usleep(1000); - s = read_from_backend (pdialog, "assword:", ": ", "\n", NULL); - } - - /* Send new and retyped password to backend */ - write_to_backend (pdialog, retyped_password); - s = read_from_backend (pdialog, "assword:", ": ", "\n", NULL); - while (strlen(s) < 4) { - usleep(1000); - s = read_from_backend (pdialog, "\n", NULL); - } - } else { gtk_main_quit (); } } +static gboolean +passdlg_check_password_timeout_cb (PasswordDialog *pdialog) +{ + const gchar *password; + const gchar *retyped_password; + char *msg, *msgtmp; + gboolean good_password; + + GtkWidget *wbulb, *wok, *wmessage; + GtkWidget *wnpassword, *wrnpassword; + GladeXML *dialog; + + dialog = pdialog->xml; + + wnpassword = WID ("new-password"); + wrnpassword = WID ("retyped-password"); + wmessage = WID ("message"); + wbulb = WID ("bulb"); + wok = WID ("ok"); + + password = gtk_entry_get_text (GTK_ENTRY (wnpassword)); + retyped_password = gtk_entry_get_text (GTK_ENTRY (wrnpassword)); + + if (strlen (password) == 0 || strlen (retyped_password) == 0) { + gtk_image_set_from_file (GTK_IMAGE (wbulb), + GNOMECC_DATA_DIR "/pixmaps/gnome-about-me-bulb-off.png"); + gtk_label_set_markup (GTK_LABEL (wmessage), NULL); + + return FALSE; + } + + if (strcmp (password, retyped_password) != 0) { + msg = g_strdup ("Please type the password again, it is wrong."); + good_password = FALSE; + } else { + msgtmp = FascistCheck (password, CRACKLIB_DICTPATH); + + if (msgtmp == NULL) { + msg = g_strdup ("Push on the ok button to change the password"); + good_password = TRUE; + } else { + msg = g_strdup_printf ("%s", msgtmp); + g_free (msgtmp); + good_password = FALSE; + } + } + + if (good_password && pdialog->good_password == FALSE) { + gtk_image_set_from_file (GTK_IMAGE (wbulb), + GNOMECC_DATA_DIR "/pixmaps/gnome-about-me-bulb-on.png"); + gtk_widget_set_sensitive (wok, TRUE); + } else if (good_password == FALSE && pdialog->good_password == TRUE) { + gtk_image_set_from_file (GTK_IMAGE (wbulb), + GNOMECC_DATA_DIR "/pixmaps/gnome-about-me-bulb-off.png"); + gtk_widget_set_sensitive (wok, FALSE); + } + + pdialog->good_password = good_password; + + gtk_label_set_markup (GTK_LABEL (wmessage), msg); + g_free (msg); + + return FALSE; +} + + +static void +passdlg_check_password (GtkEntry *entry, PasswordDialog *pdialog) +{ + if (pdialog->check_password_timeout_id) { + g_source_remove (pdialog->check_password_timeout_id); + } + + pdialog->check_password_timeout_id = + g_timeout_add (300, (GSourceFunc) passdlg_check_password_timeout_cb, pdialog); + +} + void -gnome_about_me_password (void) +gnome_about_me_password (GtkWindow *parent) { PasswordDialog *pdialog; + GtkWidget *wpassdlg; GladeXML *dialog; pdialog = g_new0 (PasswordDialog, 1); dialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/gnome-about-me.glade", "change-password", NULL); - pdialog->dialog = WID ("change-password"); - g_signal_connect (G_OBJECT (pdialog->dialog), "response", + pdialog->xml = dialog; + + wpassdlg = WID ("change-password"); + g_signal_connect (G_OBJECT (wpassdlg), "response", G_CALLBACK (passdlg_button_clicked_cb), pdialog); - pdialog->old_password = WID ("old-password"); - pdialog->new_password = WID ("new-password"); - pdialog->retyped_password = WID ("retyped-password"); + pdialog->good_password = FALSE; - gtk_window_set_resizable (GTK_WINDOW (pdialog->dialog), FALSE); - gtk_widget_show_all (pdialog->dialog); + g_signal_connect (G_OBJECT (WID ("new-password")), "changed", + G_CALLBACK (passdlg_check_password), pdialog); + g_signal_connect (G_OBJECT (WID ("retyped-password")), "changed", + G_CALLBACK (passdlg_check_password), pdialog); + + gtk_image_set_from_file (GTK_IMAGE (WID ("bulb")), GNOMECC_DATA_DIR "/pixmaps/gnome-about-me-bulb-off.png"); + gtk_widget_set_sensitive (WID ("ok"), FALSE); + + gtk_window_set_resizable (GTK_WINDOW (wpassdlg), FALSE); + gtk_window_set_transient_for (GTK_WINDOW (wpassdlg), GTK_WINDOW (parent)); + gtk_widget_show_all (wpassdlg); gtk_main (); - gtk_widget_destroy (pdialog->dialog); - g_object_unref (G_OBJECT (dialog)); + gtk_widget_destroy (wpassdlg); + g_object_unref (G_OBJECT (wpassdlg)); g_free (pdialog); } diff --git a/capplets/about-me/gnome-about-me.c b/capplets/about-me/gnome-about-me.c index 0abf611cc..53428cce5 100644 --- a/capplets/about-me/gnome-about-me.c +++ b/capplets/about-me/gnome-about-me.c @@ -55,6 +55,8 @@ typedef struct { gboolean create_self; gchar *person; + + guint commit_timeout_id; } GnomeAboutMe; static GnomeAboutMe *me; @@ -152,6 +154,16 @@ about_me_commit (GnomeAboutMe *me) me->create_self = FALSE; } +static gboolean +about_me_commit_from_timeout (GnomeAboutMe *me) +{ + g_print ("commit from timeout\n"); + + about_me_commit (me); + + return FALSE; +} + static gboolean about_me_focus_out (GtkWidget *widget, GdkEventFocus *event, GnomeAboutMe *me) { @@ -198,8 +210,12 @@ about_me_focus_out (GtkWidget *widget, GdkEventFocus *event, GnomeAboutMe *me) g_free (str); - about_me_commit (me); - + if (me->commit_timeout_id) { + g_source_remove (me->commit_timeout_id); + } + + me->commit_timeout_id = g_timeout_add (600, (GSourceFunc) about_me_commit_from_timeout, me); + return FALSE; } @@ -391,15 +407,17 @@ about_me_update_photo (GnomeAboutMe *me) e_contact_set (me->contact, E_CONTACT_PHOTO, photo); /* Save the image for GDM */ - file = g_strdup_printf ("%s/.gnome2/face.png", g_get_home_dir ()); + file = g_strdup_printf ("%s/.face", g_get_home_dir ()); fp = fopen (file, "wb"); fwrite (photo->data, 1, photo->length, fp); fclose (fp); /* Update GDM configuration */ + /* gnome_config_set_string ("/gdmphotosetup/last/picture", file); gnome_config_set_string ("/gdm/face/picture", file); gnome_config_sync (); + */ g_free (file); e_contact_photo_free (photo); @@ -579,9 +597,12 @@ about_me_button_clicked_cb (GtkDialog *dialog, gint response_id, GnomeAboutMe *m } static void -about_me_passwd_clicked_cb (GtkWidget *button, gpointer data) +about_me_passwd_clicked_cb (GtkWidget *button, GnomeAboutMe *me) { - gnome_about_me_password (); + GladeXML *dialog; + + dialog = me->dialog; + gnome_about_me_password (WID ("about-me-dialog")); } static void @@ -659,11 +680,12 @@ about_me_setup_dialog (void) about_me_load_photo (me, me->contact); widget = WID ("fullname"); - if (tok[0] == NULL || strlen(tok[0]) == 0) { - str = g_strdup ("COMO LO HAGO?"); + if (tok[0] == NULL || strlen (tok[0]) == 0) { + str = g_strdup_printf ("%s", user); } else { str = g_strdup_printf ("%s", tok[0]); } + gtk_label_set_markup (GTK_LABEL (widget), str); g_free (str); @@ -671,13 +693,17 @@ about_me_setup_dialog (void) gtk_label_set_text (GTK_LABEL (widget), user); widget = WID ("about-me-dialog"); - str = g_strdup_printf ("About %s", tok[0]); + if (tok[0] == NULL || strlen (tok[0]) == 0) { + str = g_strdup_printf ("About %s", user); + } else { + str = g_strdup_printf ("About %s", tok[0]); + } gtk_window_set_title (GTK_WINDOW (widget), str); g_free (str); widget = WID("password"); g_signal_connect (G_OBJECT (widget), "clicked", - G_CALLBACK (about_me_passwd_clicked_cb), NULL); + G_CALLBACK (about_me_passwd_clicked_cb), me); widget = WID ("button-image"); g_signal_connect (G_OBJECT (widget), "clicked", diff --git a/capplets/about-me/gnome-about-me.desktop.in.in b/capplets/about-me/gnome-about-me.desktop.in.in new file mode 100644 index 000000000..8fa7d15b2 --- /dev/null +++ b/capplets/about-me/gnome-about-me.desktop.in.in @@ -0,0 +1,15 @@ +[Desktop Entry] +Encoding=UTF-8 +_Name=About-me +_Comment=Set your personal information +Exec=gnome-about-me +Icon=gnome-about-me +Terminal=false +Type=Application +StartupNotify=true +Categories=GNOME;Application;Settings; +OnlyShowIn=GNOME; +X-GNOME-Bugzilla-Bugzilla=GNOME +X-GNOME-Bugzilla-Product=control-center +X-GNOME-Bugzilla-Component=Keyboard +X-GNOME-Bugzilla-Version=@VERSION@ diff --git a/capplets/about-me/gnome-about-me.glade b/capplets/about-me/gnome-about-me.glade index 22bd4ec5e..66293b1cb 100644 --- a/capplets/about-me/gnome-about-me.glade +++ b/capplets/about-me/gnome-about-me.glade @@ -16,6 +16,7 @@ False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST + True False @@ -119,9 +120,13 @@ False False 0.5 - 0.48 + 0.479999989271 12 12 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -163,6 +168,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -184,6 +193,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -319,6 +332,10 @@ 0 0 email-work-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -344,6 +361,10 @@ 0 0 email-home-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -414,6 +435,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 label_item @@ -470,6 +495,10 @@ 0 0 phone-work-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -495,6 +524,10 @@ 0 0 phone-home-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -604,6 +637,10 @@ 0 0 phone-mobile-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -629,6 +666,10 @@ 0 0 phone-work-fax-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -657,6 +698,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 label_item @@ -713,6 +758,10 @@ 0 0 im-jabber-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -780,6 +829,10 @@ 0 0 im-yahoo-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -805,6 +858,10 @@ 0 0 im-msn-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -830,6 +887,10 @@ 0 0 im-icq-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -855,6 +916,10 @@ 0 0 im-aim-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -880,6 +945,10 @@ 0 0 im-groupwise-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -992,6 +1061,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 label_item @@ -1024,6 +1097,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 tab @@ -1085,6 +1162,11 @@ 0.5 0 0 + scrolledwindow3 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1147,6 +1229,11 @@ 0.5 0 0 + addr-locality-1 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1171,6 +1258,11 @@ 0.5 0 0 + addr-code-1 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1195,6 +1287,11 @@ 0.5 0 0 + addr-region-1 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1219,6 +1316,11 @@ 0.5 0 0 + addr-country-1 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1243,6 +1345,11 @@ 0.5 0 0 + addr-po-1 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1376,6 +1483,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 label_item @@ -1438,6 +1549,11 @@ 0.5 0 0 + scrolledwindow4 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1500,6 +1616,11 @@ 0.5 0 0 + addr-code-2 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1524,6 +1645,11 @@ 0.5 0 0 + addr-region-2 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1548,6 +1674,11 @@ 0.5 0 0 + addr-country-2 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1572,6 +1703,11 @@ 0.5 0 0 + addr-po-2 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1596,6 +1732,11 @@ 0.5 0 0 + addr-locality-2 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 @@ -1729,6 +1870,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 label_item @@ -1761,6 +1906,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 tab @@ -1817,6 +1966,10 @@ 0 0 web-homepage-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1842,6 +1995,10 @@ 0 0 web-weblog-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1867,6 +2024,10 @@ 0 0 web-calendar-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1958,6 +2119,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 label_item @@ -2014,6 +2179,10 @@ 0 0 job-profession-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2039,6 +2208,10 @@ 0 0 job-company-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2064,6 +2237,10 @@ 0 0 job-manager-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2089,6 +2266,10 @@ 0 0 job-title-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2114,6 +2295,10 @@ 0 0 job-dept-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2139,6 +2324,10 @@ 0 0 job-assistant-e + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2293,6 +2482,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 label_item @@ -2325,6 +2518,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 tab @@ -2384,7 +2581,7 @@ Change Password GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER_ON_PARENT - False + True False False True @@ -2392,7 +2589,8 @@ False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_CENTER - True + True + False @@ -2419,7 +2617,7 @@ - + True True True @@ -2463,7 +2661,7 @@ 12 True - 4 + 6 2 False 6 @@ -2503,6 +2701,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2548,6 +2750,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2607,6 +2813,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -2617,6 +2827,88 @@ + + + + True + False + 0 + + + + True + 0.5 + 0.5 + 0 + 0 + + + 0 + True + True + + + + + + True + True + + False + True + GTK_JUSTIFY_CENTER + False + True + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 39 + False + 0 + + + 0 + True + True + + + + + 0 + 2 + 5 + 6 + fill + + + + + + 7 + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + + + + 0 + 2 + 4 + 5 + fill + +