Skip to content

Commit

Permalink
campaignd: Record the hashed passphrase for new uploads
Browse files Browse the repository at this point in the history
Otherwise no passphrase is recorded into the server config and it
becomes impossible to reupload the add-on without admin assistance.
  • Loading branch information
irydacea committed Oct 9, 2016
1 parent 265bd66 commit 56a1494
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/campaign_server/campaign_server.cpp
Expand Up @@ -720,6 +720,8 @@ void server::handle_upload(const server::request& req)
return;
}

const bool existing_upload = campaign != NULL;

std::string message = "Add-on accepted.";

if(!version_info(upload["version"]).good()) {
Expand All @@ -744,6 +746,10 @@ void server::handle_upload(const server::request& req)
(*campaign)["type"] = upload["type"];
(*campaign)["email"] = upload["email"];

if(!existing_upload) {
set_passphrase(*campaign, upload["passphrase"]);
}

if((*campaign)["downloads"].empty()) {
(*campaign)["downloads"] = 0;
}
Expand Down

0 comments on commit 56a1494

Please sign in to comment.