Changeset: f04ec543d5fd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f04ec543d5fd
Modified Files:
        clients/odbc/winsetup/setup.rc
Branch: default
Log Message:

Fix the odbc-tls mess.
After merge into default, there were some more checkins on the branch,
and then the branch was closed, so loosing those changes.  They are now
merged.


diffs (299 lines):

diff --git a/clients/odbc/winsetup/install.c b/clients/odbc/winsetup/install.c
--- a/clients/odbc/winsetup/install.c
+++ b/clients/odbc/winsetup/install.c
@@ -166,7 +166,7 @@ static void
 CreateAttributeString(char *attrs, size_t len, const char *dsn)
 {
        snprintf(attrs, len,
-                        
"DSN=%s;Server=localhost;Database=;UID=monetdb;PWD=monetdb;Logfile=;",
+                        
"DSN=%s;Server=localhost;Database=;UID=monetdb;PWD=monetdb;AutoCommit=on;TLS=off;",
                         dsn);
 
        for (; *attrs; attrs++)
@@ -230,9 +230,8 @@ Install(const char *driverpath, const ch
        }
 
        rc = InstallMyDriver(driverpath, drivername);
-
        if (rc) {
-               /* after the driver is installed create the new DSN */
+               /* after the driver is installed create the new System DSN */
                rc = AddMyDSN(dsn, drivername);
        }
 
diff --git a/clients/odbc/winsetup/resource.h b/clients/odbc/winsetup/resource.h
--- a/clients/odbc/winsetup/resource.h
+++ b/clients/odbc/winsetup/resource.h
@@ -40,7 +40,9 @@
 #define IDC_EDIT_CLIENTKEY              2024
 #define IDC_EDIT_CLIENTCERT             2025
 
-#define IDC_BUTTON_CANCEL               2031
+//#define IDC_BUTTON_CANCEL               2031
+#define IDC_BUTTON_TEST                 2031
+#define IDC_BUTTON_HELP                 2032
 
 // Next default values for new objects
 //
diff --git a/clients/odbc/winsetup/setup.c b/clients/odbc/winsetup/setup.c
--- a/clients/odbc/winsetup/setup.c
+++ b/clients/odbc/winsetup/setup.c
@@ -328,44 +328,44 @@ ConfigDSN(HWND parent, WORD request, LPC
                        return FALSE;
                }
                value++;
-               if (strncasecmp("dsn=", attributes, value - attributes) == 0) {
+               if (strncasecmp("DSN=", attributes, value - attributes) == 0) {
                        dsn = value;
                        data.dsn = strdup(value);
-               } else if (strncasecmp("description=", attributes, value - 
attributes) == 0)
+               } else if (strncasecmp("Description=", attributes, value - 
attributes) == 0)
                        data.desc = strdup(value);
-               else if (strncasecmp("uid=", attributes, value - attributes) == 
0)
+               else if (strncasecmp("UID=", attributes, value - attributes) == 
0)
                        data.uid = strdup(value);
-               else if (strncasecmp("pwd=", attributes, value - attributes) == 
0)
+               else if (strncasecmp("PWD=", attributes, value - attributes) == 
0)
                        data.pwd = strdup(value);
-               else if (strncasecmp("host=", attributes, value - attributes) 
== 0)
+               else if (strncasecmp("Host=", attributes, value - attributes) 
== 0)
                        data.host = strdup(value);
-               else if (strncasecmp("port=", attributes, value - attributes) 
== 0)
+               else if (strncasecmp("Port=", attributes, value - attributes) 
== 0)
                        data.port = strdup(value);
-               else if (strncasecmp("database=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("Database=", attributes, value - 
attributes) == 0)
                        data.database = strdup(value);
-               else if (strncasecmp("schema=", attributes, value - attributes) 
== 0)
+               else if (strncasecmp("Schema=", attributes, value - attributes) 
== 0)
                        data.schema = strdup(value);
-               else if (strncasecmp("logintimeout=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("LoginTimeout=", attributes, value - 
attributes) == 0)
                        data.logintimeout = strdup(value);
-               else if (strncasecmp("replytimeout=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("ReplyTimeout=", attributes, value - 
attributes) == 0)
                        data.replytimeout = strdup(value);
-               else if (strncasecmp("replysize=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("ReplySize=", attributes, value - 
attributes) == 0)
                        data.replysize = strdup(value);
-               else if (strncasecmp("autocommit=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("AutoCommit=", attributes, value - 
attributes) == 0)
                        data.autocommit = strdup(value);
-               else if (strncasecmp("timezone=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("TimeZone=", attributes, value - 
attributes) == 0)
                        data.timezone = strdup(value);
-               else if (strncasecmp("logfile=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("LogFile=", attributes, value - 
attributes) == 0)
                        data.logfile = strdup(value);
-               else if (strncasecmp("tls=", attributes, value - attributes) == 
0)
+               else if (strncasecmp("TLS=", attributes, value - attributes) == 
0)
                        data.use_tls = strdup(value);
-               else if (strncasecmp("cert=", attributes, value - attributes) 
== 0)
+               else if (strncasecmp("Cert=", attributes, value - attributes) 
== 0)
                        data.servercert = strdup(value);
-               else if (strncasecmp("certhash=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("CertHash=", attributes, value - 
attributes) == 0)
                        data.servercerthash = strdup(value);
-               else if (strncasecmp("clientkey=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("ClientKey=", attributes, value - 
attributes) == 0)
                        data.clientkey = strdup(value);
-               else if (strncasecmp("clientcert=", attributes, value - 
attributes) == 0)
+               else if (strncasecmp("ClientCert=", attributes, value - 
attributes) == 0)
                        data.clientcert = strdup(value);
                attributes = value + strlen(value) + 1;
        }
@@ -380,26 +380,26 @@ ConfigDSN(HWND parent, WORD request, LPC
                goto finish;
        }
 
-       MergeFromProfileString(data.dsn, &data.desc, "description", "");
-       MergeFromProfileString(data.dsn, &data.uid, "uid", "");
-       MergeFromProfileString(data.dsn, &data.pwd, "pwd", "");
-       MergeFromProfileString(data.dsn, &data.host, "host", "localhost");
-       MergeFromProfileString(data.dsn, &data.port, "port", MAPI_PORT_STR);
-       MergeFromProfileString(data.dsn, &data.database, "database", "");
-       MergeFromProfileString(data.dsn, &data.schema, "schema", "");
-       MergeFromProfileString(data.dsn, &data.logintimeout, "logintimeout", 
"30");
-       MergeFromProfileString(data.dsn, &data.replytimeout, "replytimeout", 
"300");
-       MergeFromProfileString(data.dsn, &data.replysize, "replysize", "");
-       MergeFromProfileString(data.dsn, &data.autocommit, "autocommit", "on");
-       MergeFromProfileString(data.dsn, &data.timezone, "timezone", "");
-       MergeFromProfileString(data.dsn, &data.logfile, "logfile", "");
-       MergeFromProfileString(data.dsn, &data.use_tls, "tls", "off");
-       MergeFromProfileString(data.dsn, &data.servercert, "cert", "");
-       MergeFromProfileString(data.dsn, &data.servercerthash, "certhash", "");
-       MergeFromProfileString(data.dsn, &data.clientkey, "clientkey", "");
-       MergeFromProfileString(data.dsn, &data.clientcert, "clientcert", "");
+       MergeFromProfileString(data.dsn, &data.desc, "Description", "");
+       MergeFromProfileString(data.dsn, &data.uid, "UID", "");
+       MergeFromProfileString(data.dsn, &data.pwd, "PWD", "");
+       MergeFromProfileString(data.dsn, &data.host, "Host", "localhost");
+       MergeFromProfileString(data.dsn, &data.port, "Port", MAPI_PORT_STR);
+       MergeFromProfileString(data.dsn, &data.database, "Database", "");
+       MergeFromProfileString(data.dsn, &data.schema, "Schema", "");
+       MergeFromProfileString(data.dsn, &data.logintimeout, "LoginTimeout", 
"");
+       MergeFromProfileString(data.dsn, &data.replytimeout, "ReplyTimeout", 
"");
+       MergeFromProfileString(data.dsn, &data.replysize, "ReplySize", "");
+       MergeFromProfileString(data.dsn, &data.autocommit, "AutoCommit", "on");
+       MergeFromProfileString(data.dsn, &data.timezone, "TimeZone", "");
+       MergeFromProfileString(data.dsn, &data.logfile, "LogFile", "");
+       MergeFromProfileString(data.dsn, &data.use_tls, "TLS", "off");
+       MergeFromProfileString(data.dsn, &data.servercert, "Cert", "");
+       MergeFromProfileString(data.dsn, &data.servercerthash, "CertHash", "");
+       MergeFromProfileString(data.dsn, &data.clientkey, "ClientKey", "");
+       MergeFromProfileString(data.dsn, &data.clientcert, "ClientCert", "");
 
-       ODBCLOG("ConfigDSN values: dsn=%s uid=%s pwd=%s host=%s port=%s 
database=%s schema=%s logintimeout=%s replytimeout=%s replysize=%s 
autocommit=%s timezone=%s logfile=%s tls=%s cert=%s certhash=%s clientkey=%s 
clientcert=%s\n",
+       ODBCLOG("ConfigDSN values: DSN=%s UID=%s PWD=%s Host=%s Port=%s 
Database=%s Schema=%s LoginTimeout=%s ReplyTimeout=%s ReplySize=%s 
AutoCommit=%s TimeZone=%s LogFile=%s TLSs=%s Cert=%s CertHash=%s ClientKey=%s 
ClientCert=%s\n",
                data.dsn ? data.dsn : "(null)",
                data.uid ? data.uid : "(null)",
                data.pwd ? data.pwd : "(null)",
@@ -483,7 +483,7 @@ ConfigDSN(HWND parent, WORD request, LPC
                        goto finish;
                }
        }
-       ODBCLOG("ConfigDSN writing values: dsn=%s uid=%s pwd=%s host=%s port=%s 
database=%s schema=%s logintimeout=%s replytimeout=%s replysize=%s 
autocommit=%s timezone=%s logfile=%s tls=%s cert=%s certhash=%s clientkey=%s 
clientcert=%s\n",
+       ODBCLOG("ConfigDSN writing values: DSN=%s UID=%s PWD=%s Host=%s Port=%s 
Database=%s Schema=%s LoginTimeout=%s ReplyTimeout=%s ReplySize=%s 
AutoCommit=%s TimeZone=%s LogFile=%s TLSs=%s Cert=%s CertHash=%s ClientKey=%s 
ClientCert=%s\n",
                data.dsn ? data.dsn : "(null)",
                data.uid ? data.uid : "(null)",
                data.pwd ? data.pwd : "(null)",
@@ -503,11 +503,11 @@ ConfigDSN(HWND parent, WORD request, LPC
                data.clientkey ? data.clientkey : "(null)",
                data.clientcert ? data.clientcert : "(null)");
 
-       if (!SQLWritePrivateProfileString(data.dsn, "uid", data.uid, "odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "pwd", data.pwd, "odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "host", data.host, 
"odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "port", data.port, 
"odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "database", data.database, 
"odbc.ini")) {
+       if (!SQLWritePrivateProfileString(data.dsn, "UID", data.uid, "odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "PWD", data.pwd, "odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "Host", data.host, 
"odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "Port", data.port, 
"odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "Database", data.database, 
"odbc.ini")) {
                rc = FALSE;
                if (parent)
                        MessageBox(parent, "Error writing configuration data to 
registry", NULL, MB_ICONERROR);
@@ -515,19 +515,19 @@ ConfigDSN(HWND parent, WORD request, LPC
                goto finish;
        }
 
-       if (!SQLWritePrivateProfileString(data.dsn, "description", data.desc, 
"odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "schema", data.schema, 
"odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "logintimeout", 
data.logintimeout, "odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "replytimeout", 
data.replytimeout, "odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "replysize", 
data.replysize, "odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "autocommit", 
data.autocommit, "odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "timezone", data.timezone, 
"odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "logfile", data.logfile, 
"odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "tls", data.use_tls, 
"odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "cert", data.servercert, 
"odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "certhash", 
data.servercerthash, "odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "clientkey", 
data.clientkey, "odbc.ini")
-        || !SQLWritePrivateProfileString(data.dsn, "clientcert", 
data.clientcert, "odbc.ini")) {
+       if (!SQLWritePrivateProfileString(data.dsn, "Description", data.desc, 
"odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "Schema", data.schema, 
"odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "LoginTimeout", 
data.logintimeout, "odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "ReplyTimeout", 
data.replytimeout, "odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "ReplySize", 
data.replysize, "odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "AutoCommit", 
data.autocommit, "odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "TimeZone", data.timezone, 
"odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "LogFile", data.logfile, 
"odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "TLS", data.use_tls, 
"odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "Cert", data.servercert, 
"odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "CertHash", 
data.servercerthash, "odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "ClientKey", 
data.clientkey, "odbc.ini")
+        || !SQLWritePrivateProfileString(data.dsn, "ClientCert", 
data.clientcert, "odbc.ini")) {
                if (parent)
                        MessageBox(parent, "Error writing optional 
configuration data to registry", NULL, MB_ICONERROR);
                goto finish;
diff --git a/clients/odbc/winsetup/setup.rc b/clients/odbc/winsetup/setup.rc
--- a/clients/odbc/winsetup/setup.rc
+++ b/clients/odbc/winsetup/setup.rc
@@ -104,18 +104,18 @@ END
 //
 // X, Y, WIDTH, HEIGHT
 
-IDD_SETUP_DIALOG DIALOGEX 0, 0, 230, 419
+IDD_SETUP_DIALOG DIALOGEX 0, 0, 228, 416
 STYLE DS_MODALFRAME | WS_CAPTION
 CAPTION "MonetDB ODBC Data Source Setup"
 FONT 8, "MS Shell Dlg", 0, 0, 0x0
 BEGIN
-    EDITTEXT        IDC_EDIT_DSN,95,40,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_DESC,95,56,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_UID,95,72,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_PWD,95,88,128,14,ES_AUTOHSCROLL | ES_PASSWORD
-    EDITTEXT        IDC_EDIT_HOST,95,104,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_PORT,95,120,32,14,ES_AUTOHSCROLL | ES_NUMBER
-    EDITTEXT        IDC_EDIT_DATABASE,95,136,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_DSN,80,40,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_DESC,80,56,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_UID,80,72,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_PWD,80,88,128,14,ES_AUTOHSCROLL | ES_PASSWORD
+    EDITTEXT        IDC_EDIT_HOST,80,104,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_PORT,80,120,32,14,ES_AUTOHSCROLL | ES_NUMBER
+    EDITTEXT        IDC_EDIT_DATABASE,80,136,128,14,ES_AUTOHSCROLL
     LTEXT           "Data Source Name:",IDC_STATIC,7,42,63,8
     LTEXT           "Description:",IDC_STATIC,7,58,63,8
     LTEXT           "User Name:",IDC_STATIC,7,74,63,8
@@ -123,7 +123,7 @@ BEGIN
     LTEXT           "Host:",IDC_STATIC,7,106,63,8
     LTEXT           "Port:",IDC_STATIC,7,122,63,8
     LTEXT           "Database:",IDC_STATIC,7,138,63,8
-    GROUPBOX        "Advanced settings",IDC_STATIC,7,154,216,128
+    GROUPBOX        "Advanced settings",IDC_STATIC,7,154,214,132
     LTEXT           "Schema:",IDC_STATIC,12,170,63,8
     LTEXT           "Login Timeout:",IDC_STATIC,12,186,63,8
     LTEXT           "Reply Timeout:",IDC_STATIC,12,202,63,8
@@ -131,30 +131,28 @@ BEGIN
     LTEXT           "Autocommit on/off:",IDC_STATIC,12,234,63,8
     LTEXT           "Time Zone:",IDC_STATIC,12,250,63,8
     LTEXT           "Log File:",IDC_STATIC,12,266,63,8
-    EDITTEXT        IDC_EDIT_SCHEMA,95,168,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_LOGINTIMEOUT,95,184,32,14,ES_AUTOHSCROLL | 
ES_NUMBER
-    EDITTEXT        IDC_EDIT_REPLYTIMEOUT,95,200,32,14,ES_AUTOHSCROLL | 
ES_NUMBER
-    EDITTEXT        IDC_EDIT_REPLYSIZE,95,216,32,14,ES_AUTOHSCROLL | ES_NUMBER
-    EDITTEXT        IDC_EDIT_AUTOCOMMIT,95,232,10,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_TIMEZONE,95,248,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_LOGFILE,95,264,128,14,ES_AUTOHSCROLL
-    GROUPBOX        "Secure Connection",IDC_STATIC,7,298,216,96
-    LTEXT           "TLS Encrypt on/off:",IDC_STATIC,12,314,66,8
-    LTEXT           "Server Certificate:",IDC_STATIC,12,330,66,8
-    LTEXT           "Server Cert. Hash:",IDC_STATIC,12,346,70,8
-    LTEXT           "Client Key:",IDC_STATIC,12,362,63,8
-    LTEXT           "Client Certificate:",IDC_STATIC,12,388,66,8
-    EDITTEXT        IDC_EDIT_USETLS,95,312,10,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_SERVERCERT,95,328,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_SERVERCERTHASH,95,344,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_CLIENTKEY,95,360,128,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_CLIENTCERT,95,376,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_SCHEMA,80,168,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_LOGINTIMEOUT,80,184,32,14,ES_AUTOHSCROLL | 
ES_NUMBER
+    EDITTEXT        IDC_EDIT_REPLYTIMEOUT,80,200,32,14,ES_AUTOHSCROLL | 
ES_NUMBER
+    EDITTEXT        IDC_EDIT_REPLYSIZE,80,216,32,14,ES_AUTOHSCROLL | ES_NUMBER
+    EDITTEXT        IDC_EDIT_AUTOCOMMIT,80,232,24,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_TIMEZONE,80,248,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_LOGFILE,80,264,128,14,ES_AUTOHSCROLL
+    GROUPBOX        "Secure Connection",IDC_STATIC,7,288,214,100
+    LTEXT           "TLS Encrypt on/off:",IDC_STATIC,12,304,66,8
+    LTEXT           "Server Certificate:",IDC_STATIC,12,320,66,8
+    LTEXT           "Server Cert. Hash:",IDC_STATIC,12,336,70,8
+    LTEXT           "Client Key:",IDC_STATIC,12,352,63,8
+    LTEXT           "Client Certificate:",IDC_STATIC,12,368,66,8
+    EDITTEXT        IDC_EDIT_USETLS,80,302,24,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_SERVERCERT,80,318,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_SERVERCERTHASH,80,334,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_CLIENTKEY,80,350,128,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_CLIENTCERT,80,366,128,14,ES_AUTOHSCROLL
     DEFPUSHBUTTON   "OK",IDOK,7,397,50,14
     PUSHBUTTON      "Cancel",IDCANCEL,62,397,50,14
-//    PUSHBUTTON      "Test",IDC_TEST,117,397,50,14
-    PUSHBUTTON      "Test",IDOK,117,397,50,14
-//    PUSHBUTTON      "Help",IDC_HELP,172,397,50,14
-    PUSHBUTTON      "Help",IDOK,172,397,50,14
+    PUSHBUTTON      "Test",IDC_BUTTON_TEST,117,397,50,14
+    PUSHBUTTON      "Help",IDC_BUTTON_HELP,172,397,50,14
     CONTROL         2000,IDC_STATIC,"Static",SS_BITMAP,0,0,240,37
 END
 
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to