Skip to content

Commit

Permalink
Merge pull request #110 from AppImage/fix_set_execution_permissions_o…
Browse files Browse the repository at this point in the history
…peration_not_permitted

Only try setting the execution permissions if the file doesn't have them already
  • Loading branch information
TheAssassin authored May 9, 2019
2 parents f3d6400 + 0d06104 commit 0705fea
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libappimage/desktop_integration/integrator/Integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,15 @@ namespace appimage {
}

void setExecutionPermission() {
bf::permissions(appImage.getPath(), bf::owner_read | bf::owner_exe | bf::add_perms);
if (access(appImage.getPath().c_str(), X_OK) != F_OK)
try {
bf::permissions(appImage.getPath(), bf::owner_read | bf::owner_exe |
bf::group_read | bf::group_exe |
bf::others_read | bf::others_exe |
bf::add_perms);
} catch (const bf::filesystem_error&) {
Logger::error("Unable to set execution permissions on " + appImage.getPath());
}
}
};

Expand Down

0 comments on commit 0705fea

Please sign in to comment.