Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5fa48d6c
Commit
5fa48d6c
authored
Aug 22, 2024
by
Nikita Malyavin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow plugins to set flags
parent
ad17a89e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
109 additions
and
10 deletions
+109
-10
include/mysql/plugin.h
include/mysql/plugin.h
+18
-0
include/mysql/plugin_audit.h.pp
include/mysql/plugin_audit.h.pp
+11
-1
include/mysql/plugin_auth.h.pp
include/mysql/plugin_auth.h.pp
+11
-1
include/mysql/plugin_data_type.h.pp
include/mysql/plugin_data_type.h.pp
+11
-1
include/mysql/plugin_encryption.h.pp
include/mysql/plugin_encryption.h.pp
+11
-1
include/mysql/plugin_ftparser.h.pp
include/mysql/plugin_ftparser.h.pp
+11
-1
include/mysql/plugin_function.h.pp
include/mysql/plugin_function.h.pp
+11
-1
include/mysql/plugin_password_validation.h.pp
include/mysql/plugin_password_validation.h.pp
+11
-1
plugin/auth_parsec/server_parsec.cc
plugin/auth_parsec/server_parsec.cc
+1
-1
sql/sql_acl.cc
sql/sql_acl.cc
+13
-2
No files found.
include/mysql/plugin.h
View file @
5fa48d6c
...
@@ -98,6 +98,9 @@ typedef struct st_mysql_xid MYSQL_XID;
...
@@ -98,6 +98,9 @@ typedef struct st_mysql_xid MYSQL_XID;
#define MYSQL_AUTHENTICATION_PLUGIN 7
#define MYSQL_AUTHENTICATION_PLUGIN 7
#define MYSQL_MAX_PLUGIN_TYPE_NUM 12
/**< The number of plugin types */
#define MYSQL_MAX_PLUGIN_TYPE_NUM 12
/**< The number of plugin types */
#define MYSQL_PLUGIN_TYPE_MASK ((1<<16)-1)
#define MYSQL_AUTH_CAN_BE_DEFAULT (1<<16)
/* MariaDB plugin types */
/* MariaDB plugin types */
/** Client and server password validation */
/** Client and server password validation */
#define MariaDB_PASSWORD_VALIDATION_PLUGIN 8
#define MariaDB_PASSWORD_VALIDATION_PLUGIN 8
...
@@ -565,7 +568,22 @@ struct st_mysql_plugin
...
@@ -565,7 +568,22 @@ struct st_mysql_plugin
struct
st_maria_plugin
struct
st_maria_plugin
{
{
#ifdef __cplusplus
struct
alignas
(
sizeof
(
int
))
auth_type_t
{
int
raw_version
;
auth_type_t
()
=
default
;
auth_type_t
(
int
version
)
:
raw_version
(
version
){}
operator
int
()
const
{
return
raw_version
&
MYSQL_PLUGIN_TYPE_MASK
;
}
int
flags
()
const
{
return
raw_version
&
~
MYSQL_PLUGIN_TYPE_MASK
;
}
};
auth_type_t
type
;
/**< the plugin type (a MYSQL_XXX_PLUGIN value) */
#else
int
type
;
/**< the plugin type (a MYSQL_XXX_PLUGIN value) */
int
type
;
/**< the plugin type (a MYSQL_XXX_PLUGIN value) */
#endif
void
*
info
;
/**< pointer to type-specific plugin descriptor */
void
*
info
;
/**< pointer to type-specific plugin descriptor */
const
char
*
name
;
/**< plugin name */
const
char
*
name
;
/**< plugin name */
const
char
*
author
;
/**< plugin author (for SHOW PLUGINS) */
const
char
*
author
;
/**< plugin author (for SHOW PLUGINS) */
...
...
include/mysql/plugin_audit.h.pp
View file @
5fa48d6c
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
};
};
struct
st_maria_plugin
struct
st_maria_plugin
{
{
int
type
;
struct
alignas
(
sizeof
(
int
))
auth_type_t
{
int
raw_version
;
auth_type_t
()
=
default
;
auth_type_t
(
int
version
):
raw_version
(
version
){}
operator
int
()
const
{
return
raw_version
&
((
1
<<
16
)
-
1
);
}
int
flags
()
const
{
return
raw_version
&
~
((
1
<<
16
)
-
1
);
}
};
auth_type_t
type
;
void
*
info
;
void
*
info
;
const
char
*
name
;
const
char
*
name
;
const
char
*
author
;
const
char
*
author
;
...
...
include/mysql/plugin_auth.h.pp
View file @
5fa48d6c
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
};
};
struct
st_maria_plugin
struct
st_maria_plugin
{
{
int
type
;
struct
alignas
(
sizeof
(
int
))
auth_type_t
{
int
raw_version
;
auth_type_t
()
=
default
;
auth_type_t
(
int
version
):
raw_version
(
version
){}
operator
int
()
const
{
return
raw_version
&
((
1
<<
16
)
-
1
);
}
int
flags
()
const
{
return
raw_version
&
~
((
1
<<
16
)
-
1
);
}
};
auth_type_t
type
;
void
*
info
;
void
*
info
;
const
char
*
name
;
const
char
*
name
;
const
char
*
author
;
const
char
*
author
;
...
...
include/mysql/plugin_data_type.h.pp
View file @
5fa48d6c
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
};
};
struct
st_maria_plugin
struct
st_maria_plugin
{
{
int
type
;
struct
alignas
(
sizeof
(
int
))
auth_type_t
{
int
raw_version
;
auth_type_t
()
=
default
;
auth_type_t
(
int
version
):
raw_version
(
version
){}
operator
int
()
const
{
return
raw_version
&
((
1
<<
16
)
-
1
);
}
int
flags
()
const
{
return
raw_version
&
~
((
1
<<
16
)
-
1
);
}
};
auth_type_t
type
;
void
*
info
;
void
*
info
;
const
char
*
name
;
const
char
*
name
;
const
char
*
author
;
const
char
*
author
;
...
...
include/mysql/plugin_encryption.h.pp
View file @
5fa48d6c
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
};
};
struct
st_maria_plugin
struct
st_maria_plugin
{
{
int
type
;
struct
alignas
(
sizeof
(
int
))
auth_type_t
{
int
raw_version
;
auth_type_t
()
=
default
;
auth_type_t
(
int
version
):
raw_version
(
version
){}
operator
int
()
const
{
return
raw_version
&
((
1
<<
16
)
-
1
);
}
int
flags
()
const
{
return
raw_version
&
~
((
1
<<
16
)
-
1
);
}
};
auth_type_t
type
;
void
*
info
;
void
*
info
;
const
char
*
name
;
const
char
*
name
;
const
char
*
author
;
const
char
*
author
;
...
...
include/mysql/plugin_ftparser.h.pp
View file @
5fa48d6c
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
};
};
struct
st_maria_plugin
struct
st_maria_plugin
{
{
int
type
;
struct
alignas
(
sizeof
(
int
))
auth_type_t
{
int
raw_version
;
auth_type_t
()
=
default
;
auth_type_t
(
int
version
):
raw_version
(
version
){}
operator
int
()
const
{
return
raw_version
&
((
1
<<
16
)
-
1
);
}
int
flags
()
const
{
return
raw_version
&
~
((
1
<<
16
)
-
1
);
}
};
auth_type_t
type
;
void
*
info
;
void
*
info
;
const
char
*
name
;
const
char
*
name
;
const
char
*
author
;
const
char
*
author
;
...
...
include/mysql/plugin_function.h.pp
View file @
5fa48d6c
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
};
};
struct
st_maria_plugin
struct
st_maria_plugin
{
{
int
type
;
struct
alignas
(
sizeof
(
int
))
auth_type_t
{
int
raw_version
;
auth_type_t
()
=
default
;
auth_type_t
(
int
version
):
raw_version
(
version
){}
operator
int
()
const
{
return
raw_version
&
((
1
<<
16
)
-
1
);
}
int
flags
()
const
{
return
raw_version
&
~
((
1
<<
16
)
-
1
);
}
};
auth_type_t
type
;
void
*
info
;
void
*
info
;
const
char
*
name
;
const
char
*
name
;
const
char
*
author
;
const
char
*
author
;
...
...
include/mysql/plugin_password_validation.h.pp
View file @
5fa48d6c
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
...
@@ -569,7 +569,17 @@ struct st_mysql_plugin
};
};
struct
st_maria_plugin
struct
st_maria_plugin
{
{
int
type
;
struct
alignas
(
sizeof
(
int
))
auth_type_t
{
int
raw_version
;
auth_type_t
()
=
default
;
auth_type_t
(
int
version
):
raw_version
(
version
){}
operator
int
()
const
{
return
raw_version
&
((
1
<<
16
)
-
1
);
}
int
flags
()
const
{
return
raw_version
&
~
((
1
<<
16
)
-
1
);
}
};
auth_type_t
type
;
void
*
info
;
void
*
info
;
const
char
*
name
;
const
char
*
name
;
const
char
*
author
;
const
char
*
author
;
...
...
plugin/auth_parsec/server_parsec.cc
View file @
5fa48d6c
...
@@ -294,7 +294,7 @@ static struct st_mysql_auth info =
...
@@ -294,7 +294,7 @@ static struct st_mysql_auth info =
maria_declare_plugin
(
auth_parsec
)
maria_declare_plugin
(
auth_parsec
)
{
{
MYSQL_AUTHENTICATION_PLUGIN
,
MYSQL_AUTHENTICATION_PLUGIN
|
MYSQL_AUTH_CAN_BE_DEFAULT
,
&
info
,
&
info
,
"parsec"
,
"parsec"
,
"Nikita Maliavin"
,
"Nikita Maliavin"
,
...
...
sql/sql_acl.cc
View file @
5fa48d6c
...
@@ -2549,6 +2549,15 @@ bool acl_init(bool dont_read_acl_tables)
...
@@ -2549,6 +2549,15 @@ bool acl_init(bool dont_read_acl_tables)
if
(
!
native_password_plugin
||
!
old_password_plugin
||
!
default_auth_plugin
)
if
(
!
native_password_plugin
||
!
old_password_plugin
||
!
default_auth_plugin
)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
st_plugin_int
*
default_auth_int
=
plugin_ref_to_int
(
default_auth_plugin
);
if
(
!
(
default_auth_int
->
plugin
->
type
.
flags
()
&
MYSQL_AUTH_CAN_BE_DEFAULT
))
{
sql_print_error
(
"Error: plugin %s cannot be set as default."
,
default_auth_int
->
name
.
str
);
DBUG_RETURN
(
1
);
}
if
(
dont_read_acl_tables
)
if
(
dont_read_acl_tables
)
{
{
DBUG_RETURN
(
0
);
/* purecov: tested */
DBUG_RETURN
(
0
);
/* purecov: tested */
...
@@ -15362,7 +15371,8 @@ static struct st_mysql_auth old_password_handler=
...
@@ -15362,7 +15371,8 @@ static struct st_mysql_auth old_password_handler=
maria_declare_plugin
(
mysql_password
)
maria_declare_plugin
(
mysql_password
)
{
{
MYSQL_AUTHENTICATION_PLUGIN
,
/* type constant */
MYSQL_AUTHENTICATION_PLUGIN
|
MYSQL_AUTH_CAN_BE_DEFAULT
,
/* type constant */
&
native_password_handler
,
/* type descriptor */
&
native_password_handler
,
/* type descriptor */
native_password_plugin_name
.
str
,
/* Name */
native_password_plugin_name
.
str
,
/* Name */
"R.J.Silk, Sergei Golubchik"
,
/* Author */
"R.J.Silk, Sergei Golubchik"
,
/* Author */
...
@@ -15377,7 +15387,8 @@ maria_declare_plugin(mysql_password)
...
@@ -15377,7 +15387,8 @@ maria_declare_plugin(mysql_password)
MariaDB_PLUGIN_MATURITY_STABLE
/* Maturity */
MariaDB_PLUGIN_MATURITY_STABLE
/* Maturity */
},
},
{
{
MYSQL_AUTHENTICATION_PLUGIN
,
/* type constant */
MYSQL_AUTHENTICATION_PLUGIN
|
MYSQL_AUTH_CAN_BE_DEFAULT
,
/* type constant */
&
old_password_handler
,
/* type descriptor */
&
old_password_handler
,
/* type descriptor */
old_password_plugin_name
.
str
,
/* Name */
old_password_plugin_name
.
str
,
/* Name */
"R.J.Silk, Sergei Golubchik"
,
/* Author */
"R.J.Silk, Sergei Golubchik"
,
/* Author */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment