MySQL 8.3.0
Source Code Documentation
authentication_kerberos_clientopt-vars.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 2023, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23/**
24 @file include/authentication_kerberos_clientopt-vars.h
25*/
26
27#ifndef AUTHETICATION_KERBEROS_CLIENTOPT_VARS_H
28#define AUTHETICATION_KERBEROS_CLIENTOPT_VARS_H
29
30#if defined(_WIN32)
31#include "m_string.h"
32#include "mysql.h"
33#include "template_utils.h"
34#include "typelib.h"
35
36#include <cstdio>
37
38using std::snprintf;
39
40const char *client_mode_names_lib[] = {"SSPI", "GSSAPI", NullS};
41
42TYPELIB client_mode_typelib = {array_elements(client_mode_names_lib) - 1, "",
43 client_mode_names_lib, nullptr};
44
45static int opt_authentication_kerberos_client_mode = 0;
46
47static int set_authentication_kerberos_client_mode(MYSQL *mysql, char *error,
48 size_t error_size) {
49 if (opt_authentication_kerberos_client_mode == 1) {
50 struct st_mysql_client_plugin *kerberos_client_plugin =
51 mysql_client_find_plugin(mysql, "authentication_kerberos_client",
53 if (!kerberos_client_plugin) {
54 snprintf(error, error_size,
55 "Failed to load plugin authentication_kerberos_client.");
56 return 1;
57 }
58
60 kerberos_client_plugin,
61 "plugin_authentication_kerberos_client_mode",
62 client_mode_names_lib[opt_authentication_kerberos_client_mode])) {
63 snprintf(error, error_size,
64 "Failed to set value '%s' for "
65 "--plugin-authentication-kerberos-client-mode",
66 client_mode_names_lib[opt_authentication_kerberos_client_mode]);
67 return 1;
68 }
69 }
70 return 0;
71}
72#endif /* _WIN32 */
73
74#endif // !AUTHETICATION_KERBEROS_CLIENTOPT_VARS_H
int mysql_plugin_options(struct st_mysql_client_plugin *plugin, const char *option, const void *value)
set plugin options
Definition: client_plugin.cc:596
struct st_mysql_client_plugin * mysql_client_find_plugin(struct MYSQL *mysql, const char *name, int type)
finds an already loaded plugin by name, or loads it, if necessary
Definition: client_plugin.cc:569
#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN
Definition: client_plugin.h:79
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
Definition: instrumented_condition_variable.h:31
#define NullS
Definition of the null string (a null pointer of type char *), used in some of our string handling co...
Definition: nulls.h:32
Definition: mysql.h:297
Definition: typelib.h:34
Definition: client_plugin.h:113
#define array_elements(A)
Definition: validate_password_imp.cc:47