mysql-useradm - Don't require current password for a password change, only

ask for the new one.
This commit is contained in:
Geir Hauge 2011-09-22 12:17:18 +00:00
parent 8de782e9e6
commit 953f1fe842
1 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-useradm.c,v 1.11 2007-02-27 14:10:08 geirha Exp $
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-useradm.c,v 1.12 2011-09-22 12:17:18 geirha Exp $
*
* mysql-useradm.c
*
@ -25,8 +25,7 @@ usage()
printf("\n");
printf(" create create the USER(s).\n");
printf(" delete delete the USER(s).\n");
printf(" passwd change the MySQL password for the USER(s). You\n");
printf(" will be promptet for the old and the new password.\n");
printf(" passwd change the MySQL password for the USER(s).\n");
printf(" show give information about the USERS(s), or, if\n");
printf(" none are given, all the users you have.\n");
printf("\n");
@ -94,6 +93,7 @@ passwd(MYSQL *pmysql, const char *user)
int rows;
MYSQL_ROW row;
/*
if (is_password_set(pmysql, user))
{
sprintf(prompt, "(current) MySQL password for user '%s': ", user);
@ -119,6 +119,7 @@ passwd(MYSQL *pmysql, const char *user)
return 1;
}
}
*/
sprintf(prompt, "New MySQL password for user '%s': ", user);
password = getpass(prompt);
@ -298,7 +299,7 @@ main(int argc, char *argv[])
if (command == c_create)
dberror(NULL,"Unable to create mysql-user '%s'.\n"
"A mysql-user must start with either '%s_' or "
"A mysql-user must start with either '%s_' or "
"'groupname_', where groupname is a unix group you are a "
"member of. Type \"groups\" to see which groups you are "
"a member of.\n",