1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 10:50:24 -04:00

Merge pull request #3656 from obsidiansystems/handle-unknown-file-ingestion

Add error message when FileIngestionMethod is out of bounds
This commit is contained in:
Eelco Dolstra 2020-06-05 17:18:12 +02:00 committed by GitHub
commit d558fb98f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -358,8 +358,10 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
std::string s, baseName; std::string s, baseName;
FileIngestionMethod method; FileIngestionMethod method;
{ {
bool fixed, recursive; bool fixed; uint8_t recursive;
from >> baseName >> fixed /* obsolete */ >> recursive >> s; from >> baseName >> fixed /* obsolete */ >> recursive >> s;
if (recursive > (uint8_t) FileIngestionMethod::Recursive)
throw Error("unsupported FileIngestionMethod with value of %i; you may need to upgrade nix-daemon", recursive);
method = FileIngestionMethod { recursive }; method = FileIngestionMethod { recursive };
/* Compatibility hack. */ /* Compatibility hack. */
if (!fixed) { if (!fixed) {