Skip to content

Commit

Permalink
[daemon] Fix interpreting of empty snapshot args
Browse files Browse the repository at this point in the history
Fix interpreting of snapshot arguments with empty name, i.e. ending in
dot (like "<instance>."). Refuse such arguments, instead of interpreting
them as instance arguments (i.e. equivalent to "<instance>").
  • Loading branch information
ricab committed Oct 19, 2023
1 parent 8751496 commit 3a5b364
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/daemon/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,13 +1166,12 @@ InstanceSnapshotsMap map_snapshots_to_instances(const InstanceSnapshotPairs& ins
for (const auto& it : instances_snapshots)
{
const auto& instance = it.instance_name();
const auto& snapshot = it.snapshot_name();
auto& snapshot_pick = instance_snapshots_map[instance];

if (snapshot.empty())
if (!it.has_snapshot_name())
snapshot_pick.all_or_none = true;
else
snapshot_pick.pick.insert(snapshot);
snapshot_pick.pick.insert(it.snapshot_name());
}

return instance_snapshots_map;
Expand Down

0 comments on commit 3a5b364

Please sign in to comment.