@@ -169,16 +169,18 @@ void SBlock::putData(CheckStatusWrapper* status, unsigned int length, const void
169169
170170namespace EDS {
171171
172- void validatePassword (thread_db* tdbb, const PathName& file, ClumpletWriter& dpb)
172+ bool validatePassword (thread_db* tdbb, const PathName& file, ClumpletWriter& dpb)
173173{
174174 // Peliminary checks - should we really validate password ourself
175175 if (!dpb.find (isc_dpb_user_name)) // check for user name presence
176- return ;
176+ return false ;
177177 if (ISC_check_if_remote (file, false )) // check for remote connection
178- return ;
178+ return false ;
179179 UserId* usr = tdbb->getAttachment ()->att_user ;
180+ if (!usr)
181+ return false ;
180182 if (!usr->usr_auth_block .hasData ()) // check for embedded attachment
181- return ;
183+ return false ;
182184
183185 Arg::Gds loginError (isc_login_error);
184186
@@ -260,10 +262,13 @@ void validatePassword(thread_db* tdbb, const PathName& file, ClumpletWriter& dpb
260262 switch (server.plugin ()->authenticate (&s, &sBlock , &writer))
261263 {
262264 case IAuth::AUTH_SUCCESS:
265+ // remove isc_dpb_user_name cause it has precedence over isc_dpb_auth_block
263266 dpb.deleteWithTag (isc_dpb_user_name);
267+ // isc_dpb_password makes no sense w/o isc_dpb_user_name
264268 dpb.deleteWithTag (isc_dpb_password);
269+ // save built by this routine isc_dpb_auth_block
265270 writer.store (&dpb, isc_dpb_auth_block);
266- return ;
271+ return true ;
267272
268273 case IAuth::AUTH_CONTINUE:
269274 limit = MAXLIMIT;
@@ -289,6 +294,7 @@ void validatePassword(thread_db* tdbb, const PathName& file, ClumpletWriter& dpb
289294 }
290295
291296 Arg::Gds (isc_login).raise ();
297+ return false ; // warning silencer
292298}
293299
294300} // namespace EDS
0 commit comments