Skip to content
Snippets Groups Projects
Commit a8926e04 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Salt fix for password, from Tatsuo Ishii.

parent 241a87b9
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,6 @@ verify_password(char *user, char *password, Port *port, ...@@ -24,7 +24,6 @@ verify_password(char *user, char *password, Port *port,
char *p, char *p,
*test_user, *test_user,
*test_pw; *test_pw;
char salt[3];
find_hba_entry(DataDir, port->raddr.in.sin_addr, database, find_hba_entry(DataDir, port->raddr.in.sin_addr, database,
&host_ok, &userauth, pw_file_name, true); &host_ok, &userauth, pw_file_name, true);
...@@ -90,14 +89,12 @@ verify_password(char *user, char *password, Port *port, ...@@ -90,14 +89,12 @@ verify_password(char *user, char *password, Port *port,
if (test_pw[strlen(test_pw) - 1] == '\n') if (test_pw[strlen(test_pw) - 1] == '\n')
test_pw[strlen(test_pw) - 1] = '\0'; test_pw[strlen(test_pw) - 1] = '\0';
StrNCpy(salt, test_pw, 3);
if (strcmp(user, test_user) == 0) if (strcmp(user, test_user) == 0)
{ {
/* we're outta here one way or the other. */ /* we're outta here one way or the other. */
FreeFile(pw_file); FreeFile(pw_file);
if (strcmp(crypt(password, salt), test_pw) == 0) if (strcmp(crypt(password, test_pw), test_pw) == 0)
{ {
/* it matched. */ /* it matched. */
return STATUS_OK; return STATUS_OK;
......
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