Skip to content

Commit

Permalink
improvement: +x not u+x
Browse files Browse the repository at this point in the history
  • Loading branch information
martim01 committed May 11, 2022
1 parent 12dcc40 commit 5fb117c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pamupdatemanager/pamupdatemanagerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ bool pamupdatemanagerDialog::ReplaceFileUsr(wxDC& dc, wxTarInputStream& input, c
}
}


wxString sTemp = "/tmp/"+fnOutput.GetFullName();
wxFileOutputStream out(sTemp);
if(out.IsOk())
Expand All @@ -436,7 +437,7 @@ bool pamupdatemanagerDialog::ReplaceFileUsr(wxDC& dc, wxTarInputStream& input, c
input.Read(out);
}
auto nResult = wxExecute(wxString::Format("sh -c \"echo %s | sudo -S -k mv %s %s\"", m_pedtPassword->GetValue().c_str(), sTemp.c_str(), fnOutput.GetFullPath().c_str()), wxEXEC_SYNC);
nResult += wxExecute(wxString::Format("sh -c \"echo %s | sudo -S -k chmod u+x %s\"", m_pedtPassword->GetValue().c_str(), fnOutput.GetFullPath().c_str()), wxEXEC_SYNC);
nResult += wxExecute(wxString::Format("sh -c \"echo %s | sudo -S -k chmod +x %s\"", m_pedtPassword->GetValue().c_str(), fnOutput.GetFullPath().c_str()), wxEXEC_SYNC);
if(nResult == 0)
{
m_setUpdated.insert(fnOutput.GetFullPath()+".bak");
Expand Down

0 comments on commit 5fb117c

Please sign in to comment.