From: Yehuda Sadeh Date: Sat, 24 Jan 2015 01:28:14 +0000 (-0800) Subject: rgw: version id should not contain underscore X-Git-Tag: v0.93~156^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=caefe693562837f9c9071d3bb273b47c5821f169;p=ceph.git rgw: version id should not contain underscore The problem is that we use underscore for the raw object name encoding. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index fd0a35cac81..17e9fc95a58 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -505,6 +505,26 @@ int gen_rand_alphanumeric(CephContext *cct, char *dest, int size) /* size should return 0; } +static const char alphanum_no_underscore_table[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-."; + +int gen_rand_alphanumeric_no_underscore(CephContext *cct, char *dest, int size) /* size should be the required string size + 1 */ +{ + int ret = get_random_bytes(dest, size); + if (ret < 0) { + lderr(cct) << "cannot get random bytes: " << cpp_strerror(-ret) << dendl; + return ret; + } + + int i; + for (i=0; iset_instance(buf); }