Readability of the credential files is what matters for our usage,
so access() is more appropriate than stat().
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
char **cred,
Error **errp)
{
- struct stat sb;
int ret = -1;
if (!creds->dir) {
*cred = g_strdup_printf("%s/%s", creds->dir, filename);
- if (stat(*cred, &sb) < 0) {
+ if (access(*cred, R_OK) < 0) {
if (errno == ENOENT && !required) {
ret = 0;
} else {