From: Volker Lendecke Date: Sun, 17 Nov 2019 15:45:45 +0000 (+0100) Subject: dbwrap_watch: Prevent two watchers per fetch_locked sequence X-Git-Tag: ldb-2.1.0~629 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7cea5fec29a0d425263a7ecb79d89a4f13de3f7e;p=thirdparty%2Fsamba.git dbwrap_watch: Prevent two watchers per fetch_locked sequence This can lead to very confusing bugs, and the code right now does not deal with it well. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/selftest/knownfail b/selftest/knownfail index ffd2f0b3f00..82259dcfe90 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -16,7 +16,6 @@ ^samba3.smbtorture_s3.crypt_server # expected to give ACCESS_DENIED as SMB1 encryption isn't used ^samba3.smbtorture_s3.*.LOCK12.*\(fileserver\) ^samba3.smbtorture_s3.*.LOCK12.*\(nt4_dc\) -^samba3.smbtorture_s3.LOCAL-DBWRAP-WATCH4 ^samba3.nbt.dgram.*netlogon2\(nt4_dc\) ^samba3.*rap.sam.*.useradd # Not provided by Samba 3 ^samba3.*rap.sam.*.userdelete # Not provided by Samba 3 diff --git a/source3/lib/dbwrap/dbwrap_watch.c b/source3/lib/dbwrap/dbwrap_watch.c index 8246fd925e2..0be8fd2df74 100644 --- a/source3/lib/dbwrap/dbwrap_watch.c +++ b/source3/lib/dbwrap/dbwrap_watch.c @@ -895,6 +895,10 @@ struct tevent_req *dbwrap_watched_watch_send(TALLOC_CTX *mem_ctx, tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); return tevent_req_post(req, ev); } + if (subrec->added_watcher) { + tevent_req_nterror(req, NT_STATUS_REQUEST_NOT_ACCEPTED); + return tevent_req_post(req, ev); + } state->me = messaging_server_id(ctx->msg);