]> granicus.if.org Git - php/commitdiff
support for password expiration in mysqlnd, through a flag
authorAndrey Hristov <andrey@php.net>
Wed, 9 Jan 2013 14:33:07 +0000 (15:33 +0100)
committerAndrey Hristov <andrey@php.net>
Wed, 9 Jan 2013 14:33:07 +0000 (15:33 +0100)
ext/mysqlnd/mysqlnd.c
ext/mysqlnd/mysqlnd_enum_n_def.h

index 653561eaec2cca9e3672ff6570666488f51a8001..b9db94b9df63ef9ca1ff8e86f31ca961d40629ed 100644 (file)
@@ -2282,7 +2282,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
                        break;
 #endif
                case MYSQL_OPT_LOCAL_INFILE:
-                       if (!value || (*(unsigned int*) value) ? 1 : 0) {
+                       if (value && (*(unsigned int*) value) ? 1 : 0) {
                                conn->options->flags |= CLIENT_LOCAL_FILES;
                        } else {
                                conn->options->flags &= ~CLIENT_LOCAL_FILES;
@@ -2366,6 +2366,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
                        DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol);
                        break;
                }
+               case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS:
+                       if (value && (*(unsigned int*) value) ? 1 : 0) {
+                               conn->options->flags |= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
+                       } else {
+                               conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
+                       }
+                       break;
 #ifdef WHEN_SUPPORTED_BY_MYSQLI
                case MYSQL_SHARED_MEMORY_BASE_NAME:
                case MYSQL_OPT_USE_RESULT:
index 7dd4d0fb8f5f24e470bdf889a5826261b0c80c80..abaaf1f43e30e49c551c5b15be5f4c11a22dddea 100644 (file)
@@ -169,6 +169,8 @@ typedef enum mysqlnd_option
        MYSQL_PLUGIN_DIR,
        MYSQL_DEFAULT_AUTH,
        MYSQL_SERVER_PUBLIC_KEY,
+       MYSQL_ENABLE_CLEARTEXT_PLUGIN,
+       MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
        MYSQLND_DEPRECATED_ENUM1 = 200,
 #ifdef MYSQLND_STRING_TO_INT_CONVERSION
        MYSQLND_OPT_INT_AND_FLOAT_NATIVE = 201,