Skip to content

Commit

Permalink
Fix shadow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Laurie committed Feb 11, 2000
1 parent f6814ea commit efb4162
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions apps/passwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int MAIN(int argc, char **argv)
BIO *out = NULL;
int i, badopt, opt_done;
int passed_salt = 0, quiet = 0, table = 0;
int crypt = 0;
int usecrypt = 0;
size_t pw_maxlen = 0;

apps_startup();
Expand All @@ -64,7 +64,7 @@ int MAIN(int argc, char **argv)
while (!badopt && !opt_done && argv[++i] != NULL)
{
if (strcmp(argv[i], "-crypt") == 0)
crypt = 1;
usecrypt = 1;
else if (strcmp(argv[i], "-salt") == 0)
{
if ((argv[i+1] != NULL) && (salt == NULL))
Expand All @@ -88,9 +88,9 @@ int MAIN(int argc, char **argv)
}
}

if (crypt /* + algo2 + algo3 + ... */ == 0) /* use default */
crypt = 1;
if (crypt /* + algo2 + algo3 */ > 1) /* conflict */
if (usecrypt /* + algo2 + algo3 + ... */ == 0) /* use default */
usecrypt = 1;
if (usecrypt /* + algo2 + algo3 */ > 1) /* conflict */
badopt = 1;

if (badopt)
Expand All @@ -105,7 +105,7 @@ int MAIN(int argc, char **argv)
goto err;
}

if (crypt)
if (usecrypt)
pw_maxlen = 8;
/* else if ... */

Expand All @@ -131,7 +131,7 @@ int MAIN(int argc, char **argv)
/* first make sure we have a salt */
if (!passed_salt)
{
if (crypt)
if (usecrypt)
{
if (salt_malloc == NULL)
{
Expand Down Expand Up @@ -165,7 +165,7 @@ int MAIN(int argc, char **argv)
assert(strlen(passwd) <= pw_maxlen);

/* now compute password hash */
if (crypt)
if (usecrypt)
{
char *hash = des_crypt(passwd, salt);
if (table)
Expand Down

0 comments on commit efb4162

Please sign in to comment.