[MDEV-4760] Audit: log is only created when parameters are set in a certain order Created: 2013-07-05  Updated: 2013-08-27  Resolved: 2013-08-27

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: server_audit

Issue Links:
Relates
relates to MDEV-4472 Auditing Plugin Closed

 Description   

Logging only works if the output type is set after the file path.
This example (as in the MTR test provided with the code) works:

install soname 'server_audit';
 
set global server_audit_logging=on;
set global server_audit_file_path='my_audit.log';
set global server_audit_output_type=file;
set global server_audit_incl_ddl_users='root';
create table t1 (id int);
drop table t1;
 
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--echo # Check if file exists:
list_files $MYSQLD_DATADIR my_audit.log;
 
uninstall soname 'server_audit';

Output:

...
# Check if file exists:
my_audit.log
uninstall soname 'server_audit';

But this one does not (I switched setting of file_path and output_type):

install soname 'server_audit';
 
set global server_audit_logging=on;
set global server_audit_output_type=file;
set global server_audit_file_path='my_audit.log';
set global server_audit_incl_ddl_users='root';
create table t1 (id int);
drop table t1;
 
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--echo # Check if file exists:
list_files $MYSQLD_DATADIR my_audit.log;
 
uninstall soname 'server_audit';

Output:

...
# Check if file exists:
uninstall soname 'server_audit';

bzr version-info

revision-id: holyfoot@askmonty.org-20130704123621-gb3jvhyxdax6gpm9
revno: 3825
branch-nick: 5.5-noga-hf



 Comments   
Comment by Alexey Botchkov [ 2013-07-05 ]

As it is implemented now setting output_type=file tries to create the log file and set it for logging. And if the filename isn't properly specified, that naturally fails and output_type keeps 'null' value.
Going to think how to change it.

Comment by Alexey Botchkov [ 2013-08-25 ]

Fixed along with the MDEV-4767.
So that the server_audit_file_path='server_audit.log' by default. And logging starts/stops with setting the server_audit_logging variable.

Generated at Thu Feb 08 06:58:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.