[Pkg-shadow-commits] r781 - in trunk/debian: . patches

Christian Perrier bubulle at costa.debian.org
Wed Jan 11 07:54:50 UTC 2006


Author: bubulle
Date: 2006-01-11 07:54:49 +0000 (Wed, 11 Jan 2006)
New Revision: 781

Modified:
   trunk/debian/changelog
   trunk/debian/patches/462_warn_to_edit_shadow
   trunk/debian/patches/series
Log:
Patch 462 got the blessing of Nicolas


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-01-10 00:02:36 UTC (rev 780)
+++ trunk/debian/changelog	2006-01-11 07:54:49 UTC (rev 781)
@@ -5,6 +5,9 @@
     - 479_chowntty_debug: 
       - produce more helpful syslog message[s] when is_my_tty() fails
         (see bug #332198).
+    - 462_warn_to_edit_shadow:
+      - warn users to edit the shadow file when using vipw or vigr
+        Closes: #62821
   * Debian specific fixes:
     - debian/rules:
       - switch to cdbs for package build

Modified: trunk/debian/patches/462_warn_to_edit_shadow
===================================================================
--- trunk/debian/patches/462_warn_to_edit_shadow	2006-01-10 00:02:36 UTC (rev 780)
+++ trunk/debian/patches/462_warn_to_edit_shadow	2006-01-11 07:54:49 UTC (rev 781)
@@ -5,35 +5,62 @@
 
 Status wrt upstream: Forwarded but not applied yet
 
-Index: shadow-4.0.13/src/vipw.c
+Index: shadow-4.0.14/src/vipw.c
 ===================================================================
---- shadow-4.0.13.orig/src/vipw.c	2005-10-27 15:30:16.567527832 +0200
-+++ shadow-4.0.13/src/vipw.c	2005-10-27 15:36:24.261629832 +0200
-@@ -248,15 +248,27 @@
+--- shadow-4.0.14.orig/src/vipw.c	2005-12-13 15:01:08.000000000 +0100
++++ shadow-4.0.14/src/vipw.c	2006-01-11 00:47:25.000000000 +0100
+@@ -41,6 +41,12 @@
+ #include "pwio.h"
+ #include "sgroupio.h"
+ #include "shadowio.h"
++
++#define MSG_WARN_EDIT_OTHER_FILE _( \
++	"You have modified %s.\n"\
++	"You may need to modify %s for consistency.\n"\
++	"Please use the command `%s' to do so.\n")
++
+ /*
+  * Global variables
+  */
+@@ -285,17 +291,39 @@
+ 	}
+ 
  	if (do_vipw) {
- 		if (editshadow)
+-		if (editshadow)
++		if (editshadow) {
  			vipwedit (SHADOW_FILE, spw_lock, spw_unlock);
 -		else
-+		else {
++			printf (MSG_WARN_EDIT_OTHER_FILE,
++			        SHADOW_FILE,
++			        PASSWD_FILE,
++			        "vipw");
++		} else {
  			vipwedit (PASSWD_FILE, pw_lock, pw_unlock);
-+			printf (_("You have modified the password file.\n\
-+You may need to modify the shadow file for consistency.\n\
-+Please use the command `vipw -s' to do so.\n\
-+"));
++			if (spw_file_present ())
++				printf (MSG_WARN_EDIT_OTHER_FILE,
++				        PASSWD_FILE,
++				        SHADOW_FILE,
++				        "vipw -s");
 +		}
  	} else {
  #ifdef SHADOWGRP
- 		if (editshadow)
+-		if (editshadow)
++		if (editshadow) {
  			vipwedit (SGROUP_FILE, sgr_lock, sgr_unlock);
 -		else
-+		else {
++			printf (MSG_WARN_EDIT_OTHER_FILE,
++			        SGROUP_FILE,
++			        GROUP_FILE,
++			        "vigr");
++		} else {
  #endif
  			vipwedit (GROUP_FILE, gr_lock, gr_unlock);
 +#ifdef SHADOWGRP
-+			printf (_("You have modified the group file.\n\
-+You may need to modify the shadow group file for consistency.\n\
-+Please use the command `vigr -s' to do so.\n	\
-+"));
++			if (sgr_file_present ())
++				printf (MSG_WARN_EDIT_OTHER_FILE,
++				        GROUP_FILE,
++				        SGROUP_FILE,
++				        "vigr -s");
 +#endif
 +		}
  	}

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2006-01-10 00:02:36 UTC (rev 780)
+++ trunk/debian/patches/series	2006-01-11 07:54:49 UTC (rev 781)
@@ -31,7 +31,8 @@
 # All these below need more investigation and advice from Tomasz
 # kept here during bubulle's holidays..:-)
 #461_keep_sticky_bit_for_dirs
-#462_warn_to_edit_shadow
+# 462 got the blessing of Nicolas
+462_warn_to_edit_shadow
 #463_login_delay_obeys_to_PAM
 #464_login_service_configurable
 #466_useradd_-r_LSB




More information about the Pkg-shadow-commits mailing list