Skip to content

Commit 11488de

Browse files
committed
Log credentials used to set up a connection (#256)
This commit adds info-logging of the credentials (with redacted password), just like with the rest of the connection properties. The properties are also debug-logged when the connection string is parsed, but those messages aren't logged into the per-connection log file. (The user needs to configure the "alternative logging" to get those, which is more convoluted.) (cherry picked from commit 16c811c)
1 parent 0ddc253 commit 11488de

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

driver/connect.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
12781278
"failed", 0);
12791279
goto err;
12801280
}
1281+
INFOH(dbc, "connection UID: `%s`.", dbc->uid.str);
12811282
if (attrs->pwd.cnt) {
12821283
if (! wstr_to_utf8(&attrs->pwd, &dbc->pwd)) {
12831284
ERRH(dbc, "failed to convert password [%zu] `%s` to "
@@ -1286,6 +1287,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
12861287
"conversion failed", 0);
12871288
goto err;
12881289
}
1290+
/* indicates the presence of a non-empty password */
1291+
INFOH(dbc, "connection PWD: " ESODBC_PWD_VAL_SUBST ".");
12891292
}
12901293
}
12911294

0 commit comments

Comments
 (0)