]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- disallow post snapshots with pre snapshots that already have a post snapshot
authorArvin Schnell <aschnell@suse.de>
Thu, 6 Sep 2012 13:57:57 +0000 (15:57 +0200)
committerArvin Schnell <aschnell@suse.de>
Thu, 6 Sep 2012 13:57:57 +0000 (15:57 +0200)
snapper/Snapshot.cc

index a4a9ceb99d219e2a404d68ad4e890c86b07acd31..a3a2a271a3f36a52144f4cbadd2e14858261f7ba 100644 (file)
@@ -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));