Skip to content

Commit

Permalink
Merge pull request #2203 from spnethw/multiarc_check_read_access_to_a…
Browse files Browse the repository at this point in the history
…rchive

multiarc: check if we have read access to the archive
  • Loading branch information
elfmz committed May 6, 2024
2 parents 799e1ac + de549ce commit 079172e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions multiarc/src/arccmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ ArcCommand::ArcCommand(struct PluginPanelItem *PanelItem, int ItemsNumber, const
}
}
} else {
if ((CommandType == CMD_EXTRACT || CommandType == CMD_EXTRACTWITHOUTPATH) // extraction from the archive,
&& (sudo_client_is_required_for(".", true) == 1)) { // check if we have write access to dest dir
if((sudo_client_is_required_for(ArcName, false) == 1) // do we have read access to the archive?
|| ((CommandType == CMD_EXTRACT || CommandType == CMD_EXTRACTWITHOUTPATH) // extraction from the archive,
&& (sudo_client_is_required_for(".", true) == 1))) { // check if we have write access to dest dir
NeedSudo = true;
}
}
Expand Down

0 comments on commit 079172e

Please sign in to comment.