From: Paul B. <pb...@ib...> - 2006-05-04 06:43:59
|
Claudio, Yup, this looks like the place where I also saw the problem in debug. But wasn't 100% sure how to fix it. Would you do us all a small favour and fix this please. Regards Paul > I think I emailed Jim thrice about this code in svc.cpp on different months > in the past year. As with many observations mine on his source code bugs, > this one didn't deserve his attention either: > > ISC_STATUS statusVector[ISC_STATUS_LENGTH]; > isc_db_handle dbHandle = 0; > TEXT *databaseName = "security.fdb"; > > try > { > if (isc_attach_database(statusVector, 0, databaseName, &dbHandle, > gen.getLength(), (char*) gen.buffer)) > throw OSRIException(statusVector); > } > catch (...) > { > if (dbHandle) > isc_detach_database(statusVector, &dbHandle); > } > > /* Check that the validated user has the authority to access this service */ > > if (strcasecmp(options.spb_user_name, SYSDBA_USER_NAME)) > user_flag = SVC_user_any; > else > user_flag = SVC_user_dba | SVC_user_any; > > If the attach() fails, an exception is thrown, then anything is caught > immediately and a detach() proceeds. Then the code continues executing > merrily regardless of failure or success in connecting to the db. I told Jim > the catch() should rethrow the exception: what is the value of the rest of > the code if we couldn't log in? > > Code reviewing was a waste of time with Vulcan. > > C. > --- > Claudio Valderrama C. > SW developer, consultant. > http://www.cvalde.net - http://www.firebirdsql.org > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel > > |