462_warn_to_edit_shadow was applied upstream.

This commit is contained in:
nekral-guest
2008-03-19 18:41:31 +00:00
parent ac972ba6fb
commit eb2337b2c7
3 changed files with 1 additions and 69 deletions

1
debian/changelog vendored
View File

@@ -9,6 +9,7 @@ shadow (1:4.1.1~rc1-1) UNRELEASED; urgency=low
Closes: #470745
- Remove patches applied upstream:
+ debian/patches/451_login_PATH
+ debian/patches/462_warn_to_edit_shadow
* debian/watch: Add a watch file for shadow.
-- Nicolas FRANCOIS (Nekral) <nicolas.francois@centraliens.net> Sun, 24 Feb 2008 18:33:31 +0100

View File

@@ -1,68 +0,0 @@
Goal: Warn about possible need to edit shadow files when editing the
master files with vipw
Fixes: #62821
Status wrt upstream: Forwarded but not applied yet
Index: shadow-4.1.0/src/vipw.c
===================================================================
--- shadow-4.1.0.orig/src/vipw.c
+++ shadow-4.1.0/src/vipw.c
@@ -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) {
vipwedit (SHADOW_FILE, spw_lock, spw_unlock);
- else
+ printf (MSG_WARN_EDIT_OTHER_FILE,
+ SHADOW_FILE,
+ PASSWD_FILE,
+ "vipw");
+ } else {
vipwedit (PASSWD_FILE, pw_lock, pw_unlock);
+ if (spw_file_present ())
+ printf (MSG_WARN_EDIT_OTHER_FILE,
+ PASSWD_FILE,
+ SHADOW_FILE,
+ "vipw -s");
+ }
} else {
#ifdef SHADOWGRP
- if (editshadow)
+ if (editshadow) {
vipwedit (SGROUP_FILE, sgr_lock, sgr_unlock);
- else
+ printf (MSG_WARN_EDIT_OTHER_FILE,
+ SGROUP_FILE,
+ GROUP_FILE,
+ "vigr");
+ } else {
#endif
vipwedit (GROUP_FILE, gr_lock, gr_unlock);
+#ifdef SHADOWGRP
+ if (sgr_file_present ())
+ printf (MSG_WARN_EDIT_OTHER_FILE,
+ GROUP_FILE,
+ SGROUP_FILE,
+ "vigr -s");
+#endif
+ }
}
nscd_flush_cache ("passwd");

View File

@@ -14,7 +14,6 @@
542_useradd-O_option
454_userdel_no_MAIL_FILE
501_commonio_group_shadow
462_warn_to_edit_shadow
463_login_delay_obeys_to_PAM
467_useradd_-r_LSB
466_fflush-prompt