[Pkg-shadow-commits] r1546 - upstream/trunk/src
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Fri Dec 28 22:59:17 UTC 2007
Author: nekral-guest
Date: 2007-12-28 22:59:17 +0000 (Fri, 28 Dec 2007)
New Revision: 1546
Modified:
upstream/trunk/src/chgpasswd.c
Log:
Same changes as for chpasswd:
* src/chpasswd.c: main() split in process_flags(), check_flags(),
check_perms(), open_files(), and close_files().
Modified: upstream/trunk/src/chgpasswd.c
===================================================================
--- upstream/trunk/src/chgpasswd.c 2007-12-28 22:54:35 UTC (rev 1545)
+++ upstream/trunk/src/chgpasswd.c 2007-12-28 22:59:17 UTC (rev 1546)
@@ -76,24 +76,24 @@
static void usage (void)
{
fprintf (stderr, _("Usage: %s [options]\n"
- "\n"
- "Options:\n"
- " -c, --crypt-method the crypt method (one of %s)\n"
- " -e, --encrypted supplied passwords are encrypted\n"
- " -h, --help display this help message and exit\n"
- " -m, --md5 encrypt the clear text password using\n"
- " the MD5 algorithm\n"
- "%s"
- "\n"),
- Prog,
+ "\n"
+ "Options:\n"
+ " -c, --crypt-method the crypt method (one of %s)\n"
+ " -e, --encrypted supplied passwords are encrypted\n"
+ " -h, --help display this help message and exit\n"
+ " -m, --md5 encrypt the clear text password using\n"
+ " the MD5 algorithm\n"
+ "%s"
+ "\n"),
+ Prog,
#ifndef USE_SHA_CRYPT
- "NONE DES MD5", ""
+ "NONE DES MD5", ""
#else
- "NONE DES MD5 SHA256 SHA512",
- _(" -s, --sha-rounds number of SHA rounds for the SHA*\n"
- " crypt algorithms\n")
+ "NONE DES MD5 SHA256 SHA512",
+ _(" -s, --sha-rounds number of SHA rounds for the SHA*\n"
+ " crypt algorithms\n")
#endif
- );
+ );
exit (1);
}
@@ -171,16 +171,16 @@
{
if (sflg && !cflg) {
fprintf (stderr,
- _("%s: %s flag is ONLY allowed with the %s flag\n"),
- Prog, "-s", "-c");
+ _("%s: %s flag is ONLY allowed with the %s flag\n"),
+ Prog, "-s", "-c");
usage ();
}
if ((eflg && (md5flg || cflg)) ||
(md5flg && cflg)) {
fprintf (stderr,
- _("%s: the -c, -e, and -m flags are exclusive\n"),
- Prog);
+ _("%s: the -c, -e, and -m flags are exclusive\n"),
+ Prog);
usage ();
}
@@ -272,13 +272,13 @@
if (is_shadow_grp) {
if (!sgr_lock ()) {
fprintf (stderr, _("%s: can't lock gshadow file\n"),
- Prog);
+ Prog);
gr_unlock ();
exit (1);
}
if (!sgr_open (O_RDWR)) {
fprintf (stderr, _("%s: can't open shadow file\n"),
- Prog);
+ Prog);
gr_unlock ();
sgr_unlock ();
exit (1);
@@ -296,7 +296,7 @@
if (is_shadow_grp) {
if (!sgr_close ()) {
fprintf (stderr,
- _("%s: error updating shadow file\n"), Prog);
+ _("%s: error updating shadow file\n"), Prog);
gr_unlock ();
exit (1);
}
@@ -354,7 +354,7 @@
*cp = '\0';
} else {
fprintf (stderr, _("%s: line %d: line too long\n"),
- Prog, line);
+ Prog, line);
errors++;
continue;
}
@@ -373,8 +373,8 @@
*cp++ = '\0';
} else {
fprintf (stderr,
- _("%s: line %d: missing new password\n"),
- Prog, line);
+ _("%s: line %d: missing new password\n"),
+ Prog, line);
errors++;
continue;
}
@@ -401,8 +401,8 @@
gr = gr_locate (name);
if (!gr) {
fprintf (stderr,
- _("%s: line %d: unknown group %s\n"), Prog,
- line, name);
+ _("%s: line %d: unknown group %s\n"), Prog,
+ line, name);
errors++;
continue;
}
@@ -443,9 +443,9 @@
if (!ok) {
fprintf (stderr,
- _
- ("%s: line %d: cannot update password entry\n"),
- Prog, line);
+ _
+ ("%s: line %d: cannot update password entry\n"),
+ Prog, line);
errors++;
continue;
}
@@ -460,7 +460,7 @@
*/
if (errors) {
fprintf (stderr,
- _("%s: error detected, changes ignored\n"), Prog);
+ _("%s: error detected, changes ignored\n"), Prog);
#ifdef SHADOWGRP
if (is_shadow_grp)
sgr_unlock ();
@@ -479,3 +479,4 @@
return (0);
}
+
More information about the Pkg-shadow-commits
mailing list