[Setup-tool-hackers] [Stanislav Brabec <utx penguin cz>] HelixSetup Tools - patch to make crack optional



------- Start of forwarded message -------
Date: Sat, 2 Dec 2000 16:13:05 +0100
From: Stanislav Brabec <utx@penguin.cz>
To: Miguel de Icaza <miguel@helixcode.com>
Subject: Helix Setup Tools - patch to make crack optional
Message-ID: <20001202161305.A21905@utx.cz>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="3V7upXqbjpZ4EhLz"
Content-Transfer-Encoding: 8bit


--3V7upXqbjpZ4EhLz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hallo Miguel de Icaza,

I have tried to compile Helix Setup Tools on my crackless machine and I
have had no need to install cracklib. So I wrote small patch to make
cracklib stuff optional. Only one thing is missing - disable or remove
"Check quality" button, if cracklib isn't available (I don't know,
whether it's possible to do it completelly in glade).

You can try the patch. If it will work with crack, you can commit it or
let me know and I can commit it.

-- 
Stanislav Brabec

--3V7upXqbjpZ4EhLz
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: attachment; filename="helix-setup-tools-uncrack.diff"
Content-Transfer-Encoding: 8bit

diff -ur /dist/CVS/helix-setup-tools/configure.in helix-setup-tools/configure.in
--- /dist/CVS/helix-setup-tools/configure.in	Tue Nov 28 20:23:38 2000
+++ helix-setup-tools/configure.in	Sat Dec  2 16:00:10 2000
@@ -35,10 +35,14 @@
 GNOME_XML_CHECK
 AM_PATH_GDK_PIXBUF
 AM_PATH_LIBGLADE(,,"gnome")
+
 AC_CHECK_LIB(crack, FascistCheck, ,[
-  AC_MSG_ERROR(cracklib is required.)])
-AC_CHECK_HEADER(crack.h, ,[
+  AC_MSG_WARN(Building without cracklib is not recommended.)])
+if test x"$HAVE_LIBCRACK" = xyes ; then
+  AC_CHECK_HEADER(crack.h, ,[
   AC_MSG_ERROR(cracklib crack.h header file not found.)])
+fi
+
 AC_CHECK_LIB(crypt, crypt, ,[
   AC_MSG_ERROR(crypt library is required.)])
 AC_CHECK_HEADER(crypt.h, ,[
diff -ur /dist/CVS/helix-setup-tools/src/users/passwd.c helix-setup-tools/src/users/passwd.c
--- /dist/CVS/helix-setup-tools/src/users/passwd.c	Tue Nov 28 20:23:48 2000
+++ helix-setup-tools/src/users/passwd.c	Sat Dec  2 15:35:51 2000
@@ -20,6 +20,7 @@
  * Authors: Tambet Ingo <tambeti@sa.ee> and Arturo Espinosa <arturo@helixcode.com>.
  */
 
+#include "config.h"
 #include "passwd.h"
 
 /* All this for password generation and crypting. */
@@ -28,7 +29,9 @@
 #include <fcntl.h>
 #include <stdlib.h>
 #include <unistd.h>
+#ifdef HAVE_LIBCRACK
 #include <crack.h>
+#endif
 #include <crypt.h>
 #include "md5.h"
 
@@ -48,9 +51,11 @@
 	gchar *random_passwd;
 	
 	random_passwd = g_new0 (gchar, RANDOM_PASSWD_SIZE + 1);
+#ifdef HAVE_LIBCRACK
 	while (FascistCheck (random_passwd, CRACK_DICT_PATH))
+#endif
 		passwd_rand_str (random_passwd, RANDOM_PASSWD_SIZE);
-	
+
 	return random_passwd;
 }
 
@@ -64,9 +69,11 @@
 	if (strcmp (new_passwd, confirm))
 		return (gchar *) -1;
 
+#ifdef HAVE_LIBCRACK
 	if (check_quality &&
 			(check_err = FascistCheck (new_passwd, CRACK_DICT_PATH)))
 		return check_err;
+#endif
 
 	if (passwd_uses_md5 ()) 
 		password = g_strdup (crypt_md5 (new_passwd, passwd_rand_str (salt, 8)));
diff -ur /dist/CVS/helix-setup-tools/ChangeLog helix-setup-tools/ChangeLog
--- /dist/CVS/helix-setup-tools/ChangeLog	Tue Nov 28 20:23:38 2000
+++ helix-setup-tools/ChangeLog	Sat Dec  2 16:10:27 2000
@@ -1,3 +1,7 @@
+2000-12-02  Stanislav Brabec  <utx@penguin.cz>
+
+	* configure.in, src/users/passwd.c: Make cracklib optional.
+
 2000-11-28  Martin Norbäck  <d95mback@dtek.chalmers.se>
 
 	* src/common/System.directory, src/disks/disks.desktop,

--3V7upXqbjpZ4EhLz--

------- End of forwarded message -------

_______________________________________________
Setup-tool-hackers maillist  -  Setup-tool-hackers@helixcode.com
http://lists.helixcode.com/mailman/listinfo/setup-tool-hackers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]