ibarwick / firebird_fdw

A PostgreSQL foreign data wrapper (FDW) for Firebird - latest version 1.4.0 (2024-05-11)
https://sql-info.de/postgresql/firebird-fdw/index.html
Other
36 stars 9 forks source link

Undocumented feature or access error in firebird_version function #22

Closed mkgrgis closed 3 years ago

mkgrgis commented 3 years ago

This is about SELECT * FROM firebird_version(); command. There is

SELECT fs.oid, fs.srvname, um.umuser
  FROM pg_foreign_data_wrapper fdw
 INNER JOIN pg_catalog.pg_foreign_server fs
       ON fs.srvfdw = fdw.oid
 INNER JOIN pg_catalog.pg_user_mapping um
       ON um.umserver=fs.oid
 WHERE fdw.fdwname = 'firebird_fdw'

query in algorithm of firebird_version function. By default pg_catalog.pg_user_mapping isn't accessible for a users without superuser's rights. Non privileged user get ERROR: no access to pg_user_mapping table.

Steps to reproduce:

  1. Make user without superuser's rights in Pg13.
  2. Make DB for this user as owner.
  3. From superuser. Create in the new DB of new user firebird_fdwextension and foreign server and user mapping for the user with the server.
  4. Try to execute SELECT * FROM firebird_version();.
ibarwick commented 3 years ago

Fixed, thanks for the report!

mkgrgis commented 3 years ago

Thanks, @ibarwick . I have verified on SQL level, no problem in selecting.