]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: swift update obj metadata also add generic attrs
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 4 Oct 2013 20:00:26 +0000 (13:00 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Mon, 14 Oct 2013 18:27:19 +0000 (11:27 -0700)
Fixes: #6462
We were missing the generic attributes when we updated the object
metadata (operation that only exists in the swift api).

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit f2645e1c6d7383a0ace3b239f4304e353249c4bb)

src/rgw/rgw_op.cc

index 114b8709a22338a7e3ec233e520d82f55d1e2de6..fc4ad6d3511dcf35d6f7c1bb0d120232fc9e1201 100644 (file)
@@ -1604,6 +1604,13 @@ void RGWPutMetadata::execute()
     }
   }
 
+  map<string, string>::iterator giter;
+  for (giter = s->generic_attrs.begin(); giter != s->generic_attrs.end(); ++giter) {
+    bufferlist& attrbl = attrs[giter->first];
+    const string& val = giter->second;
+    attrbl.append(val.c_str(), val.size() + 1);
+  }
+
   if (has_policy) {
     policy.encode(bl);
     attrs[RGW_ATTR_ACL] = bl;