From: Yuval Lifshitz Date: Sun, 4 Sep 2022 13:11:36 +0000 (+0300) Subject: rgw/lua: handle null lua manager in librgw X-Git-Tag: v18.0.0~88^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5177d7d1cb16d2d3c1be5110661bb648f73ec25d;p=ceph.git rgw/lua: handle null lua manager in librgw Fixes: https://tracker.ceph.com/issues/57418 Signed-off-by: Yuval Lifshitz --- diff --git a/src/rgw/rgw_lua.cc b/src/rgw/rgw_lua.cc index 9eb675923650..76b67381c0a2 100644 --- a/src/rgw/rgw_lua.cc +++ b/src/rgw/rgw_lua.cc @@ -79,19 +79,17 @@ std::string script_oid(context ctx, const std::string& tenant) { int read_script(const DoutPrefixProvider *dpp, sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx, std::string& script) { - - return manager->get_script(dpp, y, script_oid(ctx, tenant), script); - + return manager ? manager->get_script(dpp, y, script_oid(ctx, tenant), script) : -ENOENT; } int write_script(const DoutPrefixProvider *dpp, sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx, const std::string& script) { - return manager->put_script(dpp, y, script_oid(ctx, tenant), script); + return manager ? manager->put_script(dpp, y, script_oid(ctx, tenant), script) : -ENOENT; } int delete_script(const DoutPrefixProvider *dpp, sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx) { - return manager->del_script(dpp, y, script_oid(ctx, tenant)); + return manager ? manager->del_script(dpp, y, script_oid(ctx, tenant)) : -ENOENT; } #ifdef WITH_RADOSGW_LUA_PACKAGES