aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 72188b7f3ef..bc3d10e5158 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -160,6 +160,7 @@ static void print_with_linenumbers(FILE *output, char *lines,
static void minimal_error_message(PGresult *res);
static void printSSLInfo(void);
+static void printGSSInfo(void);
static bool printPsetInfo(const char *param, struct printQueryOpt *popt);
static char *pset_value_string(const char *param, struct printQueryOpt *popt);
@@ -621,6 +622,7 @@ exec_command_conninfo(PsqlScanState scan_state, bool active_branch)
db, PQuser(pset.db), host, PQport(pset.db));
}
printSSLInfo();
+ printGSSInfo();
}
}
@@ -3184,6 +3186,7 @@ connection_warnings(bool in_startup)
checkWin32Codepage();
#endif
printSSLInfo();
+ printGSSInfo();
}
}
@@ -3216,6 +3219,20 @@ printSSLInfo(void)
(compression && strcmp(compression, "off") != 0) ? _("on") : _("off"));
}
+/*
+ * printGSSInfo
+ *
+ * Prints information about the current GSSAPI connection, if GSSAPI encryption is in use
+ */
+static void
+printGSSInfo(void)
+{
+ if (!PQgssEncInUse(pset.db))
+ return; /* no GSSAPI encryption in use */
+
+ printf(_("GSSAPI Encrypted connection\n"));
+}
+
/*
* checkWin32Codepage