Skip to content

Commit af6c1a2

Browse files
committed
1) Upgraded Gunicorn to version 23.0.0 to address a security vulnerability present in Gunicorn.
2) Resolved an issue where an empty PSQL panel would open if the psql utility was not found in the binary path.
1 parent cfca6f6 commit af6c1a2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ RUN apk add --no-cache \
208208
libedit \
209209
libldap \
210210
libcap && \
211-
/venv/bin/python3 -m pip install --no-cache-dir gunicorn==22.0.0 && \
211+
/venv/bin/python3 -m pip install --no-cache-dir gunicorn==23.0.0 && \
212212
find / -type d -name '__pycache__' -exec rm -rf {} + && \
213213
useradd -r -u 5050 -g root -s /sbin/nologin pgadmin && \
214214
mkdir -p /run/pgadmin /var/lib/pgadmin && \

web/pgadmin/tools/psql/__init__.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def non_windows_platform(parent, p, fd, data, max_read_bytes, sid):
271271
timeout)
272272

273273
read_terminal_data(parent, data_ready, max_read_bytes, sid)
274-
except OSError as e:
274+
except OSError:
275275
# If the process is killed, bad file descriptor exception may
276276
# occur. Handle it gracefully
277277
pass
@@ -311,14 +311,15 @@ def read_and_forward_pty_output(sid, data):
311311

312312
_, manager = _get_connection(int(data['sid']), data)
313313
psql_utility = manager.utility('sql')
314-
if psql_utility is None:
314+
if psql_utility is None or not os.path.exists(psql_utility):
315315
sio.emit('pty-output',
316316
{
317317
'result': gettext(
318-
'PSQL utility not found. Specify the binary '
319-
'path in the preferences for the appropriate '
320-
'server version, or select "Set as default" '
321-
'to use an existing binary path.'),
318+
'PSQL utility not found. Specify the valid '
319+
'binary path in the preferences for the '
320+
'appropriate server version, or select '
321+
'"Set as default" to use an existing binary '
322+
'path.'),
322323
'error': True},
323324
namespace='/pty', room=request.sid)
324325
return

0 commit comments

Comments
 (0)