From: Andrey Hristov Date: Wed, 9 Jan 2013 14:33:07 +0000 (+0100) Subject: support for password expiration in mysqlnd, through a flag X-Git-Tag: php-5.5.0alpha4~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ddcb67d446ba7a0637fdf3a52bdaaaa99ee80755;p=php support for password expiration in mysqlnd, through a flag --- diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 653561eaec..b9db94b9df 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -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: diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 7dd4d0fb8f..abaaf1f43e 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -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,