static void usage (void)
{
fprintf (stderr, _("Usage: %s [-q] [-r] [-s] [passwd [shadow]]\n"),
- Prog);
+ Prog);
exit (E_USAGE);
}
if (!read_only) {
if (!pw_lock ()) {
fprintf (stderr, _("%s: cannot lock file %s\n"),
- Prog, pwd_file);
+ Prog, pwd_file);
if (use_system_pw_file)
SYSLOG ((LOG_WARN, "cannot lock %s", pwd_file));
closelog ();
}
if (is_shadow && !spw_lock ()) {
fprintf (stderr, _("%s: cannot lock file %s\n"),
- Prog, spw_file);
+ Prog, spw_file);
if (use_system_spw_file)
SYSLOG ((LOG_WARN, "cannot lock %s", spw_file));
closelog ();
*/
if (!pw_open (read_only ? O_RDONLY : O_RDWR)) {
fprintf (stderr, _("%s: cannot open file %s\n"),
- Prog, pwd_file);
+ Prog, pwd_file);
if (use_system_pw_file)
SYSLOG ((LOG_WARN, "cannot open %s", pwd_file));
closelog ();
}
if (is_shadow && !spw_open (read_only ? O_RDONLY : O_RDWR)) {
fprintf (stderr, _("%s: cannot open file %s\n"),
- Prog, spw_file);
+ Prog, spw_file);
if (use_system_spw_file)
SYSLOG ((LOG_WARN, "cannot open %s", spw_file));
closelog ();
if (changed) {
if (!pw_close ()) {
fprintf (stderr, _("%s: cannot update file %s\n"),
- Prog, pwd_file);
+ Prog, pwd_file);
SYSLOG ((LOG_WARN, "cannot update %s", pwd_file));
closelog ();
exit (E_CANTUPDATE);
}
if (is_shadow && !spw_close ()) {
fprintf (stderr, _("%s: cannot update file %s\n"),
- Prog, spw_file);
+ Prog, spw_file);
SYSLOG ((LOG_WARN, "cannot update %s", spw_file));
closelog ();
exit (E_CANTUPDATE);
*/
delete_pw:
SYSLOG ((LOG_INFO, "delete passwd line `%s'",
- pfe->line));
+ pfe->line));
*changed = 1;
__pw_del_entry (pfe);
*/
printf (_("user %s: no group %u\n"),
- pwd->pw_name, pwd->pw_gid);
+ pwd->pw_name, pwd->pw_gid);
*errors += 1;
}
/*
* Home directory doesn't exist, give a warning
*/
- printf (_
- ("user %s: directory %s does not exist\n"),
- pwd->pw_name, pwd->pw_dir);
+ printf (_("user %s: directory %s does not exist\n"),
+ pwd->pw_name, pwd->pw_dir);
*errors += 1;
}
* Login shell doesn't exist, give a warning
*/
printf (_("user %s: program %s does not exist\n"),
- pwd->pw_name, pwd->pw_shell);
+ pwd->pw_name, pwd->pw_shell);
*errors += 1;
}
if (is_shadow) {
spw = (struct spwd *) spw_locate (pwd->pw_name);
if (spw == NULL) {
- printf (_
- ("no matching password file entry in %s\n"),
- spw_file);
+ printf (_("no matching password file entry in %s\n"),
+ spw_file);
printf (_("add user '%s' in %s? "),
- pwd->pw_name, spw_file);
+ pwd->pw_name, spw_file);
*errors += 1;
if (yes_or_no (read_only)) {
struct spwd sp;
if (!spw_update (&sp)) {
fprintf (stderr,
- _
- ("%s: can't update shadow entry for %s\n"),
- Prog, sp.sp_namp);
+ _("%s: can't update shadow entry for %s\n"),
+ Prog, sp.sp_namp);
exit (E_CANTUPDATE);
}
/* remove password from /etc/passwd */
pw.pw_passwd = SHADOW_PASSWD_STRING; /* XXX warning: const */
if (!pw_update (&pw)) {
fprintf (stderr,
- _
- ("%s: can't update passwd entry for %s\n"),
- Prog, pw.pw_name);
+ _("%s: can't update passwd entry for %s\n"),
+ Prog, pw.pw_name);
exit (E_CANTUPDATE);
}
}
*/
delete_spw:
SYSLOG ((LOG_INFO, "delete shadow line `%s'",
- spe->line));
+ spe->line));
*changed = 1;
__spw_del_entry (spe);
* /etc/passwd entry and ask them to delete it.
*/
printf (_("no matching password file entry in %s\n"),
- pwd_file);
+ pwd_file);
printf (_("delete line '%s'? "), spe->line);
*errors += 1;
* Warn if last password change in the future. --marekm
*/
if (!quiet && spw->sp_lstchg > time ((time_t *) 0) / SCALE) {
- printf (_
- ("user %s: last password change in the future\n"),
- spw->sp_namp);
+ printf (_("user %s: last password change in the future\n"),
+ spw->sp_namp);
*errors += 1;
}
}
*/
if (errors)
printf (changed ?
- _("%s: the files have been updated\n") :
- _("%s: no changes\n"), Prog);
+ _("%s: the files have been updated\n") :
+ _("%s: no changes\n"), Prog);
closelog ();
exit (errors ? E_BADENTRY : E_OKAY);
}
+