public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][patch] No password supplied on auto detected servers
Date: Fri, 14 May 2021 14:45:54 +0530
Message-ID: <CAM9w-_nhFhx3eQ-A5EzKk4vDPzQ2e0omLDmOkDaSi3LRud8L9w@mail.gmail.com> (raw)

Hi Hackers,

Attached patch fixed "No password supplied" error occurring on
auto-detected servers.
Please review.

-- 
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] noPassSupplied.patch (1.5K, 3-noPassSupplied.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py
index 0d32bf4d3..f4165c32d 100644
--- a/web/pgadmin/browser/server_groups/servers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/__init__.py
@@ -1362,7 +1362,8 @@ class ServerNode(PGChildNodeView):
                 except Exception as e:
                     current_app.logger.exception(e)
                     return internal_server_error(errormsg=str(e))
-        if 'password' not in data and server.kerberos_conn is False:
+        if 'password' not in data and (server.kerberos_conn is False or
+                                       server.kerberos_conn is None):
             conn_passwd = getattr(conn, 'password', None)
             if conn_passwd is None and not server.save_password and \
                     server.passfile is None and server.service is None:
diff --git a/web/pgadmin/model/__init__.py b/web/pgadmin/model/__init__.py
index edfa7a49f..bd90077b7 100644
--- a/web/pgadmin/model/__init__.py
+++ b/web/pgadmin/model/__init__.py
@@ -184,7 +184,7 @@ class Server(db.Model):
     tunnel_identity_file = db.Column(db.String(64), nullable=True)
     tunnel_password = db.Column(db.String(64), nullable=True)
     shared = db.Column(db.Boolean(), nullable=False)
-    kerberos_conn = db.Column(db.Boolean(), nullable=False)
+    kerberos_conn = db.Column(db.Boolean(), nullable=False, default=0)
 
     @property
     def serialize(self):


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin][patch] No password supplied on auto detected servers
  In-Reply-To: <CAM9w-_nhFhx3eQ-A5EzKk4vDPzQ2e0omLDmOkDaSi3LRud8L9w@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox