summaryrefslogtreecommitdiff
path: root/repo/ceph/11-s3_expiration_header.patch
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-06-15 20:02:02 +0100
committerdavidovski <david@davidovski.xyz>2022-06-15 20:02:02 +0100
commitd2567bfbdf0e9fa6db0a6ed1534831ec859a3e03 (patch)
tree684a17eebf446aa1adab1097616f1882c8d51568 /repo/ceph/11-s3_expiration_header.patch
parentd1fc3393cca72e8e432f827f7624e38734fad6dc (diff)
added deps for qemu
Diffstat (limited to 'repo/ceph/11-s3_expiration_header.patch')
-rw-r--r--repo/ceph/11-s3_expiration_header.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/repo/ceph/11-s3_expiration_header.patch b/repo/ceph/11-s3_expiration_header.patch
new file mode 100644
index 0000000..ac12a83
--- /dev/null
+++ b/repo/ceph/11-s3_expiration_header.patch
@@ -0,0 +1,30 @@
+Patch by Robin Mueller
+
+Fix musl date handling
+
+--- a/src/rgw/rgw_lc.cc 2021-09-16 16:27:19.000000000 +0200
++++ b/src/rgw/rgw_lc.cc 2021-10-01 09:17:06.996639952 +0200
+@@ -2238,8 +2238,21 @@
+ // Fri, 23 Dec 2012 00:00:00 GMT
+ char exp_buf[100];
+ time_t exp = ceph::real_clock::to_time_t(*expiration_date);
+- if (std::strftime(exp_buf, sizeof(exp_buf),
+- "%a, %d %b %Y %T %Z", std::gmtime(&exp))) {
++ std::size_t len = std::strftime(exp_buf, sizeof(exp_buf), "%a, %d %b %Y %T %Z", std::gmtime(&exp));
++
++ if (len) {
++ int position = 0;
++ while (exp_buf[position] != 'U' && len - position > 3)
++ position++;
++
++ if (len - position == 3) {
++ char substr[4];
++ memcpy(substr, &exp_buf[position], 4);
++
++ if (strcmp(substr, "UTC") == 0)
++ memcpy(&exp_buf[position], "GMT", 3);
++ }
++
+ hdr = fmt::format("expiry-date=\"{0}\", rule-id=\"{1}\"", exp_buf,
+ *rule_id);
+ } else {