Recommend editing the shadowed (resp. regular) file if the regular (resp.

shadowed) file was edited.
This commit is contained in:
nekral-guest 2007-12-26 23:43:55 +00:00
parent ac7693ef7b
commit 5714adb090
3 changed files with 43 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2007-12-27 Nicolas François <nicolas.francois@centraliens.net>
Merge Debian's patch 462_warn_to_edit_shadow
* NEW, src/vipw.c: Recommend editing the shadowed (resp. regular) file
if the regular (resp. shadowed) file was edited.
2007-12-26 Nicolas François <nicolas.francois@centraliens.net>
Merge Debian's patch 451_login_PATH

3
NEWS
View File

@ -25,6 +25,9 @@ shadow-4.1.0 -> shadow-4.1.1 UNRELEASED
- login
* Use PATH and SUPATH to set the PATH environment variable, even when
support for PAM is enabled.
- vipw/vigr
* Recommend editing the shadowed (resp. regular) file if the regular (resp.
shadowed) file was edited.
shadow-4.0.18.2 -> shadow-4.1.0 09-12-2008

View File

@ -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,41 @@ int main (int argc, char **argv)
}
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");