From: Jim S. <jim...@us...> - 2005-09-12 19:55:11
|
Update of /cvsroot/firebird/vulcan/src/remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28537/src/remote Modified Files: interface.cpp Log Message: Make it compile w/ new enc.cpp Index: interface.cpp =================================================================== RCS file: /cvsroot/firebird/vulcan/src/remote/interface.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -b -U3 -r1.2 -r1.3 --- interface.cpp 2 Sep 2005 19:11:10 -0000 1.2 +++ interface.cpp 12 Sep 2005 19:55:01 -0000 1.3 @@ -5575,7 +5575,7 @@ * (Based on JRD get_options()) * **************************************/ - UCHAR pw_buffer[MAX_PASSWORD_ENC_LENGTH + 6]; + TEXT pw_buffer[MAX_PASSWORD_ENC_LENGTH + 6]; *user_string = 0; *new_dpb_length = 0; @@ -5647,17 +5647,18 @@ { const UCHAR c = *p++; *s++ = c; + if (c == pb_sys_user_name) { s--; UCHAR* q = (UCHAR *) user_string; SSHORT l = *p++; + if (l) - { do { *q++ = *p++; } while (--l); - } + *q = 0; } else if (c == pb_password) @@ -5672,16 +5673,16 @@ { if (c == pb_user_name) result = true; + moved_some = true; SSHORT l = *p++; + if (*s++ = static_cast<UCHAR>(l)) - { do { *s++ = *p++; } while (--l); } } - } #ifdef NO_PASSWORD_ENCRYPTION if (password) @@ -5689,6 +5690,7 @@ moved_some = true; *s++ = pb_password; *s++ = password_length; + do { *s++ = *password++; } while (--password_length); @@ -5702,9 +5704,10 @@ strncpy((char*) pw_buffer, (const char*) password, l); pw_buffer[l] = 0; char temp[ENCRYPT_SIZE]; - p = (UCHAR *) ENC_crypt(reinterpret_cast<char*>(pw_buffer),PASSWORD_SALT, temp) + 2; - *s++ = strlen((const char*) p); - while (*p) + ENC_crypt(pw_buffer, sizeof(pw_buffer) ,PASSWORD_SALT, temp); + *s++ = (UCHAR) strlen(pw_buffer); + + for (p = (UCHAR*) pw_buffer; *p;) *s++ = *p++; } #endif |