[Pkg-shadow-commits] r177 - trunk/debian/patches

Nicolas FRANCOIS pkg-shadow-devel@lists.alioth.debian.org
Tue, 24 May 2005 11:07:40 +0000


Author: nekral-guest
Date: 2005-05-24 11:07:39 +0000 (Tue, 24 May 2005)
New Revision: 177

Added:
   trunk/debian/patches/331_chpasswd-md5.dpatch
Removed:
   trunk/debian/patches/010_chpasswd-md5.dpatch
Modified:
   trunk/debian/patches/series
Log:
Move 010_chpasswd-md5.dpatch to 331_chpasswd-md5.dpatch (applied upstream)


Deleted: trunk/debian/patches/010_chpasswd-md5.dpatch
===================================================================
--- trunk/debian/patches/010_chpasswd-md5.dpatch	2005-05-23 21:53:20 UTC (rev 176)
+++ trunk/debian/patches/010_chpasswd-md5.dpatch	2005-05-24 11:07:39 UTC (rev 177)
@@ -1,110 +0,0 @@
-#! /bin/sh -e
-## 010_chpasswd-md5.patch by Ian Gulliver <ian@penguinhosting.net>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Add MD5 support to chpasswd. Debian bug #283961
-
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
-
-@DPATCH@
-
-Index: shadow-4.0.3/src/chpasswd.c
-===================================================================
---- shadow-4.0.3.orig/src/chpasswd.c	2005-05-12 14:00:54.046770311 +0200
-+++ shadow-4.0.3/src/chpasswd.c	2005-05-12 14:00:57.064319450 +0200
-@@ -36,6 +36,7 @@ RCSID (PKG_VER "$Id: chpasswd.c,v 1.14 2
- #include "defines.h"
- #include <pwd.h>
- #include <fcntl.h>
-+#include <getopt.h>
- #include "pwio.h"
- #ifdef	SHADOWPWD
- #include "shadowio.h"
-@@ -47,6 +48,7 @@ RCSID (PKG_VER "$Id: chpasswd.c,v 1.14 2
- #endif				/* USE_PAM */
- static char *Prog;
- static int eflg = 0;
-+static int md5flg = 0;
- 
- #ifdef SHADOWPWD
- static int is_shadow_pwd;
-@@ -63,7 +65,7 @@ static void usage (void);
- 
- static void usage (void)
- {
--	fprintf (stderr, _("usage: %s [-e]\n"), Prog);
-+	fprintf (stderr, _("usage: %s [--encrypted] [--md5]\n"), Prog);
- 	exit (1);
- }
- 
-@@ -142,11 +144,32 @@ int main (int argc, char **argv)
- 	}
- #endif				/* USE_PAM */
- 
--	/* XXX - use getopt() */
--	if (!(argc == 1 || (argc == 2 && !strcmp (argv[1], "-e"))))
--		usage ();
--	if (argc == 2)
--		eflg = 1;
-+	{
-+		int option_index = 0;
-+		int c;
-+		static struct option long_options[] = {
-+			{ "encrypted",	no_argument,	&eflg,	1 },
-+			{ "md5",	no_argument,	&md5flg,	1 },
-+			{ 0 }
-+		};
-+
-+		while ((c = getopt_long(argc,argv,"em",long_options,&option_index)) != -1) {
-+			switch (c) {
-+				case 'e':
-+					eflg = 1;
-+					break;
-+				case 'm':
-+					md5flg = 1;
-+					break;
-+				case 0:
-+					/* long option */
-+					break;
-+				default:
-+					usage();
-+					break;
-+			}
-+		}
-+	}
- 
- 	/*
- 	 * Lock the password file and open it for reading. This will bring
-@@ -223,8 +246,14 @@ int main (int argc, char **argv)
- 			continue;
- 		}
- 		newpwd = cp;
--		if (!eflg)
--			cp = pw_encrypt (newpwd, crypt_make_salt ());
-+		if (!eflg) {
-+			if (md5flg) {
-+				char salt[12] = "$1$";
-+				strcat(salt,crypt_make_salt());
-+				cp = pw_encrypt (newpwd, salt);
-+			} else
-+				cp = pw_encrypt (newpwd, crypt_make_salt());
-+		}
- 
- 		/*
- 		 * Get the password file entry for this user. The user must

Copied: trunk/debian/patches/331_chpasswd-md5.dpatch (from rev 176, trunk/debian/patches/010_chpasswd-md5.dpatch)

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2005-05-23 21:53:20 UTC (rev 176)
+++ trunk/debian/patches/series	2005-05-24 11:07:39 UTC (rev 177)
@@ -13,7 +13,6 @@
 008_newgrp_preserve_env
 008_su_GNU_origin
 009_etc.dpatch
-010_chpasswd-md5.dpatch
 100_LINGUAS.dpatch
 101_cs.dpatch
 102_de.dpatch
@@ -74,6 +73,7 @@
 328_successful_password_change
 329_libmisc_failure_ngettext
 330_CAN-2004-1001_passwd_check
+331_chpasswd-md5.dpatch
 401_cppw_src.dpatch
 403_sg_symlink_162339_163652.dpatch
 404_undef_USE_PAM.dpatch