1
0
mirror of https://github.com/mariadb-corporation/libmarias3.git synced 2025-04-18 16:24:01 +03:00

191 Commits

Author SHA1 Message Date
Andrew Hutchings
cfa1f7fcbb
Fix version history (#135) 2024-09-27 10:39:37 +01:00
Andrew Hutchings
374adc5d9f
Delete .github/workflows/.readthedocs.yaml
Thought I had moved this file, it causes CI to freak out.
2024-09-27 10:39:20 +01:00
Andrew Hutchings
63e0edb0dd
Update VERSION.txt
Bump version
libmarias3-3.2.0
2024-09-27 10:24:49 +01:00
Andrew Hutchings
d23e1ad9df
Fix ms3_get_content_type() (#128)
Now uses the legacy curl method of header callbacks. #ifdef guard
removed.
2024-09-27 10:23:30 +01:00
Andrew Hutchings
9d27d9864d
Update README.rst
Fix code block issue
2024-09-27 10:23:12 +01:00
Andrew Hutchings
c76073c848
Fix rtd (#134)
* Fix Read The Docs build

* Put RTD config in the right place...
2024-09-27 10:16:59 +01:00
Andrew Hutchings
2b9837955e
Fix Read The Docs build (#133) 2024-09-27 10:13:44 +01:00
Andrew Hutchings
459e66b27c
Add a bunch more tests to workflows (#132) 2024-09-27 10:08:32 +01:00
Andrew Hutchings
97bfb1110c
Create asan.yml (#131)
Add a GitHub action for ASAN
2024-09-27 09:22:34 +01:00
Andrew Hutchings
0d5babbe46
Merge pull request #130 from grooverdan/fix2
MDEV-34937 s3 engine no longer functional on non-gcc builds
2024-09-26 15:35:05 +01:00
Daniel Black
6d01584d5e MDEV-34937 s3 engine no longer functional on non-gcc builds
snprintf already includes a mechanism to prevent writing
too much into a buffer. The maximum length snprintf will
write is its size. Per manual of snprintf, an insufficient
buffer will result in the function returning size or more.

The common case is this buffer isn't too much. If the
limit is reached, return the MS3_ERR_URI_TOO_LONG like
like before.

With this in place, no pre-processor warning handling is
needed.
2024-09-16 13:53:26 +10:00
Andrew Hutchings
5e6aa32f96 Fix pragma in old Clang
Older Clang versions flag `-Wunused-but-set-variable` as an unknown
warning option. So we need `-Wunknown-warning-option` to stop this, but
GCC doesn't know this, so we need `-Wpragmas` for GCC.
2024-09-11 16:13:49 +03:00
Monty
cbdf5e2851 Added TAGS to .gitignore 2024-09-10 21:50:12 +03:00
Andrew Hutchings
770f8d16bf Put ms3_get_content_type() behind ifdef
It only works with Curl 7.83.0 onwards. It can be refactored to use the
older header API which is callback based at a later date.
2024-09-10 21:48:16 +03:00
Andrew Hutchings
93b1b1e5fd Add Content-Type support for object mime
This adds two new functions `ms3_set_content_type` and
`ms3_get_content_type`.
2024-09-10 15:19:06 +03:00
Andrew Hutchings
28e5459035 Allow for disabling content type
Curl automatically sets the content type of
`application/x-www-form-urlencoded`, whilst this hasn't caused us any
problems in the past, Huawei's S3 implementation does not like it. The
two possible options are to remove the content type header, or use mime
multipart uploads.

Multipart uploads could be implemented eventually, but are only really
needed for very large files (> 4GB). So, this patch adds an option to do
the former, disabling the content type. This is not a default option at
the moment and needs to be set using:

```
ms3_set_option(ms3, MS3_OPT_NO_CONTENT_TYPE, NULL);
```
2024-09-10 15:18:57 +03:00
Andrew Hutchings
70b9a93fd6 Fix building
* RTD theme no longer builds with latest Sphinx. This updates it.
* Fix types based docs compile issues.
* Fix compiler warning not seeing a size check.
2024-09-10 13:45:32 +03:00
Monty
8829031736 Update docs for ms3_debug() API change
Author: Andrew Hutchings <andrew@mariadb.org>
2024-09-10 11:09:39 +03:00
Alexey Antipovsky
f74150b056
feat(curl,timeouts): MCOL-5785: Add functionality to set curl timeouts (#117) 2024-08-08 15:40:43 +03:00
Monty
a81724ab07 Make it possible to enable and disable debugging.
Reviewer: Andrew Hutchings <andrew@mariadb.org
2023-11-26 13:06:15 +02:00
Monty
8ca57c583a Update README.rst with information of how to run tests with minio 2023-11-26 13:05:35 +02:00
Monty
1af7c728dd Clear ms3->read_cb and m3->user_data to stop core dumps in make check 2023-11-26 13:03:36 +02:00
Markus Mäkelä
d2dcab4e95
Add custom callback mechanism (#113)
* Allow custom read callbacks to be used

This allows handling of data in smaller chunks if the ms3_get result is
too large to fit into memory.

* Use the configured buffer size in curl

This way the chunks that curl will return will be the same size that the
internal buffer will be. For the custom read callback, this will allow
the data to be handled in smaller chunks.

* Fix copyright year in read_cb.c

The year is 2023.
2023-06-26 15:13:43 +03:00
Roman Nozdrin
bce1ac8da0
MCOL-5175 Increase the maximum effective length of S3 secret used as SHA256 key producing S3 signature (#114)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2023-06-07 12:10:28 +03:00
Roman Nozdrin
7d7079a080
Merge pull request #112 from markus456/master
Always build with -fPIC
2023-05-23 22:57:56 +01:00
Markus Mäkelä
7d8b61366e
Always build with -fPIC
The flag seems to be added automatically to shared objects but for the
static library only -fPIE is added. Adding -fPIC should allow the static
library to be linked to other libraries.
2023-05-23 15:28:08 +03:00
Roman Nozdrin
1ffac6f40a
Merge pull request #111 from ottok/fix-spelling
Fix spelling: occured -> occurred

> @drrtuy This PR is rather trivial, it should take you only 10 seconds to review and merge.

Sorry. I missed this one.
2023-03-21 23:44:18 +00:00
Otto Kekäläinen
96053cf234 Fix spelling: occured -> occurred
All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
2023-03-11 12:05:28 -08:00
Roman Nozdrin
80a4ed3362
Merge pull request #110 from LinuxJedi/sa-fixes
Fix issues found in static analyzers
2023-01-19 12:15:41 +03:00
Andrew Hutchings
5f4e05b59e Fix issues found in static analyzers
Fix a few issues found by static analyzers and a compile issue for GCC
12.2.1.
2023-01-18 15:30:40 +00:00
David.Hall
d7028f429b
Merge pull request #109 from benthompson15/MCOL-5177
MCOL-5177
2022-09-19 15:32:50 -05:00
David.Hall
91b3604155
Merge pull request #107 from markus456/master
Fix MS3_OPT_FORCE_PROTOCOL_VERSION
2022-09-19 15:31:00 -05:00
benthompson15
906b5b8443 MCOL-5177: Mismatch bucket and endpoint AWS returning HTTP response code 301. SM needs this error reported. 2022-09-19 13:47:40 -05:00
Markus Mäkelä
289108f9f2 Fix MS3_OPT_FORCE_PROTOCOL_VERSION
The wrong variable was being updated.
2022-05-06 10:32:50 +03:00
Roman Nozdrin
3846890513
Merge pull request #105 from ottok/bugfix/kfreebsd-build
Define RTLD_DEFAULT if not defined
2021-06-30 11:51:11 +03:00
Otto Kekäläinen
d26b04537e Define RTLD_DEFAULT if not defined
It was noticed with mariadb-10.5 builds in Debian that libmarias3 failed
to build on platform kFreeBSD due to missing RTLD_DEFAULT. This fix has
been in Debian since February and has proven to work as intended.

Once this is merged upstream, we can stop carrying the downsteam patch
https://salsa.debian.org/mariadb-team/mariadb-10.5/-/blob/master/debian/patches/rtld_default-kfreebsd.patch
2021-06-29 20:39:02 -07:00
Monty
c71898f825 MDEV-25716 Building failure in S3 engine on MacOS
Fixed by renaming VERSION to VERSION.txt
2021-06-14 22:22:25 +03:00
Monty
324efa38ac Added .dgcov to .gitignore 2021-06-14 21:31:14 +03:00
Roman Nozdrin
32b94fff37
Merge pull request #104 from benthompson15/MCOL-4386
MCOL-4386: add functionality to set IAM role credentials directly.
2021-02-22 18:04:51 +03:00
benthompson15
b667953fc4 MCOL-4386: add functionality to set IAM role credentials directly. 2021-02-19 13:02:37 -06:00
Otto Kekäläinen
04bf0070a8 Fix various spelling errors still found in code
missmatch -> mismatch
2021-02-05 11:18:20 +01:00
montywi
0d48bf334f
Merge pull request #101 from LinuxJedi/support-minio
Fix ms3_copy for non-alphanumeric characters
2020-10-20 16:46:51 +03:00
Andrew Hutchings
e97fe760b4 Fix ms3_copy for non-alphanumeric characters
The S3 API specification states that x-amz-copy-source should be
urlencoded. libmarias3 wasn't doing this but Amazon's S3 implementation
appeared to be forgiving enough that it didn't matter. When using
compatible APIs such as MinIO this requirement became stricter.

The code now urlencodes the source path for ms3_copy / ms3_move.

In addition this patch adds support for MinIO in the test suite by
adding environment variables for port and disabling https.
2020-10-20 13:17:09 +01:00
Gagan Goel
e7db0e1e3c
Merge pull request #100 from mariadb-corporation/monty
Fixed that libmarias3 compiles without warnings/errors on OpenSuse Le…
2020-10-19 17:07:34 -04:00
Monty
9ac65b37b9 Fixed that libmarias3 compiles without warnings/errors on OpenSuse Leap 15.1
- Added missing headers to src/include.am. This made 'make distcheck' work
  again!
- Removed not used last argument to execute_assume_role_request()
- Added missing ENUM's to switches.  (gcc 7.5.0 on OpenSuse has by default
  [-Werror=switch-enum] enabled, which causes this to fail even if there
  is a default:)
- In src/responce.c fixed that code is after declarations.  This is C,
  not C++!
- Re-indented some very long line
2020-10-19 23:23:37 +03:00
Patrick LeBlanc
9c5cf22ce0
Merge pull request #99 from benthompson15/IAM-init-fix
IAM assume role could hit unitialized value.
2020-10-09 13:31:38 -05:00
benthompson15
45d8e3f016 IAM assume role could hit unitialized value. 2020-10-09 11:50:56 -05:00
Patrick LeBlanc
4b2753a73d
Merge pull request #98 from benthompson15/IAM-region-bug
Fix for IAM/STS regions to not use S3 bucket region.
2020-10-01 15:46:11 -05:00
benthompson15
2cf111e2f7 Fix for IAM/STS regions to not use S3 bucket region. 2020-10-01 15:17:15 -05:00
Roman Nozdrin
1b259cb47b
Merge pull request #97 from benthompson15/cleanup
Remove unused section of parse_role_list_response
2020-10-01 20:28:02 +03:00