]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't log entries with bad utf8
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 15 Nov 2011 01:02:08 +0000 (17:02 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 15 Nov 2011 01:02:08 +0000 (17:02 -0800)
src/rgw/rgw_log.cc

index 066ec0abdbab0ffc27da7218b6f58ae922b955fa..51caaef044b645487e789a2922be4518aebee938 100644 (file)
@@ -1,4 +1,5 @@
 #include "common/Clock.h"
+#include "common/utf8.h"
 
 #include "rgw_log.h"
 #include "rgw_acl.h"
@@ -97,6 +98,11 @@ int rgw_log_op(struct req_state *s)
   }
   entry.bucket = s->bucket_name;
 
+  if (check_utf8(s->bucket_name, entry.bucket.size()) != 0) {
+    dout(0) << "not logging op on bucket with non-utf8 name" << dendl;
+    return 0;
+  }
+
   if (s->object)
     entry.obj = s->object;
   else