]> git.pond.sub.org Git - empserver/commitdiff
Really fix give not to wipe out concurrent updates
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Jan 2013 16:37:37 +0000 (17:37 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Jan 2013 16:56:26 +0000 (17:56 +0100)
give() continues after check_sect_ok() fails.  Clobbers the updates
that made check_sect_ok() fail, triggering a seqno mismatch oops.

Commit b58c37e2 (v4.3.27) claimed to fix this, but actually only
suppressed the generation oops.

src/lib/commands/give.c

index b8d4577bd8bace7e26c12263c7b3f07bc2fa3864..dfe1df77ea7bd40bedefcdd8c1ab2e819a06a09a 100644 (file)
@@ -62,7 +62,8 @@ give(void)
            return RET_SYN;
        if ((amt = atoi(p)) == 0)
            return RET_SYN;
-       check_sect_ok(&sect);
+       if (!check_sect_ok(&sect))
+           return RET_FAIL;
        n = sect.sct_item[ip->i_uid];
        if (amt < 0 && -amt > n) {
            m = 0;