diff -c psqlodbc.orig\connection.c psqlodbc\connection.c *** psqlodbc.orig\connection.c Sun Dec 04 22:16:28 2005 --- psqlodbc\connection.c Sun Dec 04 22:58:19 2005 *************** *** 1726,1744 **** } ! if(self->connInfo.sslmode[0] != '\0') { ! size_t size = (sizeof(char) * (strlen(" sslmode=") + strlen(self->connInfo.sslmode) + 1)); ! conninfo = (char *)realloc(conninfo,size+strlen(conninfo)); ! if(!conninfo) { ! CC_set_error(self, CONN_MEMORY_ALLOCATION_FAILED,"Could not allocate memory for connection string(sslmode)"); ! CC_set_sqlstate(self, "08000"); ! mylog("i could not allocate memory for sslmode \n"); ! return 0; } - conninfo = strcat(conninfo," sslmode="); - conninfo = strcat(conninfo,self->connInfo.sslmode); } if(self->connInfo.password[0] != '\0') --- 1726,1765 ---- } ! if((self->connInfo.sslmode[0] != '\0') && (strcmp(self->connInfo.sslmode,"none"))) { ! size_t size_req = strlen("requiressl_"); ! if (strncmp(self->connInfo.sslmode,"requiressl_",size_req) == 0) { ! size_t size = (sizeof(char) * (size_req + 2)); ! conninfo = (char *)realloc(conninfo,size+strlen(conninfo)); ! if(!conninfo) ! { ! CC_set_error(self, CONN_MEMORY_ALLOCATION_FAILED,"Could not allocate memory for connection string(requiressl)"); ! CC_set_sqlstate(self, "08000"); ! mylog("i could not allocate memory for sslmode \n"); ! return 0; ! } ! conninfo = strcat(conninfo," requiressl="); ! if (strcmp(self->connInfo.sslmode+size_req,"on") == 0) ! conninfo = strcat(conninfo,"1"); ! else ! conninfo = strcat(conninfo,"0"); ! } ! else ! { ! size_t size = (sizeof(char) * (strlen(" sslmode=") + strlen(self->connInfo.sslmode) + 1)); ! conninfo = (char *)realloc(conninfo,size+strlen(conninfo)); ! if(!conninfo) ! { ! CC_set_error(self, CONN_MEMORY_ALLOCATION_FAILED,"Could not allocate memory for connection string(sslmode)"); ! CC_set_sqlstate(self, "08000"); ! mylog("i could not allocate memory for sslmode \n"); ! return 0; ! } ! conninfo = strcat(conninfo," sslmode="); ! conninfo = strcat(conninfo,self->connInfo.sslmode); } } if(self->connInfo.password[0] != '\0') diff -c psqlodbc.orig\dlg_specific.h psqlodbc\dlg_specific.h *** psqlodbc.orig\dlg_specific.h Wed Nov 30 13:44:16 2005 --- psqlodbc\dlg_specific.h Sun Dec 04 22:58:19 2005 *************** *** 125,131 **** /* Connection Defaults */ #define DEFAULT_PORT "5432" ! #define DEFAULT_SSLMODE "prefer" #define DEFAULT_READONLY 0 #define DEFAULT_PROTOCOL "6.4" /* the latest protocol is the default */ #define DEFAULT_USEDECLAREFETCH 0 --- 125,131 ---- /* Connection Defaults */ #define DEFAULT_PORT "5432" ! #define DEFAULT_SSLMODE "none" #define DEFAULT_READONLY 0 #define DEFAULT_PROTOCOL "6.4" /* the latest protocol is the default */ #define DEFAULT_USEDECLAREFETCH 0 diff -c psqlodbc.orig\dlg_wingui.c psqlodbc\dlg_wingui.c *** psqlodbc.orig\dlg_wingui.c Wed Nov 30 13:44:17 2005 --- psqlodbc\dlg_wingui.c Sun Dec 04 22:58:19 2005 *************** *** 63,85 **** SetDlgItemText(hdlg, IDC_PASSWORD, ci->password); SetDlgItemText(hdlg, IDC_PORT, ci->port); ! LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_PREFER, buff, MEDIUM_REGISTRY_LEN); SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_ALLOW, buff, MEDIUM_REGISTRY_LEN); SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_REQUIRE, buff, MEDIUM_REGISTRY_LEN); SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); ! LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_DISABLE, buff, MEDIUM_REGISTRY_LEN); ! SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); ! if (!strcmp(ci->sslmode, "allow")) LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_ALLOW, buff, MEDIUM_REGISTRY_LEN); else if (!strcmp(ci->sslmode, "require")) LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_REQUIRE, buff, MEDIUM_REGISTRY_LEN); ! else if (!strcmp(ci->sslmode, "disable")) ! LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_DISABLE, buff, MEDIUM_REGISTRY_LEN); ! else ! LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_PREFER, buff, MEDIUM_REGISTRY_LEN); SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_SELECTSTRING, -1, (WPARAM) ((LPSTR) buff)); --- 63,98 ---- SetDlgItemText(hdlg, IDC_PASSWORD, ci->password); SetDlgItemText(hdlg, IDC_PORT, ci->port); ! LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_NONE, buff, MEDIUM_REGISTRY_LEN); ! SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); ! LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_DISABLE, buff, MEDIUM_REGISTRY_LEN); SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_ALLOW, buff, MEDIUM_REGISTRY_LEN); SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); + LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_PREFER, buff, MEDIUM_REGISTRY_LEN); + SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_REQUIRE, buff, MEDIUM_REGISTRY_LEN); SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); ! LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_REQUIRESSL_TRY, buff, MEDIUM_REGISTRY_LEN); ! SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); ! LoadString(GetWindowInstance(hdlg),IDS_SSLREQUEST_REQUIRESSL_ON, buff, MEDIUM_REGISTRY_LEN); ! SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_ADDSTRING, 0, (WPARAM) buff); ! ! if (!strcmp(ci->sslmode, "disable")) ! LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_DISABLE, buff, MEDIUM_REGISTRY_LEN); ! else if (!strcmp(ci->sslmode, "allow")) LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_ALLOW, buff, MEDIUM_REGISTRY_LEN); + else if (!strcmp(ci->sslmode, "prefer")) + LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_PREFER, buff, MEDIUM_REGISTRY_LEN); else if (!strcmp(ci->sslmode, "require")) LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_REQUIRE, buff, MEDIUM_REGISTRY_LEN); ! else if (!strcmp(ci->sslmode, "requiressl_try")) ! LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_REQUIRESSL_TRY, buff, MEDIUM_REGISTRY_LEN); ! else if (!strcmp(ci->sslmode, "requiressl_on")) ! LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_REQUIRESSL_ON, buff, MEDIUM_REGISTRY_LEN); ! else ! LoadString(GetWindowInstance(hdlg), IDS_SSLREQUEST_NONE, buff, MEDIUM_REGISTRY_LEN); SendDlgItemMessage(hdlg, IDC_SSLMODE, CB_SELECTSTRING, -1, (WPARAM) ((LPSTR) buff)); diff -c psqlodbc.orig\psqlodbc.rc psqlodbc\psqlodbc.rc *** psqlodbc.orig\psqlodbc.rc Sun Dec 04 22:16:28 2005 --- psqlodbc\psqlodbc.rc Sun Dec 04 22:58:19 2005 *************** *** 674,679 **** --- 674,682 ---- IDS_SSLREQUEST_ALLOW "allow" IDS_SSLREQUEST_REQUIRE "require" IDS_SSLREQUEST_DISABLE "disable" + IDS_SSLREQUEST_NONE "none" + IDS_SSLREQUEST_REQUIRESSL_TRY "requiressl try" + IDS_SSLREQUEST_REQUIRESSL_ON "requiressl on" END #endif // English (U.S.) resources diff -c psqlodbc.orig\resource.h psqlodbc\resource.h *** psqlodbc.orig\resource.h Wed Nov 30 13:44:33 2005 --- psqlodbc\resource.h Sun Dec 04 22:58:19 2005 *************** *** 17,22 **** --- 17,25 ---- #define IDS_SSLREQUEST_ALLOW 11 #define IDS_SSLREQUEST_REQUIRE 12 #define IDS_SSLREQUEST_DISABLE 13 + #define IDS_SSLREQUEST_NONE 14 + #define IDS_SSLREQUEST_REQUIRESSL_TRY 15 + #define IDS_SSLREQUEST_REQUIRESSL_ON 16 #define DLG_OPTIONS_DRV 102 #define DLG_OPTIONS_DS 103 #define DLG_OPTIONS_GLOBAL 104