-2008-08-25 Nicolas François <nicolas.francois@centraliens.net>
+2008-08-26 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/chfn.c: Merge some translated messages.
+ * src/groupmems.c, src/groupadd.c, src/gpasswd.c, src/chsh.c,
+ src/chfn.c: Harmonize *_update() failure messages.
+ * src/groupmems.c: Harmonize gr_close() failure messages.
+ * src/newgrp.c: Harmonize "unknown GID" messages.
+ * src/newusers.c: Move the pwd declaration to a inner block scope.
+
+2008-08-26 Nicolas François <nicolas.francois@centraliens.net>
* src/useradd.c: Harmonize some error messages.
* src/userdel.c: Add log to syslog when the mail file could not be
if (may_change_field ('f')) {
change_field (fullnm, sizeof fullnm, _("Full Name"));
} else {
- printf (_("\tFull Name: %s\n"), fullnm);
+ printf (_("\t%s: %s\n"), _("Full Name"), fullnm);
}
if (may_change_field ('r')) {
change_field (roomno, sizeof roomno, _("Room Number"));
} else {
- printf (_("\tRoom Number: %s\n"), roomno);
+ printf (_("\t%s: %s\n"), _("Room Number"), fullnm);
}
if (may_change_field ('w')) {
change_field (workph, sizeof workph, _("Work Phone"));
} else {
- printf (_("\tWork Phone: %s\n"), workph);
+ printf (_("\t%s: %s\n"), _("Work Phone"), fullnm);
}
if (may_change_field ('h')) {
change_field (homeph, sizeof homeph, _("Home Phone"));
} else {
- printf (_("\tHome Phone: %s\n"), homeph);
+ printf (_("\t%s: %s\n"), _("Home Phone"), fullnm);
}
if (amroot) {
*/
if (pw_update (&pwent) == 0) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"),
- Prog, pw_dbname ());
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, pw_dbname (), pwent.pw_name);
fail_exit (E_NOPERM);
}
*/
if (pw_update (&pwent) == 0) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"), Prog, pw_dbname ());
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, pw_dbname (), pwent.pw_name);
fail_exit (1);
}
{
if (gr_update (gr) == 0) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_WARN, "failed to prepare the new %s entry", gr_dbname ()));
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, gr_dbname (), gr->gr_name);
+ SYSLOG ((LOG_WARN, "failed to prepare the new %s entry '%s'", gr_dbname (), gr->gr_name));
#ifdef WITH_AUDIT
audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
"updating /etc/group",
#ifdef SHADOWGRP
if (is_shadowgrp && (sgr_update (sg) == 0)) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_WARN, "failed to prepare the new %s entry", sgr_dbname ()));
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, sgr_dbname (), sg->sg_name);
+ SYSLOG ((LOG_WARN, "failed to prepare the new %s entry '%s'", sgr_dbname (), sg->sg_name));
#ifdef WITH_AUDIT
audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
"updating /etc/gshadow",
*/
if (gr_update (&grp) == 0) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"), Prog, gr_dbname ());
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, gr_dbname (), grp.gr_name);
fail_exit (E_GRP_UPDATE);
}
#ifdef SHADOWGRP
*/
if (is_shadow_grp && (sgr_update (&sgrp) == 0)) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"), Prog, sgr_dbname ());
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, sgr_dbname (), sgrp.sg_name);
fail_exit (E_GRP_UPDATE);
}
#endif /* SHADOWGRP */
grp->gr_mem = add_list (grp->gr_mem, adduser);
if (gr_update (grp) == 0) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"), Prog, gr_dbname ());
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, gr_dbname (), grp->gr_name);
fail_exit (13);
}
} else if (NULL != deluser) {
grp->gr_mem = del_list (grp->gr_mem, deluser);
if (gr_update (grp) == 0) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"), Prog, gr_dbname ());
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, gr_dbname (), grp->gr_name);
fail_exit (13);
}
} else if (purge) {
grp->gr_mem[0] = NULL;
if (gr_update (grp) == 0) {
fprintf (stderr,
- _("%s: failed to prepare the new %s entry\n"), Prog, gr_dbname ());
+ _("%s: failed to prepare the new %s entry '%s'\n"),
+ Prog, gr_dbname (), grp->gr_name);
fail_exit (13);
}
}
if (gr_close () == 0) {
- fprintf (stderr, _("%s: failure while writing %s\n"), Prog, gr_dbname ());
+ fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, gr_dbname ());
SYSLOG ((LOG_ERR, "failure while writing %s", gr_dbname ()));
fail_exit (EXIT_GROUP_FILE);
}
*/
grp = xgetgrgid (pwd->pw_gid);
if (NULL == grp) {
- fprintf (stderr, _("unknown GID: %lu\n"),
- (unsigned long) pwd->pw_gid);
- SYSLOG ((LOG_CRIT, "unknown GID: %lu",
- (unsigned long) pwd->pw_gid));
+ fprintf (stderr,
+ _("%s: GID '%lu' does not exist\n"),
+ Prog, (unsigned long) pwd->pw_gid);
+ SYSLOG ((LOG_CRIT, "GID '%lu' does not exist",
+ (unsigned long) pwd->pw_gid));
goto failure;
} else {
group = grp->gr_name;
}
static int get_uid (const char *uid, uid_t *nuid) {
- const struct passwd *pwd = NULL;
/*
* The first guess for the UID is either the numerical UID that the
*nuid = (uid_t) i;
} else {
if ('\0' != uid[0]) {
+ const struct passwd *pwd;
/* local, no need for xgetpwnam */
pwd = getpwnam (uid);
if (NULL == pwd) {