From db36449fd6b6f205df8d45b5fdfde022fc128f63 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Fri, 6 May 2011 11:24:25 -0500 Subject: [PATCH] remote: check actual access to the cert Instead of calling stat(), check that we'll actually be able to access and read the file. Signed-off-by: Doug Goldstein --- src/remote/remote_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 4c3bdf347a..97ee84a5e2 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -1140,8 +1140,7 @@ static gnutls_certificate_credentials_t x509_cred; static int check_cert_file(const char *type, const char *file) { - struct stat sb; - if (stat(file, &sb) < 0) { + if (access(file, R_OK)) { virReportSystemError(errno, _("Cannot access %s '%s'"), type, file); -- 2.39.5