* lib/groupio.c, lib/groupio.h, lib/pwio.c, lib/pwio.h,
lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c, lib/shadowio.h: Added *_dbname() functions to retrieve the name of the databases. * lib/groupio.c, lib/groupio.h, lib/pwio.c, lib/pwio.h, lib/sgroupio.c, lib/sgroupio.h, lib/shadowio.c, lib/shadowio.h: *_name() functions renamed *setname(). * src/grpck.c, src/pwck.c: Likewise. * lib/groupio.h, lib/pwio.h, lib/sgroupio.h, lib/shadowio.h: Added the name of the arguments to the prototypes. * src/chage, src/chfn.c, src/chgpasswd.c, src/chpasswd.c, src/chsh.c, src/gpasswd.c, src/groupadd.c, src/groupdel.c, src/groupmod.c, src/grpck.c, src/grpconv.c, src/grpunconv.c, src/newusers.c, src/passwd.c, src/pwck.c, src/pwconv.c, src/pwunconv.c, src/useradd.c, src/userdel.c, src/usermod.c: Harmonize the erro & syslog messages in case of failure of the *_lock(), *_open(), *_close(), *_unlock(), *_remove() functions. * src/chgpasswd.c, src/chpasswd.c, src/usermod.c: Avoid capitalized messages. * src/chpasswd.c, src/useradd.c, src/usermod.c: Harmonize messages in case of inexistent entries. * src/usermod.c: Harmonize messages in case of already existing entries. * src/newusers.c, src/useradd.c: Simplify PAM error handling. * src/useradd.c: Report failures to unlock files (stderr, syslog, and audit). But do not fail (continue). * src/useradd.c (open_files): Do not report to syslog & audit failures to lock or open the databases. This might be harmless, and the logs were not already informed that a change was requested. * src/usermod.c: It's not the account which is unlocked, but its password.
This commit is contained in:
@@ -83,22 +83,22 @@ int main (int argc, char **argv)
|
||||
(void) textdomain (PACKAGE);
|
||||
|
||||
if (gr_lock () == 0) {
|
||||
fprintf (stderr, _("%s: can't lock group file\n"), Prog);
|
||||
fprintf (stderr, _("%s: cannot lock %s\n"), Prog, gr_dbname ());
|
||||
fail_exit (5);
|
||||
}
|
||||
group_locked = true;
|
||||
if (gr_open (O_RDWR) == 0) {
|
||||
fprintf (stderr, _("%s: can't open group file\n"), Prog);
|
||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||
fail_exit (1);
|
||||
}
|
||||
|
||||
if (sgr_lock () == 0) {
|
||||
fprintf (stderr, _("%s: can't lock shadow group file\n"), Prog);
|
||||
fprintf (stderr, _("%s: cannot lock %s\n"), Prog, sgr_dbname ());
|
||||
fail_exit (5);
|
||||
}
|
||||
gshadow_locked = true;
|
||||
if (sgr_open (O_CREAT | O_RDWR) == 0) {
|
||||
fprintf (stderr, _("%s: can't open shadow group file\n"), Prog);
|
||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, sgr_dbname ());
|
||||
fail_exit (1);
|
||||
}
|
||||
|
||||
@@ -116,8 +116,8 @@ int main (int argc, char **argv)
|
||||
* This shouldn't happen (the entry exists) but...
|
||||
*/
|
||||
fprintf (stderr,
|
||||
_("%s: can't remove shadow group %s\n"),
|
||||
Prog, sg->sg_name);
|
||||
_("%s: cannot remove entry '%s' from %s\n"),
|
||||
Prog, sg->sg_name, sgr_dbname ());
|
||||
fail_exit (3);
|
||||
}
|
||||
}
|
||||
@@ -171,12 +171,15 @@ int main (int argc, char **argv)
|
||||
}
|
||||
|
||||
if (sgr_close () == 0) {
|
||||
fprintf (stderr, _("%s: can't update shadow group file\n"),
|
||||
Prog);
|
||||
fprintf (stderr,
|
||||
_("%s: failure while writing changes to %s\n"),
|
||||
Prog, sgr_dbname ());
|
||||
fail_exit (3);
|
||||
}
|
||||
if (gr_close () == 0) {
|
||||
fprintf (stderr, _("%s: can't update group file\n"), Prog);
|
||||
fprintf (stderr,
|
||||
_("%s: failure while writing changes to %s\n"),
|
||||
Prog, gr_dbname ());
|
||||
fail_exit (3);
|
||||
}
|
||||
sgr_unlock ();
|
||||
|
Reference in New Issue
Block a user