This matches the configuration from popular tools like AWS CLI and
allows multiple profile names via -o profile=name. The existing
credential mechanisms continue to work. Fixes#822.
Several of these do not work since the shell does not replace ~ in the
middle of a token, e.g., -o passwd=~/.passwd . Replace all of them
for consistency. Fixes#836.
Addresses GCC 8 warning:
common_auth.cpp: In function ‘std::__cxx11::string s3fs_sha256sum(int, off_t, ssize_t)’:
common_auth.cpp:84:12: warning: ‘char* strncat(char*, const char*, size_t)’ output may be truncated copying 2 bytes from a string of length 2 [-Wstringop-truncation]
strncat(sha256, hexbuf, 2);
Amazon SSE-C https://tinyurl.com/ychug4cg writes:
> Use this header to provide the 256-bit, base64-encoded encryption key
> for Amazon S3 to use to encrypt or decrypt your data.
It seems likely that future keys would be as long, or longer, so
this change assumes that text longer than 32 characters are keys
that are base64 encoded.
Signed-off-by: Earl Chew <earl_chew@yahoo.com>
Without this change, the following warning appears in the syslog/journal
during startup:
Libgcrypt warning: missing initialization - please fix the application
From the [documentation][0]:
> The function `gcry_check_version` initializes some subsystems used by
> Libgcrypt and must be invoked before any other function in the
> library.
Fixes#524, which says:
> gnutls is initialized by gnutls_global_init() function and
> gcry_check_version() function for initializing libgcry is called from
> this gnutls_global_init().
I checked the gnutls source and it hasn't contained a call to
gcry_check_version() since the libgcrypt backend was removed in 2011
(commit 8116cdc8f131edd586dad3128ae35dd744cfc32f). In any case, the
gcry_check_version() documentation continues:
> It is important that these initialization steps are not done by a
> library but by the actual application.
so it would be incorrect for a library used by s3fs to initialize
libgcrypt.
[0]: https://www.gnupg.org/documentation/manuals/gcrypt/Initializing-the-library.html