Skip to content
Snippets Groups Projects
Commit 8cb40e89 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix slappasswd

parent 3888bac4
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ static void ...@@ -28,7 +28,7 @@ static void
usage(const char *s) usage(const char *s)
{ {
fprintf(stderr, fprintf(stderr,
"Usage: %s [options] dn\n" "Usage: %s [options]\n"
" -h hash\tpassword scheme\n" " -h hash\tpassword scheme\n"
" -s secret\tnew password\n" " -s secret\tnew password\n"
" -v\t\tincrease verbosity\n" " -v\t\tincrease verbosity\n"
...@@ -49,9 +49,6 @@ main( int argc, char *argv[] ) ...@@ -49,9 +49,6 @@ main( int argc, char *argv[] )
struct berval passwd; struct berval passwd;
struct berval *hash = NULL; struct berval *hash = NULL;
if (argc == 1)
usage (argv[0]);
while( (i = getopt( argc, argv, while( (i = getopt( argc, argv,
"d:h:s:v" )) != EOF ) "d:h:s:v" )) != EOF )
{ {
...@@ -87,8 +84,8 @@ main( int argc, char *argv[] ) ...@@ -87,8 +84,8 @@ main( int argc, char *argv[] )
if( newpw == NULL ) { if( newpw == NULL ) {
/* prompt for new password */ /* prompt for new password */
char *cknewpw; char *cknewpw;
newpw = strdup(getpass("New password: ")); newpw = strdup(getpassphrase("New password: "));
cknewpw = getpass("Re-enter new password: "); cknewpw = getpassphrase("Re-enter new password: ");
if( strncmp( newpw, cknewpw, strlen(newpw) )) { if( strncmp( newpw, cknewpw, strlen(newpw) )) {
fprintf( stderr, "passwords do not match\n" ); fprintf( stderr, "passwords do not match\n" );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment