8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 16:03:02 +01:00

Fixed broken restore via service API

This commit is contained in:
hvlad 2008-04-29 12:24:07 +00:00
parent fcc41d428c
commit 2d7379aa3b
2 changed files with 16 additions and 1 deletions

View File

@ -665,6 +665,7 @@ int gbak(Firebird::UtilSvc* uSvc)
// trusted user name parameter missing // trusted user name parameter missing
} }
tdgbl->gbl_sw_tr_user = argv[itr]; tdgbl->gbl_sw_tr_user = argv[itr];
burp_in_sw_table[IN_SW_BURP_TRUSTED_USER].in_sw_state = 1;
} }
else if (in_sw_tab->in_sw == IN_SW_BURP_ROLE) else if (in_sw_tab->in_sw == IN_SW_BURP_ROLE)
{ {

View File

@ -600,7 +600,6 @@ int RESTORE_restore (const TEXT* file_name,
tdgbl->gbl_sw_user, tdgbl->gbl_sw_user,
strlen(tdgbl->gbl_sw_user)); strlen(tdgbl->gbl_sw_user));
} }
if (tdgbl->gbl_sw_password) if (tdgbl->gbl_sw_password)
{ {
dpb.insertString(tdgbl->uSvc->isService() ? dpb.insertString(tdgbl->uSvc->isService() ?
@ -608,6 +607,11 @@ int RESTORE_restore (const TEXT* file_name,
tdgbl->gbl_sw_password, tdgbl->gbl_sw_password,
strlen(tdgbl->gbl_sw_password)); strlen(tdgbl->gbl_sw_password));
} }
if (tdgbl->gbl_sw_tr_user)
{
dpb.insertString(isc_dpb_trusted_auth,
tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user));
}
dpb.insertByte(isc_dpb_no_db_triggers, 1); dpb.insertByte(isc_dpb_no_db_triggers, 1);
@ -653,6 +657,11 @@ int RESTORE_restore (const TEXT* file_name,
tdgbl->gbl_sw_password, tdgbl->gbl_sw_password,
strlen(tdgbl->gbl_sw_password)); strlen(tdgbl->gbl_sw_password));
} }
if (tdgbl->gbl_sw_tr_user)
{
dpb.insertString(isc_dpb_trusted_auth,
tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user));
}
dpb.insertByte(isc_dpb_set_db_readonly, TRUE); dpb.insertByte(isc_dpb_set_db_readonly, TRUE);
dpb.insertByte(isc_dpb_no_db_triggers, 1); dpb.insertByte(isc_dpb_no_db_triggers, 1);
@ -1008,6 +1017,11 @@ void create_database(BurpGlobals* tdgbl,
tdgbl->gbl_sw_password, tdgbl->gbl_sw_password,
strlen(tdgbl->gbl_sw_password)); strlen(tdgbl->gbl_sw_password));
} }
if (tdgbl->gbl_sw_tr_user)
{
dpb.insertString(isc_dpb_trusted_auth,
tdgbl->gbl_sw_tr_user, strlen(tdgbl->gbl_sw_tr_user));
}
if (page_buffers) if (page_buffers)
{ {
dpb.insertInt(isc_dpb_set_page_buffers, page_buffers); dpb.insertInt(isc_dpb_set_page_buffers, page_buffers);