Changeset 2609

Show
Ignore:
Timestamp:
05/09/12 12:41:52 (12 months ago)
Author:
peter
Message:

stop logging postgres database password in gpgsql connection errors. Fixes #459, reported by Stefan Kaltenbrunner.

Location:
trunk/pdns/modules/gpgsqlbackend
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/modules/gpgsqlbackend/spgsql.cc

    r2234 r2609  
    2727    d_connectstr+=" port="+port; 
    2828 
    29   if(!password.empty()) 
     29  d_connectlogstr=d_connectstr; 
     30 
     31  if(!password.empty()) { 
     32    d_connectlogstr+=" password=XXX"; 
    3033    d_connectstr+=" password="+password; 
     34  } 
    3135   
    3236  ensureConnect(); 
     
    5660  if (!d_db || PQstatus(d_db)==CONNECTION_BAD) { 
    5761    try { 
    58       throw sPerrorException("Unable to connect to database, connect string: "+d_connectstr); 
     62      throw sPerrorException("Unable to connect to database, connect string: "+d_connectlogstr); 
    5963    } 
    6064    catch(...) { 
  • trunk/pdns/modules/gpgsqlbackend/spgsql.hh

    r2234 r2609  
    2727  PGconn* d_db;  
    2828  string d_connectstr; 
     29  string d_connectlogstr; 
    2930  PGresult* d_result; 
    3031  int d_count;