Changeset: acc24cd4639d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/acc24cd4639d Modified Files: MonetDB.spec clients/odbc/winsetup/setup.rc sql/backends/monet5/sql.c Branch: default Log Message:
merged with aug2024 diffs (truncated from 2480 to 300 lines): diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -44,6 +44,7 @@ GPATH GRTAGS TAGS tags +cscope.* *.pyo *.rej *.orig diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,8 +118,14 @@ if(WIN32) ${CMAKE_CURRENT_BINARY_DIR}/unistd.h) endif() -add_library(monetdb_config_header - INTERFACE) +add_library(monetdb_config_header INTERFACE) + +if (CTAGS_PATH) + add_dependencies(monetdb_config_header tags) +endif() +if (CSCOPE_PATH) + add_dependencies(monetdb_config_header cscope) +endif() target_include_directories(monetdb_config_header INTERFACE diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -417,6 +417,7 @@ developer. %{_bindir}/arraytest %{_bindir}/bincopydata %{_bindir}/murltest +%{_bindir}/odbcconnect %{_bindir}/odbcsample1 %{_bindir}/sample0 %{_bindir}/sample1 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 @@ -24,21 +24,21 @@ #define IDC_EDIT_PORT 2006 #define IDC_EDIT_DATABASE 2007 -// Advanced settings (new from Jun2024) -#define IDC_EDIT_SCHEMA 2011 -#define IDC_EDIT_LOGINTIMEOUT 2012 -#define IDC_EDIT_REPLYTIMEOUT 2013 -#define IDC_EDIT_REPLYSIZE 2014 -#define IDC_EDIT_AUTOCOMMIT 2015 -#define IDC_EDIT_TIMEZONE 2016 -#define IDC_EDIT_LOGFILE 2017 +// Secure connections using TLS +#define IDC_EDIT_USETLS 2011 +#define IDC_EDIT_SERVERCERT 2012 +#define IDC_EDIT_SERVERCERTHASH 2013 +#define IDC_EDIT_CLIENTKEY 2014 +#define IDC_EDIT_CLIENTCERT 2015 -// Secure connections using TLS -#define IDC_EDIT_USETLS 2021 -#define IDC_EDIT_SERVERCERT 2022 -#define IDC_EDIT_SERVERCERTHASH 2023 -#define IDC_EDIT_CLIENTKEY 2024 -#define IDC_EDIT_CLIENTCERT 2025 +// Advanced settings +#define IDC_EDIT_SCHEMA 2021 +#define IDC_EDIT_LOGINTIMEOUT 2022 +#define IDC_EDIT_REPLYTIMEOUT 2023 +#define IDC_EDIT_REPLYSIZE 2024 +#define IDC_EDIT_AUTOCOMMIT 2025 +#define IDC_EDIT_TIMEZONE 2026 +#define IDC_EDIT_LOGFILE 2027 #define IDC_BUTTON_TEST 2031 #define IDC_BUTTON_HELP 2032 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 @@ -154,6 +154,13 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR SetDlgItemText(hwndDlg, IDC_EDIT_HOST, datap->host ? datap->host : ""); SetDlgItemText(hwndDlg, IDC_EDIT_PORT, datap->port ? datap->port : ""); SetDlgItemText(hwndDlg, IDC_EDIT_DATABASE, datap->database ? datap->database : ""); + // Secure connections using TLS + SetDlgItemText(hwndDlg, IDC_EDIT_USETLS, datap->use_tls ? datap->use_tls : "off"); + SetDlgItemText(hwndDlg, IDC_EDIT_SERVERCERT, datap->servercert ? datap->servercert : ""); + SetDlgItemText(hwndDlg, IDC_EDIT_SERVERCERTHASH, datap->servercerthash ? datap->servercerthash : ""); + SetDlgItemText(hwndDlg, IDC_EDIT_CLIENTKEY, datap->clientkey ? datap->clientkey : ""); + SetDlgItemText(hwndDlg, IDC_EDIT_CLIENTCERT, datap->clientcert ? datap->clientcert : ""); + // Advanced settings SetDlgItemText(hwndDlg, IDC_EDIT_SCHEMA, datap->schema ? datap->schema : ""); SetDlgItemText(hwndDlg, IDC_EDIT_LOGINTIMEOUT, datap->logintimeout ? datap->logintimeout : ""); SetDlgItemText(hwndDlg, IDC_EDIT_REPLYTIMEOUT, datap->replytimeout ? datap->replytimeout : ""); @@ -161,11 +168,6 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR SetDlgItemText(hwndDlg, IDC_EDIT_AUTOCOMMIT, datap->autocommit ? datap->autocommit : "on"); SetDlgItemText(hwndDlg, IDC_EDIT_TIMEZONE, datap->timezone ? datap->timezone : ""); SetDlgItemText(hwndDlg, IDC_EDIT_LOGFILE, datap->logfile ? datap->logfile : ""); - SetDlgItemText(hwndDlg, IDC_EDIT_USETLS, datap->use_tls ? datap->use_tls : "off"); - SetDlgItemText(hwndDlg, IDC_EDIT_SERVERCERT, datap->servercert ? datap->servercert : ""); - SetDlgItemText(hwndDlg, IDC_EDIT_SERVERCERTHASH, datap->servercerthash ? datap->servercerthash : ""); - SetDlgItemText(hwndDlg, IDC_EDIT_CLIENTKEY, datap->clientkey ? datap->clientkey : ""); - SetDlgItemText(hwndDlg, IDC_EDIT_CLIENTCERT, datap->clientcert ? datap->clientcert : ""); if (datap->request == ODBC_ADD_DSN && datap->dsn && *datap->dsn) EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_DSN), FALSE); return TRUE; @@ -220,6 +222,28 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR if (datap->database) free(datap->database); datap->database = strdup(buf); + // Secure connections using TLS + GetDlgItemText(hwndDlg, IDC_EDIT_USETLS, buf, sizeof(buf)); + if (datap->use_tls) + free(datap->use_tls); + datap->use_tls = strdup(buf); + GetDlgItemText(hwndDlg, IDC_EDIT_SERVERCERT, buf, sizeof(buf)); + if (datap->servercert) + free(datap->servercert); + datap->servercert = strdup(buf); + GetDlgItemText(hwndDlg, IDC_EDIT_SERVERCERTHASH, buf, sizeof(buf)); + if (datap->servercerthash) + free(datap->servercerthash); + datap->servercerthash = strdup(buf); + GetDlgItemText(hwndDlg, IDC_EDIT_CLIENTKEY, buf, sizeof(buf)); + if (datap->clientkey) + free(datap->clientkey); + datap->clientkey = strdup(buf); + GetDlgItemText(hwndDlg, IDC_EDIT_CLIENTCERT, buf, sizeof(buf)); + if (datap->clientcert) + free(datap->clientcert); + datap->clientcert = strdup(buf); + // Advanced settings GetDlgItemText(hwndDlg, IDC_EDIT_SCHEMA, buf, sizeof(buf)); if (datap->schema) free(datap->schema); @@ -248,26 +272,6 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR if (datap->logfile) free(datap->logfile); datap->logfile = strdup(buf); - GetDlgItemText(hwndDlg, IDC_EDIT_USETLS, buf, sizeof(buf)); - if (datap->use_tls) - free(datap->use_tls); - datap->use_tls = strdup(buf); - GetDlgItemText(hwndDlg, IDC_EDIT_SERVERCERT, buf, sizeof(buf)); - if (datap->servercert) - free(datap->servercert); - datap->servercert = strdup(buf); - GetDlgItemText(hwndDlg, IDC_EDIT_SERVERCERTHASH, buf, sizeof(buf)); - if (datap->servercerthash) - free(datap->servercerthash); - datap->servercerthash = strdup(buf); - GetDlgItemText(hwndDlg, IDC_EDIT_CLIENTKEY, buf, sizeof(buf)); - if (datap->clientkey) - free(datap->clientkey); - datap->clientkey = strdup(buf); - GetDlgItemText(hwndDlg, IDC_EDIT_CLIENTCERT, buf, sizeof(buf)); - if (datap->clientcert) - free(datap->clientcert); - datap->clientcert = strdup(buf); /* fall through */ case IDCANCEL: EndDialog(hwndDlg, LOWORD(wParam)); @@ -359,6 +363,16 @@ ConfigDSN(HWND parent, WORD request, LPC data.port = strdup(value); else if (strncasecmp("Database=", attributes, value - attributes) == 0) data.database = strdup(value); + else if (strncasecmp("TLS=", attributes, value - attributes) == 0) + data.use_tls = strdup(value); + else if (strncasecmp("Cert=", attributes, value - attributes) == 0) + data.servercert = strdup(value); + else if (strncasecmp("CertHash=", attributes, value - attributes) == 0) + data.servercerthash = strdup(value); + else if (strncasecmp("ClientKey=", attributes, value - attributes) == 0) + data.clientkey = strdup(value); + else if (strncasecmp("ClientCert=", attributes, value - attributes) == 0) + data.clientcert = strdup(value); else if (strncasecmp("Schema=", attributes, value - attributes) == 0) data.schema = strdup(value); else if (strncasecmp("LoginTimeout=", attributes, value - attributes) == 0) @@ -373,16 +387,6 @@ ConfigDSN(HWND parent, WORD request, LPC data.timezone = strdup(value); else if (strncasecmp("LogFile=", attributes, value - attributes) == 0) data.logfile = strdup(value); - else if (strncasecmp("TLS=", attributes, value - attributes) == 0) - data.use_tls = strdup(value); - else if (strncasecmp("Cert=", attributes, value - attributes) == 0) - data.servercert = strdup(value); - else if (strncasecmp("CertHash=", attributes, value - attributes) == 0) - data.servercerthash = strdup(value); - else if (strncasecmp("ClientKey=", attributes, value - attributes) == 0) - data.clientkey = strdup(value); - else if (strncasecmp("ClientCert=", attributes, value - attributes) == 0) - data.clientcert = strdup(value); attributes = value + strlen(value) + 1; } @@ -402,6 +406,11 @@ ConfigDSN(HWND parent, WORD request, LPC 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.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.schema, "Schema", ""); MergeFromProfileString(data.dsn, &data.logintimeout, "LoginTimeout", ""); MergeFromProfileString(data.dsn, &data.replytimeout, "ReplyTimeout", ""); @@ -409,11 +418,6 @@ ConfigDSN(HWND parent, WORD request, LPC 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 TLSs=%s Cert=%s CertHash=%s ClientKey=%s ClientCert=%s\n", data.dsn ? data.dsn : "(null)", @@ -530,18 +534,18 @@ ConfigDSN(HWND parent, WORD request, LPC } if (!SQLWritePrivateProfileString(data.dsn, "Description", data.desc, "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") || !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")) { + || !SQLWritePrivateProfileString(data.dsn, "LogFile", data.logfile, "odbc.ini")) { if (parent) MessageBox(parent, "Error writing optional configuration data to registry", NULL, MB_ICONERROR); goto finish; @@ -562,6 +566,16 @@ ConfigDSN(HWND parent, WORD request, LPC free(data.port); if (data.database) free(data.database); + if (data.use_tls) + free(data.use_tls); + if (data.servercert) + free(data.servercert); + if (data.servercerthash) + free(data.servercerthash); + if (data.clientkey) + free(data.clientkey); + if (data.clientcert) + free(data.clientcert); if (data.schema) free(data.schema); if (data.logintimeout) @@ -576,16 +590,6 @@ ConfigDSN(HWND parent, WORD request, LPC free(data.timezone); if (data.logfile) free(data.logfile); - if (data.use_tls) - free(data.use_tls); - if (data.servercert) - free(data.servercert); - if (data.servercerthash) - free(data.servercerthash); - if (data.clientkey) - free(data.clientkey); - if (data.clientcert) - free(data.clientcert); ODBCLOG("ConfigDSN returning %s\n", rc ? "TRUE" : "FALSE"); return rc; 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 @@ -109,13 +109,6 @@ STYLE DS_MODALFRAME | WS_CAPTION CAPTION "MonetDB ODBC Data Source Setup" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - EDITTEXT IDC_EDIT_DSN,80,40,134,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_DESC,80,56,134,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_UID,80,72,134,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_PWD,80,88,134,14,ES_AUTOHSCROLL | ES_PASSWORD - EDITTEXT IDC_EDIT_HOST,80,104,134,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_PORT,80,120,32,14,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_EDIT_DATABASE,80,136,134,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 _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org