From: Sun Yuechi Date: Tue, 30 Jun 2026 06:44:56 +0000 (+0800) Subject: rgw/posix: fix inverted If-None-Match check allowing overwrite X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=93febadb4fae16d9313830c3e8e311c7c18187e8;p=ceph.git rgw/posix: fix inverted If-None-Match check allowing overwrite If-None-Match: * must fail when the object exists, but the posix writer did the opposite, disabling overwrite protection. Return PRECONDITION_FAILED when the object exists. Fixes: https://tracker.ceph.com/issues/77871 Signed-off-by: Sun Yuechi --- diff --git a/src/rgw/driver/posix/rgw_sal_posix.cc b/src/rgw/driver/posix/rgw_sal_posix.cc index 92710d016691..ab3310f9596a 100644 --- a/src/rgw/driver/posix/rgw_sal_posix.cc +++ b/src/rgw/driver/posix/rgw_sal_posix.cc @@ -4577,7 +4577,7 @@ int POSIXAtomicWriter::complete(size_t accounted_size, const std::string& etag, if (if_nomatch) { if (strcmp(if_nomatch, "*") == 0) { // test the object is not existing - if (!exists) { + if (exists) { return -ERR_PRECONDITION_FAILED; } } else {