Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-21476: auth_socket: add support for illumos with getpeerucred() #1434

Merged
merged 1 commit into from Mar 3, 2020

Conversation

citrus-it
Copy link
Contributor

I have been packaging MariaDB 10.4 for the OmniOS operating system, which is a distribution of illumos (née OpenSolaris), and wanted to enable support for the auth_socket plugin.

illumos has getpeerucred() and so here's a patch to make auth_socket work on illumos platforms.
(It may also allow it to work on Solaris, which also has getpeerucred(), but I have not tested)

root@database:~# uname -a
SunOS sparse 5.11 omnios-r151032-702376803e i86pc i386 i86pc

root@database:~# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.4.11-MariaDB OmniOS MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> select current_user() from dual;
+----------------+
| current_user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.000 sec)

MariaDB [(none)]> select user, password from mysql.user where user != '';
+-------+----------+
| User  | Password |
+-------+----------+
| root  | invalid  |
| mysql | invalid  |
+-------+----------+
2 rows in set (0.001 sec)

MariaDB [(none)]> show plugins soname where name = 'unix_socket';
+-------------+--------+----------------+---------+---------+
| Name        | Status | Type           | Library | License |
+-------------+--------+----------------+---------+---------+
| unix_socket | ACTIVE | AUTHENTICATION | NULL    | GPL     |
+-------------+--------+----------------+---------+---------+
1 row in set (0.014 sec)

@claassistantio
Copy link

claassistantio commented Jan 14, 2020

CLA assistant check
All committers have signed the CLA.

@an3l an3l added the license-mca Contributed under the MCA label Jan 14, 2020
@an3l an3l added this to the 10.5 milestone Jan 14, 2020
@an3l an3l changed the title auth_socket: add support for illumos with getpeerucred() MDEV-21476: auth_socket: add support for illumos with getpeerucred() Jan 14, 2020
@an3l
Copy link
Collaborator

an3l commented Jan 14, 2020

Hi @citrus-it,
thank you for the patch.
The patch is for 10.5, but you said you are doing packaging for 10.4, which version is from interest?

@citrus-it
Copy link
Contributor Author

Hi @citrus-it,
thank you for the patch.
The patch is for 10.5, but you said you are doing packaging for 10.4, which version is from interest?

I'm using this patch on 10.4 but I was intending to contribute the patch to trunk so that it will be in the next version. I could do a separate PR against 10.4 too if it's of interest (the code hasn't changed between the two).

@an3l
Copy link
Collaborator

an3l commented Jan 14, 2020

Not needed, just asking about the intention of the patch. Someone will take a look on this.
Thanks.

@an3l an3l requested a review from vuvova January 14, 2020 14:56
@vuvova
Copy link
Member

vuvova commented Feb 3, 2020

Looks good to me.

Copy link
Member

@grooverdan grooverdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visually inspected flows of code and cmake definations (and laughed at existing comments).

Looks good to me.

@robertbindar robertbindar merged commit 8f8cc5f into MariaDB:10.5 Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
license-mca Contributed under the MCA
6 participants