Index: frmBackup.cpp =================================================================== RCS file: /projects/pgadmin3/src/ui/frmBackup.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -Lsrc/ui/frmBackup.cpp -Lsrc/ui/frmBackup.cpp -u -w -r1.6 -r1.7 --- src/ui/frmBackup.cpp +++ src/ui/frmBackup.cpp @@ -70,6 +70,8 @@ chkBlobs->SetValue(canBlob); chkDisableDollar->Enable(obj->GetConnection()->BackendMinimumVersion(7, 5)); + environment.Add(wxT("PGPASSWORD=") + object->GetDatabase()->GetServer()->GetPassword()); + // Icon SetIcon(wxIcon(backup_xpm)); @@ -140,9 +142,6 @@ wxString cmd = getCmdPart1(); pgServer *server=object->GetDatabase()->GetServer(); - if (!server->GetTrusted()) - cmd += wxT(" -W ") + server->GetPassword(); - return cmd + getCmdPart2(); } @@ -152,9 +151,6 @@ wxString cmd = getCmdPart1(); pgServer *server=object->GetDatabase()->GetServer(); - if (!server->GetTrusted()) - cmd += wxT(" -W ****"); - return cmd + getCmdPart2(); } Index: dlgClasses.cpp =================================================================== RCS file: /projects/pgadmin3/src/ui/dlgClasses.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -Lsrc/ui/dlgClasses.cpp -Lsrc/ui/dlgClasses.cpp -u -w -r1.6 -r1.7 --- src/ui/dlgClasses.cpp +++ src/ui/dlgClasses.cpp @@ -320,6 +320,12 @@ delete process; process = new wxProcess(this); + size_t i; + for (i=0 ; i < environment.GetCount() ; i++) + { + wxString str=environment.Item(i); + wxSetEnv(str.BeforeFirst('='), str.AfterFirst('=')); + } process->Redirect(); pid = wxExecute(GetCmd(step), wxEXEC_ASYNC, process); if (pid) Index: frmRestore.cpp =================================================================== RCS file: /projects/pgadmin3/src/ui/frmRestore.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -Lsrc/ui/frmRestore.cpp -Lsrc/ui/frmRestore.cpp -u -w -r1.8 -r1.9 --- src/ui/frmRestore.cpp +++ src/ui/frmRestore.cpp @@ -102,6 +102,7 @@ txtMessages->SetMaxLength(0L); btnOK->Disable(); filenameValid=false; + environment.Add(wxT("PGPASSWORD=") + server->GetPassword()); wxCommandEvent ev; OnChange(ev); @@ -244,9 +245,6 @@ { wxString cmd = getCmdPart1(); - if (server->GetNeedPwd()) - cmd += wxT(" -W ") + server->GetPassword(); - return cmd + getCmdPart2(step); } @@ -255,9 +253,6 @@ { wxString cmd = getCmdPart1(); - if (server->GetNeedPwd()) - cmd += wxT(" -W ****"); - return cmd + getCmdPart2(step); } Index: dlgClasses.h =================================================================== RCS file: /projects/pgadmin3/src/include/dlgClasses.h,v retrieving revision 1.8 retrieving revision 1.9 diff -Lsrc/include/dlgClasses.h -Lsrc/include/dlgClasses.h -u -w -r1.8 -r1.9 --- src/include/dlgClasses.h +++ src/include/dlgClasses.h @@ -111,6 +111,7 @@ wxProcess *process; int pid; bool done, final; + wxArrayString environment; #if __GNUC__ >= 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) public: