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

In mysql on solaris 10, can't install audit plugin #97

Closed
ajaajalee opened this issue Jan 6, 2015 · 10 comments
Closed

In mysql on solaris 10, can't install audit plugin #97

ajaajalee opened this issue Jan 6, 2015 · 10 comments

Comments

@ajaajalee
Copy link

I did success compile solairs 10 x64 this audit plugin 1.0.7
but, in mysql can't install audit plugin.

mysql> INSTALL PLUGIN AUDIT SONAME 'libaudit_plugin.so';
ERROR 1126 (HY000): Can't open shared library '/usr/local/mysql5.5.27-ndb7.2.8/lib/plugin/libaudit_plugin.so' (errno: 2 ld.so.1: mysqld: fatal: relocation error: file /usr/local/mysql5.5.27-ndb7.2.8/lib/plugin/libaudit_plugin.so: symbol _Z18log_slo)

Do you know how to solve this error?

@glicht
Copy link
Contributor

glicht commented Jan 6, 2015

Not too sure why you are encountering this error. We never tried supporting Solaris so I guess there is some work needed to get it to fully function. Can you share how you got the plugin to compile on solaris. Maybe that can help.

@ajaajalee
Copy link
Author

Thannks for you reply.

I encountred two problem during complie on solaris.
firstly, in solaris strcasestr function not exist. and then, i add in audit_plugin.cc.
strcasestr(const char *s, const char *find)
{
char c, sc;
size_t len;

if ((c = *find++) != 0) {
    c = (char)tolower((unsigned char)c);
    len = strlen(find);
    do {
        do {
            if ((sc = *s++) == 0)
                return (NULL);
        } while ((char)tolower((unsigned char)sc) != c);
    } while (strncasecmp(s, find, len) != 0);
    s--;
}
return ((char *)s);

}

secondly, ld of solaris not compatible. and then modified in src/Makefile
libaudit_plugin_la_LDFLAGS = -module -Wl,-M,MySQLPlugin.map

no problmen to compile on solaris this plugin with this two solution.
but, It failed INSTALL PLUGIN AUDIT SONAME 'libaudit_plugin.so' on mysql.

@glicht
Copy link
Contributor

glicht commented Jan 8, 2015

Thanks for specifying the details for getting the plugin to compile on Solaris. Solaris support is not currently on our roadmap, I am leaving this issue open and if anyone else is looking for a Solaris solution please add a comment here.

@kubo
Copy link
Contributor

kubo commented Aug 4, 2016

@ajaajalee
Could you post the output of the following commands?

$ nm /usr/local/mysql5.5.27-ndb7.2.8/lib/plugin/libaudit_plugin.so | grep log_slow_statement
$ nm /usr/local/mysql5.5.27-ndb7.2.8/bin/mysqld | grep log_slow_statement

IMO, libaudit_plugin.so was compiled by gcc and mysqld was compiled by Oracle Solaris Studio.

... relocation error: file /usr/local/mysql5.5.27-ndb7.2.8/lib/plugin/libaudit_plugin.so: symbol _Z18log_slo)

_Z18log_slo looks like _Z18log_slow_statementP3THD, which is the mangled name of void log_slow_statement(THD *thd) by gcc.
If mysqld was compiled by Oracle Solaris Studio, the same function was mangled to different name.
See here. (SunPro CC in the link is old name of Oracle Solaris Studio.)
As a result, libaudit_mysql.so tried to reference _Z18log_slow_statementP3THD but it wasn't defined anywhere.

@jadhavmanoj
Copy link

Hi

I am using ubuntu 14.04 and mysql - 5.5.50-0ubuntu0.14.04.1

I tried to execute below command to generate offset but it returns error.

manoj@manoj-Lenovo-B50-80:~$ ../offset-extract.sh /usr/sbin/mysqld
//offsets for: /usr/sbin/mysqld (5.5.50-0ubuntu0.14.04.1)
offsets.gdb:2: Error in sourced command file:
No symbol table is loaded. Use the "file" command.,

How can I resolved this issue?

@ajaajalee
Copy link
Author

ajaajalee commented Aug 10, 2016

@kubo
Thanks for your reply.
but currently I am sorry that I don't use solaris.

@aharonrobbins
Copy link

Hi.

The problem is that /usr/sbin/mysqld is stripped – it has no symbols.

Please see the discussion in #136 which may be useful.

You can also try installing the mysql-server-5.5-dbgsym package and see if it brings you a version of mysqld that isn’t stripped. If so, you would run the offset-exract.sh script with two arguments: the path to mysqld and the path to the file with the debug symbols.

I will try to set up an Ubuntu 14.04 system and test this myself sometime soon.

Thanks,

Aharon Robbins

Aharon (Arnold) Robbins
Senior Software Engineer
Sensor - Database Security
McAfee. Part of Intel Security.
[cid:[email protected]]

From: Manoj [mailto:[email protected]]
Sent: Wednesday, August 10, 2016 08:20
To: mcafee/mysql-audit [email protected]
Subject: Re: [mcafee/mysql-audit] In mysql on solaris 10, can't install audit plugin (#97)

Hi

I am using ubuntu 14.04 and mysql - 5.5.50-0ubuntu0.14.04.1

I tried to execute below command to generate offset but it returns error.

manoj@manoj-Lenovo-B50-80:~$ ../offset-extract.sh /usr/sbin/mysqld

//offsets for: /usr/sbin/mysqld (5.5.50-0ubuntu0.14.04.1)
offsets.gdb:2: Error in sourced command file:
No symbol table is loaded. Use the "file" command.,

How can I resolved this issue?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/97#issuecomment-238768420, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKT-vTNvAkbn-oS2FZZs40Yd7Y2_LLCbks5qeV95gaJpZM4DOvBJ.

@jadhavmanoj
Copy link

@aharonrobbins

Thanks for your reply

@aharonrobbins
Copy link

I spent quite some time trying to determine how to install and use the -dbgsym package for mysql-server on Ubuntu 14.04. I was not able to use any of the files it installed as the symbol file for use with the extract_offset script. I think your best bet will be to build mysql-server from Ubuntu sources and then extract the offsets from the version you compile yourself.

Best of luck,

Aharon

@aharonrobbins
Copy link

Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants