One possible way to get around the requirement for having the FILE privilege to access ODBC tables with CONNECT would be to have them called indirectly via a security definer view. However, it does not currently work.
Create a security definer view to access the ODBC table, then create a new user:
[gmontee@localhost ~]$ mysql -u root tmp
|
Reading table information for completion of table and column names
|
You can turn off this feature to get a quicker startup with -A
|
|
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
Your MariaDB connection id is 16
|
Server version: 10.0.15-MariaDB-log MariaDB Server
|
|
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
|
MariaDB [tmp]> SHOW CREATE TABLE datetime_table;
|
+----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| datetime_table | CREATE TABLE `datetime_table` (
|
`id` int(10) NOT NULL,
|
`modifiedon` datetime DEFAULT NULL
|
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=connect_test_azure;UID=connect_test;PWD=Password1' `TABLE_TYPE`='ODBC' `TABNAME`='dbo.datetime_table' |
|
+----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [tmp]> DROP USER 'connecttest'@'localhost';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [tmp]> CREATE OR REPLACE
|
-> DEFINER = CURRENT_USER
|
-> SQL SECURITY DEFINER
|
-> VIEW datetime_view
|
-> AS SELECT * FROM datetime_table;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [tmp]> CREATE USER 'connecttest'@'localhost';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [tmp]> GRANT SELECT ON datetime_view TO 'connecttest'@'localhost';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [tmp]> \q
|
Bye
|
Now connect with the new user, and try to use the view:
[gmontee@localhost ~]$ mysql -u connecttest tmp
|
Reading table information for completion of table and column names
|
You can turn off this feature to get a quicker startup with -A
|
|
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
Your MariaDB connection id is 17
|
Server version: 10.0.15-MariaDB-log MariaDB Server
|
|
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
|
MariaDB [tmp]> SELECT * FROM datetime_view;
|
ERROR 1045 (28000): Access denied for user 'connecttest'@'localhost' (using password: NO)
|
MariaDB [tmp]> \q
|
Bye
|
It didn't work, so give the user privileges on the underlying ODBC table:
[gmontee@localhost ~]$ mysql -u root tmp
|
Reading table information for completion of table and column names
|
You can turn off this feature to get a quicker startup with -A
|
|
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
Your MariaDB connection id is 18
|
Server version: 10.0.15-MariaDB-log MariaDB Server
|
|
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
|
MariaDB [tmp]> GRANT FILE ON *.* TO 'connecttest'@'localhost';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [tmp]> GRANT SELECT ON datetime_table TO 'connecttest'@'localhost';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [tmp]> \q
|
Bye
|
Now try using the view again:
[gmontee@localhost ~]$ mysql -u connecttest tmp
|
Reading table information for completion of table and column names
|
You can turn off this feature to get a quicker startup with -A
|
|
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
Your MariaDB connection id is 19
|
Server version: 10.0.15-MariaDB-log MariaDB Server
|
|
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
|
MariaDB [tmp]> SELECT * FROM datetime_view;
|
+----+---------------------+
|
| id | modifiedon |
|
+----+---------------------+
|
| 1 | 2014-01-01 00:00:00 |
|
| 2 | 2016-01-01 00:00:00 |
|
+----+---------------------+
|
2 rows in set (0.24 sec)
|
- relates to
-
MDEV-8545
Security definer views don't work with engine's privilege checks
-
-
Closed
There are no comments yet on this issue.
{"report":{"fcp":1385.1999999284744,"ttfb":302.6999999284744,"pageVisibility":"visible","entityId":50028,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"85fa4256-cb1c-4ae1-9ae7-9d52bf95a366","navigationType":0,"readyForUser":1566,"redirectCount":0,"resourceLoadedEnd":1929.7999999523163,"resourceLoadedStart":308.2999999523163,"resourceTiming":[{"duration":529.7000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":308.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":308.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":838,"responseStart":0,"secureConnectionStart":0},{"duration":529.7999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":308.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":308.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":838.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":539,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":308.7999999523163,"connectEnd":308.7999999523163,"connectStart":308.7999999523163,"domainLookupEnd":308.7999999523163,"domainLookupStart":308.7999999523163,"fetchStart":308.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":308.7999999523163,"responseEnd":847.7999999523163,"responseStart":847.7999999523163,"secureConnectionStart":308.7999999523163},{"duration":651.3999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":308.89999997615814,"connectEnd":308.89999997615814,"connectStart":308.89999997615814,"domainLookupEnd":308.89999997615814,"domainLookupStart":308.89999997615814,"fetchStart":308.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":308.89999997615814,"responseEnd":960.2999999523163,"responseStart":960.2999999523163,"secureConnectionStart":308.89999997615814},{"duration":672.8999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":309.10000002384186,"connectEnd":309.10000002384186,"connectStart":309.10000002384186,"domainLookupEnd":309.10000002384186,"domainLookupStart":309.10000002384186,"fetchStart":309.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":309.10000002384186,"responseEnd":982,"responseStart":982,"secureConnectionStart":309.10000002384186},{"duration":678.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":309.2999999523163,"connectEnd":309.2999999523163,"connectStart":309.2999999523163,"domainLookupEnd":309.2999999523163,"domainLookupStart":309.2999999523163,"fetchStart":309.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":309.2999999523163,"responseEnd":987.7999999523163,"responseStart":987.7999999523163,"secureConnectionStart":309.2999999523163},{"duration":678.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":309.60000002384186,"connectEnd":309.60000002384186,"connectStart":309.60000002384186,"domainLookupEnd":309.60000002384186,"domainLookupStart":309.60000002384186,"fetchStart":309.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":309.60000002384186,"responseEnd":988.1999999284744,"responseStart":988.1999999284744,"secureConnectionStart":309.60000002384186},{"duration":712.9000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":309.6999999284744,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":309.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1022.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":679,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":309.89999997615814,"connectEnd":309.89999997615814,"connectStart":309.89999997615814,"domainLookupEnd":309.89999997615814,"domainLookupStart":309.89999997615814,"fetchStart":309.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":309.89999997615814,"responseEnd":988.8999999761581,"responseStart":988.8999999761581,"secureConnectionStart":309.89999997615814},{"duration":712.6999999284744,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":310,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":310,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1022.6999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":679.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":310.1999999284744,"connectEnd":310.1999999284744,"connectStart":310.1999999284744,"domainLookupEnd":310.1999999284744,"domainLookupStart":310.1999999284744,"fetchStart":310.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":310.1999999284744,"responseEnd":989.6999999284744,"responseStart":989.6999999284744,"secureConnectionStart":310.1999999284744},{"duration":790,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":315.7999999523163,"connectEnd":315.7999999523163,"connectStart":315.7999999523163,"domainLookupEnd":315.7999999523163,"domainLookupStart":315.7999999523163,"fetchStart":315.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":315.7999999523163,"responseEnd":1105.7999999523163,"responseStart":1105.7999999523163,"secureConnectionStart":315.7999999523163},{"duration":1564.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":315.89999997615814,"connectEnd":315.89999997615814,"connectStart":315.89999997615814,"domainLookupEnd":315.89999997615814,"domainLookupStart":315.89999997615814,"fetchStart":315.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":315.89999997615814,"responseEnd":1880.1000000238419,"responseStart":1880.1000000238419,"secureConnectionStart":315.89999997615814},{"duration":95.20000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1035.1999999284744,"connectEnd":1035.1999999284744,"connectStart":1035.1999999284744,"domainLookupEnd":1035.1999999284744,"domainLookupStart":1035.1999999284744,"fetchStart":1035.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":1035.1999999284744,"responseEnd":1130.3999999761581,"responseStart":1130.3999999761581,"secureConnectionStart":1035.1999999284744},{"duration":609.6999999284744,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1320.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1320.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1929.7999999523163,"responseStart":0,"secureConnectionStart":0}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":142,"responseStart":303,"responseEnd":309,"domLoading":307,"domInteractive":1957,"domContentLoadedEventStart":1957,"domContentLoadedEventEnd":2003,"domComplete":2590,"loadEventStart":2590,"loadEventEnd":2590,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1934},{"name":"bigPipe.sidebar-id.end","time":1934.8999999761581},{"name":"bigPipe.activity-panel-pipe-id.start","time":1935.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":1935.6000000238419},{"name":"activityTabFullyLoaded","time":2010.1999999284744}],"measures":[],"correlationId":"ea993d79e087b0","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":90,"dbReadsTimeInMs":12,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}