summaryrefslogtreecommitdiff
path: root/plugin/auth_gssapi
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-26715 Windows/installer - allow passwordless login for rootVladislav Vaintroub2022-11-0810-33/+14
| | | | | | | | | | | | Allow passwordless login in addition to usual login with password, when creating 'root' user during install. The effect of that change is that "local administrators" group are allowed to connect as root user. This is done via gssapi authentication plugin. Clients that are not aware of gssapi client plugin, can still login with password credentials.
* update C/C, fix srpm build failures on fedoraSergei Golubchik2022-09-261-0/+1
| | | | | | | | | | | | krb5-config (used by FindGSSAPI) returns `-lkrb5 -lk5crypto -lcom_err` but only libkrb5 is actually used by the gssapi plugin. The other two result in unneeded dependencies unless they're tagged optional when linked with --as-needed. Some distributions use --as-needed automatically, which causes our builds to differ from srpm builds, introducing failures in buildbot. Let's always use --as-needed for gssapi plugin
* Merge 10.5 into 10.6Marko Mäkelä2021-11-291-0/+6
|\
| * Merge 10.4 into 10.5Marko Mäkelä2021-11-291-0/+6
| |\
| | * Merge 10.3 into 10.4Marko Mäkelä2021-11-291-0/+6
| | |\
| | | * Merge 10.2 into 10.3Marko Mäkelä2021-11-291-0/+6
| | | |\
| | | | * MDEV-22522 RPM packages have meaningless summary/descriptionbb-10.2-MDEV-22522Alexey Bychko2021-11-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | this patch moves cpack summury and description for optional packages to the appropriate CMakeLists.txt files
* | | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2021-08-021-0/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.4' into 10.5Oleksandr Byelkin2021-07-311-0/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2021-07-311-0/+1
| | |\ \ \ | | | |/ /
| | | * | Merge 10.2 into 10.3Marko Mäkelä2021-07-221-0/+1
| | | |\ \ | | | | |/
| | | | * Add feature summary at the end of cmake.Heinz Wiesinger2021-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives a short overview over found/missing dependencies as well as enabled/disabled features. Initial author Heinz Wiesinger <heinz@m2mobi.com> Additions by Vicențiu Ciorbaru <vicentiu@mariadb.org> * Report all plugins enabled via MYSQL_ADD_PLUGIN * Simplify code. Eliminate duplication by making use of WITH_xxx variable values to set feature "ON" / "OFF" state. Reviewed by: wlad@mariadb.com (code details) serg@mariadb.com (the idea)
* | | | | MDEV-23959 GSSAPI plugin - support AD or local group name , and SIDs on WindowsVladislav Vaintroub2021-01-275-45/+294
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support membership tests in SSPI with special prefix form CREATE USER u IDENTIFIED WITH gssapi AS "GROUP:<group_name>" or CREATE USER u IDENTIFIED WITH gssapi AS "SID:<sid>" If user is created as one of the above, after successful SSPI handshake, this will happen 1) If "GROUP:" prefix is used, then <group_name> is translated to SID using LookupAccountName() API 2) SSPI user is checked for SID membership with ImpersonateSecurityContext() and CheckMembership() APIs Note, that it <group>/<sid> do not need strictly to refer to an actual group. Identity test is also supported, e.g "GROUP:<users_name>" or "SID:<user_sid>" will work too. Well-known SIDs (in SDDL syntax) appear to be supported such as "SID:WD" will refer to World/Everyone (== "SID:S-1-1-0") or "SID:BA" will refer to Administrators (== "SID:S-1-5-32-544") In UAC environments, for successful checks against Administrators group, elevation(Run As Administrator) might be necessary, since CheckMembership() needs groups to be marked as enabled in the token group list.
* | | | Merge 10.4 into 10.5Marko Mäkelä2021-01-251-1/+1
|\ \ \ \ | |/ / /
| * | | MDEV-24577: Fix warnings generated during compilation of ↵Dmitry Shulga2021-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | plugin/auth_pam/testing/pam_mariadb_mtr.c on FreeBSD Compiler warnings generated on building MariaDB server for BSD has the same reason as in case building is performed on MacOS. Both platforms do use clang as a C/C++ compiler. So, fix the compiler warnings in case the compiler is clang doesn't matter what kind of building platform do we use for building. This is a follow-up patch for the following bug reports: MDEV-23564: CMAKE failing due to deprecated Apple GSS method MDEV-23935: Fix warnings generated during compilation of plugin/auth_pam/testing/pam_mariadb_mtr.c on MacOS
* | | | Parse GSSAPI flags on AIXEtienne Guesnet2020-12-161-1/+5
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-10-301-0/+5
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-10-291-0/+5
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-10-281-0/+5
| | |\ \ | | | |/
| | | * MDEV-23564: CMAKE failing due to deprecated Apple GSS methodDmitry Shulga2020-10-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some GSS-API functions like gss_import_name(), gss_release_buffer() used in plugin/auth_gssapi and libmariadb/plugins/auth are marked as deprecated in MacOS starting from version 10.14+. It results in extra warnings output on server building. To eliminate extra warnings the flag '-Wno-deprecated-declarations' has been added to compiler invocation string for those source files that invoke deprecated GSS-API functions.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-07-022-4/+4
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-07-022-4/+4
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-07-022-4/+4
| | |\ \ | | | |/
| | | * Merge 10.1 into 10.2bb-10.2-mergeMarko Mäkelä2020-07-012-4/+4
| | | |\
| | | | * Check for krb5_xfree instead of krb5_free_unparsed_nameVicențiu Ciorbaru2020-06-152-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Use krb5_xfree if available, otherwise default to krb5_free_unparsed_name.
* | | | | FreeBSD compilation fixesSergei Golubchik2020-06-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * FreeBSD calls amd64 what Linux calls x86_64 * signal returns void (*)(int) * struct pam_message has char*, not const char* * krb5_free_unparsed_name exists, but is deprecated
* | | | | Fixed compiler warnings from gcc and clang 5.0.1Monty2020-05-231-3/+3
| | | | |
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-05-051-0/+4
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-05-051-0/+4
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-05-041-0/+4
| | |\ \ \ | | | |/ /
| | | * | MDEV-20685: compile fixes for Solaris/OSX/AIXDaniel Black2020-04-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sig_return: Solaris/OSX returns different function ptr Move defination to my_alarm.h as its the only use. prevents compile warnings (copied from 10.3 branch) mysys/my_sync.c:136:19: error: 'cur_dir_name' defined but not used [-Werror=unused-const-variable=] 136 | static const char cur_dir_name[]= {FN_CURLIB, 0}; | ^~~~~~~~~~~~ fix compile error (DEPRECATED) leaked from ssl headers. In file included from /export/home/dan/mariadb-server-10.4/sql/sys_vars.cc:37: /export/home/dan/mariadb-server-10.4/sql/sys_vars.ic:69: error: "DEPRECATED" redefined [-Werror] 69 | #define DEPRECATED(X) X | In file included from /export/home/dan/mariadb-server-10.4/include/violite.h:150, from /export/home/dan/mariadb-server-10.4/sql/sql_class.h:38, from /export/home/dan/mariadb-server-10.4/sql/sys_vars.cc:36: /usr/include/openssl/ssl.h:2356: note: this is the location of the previous definition 2356 | # define DEPRECATED __attribute__((deprecated)) | Avoid Werror condition on non-Linux: plugin/server_audit/server_audit.c:2267:7: error: variable 'db_len_off' set but not used [-Werror=unused-but-set-variable] 2267 | int db_len_off; | ^~~~~~~~~~ plugin/server_audit/server_audit.c:2266:7: error: variable 'db_off' set but not used [-Werror=unused-but-set-variable] 2266 | int db_off; | ^~~~~~ auth_gssapi fix include path for Solaris Consistent with the upstream packaged patch: https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/database/mariadb-103/patches/06-gssapi.h.patch compile warnings on Solaris [ 91%] Building C object plugin/server_audit/CMakeFiles/server_audit.dir/server_audit.c.o /plugin/server_audit/server_audit.c: In function 'auditing_v8': /plugin/server_audit/server_audit.c:2194:20: error: unused variable 'db_len_off' [-Werror=unused-variable] 2194 | static const int db_len_off= 128; | ^~~~~~~~~~ /plugin/server_audit/server_audit.c:2193:20: error: unused variable 'db_off' [-Werror=unused-variable] 2193 | static const int db_off= 120; | ^~~~~~ /plugin/server_audit/server_audit.c:2192:20: error: unused variable 'cmd_off' [-Werror=unused-variable] 2192 | static const int cmd_off= 4432; | ^~~~~~~ At top level: /plugin/server_audit/server_audit.c:2192:20: error: 'cmd_off' defined but not used [-Werror=unused-const-variable=] /plugin/server_audit/server_audit.c:2193:20: error: 'db_off' defined but not used [-Werror=unused-const-variable=] 2193 | static const int db_off= 120; | ^~~~~~ /plugin/server_audit/server_audit.c:2194:20: error: 'db_len_off' defined but not used [-Werror=unused-const-variable=] 2194 | static const int db_len_off= 128; | ^~~~~~~~~~ cc1: all warnings being treated as errors tested on: $ uname -a SunOS openindiana 5.11 illumos-b97b1727bc i86pc i386 i86pc
* | | | | Fix clang-cl warningsVladislav Vaintroub2019-07-041-0/+3
|/ / / /
* | | | Merge 10.3 into 10.4Marko Mäkelä2019-04-031-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2019-04-031-1/+1
| |\ \ \ | | |/ /
| | * | Merge 10.1 into 10.2Marko Mäkelä2019-04-031-1/+1
| | |\ \ | | | |/
| | | * cmake: fix krb5 detection on SUSESergei Golubchik2019-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `zypper install krb5-devel` installs executables outside of $PATH. It also installs /etc/profile.d/krb5.sh that is sourced by a new shell to add the new location to the $PATH. But this doesn't affect the current shell. Now decent Linux distros remind the user to run `. /etc/profile` to reload paths in such a case. SUSE doesn't and for a good reason - it doesn't work there. Because SUSE sets PROFILEREAD=true in the environment and /etc/profile does not do anything. By this point, one should not really expect `unset PROFILEREAD` to help, and it does not - PROFILEREAD is readonly, and cannot be unset. Apparently SUSE really *really* wants you to re-login between installing MariaDB build dependencies and actually running the rpmbuild. Which we cannot do it buildbot. And it would look very user-un-friendly in the Build Instructions section of the manual. So, we work around it - by adding SUSE krb5 path to the search list. THIS IS SUSEEEEEE!!!
* | | | After-merge fix: Initialize all fieldsMarko Mäkelä2019-04-021-1/+1
| | | |
* | | | MDEV-11340 Allow multiple alternative authentication methods for the same userSergei Golubchik2019-02-042-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce the syntax ... IDENTIFIED { WITH | VIA } plugin [ { USING | AS } auth ] [ OR plugin [ { USING | AS } auth ] [ OR ... ]] Server will try auth plugins in the specified order until the first success. No protocol changes, server uses the existing "switch plugin" packet. The auth chain is stored in json as "auth_or":[{"plugin":"xxx","authentication_string":"yyy"}, {}, {"plugin":"foo","authentication_string":"bar"}, ...], "plugin":"aaa", "authentication_string":"bbb" Note: * "auth_or" implies that there might be "auth_and" someday; * one entry in the array is an empty object, meaning to take plugin/auth from the main json object. This preserves compatibility with the existing mysql.global_priv table and with the mysql.user view. This entry is preferrably a mysql_native_password plugin for a non-empty mysql.user.password column. SET PASSWORD is supported and changes the password for the *first* plugin in the chain that has a notion of a "password"
* | | | MDEV-17950 SHOW GRANTS FOR does not work for a user identified with ↵Sergei Golubchik2019-02-044-35/+38
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-existing plugin Revert the side effect of 7c40996cc866. Do not convert password hash to its binary representation when a user entry is loaded. Do it lazily on the first authenticatation attempt. As a collateral - force all authentication plugins to follow the protocol and read_packet at least once before accessing info->username (username is not available before first client handshake packet is read). Fix PAM and GSSAPI plugins to behave.
* | | Merge 10.2 into 10.3Marko Mäkelä2018-11-062-2/+8
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | main.derived_cond_pushdown: Move all 10.3 tests to the end, trim trailing white space, and add an "End of 10.3 tests" marker. Add --sorted_result to tests where the ordering is not deterministic. main.win_percentile: Add --sorted_result to tests where the ordering is no longer deterministic.
| * | Merge 10.1 into 10.2Marko Mäkelä2018-11-062-3/+9
| |\ \ | | |/
| | * auth_gssapi : Fix string formatting in my_printf_error()Vladislav Vaintroub2018-10-161-1/+1
| | |
| | * remove MYF flags from pluginVladislav Vaintroub2018-10-161-2/+2
| | |
| | * Fix regular expression in replace_regex in auth_gssapi test.Vladislav Vaintroub2018-10-151-1/+1
| | |
| | * make auth_gssapi_basic work, also in domain environment.Vladislav Vaintroub2018-10-153-1/+4
| | |
| | * MDEV-17462 Heap corruption with auth_gssapi on Windows.Vladislav Vaintroub2018-10-151-1/+6
| | | | | | | | | | | | | | | use FreeContextAttributes() on individual members of SecPkgContext_NativeNames, not on the struct itself.
* | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-5/+5
|\ \ \ | |/ /
| * | don't use my_error(0) or my_printf_error(0)Sergei Golubchik2018-06-211-5/+5
| | | | | | | | | | | | there's an assert that catches it
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-152-1/+9
|\ \ \ | |/ /
| * | auth_gssapi - fix test result and let the test run on Windows buildbotVladislav Vaintroub2018-02-012-1/+9
| | |