mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Password obfuscation to close: #147.
This commit is contained in:
parent
bee60c203a
commit
e02f569dd3
|
@ -1,5 +1,7 @@
|
|||
2007-01-16 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* psycopg/connection_type.c: obfuscate password after using it.
|
||||
|
||||
* lib/extras.py: moved SQL_IN to extensions.py; we're now officially
|
||||
adapting tuples.
|
||||
|
||||
|
|
|
@ -272,6 +272,9 @@ static struct PyMemberDef connectionObject_members[] = {
|
|||
static int
|
||||
connection_setup(connectionObject *self, char *dsn)
|
||||
{
|
||||
int i;
|
||||
char *pos;
|
||||
|
||||
Dprintf("connection_setup: init connection object at %p, refcnt = %d",
|
||||
self, ((PyObject *)self)->ob_refcnt);
|
||||
|
||||
|
@ -284,7 +287,13 @@ connection_setup(connectionObject *self, char *dsn)
|
|||
self->async_cursor = NULL;
|
||||
self->pgconn = NULL;
|
||||
self->mark = 0;
|
||||
|
||||
|
||||
pos = strstr(self->dsn, "password");
|
||||
if (pos != NULL) {
|
||||
for (pos = pos+9 ; *pos != '\0' && *pos != ' '; pos++)
|
||||
*pos = 'x';
|
||||
}
|
||||
|
||||
pthread_mutex_init(&(self->lock), NULL);
|
||||
|
||||
if (conn_connect(self) != 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user