mirror of https://gitee.com/openkylin/libvirt.git
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 <cardoe@gentoo.org>
This commit is contained in:
parent
f84fe150e1
commit
db36449fd6
|
@ -1140,8 +1140,7 @@ static gnutls_certificate_credentials_t x509_cred;
|
||||||
static int
|
static int
|
||||||
check_cert_file(const char *type, const char *file)
|
check_cert_file(const char *type, const char *file)
|
||||||
{
|
{
|
||||||
struct stat sb;
|
if (access(file, R_OK)) {
|
||||||
if (stat(file, &sb) < 0) {
|
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("Cannot access %s '%s'"),
|
_("Cannot access %s '%s'"),
|
||||||
type, file);
|
type, file);
|
||||||
|
|
Loading…
Reference in New Issue