diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-06-05 17:18:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 17:18:12 +0200 |
commit | d558fb98f6f8ce32e5c08a36d798441f1b941ba8 (patch) | |
tree | 83fed43570e49a30072eec45fbfd08df6a4113ff | |
parent | 39e84c35d0b8bf5b49f45736febd9f506e3ee4ae (diff) | |
parent | 2299ef705c2d69add371ee4ccca04de9f2628853 (diff) |
Merge pull request #3656 from obsidiansystems/handle-unknown-file-ingestion
Add error message when FileIngestionMethod is out of bounds
-rw-r--r-- | src/libstore/daemon.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index f1afdff69..5cff170dd 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -358,8 +358,10 @@ static void performOp(TunnelLogger * logger, ref<Store> store, std::string s, baseName; FileIngestionMethod method; { - bool fixed, recursive; + bool fixed; uint8_t recursive; 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 }; /* Compatibility hack. */ if (!fixed) { |