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

Nicolas FRANCOIS nekral-guest at costa.debian.org
Tue Feb 7 21:54:09 UTC 2006


Author: nekral-guest
Date: 2006-02-07 21:54:08 +0000 (Tue, 07 Feb 2006)
New Revision: 842

Added:
   trunk/debian/patches/419_time_structures.dpatch
   trunk/debian/patches/466_fflush-prompt
Removed:
   trunk/debian/patches/319_time_structures.dpatch
   trunk/debian/patches/366_fflush-prompt
Modified:
   trunk/debian/patches/series
Log:
Move unaplied patches from 3xx to 4xx
366_fflush-prompt -> 466_fflush-prompt
319_time_structures.dpatch -> 419_time_structures.dpatch


Deleted: trunk/debian/patches/319_time_structures.dpatch
===================================================================
--- trunk/debian/patches/319_time_structures.dpatch	2006-02-07 19:28:30 UTC (rev 841)
+++ trunk/debian/patches/319_time_structures.dpatch	2006-02-07 21:54:08 UTC (rev 842)
@@ -1,202 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 319_time_structures.dpatch by Nicolas FRANCOIS <nicolas.francois at centraliens.net>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: I didn't find a related bug in the BTS.
-## DP: It must be related to the 1:4.0.3-22 changelog:
-## DP:   Don't assume that lastlog.ll_time or utmp.ut_time or utmpx.ut_tv are
-## DP:   made up of time_ts and timevals, because they aren't on x86-64.
-## DP:   Dismaying but true.
-## DP:   -- Karl Ramm <kcr at debian.org>  Sun, 14 Mar 2004
-## DP: 
-## DP: Some parts of this patch have been applied upstream. The other parts
-## DP: should be checked.
-
- at DPATCH@
-Index: shadow-4.0.3/libmisc/log.c
-===================================================================
---- shadow-4.0.3.orig/libmisc/log.c	1998-04-16 21:57:44.000000000 +0200
-+++ shadow-4.0.3/libmisc/log.c	2005-05-12 14:05:29.976542831 +0200
-@@ -88,7 +88,7 @@ dolastlog(struct lastlog *ll, const stru
- 	if (ll)
- 		*ll = newlog;
- 
--	time(&newlog.ll_time);
-+	newlog.ll_time = time(0);
- 	strncpy(newlog.ll_line, line, sizeof newlog.ll_line);
- #if HAVE_LL_HOST
- 	strncpy(newlog.ll_host, host, sizeof newlog.ll_host);
-Index: shadow-4.0.3/libmisc/utmp.c
-===================================================================
---- shadow-4.0.3.orig/libmisc/utmp.c	2002-03-08 05:30:30.000000000 +0100
-+++ shadow-4.0.3/libmisc/utmp.c	2005-05-12 14:05:29.994540142 +0200
-@@ -111,7 +111,7 @@ checkutmp(int picky)
- 		/* XXX - assumes /dev/tty?? */
- 		strncpy(utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id);
- 		strcpy(utent.ut_user, "LOGIN");
--		time(&utent.ut_time);
-+		utent.ut_time = time(0);
- 	}
- }
- 
-@@ -195,7 +195,7 @@ checkutmp(int picky)
- 		strcpy(utent.ut_user, "LOGIN");
- 		utent.ut_pid = getpid();
- 		utent.ut_type = LOGIN_PROCESS;
--		time(&utent.ut_time);
-+		utent.ut_time = time(0);
- #if HAVE_UTMPX_H
- 		strncpy(utxent.ut_line, line, sizeof utxent.ut_line);
- 		if ((utx = getutxline(&utxent)))
-@@ -204,7 +204,15 @@ checkutmp(int picky)
- 		strcpy(utxent.ut_user, "LOGIN");
- 		utxent.ut_pid = utent.ut_pid;
- 		utxent.ut_type = utent.ut_type;
--		gettimeofday((struct timeval *) &utxent.ut_tv, NULL);
-+		/* don't assume that utmpx.ut_tv is a struct timeval */
-+		{
-+		    struct timeval tv;
-+
-+		    gettimeofday(&tv, NULL);
-+
-+		    utxent.ut_tv.tv_sec = tv.tv_sec;
-+		    utxent.ut_tv.tv_usec = tv.tv_usec;
-+		}
- 		utent.ut_time = utxent.ut_tv.tv_sec;
- #endif
- 	}
-@@ -230,7 +238,7 @@ checkutmp(int picky)
- 		line += 5;
- 
- 	(void) strncpy (utent.ut_line, line, sizeof utent.ut_line);
--	(void) time (&utent.ut_time);
-+	utent.ut_time = time(0);
- }
- 
- #endif	/* !USG */
-@@ -286,7 +294,7 @@ setutmp(const char *name, const char *li
- {
- 	utent.ut_type = USER_PROCESS;
- 	strncpy(utent.ut_user, name, sizeof utent.ut_user);
--	time(&utent.ut_time);
-+	utent.ut_time = time(0);
- 	/* other fields already filled in by checkutmp above */
- 	setutent();
- 	pututline(&utent);
-@@ -375,7 +383,14 @@ setutmp(const char *name, const char *li
- 
- 	utline.ut_type = utxline.ut_type = USER_PROCESS;
- 
--	gettimeofday(&utxline.ut_tv, NULL);
-+	/* don't assume that utmpx.ut_tv is a struct timeval */
-+	{
-+	    struct timeval tv;
-+
-+	    gettimeofday(&tv, NULL);
-+	    utxline.ut_tv.tv_sec = tv.tv_sec;
-+	    utxline.ut_tv.tv_usec = tv.tv_usec;
-+	}
- 	utline.ut_time = utxline.ut_tv.tv_sec;
- 
- 	strncpy(utxline.ut_host, host ? host : "", sizeof utxline.ut_host);
-@@ -435,7 +450,7 @@ setutmp(const char *name, const char *li
- 	 * Put in the current time (common to everyone)
- 	 */
- 
--	(void) time (&utmp.ut_time);
-+	utmp.ut_time = time(0);
- 
- #ifdef UT_HOST
- 	/*
-Index: shadow-4.0.3/src/lastlog.c
-===================================================================
---- shadow-4.0.3.orig/src/lastlog.c	2005-05-12 14:05:24.511359400 +0200
-+++ shadow-4.0.3/src/lastlog.c	2005-05-12 14:05:29.994540142 +0200
-@@ -184,7 +184,13 @@ static void print_one (const struct pass
- #endif
- 		once++;
- 	}
--	tm = localtime (&lastlog.ll_time);
-+	/* don't assume lastlog.ll_time is a time_t */
-+	{
-+	    time_t when;
-+
-+	    when = lastlog.ll_time;
-+	    tm = localtime (&when);
-+	}
- #ifdef HAVE_STRFTIME
- 	strftime (ptime, sizeof (ptime), "%a %b %e %H:%M:%S %z %Y", tm);
- 	cp = ptime;
-@@ -193,7 +199,7 @@ static void print_one (const struct pass
- 	cp[24] = '\0';
- #endif
- 
--	if (lastlog.ll_time == (time_t) 0)
-+	if (lastlog.ll_time == 0)
- 		cp = _("**Never logged in**\0");
- 
- #ifdef HAVE_LL_HOST
-Index: shadow-4.0.3/src/login.c
-===================================================================
---- shadow-4.0.3.orig/src/login.c	2005-05-12 14:04:27.490878998 +0200
-+++ shadow-4.0.3/src/login.c	2005-05-12 14:05:29.995539993 +0200
-@@ -849,10 +849,18 @@ int main (int argc, char **argv)
- 			  if (getdef_str("FTMP_FILE") != NULL) {
- #if HAVE_UTMPX_H
- 			    failent = utxent;
--			    gettimeofday(&(failent.ut_tv), NULL);
-+			    /* don't assume that utmpx.ut_tv is a struct
-+			       timeval */
-+			    {
-+				struct timeval tv;
-+
-+				gettimeofday(&tv, NULL);
-+				failent.ut_tv.tv_sec = tv.tv_sec;
-+				failent.ut_tv.tv_usec = tv.tv_usec;
-+			    }
- #else
- 			    failent = utent;
--			    time(&failent.ut_time);
-+			    failent.ut_time = time(0);
- #endif
- 			    strncpy(failent.ut_user, failent_user, sizeof(failent.ut_user));
- #ifdef USER_PROCESS
-@@ -1093,10 +1101,17 @@ int main (int argc, char **argv)
- 
- #if HAVE_UTMPX_H
- 			failent = utxent;
--			gettimeofday (&(failent.ut_tv), NULL);
-+			/* don't assume that utmpx.ut_tv is a struct timeval */
-+			{
-+			    struct timeval tv;
-+			    
-+			    gettimeofday(&tv, NULL);
-+			    failent.ut_tv.tv_sec = tv.tv_sec;
-+			    failent.ut_tv.tv_usec = tv.tv_usec;
-+			}
- #else
- 			failent = utent;
--			time (&failent.ut_time);
-+			failent.ut_time = time(0);
- #endif
- 			if (pwd) {
- 				failent_user = pwent.pw_name;
-@@ -1378,15 +1393,16 @@ int main (int argc, char **argv)
- 		}
- 		if (getdef_bool ("LASTLOG_ENAB")
- 		    && lastlog.ll_time != 0) {
-+		        time_t when = lastlog.ll_time; /* may not be a time_t */
- #ifdef HAVE_STRFTIME
- 			strftime (ptime, sizeof (ptime),
- 				  "%a %b %e %H:%M:%S %z %Y",
--				  localtime (&lastlog.ll_time));
-+				  localtime (&when));
- 			printf (_("Last login: %s on %s"),
- 				ptime, lastlog.ll_line);
- #else
- 			printf (_("Last login: %.19s on %s"),
--				ctime (&lastlog.ll_time),
-+				ctime (&when),
- 				lastlog.ll_line);
- #endif
- #ifdef HAVE_LL_HOST		/* SVR4 || __linux__ || SUN4 */

Deleted: trunk/debian/patches/366_fflush-prompt
===================================================================
--- trunk/debian/patches/366_fflush-prompt	2006-02-07 19:28:30 UTC (rev 841)
+++ trunk/debian/patches/366_fflush-prompt	2006-02-07 21:54:08 UTC (rev 842)
@@ -1,305 +0,0 @@
-Goal: Fflush all prompts supposedly presented to a user, because we may
-      conversate with a script (over pipe) instead. See bug #333138.
-
-Status wrt upstream: may appear in 4.0.14
-      
-Index: shadow-4.0.14/libmisc/Makefile.am
-===================================================================
---- shadow-4.0.14.orig/libmisc/Makefile.am	2006-01-03 08:23:47.281702882 +0100
-+++ shadow-4.0.14/libmisc/Makefile.am	2006-01-03 08:25:08.108294849 +0100
-@@ -49,4 +49,5 @@
- 	ulimit.c \
- 	utmp.c \
- 	valid.c \
--	xmalloc.c
-+	xmalloc.c \
-+	yesno.c
-Index: shadow-4.0.14/libmisc/fields.c
-===================================================================
---- shadow-4.0.14.orig/libmisc/fields.c	2006-01-03 08:23:47.281702882 +0100
-+++ shadow-4.0.14/libmisc/fields.c	2006-01-03 08:25:08.109294646 +0100
-@@ -71,6 +71,7 @@
- 		maxsize = sizeof (newf);
- 
- 	printf ("\t%s [%s]: ", prompt, buf);
-+	fflush (stdout);
- 	if (fgets (newf, maxsize, stdin) != newf)
- 		return;
- 
-Index: shadow-4.0.14/libmisc/yesno.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ shadow-4.0.14/libmisc/yesno.c	2006-01-03 08:25:08.109294646 +0100
-@@ -0,0 +1,41 @@
-+/*
-+ * Common code for yes/no prompting
-+ *
-+ * Used by pwck.c and grpck.c
-+ */
-+
-+#include <config.h>	/* configuration parameters like e.g. ENABLE_NLS */
-+
-+#ident "$Id$"
-+
-+#include <stdio.h>	/* printf(), fflush() & fgets() */
-+#include "defines.h"	/* _() macro */
-+
-+/*
-+ * yes_or_no - get answer to question from the user
-+ */
-+int yes_or_no (int read_only)
-+{
-+	char buf[80];
-+
-+	/*
-+	 * In read-only mode all questions are answered "no".
-+	 */
-+	if (read_only) {
-+		printf (_("No\n"));
-+		return 0;
-+	}
-+
-+	/*
-+	 * Typically, there's a prompt on stdout, sometimes unflushed.
-+	 */
-+	fflush (stdout);
-+
-+	/*
-+	 * Get a line and see what the first character is.
-+	 */
-+	if (fgets (buf, sizeof buf, stdin))
-+		return buf[0] == 'y' || buf[0] == 'Y';
-+
-+	return 0;
-+}
-Index: shadow-4.0.14/src/grpck.c
-===================================================================
---- shadow-4.0.14.orig/src/grpck.c	2006-01-03 08:25:05.768769841 +0100
-+++ shadow-4.0.14/src/grpck.c	2006-01-03 08:25:08.110294443 +0100
-@@ -49,6 +49,8 @@
- extern struct commonio_entry *__sgr_get_head (void);
- #endif
- 
-+extern int yes_or_no (int);
-+
- /*
-  * Exit codes
-  */
-@@ -73,7 +75,6 @@
- 
- /* local function prototypes */
- static void usage (void);
--static int yes_or_no (void);
- static void delete_member (char **, const char *);
- 
- /*
-@@ -90,30 +91,6 @@
- }
- 
- /*
-- * yes_or_no - get answer to question from the user
-- */
--static int yes_or_no (void)
--{
--	char buf[80];
--
--	/*
--	 * In read-only mode all questions are answered "no".
--	 */
--	if (read_only) {
--		printf (_("No\n"));
--		return 0;
--	}
--
--	/*
--	 * Get a line and see what the first character is.
--	 */
--	if (fgets (buf, sizeof buf, stdin))
--		return buf[0] == 'y' || buf[0] == 'Y';
--
--	return 0;
--}
--
--/*
-  * delete_member - delete an entry in a list of members
-  */
- static void delete_member (char **list, const char *member)
-@@ -300,7 +277,7 @@
- 			 * prompt the user to delete the entry or not
- 			 */
- 			if (!prune) {
--			        if (!yes_or_no ())
-+			        if (!yes_or_no (read_only))
- 				        continue;
- 			} else {
- 			        puts (_("Yes"));
-@@ -360,7 +337,7 @@
- 			/*
- 			 * prompt the user to delete the entry or not
- 			 */
--			if (yes_or_no ())
-+			if (yes_or_no (read_only))
- 				goto delete_gr;
- 		}
- 
-@@ -396,7 +373,7 @@
- 				grp->gr_name, grp->gr_mem[i]);
- 			printf (_("delete member `%s'? "), grp->gr_mem[i]);
- 
--			if (!yes_or_no ())
-+			if (!yes_or_no (read_only))
- 				continue;
- 
- 			SYSLOG ((LOG_INFO, "delete member `%s' group `%s'",
-@@ -420,7 +397,7 @@
- 				printf (_("add group `%s' in %s? "),
- 				        grp->gr_name, sgr_file);
- 				errors++;
--				if (yes_or_no ())
-+				if (yes_or_no (read_only))
- 				{
- 					struct sgrp sg;
- 					struct group gr;
-@@ -502,7 +479,7 @@
- 			/*
- 			 * prompt the user to delete the entry or not
- 			 */
--			if (!yes_or_no ())
-+			if (!yes_or_no (read_only))
- 				continue;
- 
- 			/*
-@@ -558,7 +535,7 @@
- 			/*
- 			 * prompt the user to delete the entry or not
- 			 */
--			if (yes_or_no ())
-+			if (yes_or_no (read_only))
- 				goto delete_sg;
- 		}
- 
-@@ -570,7 +547,7 @@
- 			printf (_("no matching group file entry in %s\n"), grp_file);
- 			printf (_("delete line `%s'? "), sge->line);
- 			errors++;
--			if (yes_or_no ())
-+			if (yes_or_no (read_only))
- 				goto delete_sg;
- 		} else {
- 			/**
-@@ -610,7 +587,7 @@
- 			printf (_("delete administrative member `%s'? "),
- 				sgr->sg_adm[i]);
- 
--			if (!yes_or_no ())
-+			if (!yes_or_no (read_only))
- 				continue;
- 
- 			SYSLOG ((LOG_INFO,
-@@ -637,7 +614,7 @@
- 				sgr->sg_name, sgr->sg_mem[i]);
- 			printf (_("delete member `%s'? "), sgr->sg_mem[i]);
- 
--			if (!yes_or_no ())
-+			if (!yes_or_no (read_only))
- 				continue;
- 
- 			SYSLOG ((LOG_INFO,
-Index: shadow-4.0.14/src/pwck.c
-===================================================================
---- shadow-4.0.14.orig/src/pwck.c	2006-01-03 08:25:05.769769638 +0100
-+++ shadow-4.0.14/src/pwck.c	2006-01-03 08:25:08.111294240 +0100
-@@ -48,6 +48,8 @@
- extern void __spw_del_entry (const struct commonio_entry *);
- extern struct commonio_entry *__spw_get_head (void);
- 
-+extern int yes_or_no (int);
-+
- /*
-  * Exit codes
-  */
-@@ -72,7 +74,6 @@
- 
- /* local function prototypes */
- static void usage (void);
--static int yes_or_no (void);
- 
- /*
-  * usage - print syntax message and exit
-@@ -85,31 +86,6 @@
- }
- 
- /*
-- * yes_or_no - get answer to question from the user
-- */
--static int yes_or_no (void)
--{
--	char buf[80];
--
--	/*
--	 * In read-only mode all questions are answered "no".
--	 */
--
--	if (read_only) {
--		printf (_("No\n"));
--		return 0;
--	}
--
--	/*
--	 * Get a line and see what the first character is.
--	 */
--	if (fgets (buf, sizeof buf, stdin))
--		return buf[0] == 'y' || buf[0] == 'Y';
--
--	return 0;
--}
--
--/*
-  * pwck - verify password file integrity
-  */
- int main (int argc, char **argv)
-@@ -260,7 +236,7 @@
- 			/*
- 			 * prompt the user to delete the entry or not
- 			 */
--			if (!yes_or_no ())
-+			if (!yes_or_no (read_only))
- 				continue;
- 
- 			/*
-@@ -315,7 +291,7 @@
- 			/*
- 			 * prompt the user to delete the entry or not
- 			 */
--			if (yes_or_no ())
-+			if (yes_or_no (read_only))
- 				goto delete_pw;
- 		}
- 
-@@ -456,7 +432,7 @@
- 			/*
- 			 * prompt the user to delete the entry or not
- 			 */
--			if (!yes_or_no ())
-+			if (!yes_or_no (read_only))
- 				continue;
- 
- 			/*
-@@ -511,7 +487,7 @@
- 			/*
- 			 * prompt the user to delete the entry or not
- 			 */
--			if (yes_or_no ())
-+			if (yes_or_no (read_only))
- 				goto delete_spw;
- 		}
- 
-@@ -532,7 +508,7 @@
- 			/*
- 			 * prompt the user to delete the entry or not
- 			 */
--			if (yes_or_no ())
-+			if (yes_or_no (read_only))
- 				goto delete_spw;
- 		}
- 

Copied: trunk/debian/patches/419_time_structures.dpatch (from rev 841, trunk/debian/patches/319_time_structures.dpatch)

Copied: trunk/debian/patches/466_fflush-prompt (from rev 841, trunk/debian/patches/366_fflush-prompt)

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2006-02-07 19:28:30 UTC (rev 841)
+++ trunk/debian/patches/series	2006-02-07 21:54:08 UTC (rev 842)
@@ -14,7 +14,7 @@
 432_login_cancel_timout_after_authentication
 438_su_GNU_origin
 #
-# 319_time_structures.dpatch  # must be checked another time
+# 419_time_structures.dpatch  # must be checked another time
 433_shadow.5-typo_312430
 401_cppw_src.dpatch
 404_undef_USE_PAM.dpatch
@@ -36,7 +36,7 @@
 463_login_delay_obeys_to_PAM
 #466_useradd_-r_LSB
 #End of holiday patches
-366_fflush-prompt
+466_fflush-prompt
 468_duplicate_passwd_struct_before_usage
 502_fix_generated_man_pages
 437_su_-c_option




More information about the Pkg-shadow-commits mailing list