这是indexloc提供的服务,不要输入任何密码
Skip to content

Saved passwords on shared servers broken for unprivileged users #5367

@fire2

Description

@fire2

On a clean installation of PgAdmin with LDAP authentication in server mode, based on the official Docker image version 6.14 I have the following issue:

  1. Add a shared server as admin. Log out.
  2. Login as an unprivileged user, set server Username under Properties > Connection.
  3. Try to connect inserting the password and saving it -> it works.
  4. Disconnect server (or logout) then re-connect to server, the following error shows:
    not enough values to unpack (expected 3, got 2)

Screenshot 2022-09-25 at 19 01 32

Logs:

 File "/pgadmin4/pgadmin/utils/driver/psycopg2/connection.py", line 240, in _decode_password                                                                                                                                                         │
│     password = password.decode()                                                                                                                                                                                                                      │
│ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 1: invalid continuation byte                                                                                                                                                     │
│ 2022-09-25 17:05:39,203: ERROR    pgadmin:    not enough values to unpack (expected 3, got 2)                                                                                                                                                         │
│ Traceback (most recent call last):                                                                                                                                                                                                                    │
│   File "/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 1411, in connect                                                                                                                                                           │
│     status, errmsg = conn.connect(                                                                                                                                                                                                                    │
│   File "/pgadmin4/pgadmin/utils/driver/psycopg2/connection.py", line 292, in connect                                                                                                                                                                  │
│     is_error, errmsg, password = self._decode_password(encpass, manager,                                                                                                                                                                              │
│ ValueError: not enough values to unpack (expected 3, got 2)                                                                                                                                                                                           │

Note: saving passwords and connecting to servers seems to work fine for the admin user (same steps as above with no error).

I have not managed to get this to work, and I wouldn't want users to have to enter the password every time. That's what the "save password" option is for. Am I missing something here? It looks like a bug.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions