mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that non-superuser should be able to debug the function. Fixes #5760
This commit is contained in:
committed by
Akshay Joshi
parent
183c83f0d2
commit
14a5d05b80
@@ -23,6 +23,7 @@ Bug fixes
|
|||||||
|
|
||||||
| `Issue #4639 <https://redmine.postgresql.org/issues/4639>`_ - Ensure that some fields should be disabled for the trigger in edit mode.
|
| `Issue #4639 <https://redmine.postgresql.org/issues/4639>`_ - Ensure that some fields should be disabled for the trigger in edit mode.
|
||||||
| `Issue #5736 <https://redmine.postgresql.org/issues/5736>`_ - Fixed an issue where the validation error message is shown twice.
|
| `Issue #5736 <https://redmine.postgresql.org/issues/5736>`_ - Fixed an issue where the validation error message is shown twice.
|
||||||
|
| `Issue #5760 <https://redmine.postgresql.org/issues/5760>`_ - Ensure that non-superuser should be able to debug the function.
|
||||||
| `Issue #5842 <https://redmine.postgresql.org/issues/5842>`_ - Ensure that query history should be listed by date/time in descending order.
|
| `Issue #5842 <https://redmine.postgresql.org/issues/5842>`_ - Ensure that query history should be listed by date/time in descending order.
|
||||||
| `Issue #5858 <https://redmine.postgresql.org/issues/5858>`_ - Ensure that search object functionality works with case insensitive string.
|
| `Issue #5858 <https://redmine.postgresql.org/issues/5858>`_ - Ensure that search object functionality works with case insensitive string.
|
||||||
| `Issue #5895 <https://redmine.postgresql.org/issues/5895>`_ - Fixed an issue where the suffix for Toast table size is not visible in the Statistics tab.
|
| `Issue #5895 <https://redmine.postgresql.org/issues/5895>`_ - Fixed an issue where the suffix for Toast table size is not visible in the Statistics tab.
|
||||||
|
|||||||
@@ -686,32 +686,34 @@ def validate_debug(conn, debug_type, is_superuser):
|
|||||||
:param is_superuser:
|
:param is_superuser:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
if debug_type == 'indirect' and not is_superuser:
|
if debug_type == 'indirect':
|
||||||
# If user is super user then we should check debugger library is
|
if not is_superuser:
|
||||||
# loaded or not
|
# If user is super user then we should check debugger library is
|
||||||
msg = gettext("You must be a superuser to set a global breakpoint"
|
# loaded or not
|
||||||
" and perform indirect debugging.")
|
msg = gettext("You must be a superuser to set a global breakpoint"
|
||||||
return False, internal_server_error(errormsg=msg)
|
" and perform indirect debugging.")
|
||||||
|
return False, internal_server_error(errormsg=msg)
|
||||||
|
|
||||||
status, rid_pre = conn.execute_scalar(
|
status, rid_pre = conn.execute_scalar(
|
||||||
"SHOW shared_preload_libraries"
|
"SHOW shared_preload_libraries"
|
||||||
)
|
|
||||||
if not status:
|
|
||||||
return False, internal_server_error(
|
|
||||||
gettext("Could not fetch debugger plugin information.")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Need to check if plugin is really loaded or not with
|
if not status:
|
||||||
# "plugin_debugger" string
|
return False, internal_server_error(
|
||||||
if debug_type == 'indirect' and "plugin_debugger" not in rid_pre:
|
gettext("Could not fetch debugger plugin information.")
|
||||||
msg = gettext(
|
)
|
||||||
"The debugger plugin is not enabled. "
|
|
||||||
"Please add the plugin to the shared_preload_libraries "
|
# Need to check if plugin is really loaded or not with
|
||||||
"setting in the postgresql.conf file and restart the "
|
# "plugin_debugger" string
|
||||||
"database server for indirect debugging."
|
if "plugin_debugger" not in rid_pre:
|
||||||
)
|
msg = gettext(
|
||||||
current_app.logger.debug(msg)
|
"The debugger plugin is not enabled. "
|
||||||
return False, internal_server_error(msg)
|
"Please add the plugin to the shared_preload_libraries "
|
||||||
|
"setting in the postgresql.conf file and restart the "
|
||||||
|
"database server for indirect debugging."
|
||||||
|
)
|
||||||
|
current_app.logger.debug(msg)
|
||||||
|
return False, internal_server_error(msg)
|
||||||
|
|
||||||
# Check debugger extension version for EPAS 11 and above.
|
# Check debugger extension version for EPAS 11 and above.
|
||||||
# If it is 1.0 then return error to upgrade the extension.
|
# If it is 1.0 then return error to upgrade the extension.
|
||||||
|
|||||||
Reference in New Issue
Block a user