Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overwrite+remove deleting the wrong file on relative path. #235

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ int main(const int argc, const char** argv) {

optional<string> pathToAppImage = [&args]() {
if (!args.pos.empty()) {
return optional<string>(args.as<string>(0));
// calculate absolute path to normalize the path for when it's
// checked back from Updater::pathToNewFile
return optional<string>(abspath(args.as<string>(0)));
}

return optional<string>();
Expand Down Expand Up @@ -240,6 +242,9 @@ int main(const int argc, const char** argv) {
return 1;
}

// normalize against pathToAppImage - so they follow the same format
newFilePath = abspath(newFilePath);

auto validationResult = updater.validateSignature();

while (updater.nextStatusMessage(nextMessage))
Expand Down