bfc9e5fea7cdeda433effdeb36b2c43a64698006 max Mon Aug 28 12:11:04 2023 +0200 trying to work around mysql8/mariadb differences, email from Glenn Hickey and Mark diff --git src/hg/lib/jksql.c src/hg/lib/jksql.c index 99bacfd..d6c39d2 100644 --- src/hg/lib/jksql.c +++ src/hg/lib/jksql.c @@ -1106,31 +1106,35 @@ long oldTime = monitorEnterTime; monitorEnterTime = 0; monitorEnter(); if ((sc->conn = conn = mysql_init(NULL)) == NULL) // no need for monitorLeave here errAbort("Couldn't connect to mySQL."); // Fix problem where client LOCAL setting is disabled by default for security mysql_options(conn, MYSQL_OPT_LOCAL_INFILE, NULL); // Boolean option to tell client to verify that the host server certificate Subject CN equals the hostname. // If turned on this can defeat Man-In-The-Middle attacks. if (sp->verifyServerCert && !sameString(sp->verifyServerCert,"0")) { + #if MYSQL_VERSION_ID < 80000 my_bool flag = TRUE; + #else + bool flag = TRUE; + #endif mysql_options(conn, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &flag); } #if (MYSQL_VERSION_ID >= 50603) // mysql version "5.6.3" // If certificate revocation list file provided, set mysql option if (sp->crl) mysql_options(conn, MYSQL_OPT_SSL_CRL, &sp->crl); // If path to directory with crl files provided, set mysql option if (sp->crlPath) mysql_options(conn, MYSQL_OPT_SSL_CRLPATH, &sp->crlPath); #endif if (sp->key || sp->cert || sp->ca || sp->caPath || sp->cipher) mysql_ssl_set(conn, sp->key, sp->cert, sp->ca, sp->caPath, sp->cipher);