1
1
/// Handle clients by pretending to be a PostgreSQL server.
2
2
use bytes:: { Buf , BufMut , BytesMut } ;
3
- use log:: { debug, error, info, trace} ;
3
+ use log:: { debug, error, info, trace, warn } ;
4
4
use std:: collections:: HashMap ;
5
5
use std:: time:: Instant ;
6
6
use tokio:: io:: { split, AsyncReadExt , BufReader , ReadHalf , WriteHalf } ;
@@ -436,7 +436,7 @@ where
436
436
) ;
437
437
438
438
if password_hash != password_response {
439
- debug ! ( "Password authentication failed" ) ;
439
+ warn ! ( "Invalid password {{ username: {:?}, pool_name: {:?}, application_name: {:?} }}" , pool_name , username , application_name ) ;
440
440
wrong_password ( & mut write, username) . await ?;
441
441
442
442
return Err ( Error :: ClientError ) ;
@@ -458,6 +458,7 @@ where
458
458
)
459
459
. await ?;
460
460
461
+ warn ! ( "Invalid pool name {{ username: {:?}, pool_name: {:?}, application_name: {:?} }}" , pool_name, username, application_name) ;
461
462
return Err ( Error :: ClientError ) ;
462
463
}
463
464
} ;
@@ -466,7 +467,7 @@ where
466
467
let password_hash = md5_hash_password ( & username, & pool. settings . user . password , & salt) ;
467
468
468
469
if password_hash != password_response {
469
- debug ! ( "Password authentication failed" ) ;
470
+ warn ! ( "Invalid password {{ username: {:?}, pool_name: {:?}, application_name: {:?} }}" , pool_name , username , application_name ) ;
470
471
wrong_password ( & mut write, username) . await ?;
471
472
472
473
return Err ( Error :: ClientError ) ;
@@ -658,6 +659,8 @@ where
658
659
) ,
659
660
)
660
661
. await ?;
662
+
663
+ warn ! ( "Invalid pool name {{ username: {:?}, pool_name: {:?}, application_name: {:?} }}" , self . pool_name, self . username, self . application_name) ;
661
664
return Err ( Error :: ClientError ) ;
662
665
}
663
666
} ;
0 commit comments