From: Arvin Schnell Date: Thu, 6 Sep 2012 13:57:57 +0000 (+0200) Subject: - disallow post snapshots with pre snapshots that already have a post snapshot X-Git-Tag: v0.1.3~107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=082b73820ca9f950cff74470094618f496bfaacd;p=thirdparty%2Fsnapper.git - disallow post snapshots with pre snapshots that already have a post snapshot --- diff --git a/snapper/Snapshot.cc b/snapper/Snapshot.cc index a4a9ceb9..a3a2a271 100644 --- a/snapper/Snapshot.cc +++ b/snapper/Snapshot.cc @@ -530,7 +530,8 @@ namespace snapper Snapshots::iterator Snapshots::createPostSnapshot(string description, Snapshots::const_iterator pre) { - if (pre == entries.end() || pre->isCurrent() || pre->getType() != PRE) + if (pre == entries.end() || pre->isCurrent() || pre->getType() != PRE || + findPost(pre) != entries.end()) throw IllegalSnapshotException(); Snapshot snapshot(snapper, POST, nextNumber(), time(NULL));