[MDEV-11997] secure_file_priv works for CONNECT XML Tables but not for MEMORY Tables Created: 2017-02-05  Updated: 2017-03-12  Resolved: 2017-03-12

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 10.1.20
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Eduardo Reyes Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

openSUSE Thumbleweed VM, 4GB RAM, 2 CPU, 30GB HDD (10GB free) on top of EXSi 6


Attachments: PNG File Error-secure_file_priv-2.png     PNG File Error-secure_file_priv.png    

 Description   

I successfully ran the examples in https://mariadb.com/kb/en/mariadb/connect-xml-table-type/ with the XML files located in the /var/lib/mysql-files/ directory.

However when tried to run the benchmark in https://mariadb.com/kb/en/mariadb/performance-of-memory-tables/ with the files hash1.txt and hash2.txt in the same directory, I got SQL Error 1290 as shown in the attached screenshot.

Is this a bug?

Please advice



 Comments   
Comment by Elena Stepanova [ 2017-02-06 ]

According to the screenshot, in your LOAD statement you don't actually specify the path to the file, so the server has no way knowing you are trying to load from the secure folder, hence the error.
The screenshot does not show statements that you used for Connect XML tables, so I can't say anything about those.

Comment by Eduardo Reyes [ 2017-02-08 ]

I thought that there was no need to specify the file path if stored in the directory pointed by secure_file_priv.

Anyway I have tried both with and without the path and it fails. Here is the SQL code excerpt I just ran and failed:

use test_memory;

– need big heap tables
set max_heap_table_size=1024*1024*1024;

– table to hold test results
create table if not exists results (
id serial,
operation char(32),
opsize bigint unsigned,
started datetime,
ended datetime,
instance char(20)
);

drop table if exists t1;
create table t1 (c1 char(20), index (c1)) engine memory;
load data infile "/var/lib/mysql/hash2.txt" into table t1;
drop table t1;

ALso included a new screenshot. Hope this will help.

Comment by Elena Stepanova [ 2017-02-09 ]

erchbox,

Anyway I have tried both with and without the path and it fails

In your code and in the screenshot you are trying to load the file from /var/lib/mysql, but in the previous screenshot and in the description the allowed location was /var/lib/mysql-files. Unless you reconfigured it since then, naturally it does not work.

I thought that there was no need to specify the file path if stored in the directory pointed by secure_file_priv.

Yes, there is the need. The value does not set the default path, it just restricts the allowed locations

Comment by Eduardo Reyes [ 2017-02-10 ]

Great eyes, thanks!

The example works flawlessly now.

One of the wonders of collaborating is that others can see what you can't.

Sorry for having wasted your precious time on my temporary blindness.

You can close the case.

Generated at Thu Feb 08 07:54:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.