diff options
author | bju <bju@maxi.fritz.box> | 2017-04-22 15:56:41 +0200 |
---|---|---|
committer | bju <bju@maxi.fritz.box> | 2017-04-22 15:56:41 +0200 |
commit | 6502c169013854525b5103a668bc7d5644f2028d (patch) | |
tree | f979786e7077f457ef5b9ff58983675e6d003b2a /vdr-vdrmanager | |
parent | 20d03e5a34d6cbd71b76c09a9203fcd1fb342a66 (diff) | |
download | vdr-manager-6502c169013854525b5103a668bc7d5644f2028d.tar.gz vdr-manager-6502c169013854525b5103a668bc7d5644f2028d.tar.bz2 |
Fix handling of multiple certificate files
Diffstat (limited to 'vdr-vdrmanager')
-rw-r--r-- | vdr-vdrmanager/vdrmanager.cpp | 2 | ||||
-rw-r--r-- | vdr-vdrmanager/vdrmanagerthread.cpp | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/vdr-vdrmanager/vdrmanager.cpp b/vdr-vdrmanager/vdrmanager.cpp index d61f8a1..791d6a5 100644 --- a/vdr-vdrmanager/vdrmanager.cpp +++ b/vdr-vdrmanager/vdrmanager.cpp @@ -159,7 +159,7 @@ bool cVdrManager::ProcessArgs(int argc, char *argv[]) { certFile = keyFile = optarg; } else { certFile = strndup(optarg, sep - optarg); - keyFile = sep; + keyFile = sep+1; } } break; diff --git a/vdr-vdrmanager/vdrmanagerthread.cpp b/vdr-vdrmanager/vdrmanagerthread.cpp index b0c37ba..3eaae36 100644 --- a/vdr-vdrmanager/vdrmanagerthread.cpp +++ b/vdr-vdrmanager/vdrmanagerthread.cpp @@ -68,14 +68,19 @@ bool cVdrManagerThread::Init() #if VDRMANAGER_USE_SSL cVdrmanagerServerSocket * sslSock; - if (!access(certFile, R_OK) && !access(keyFile, R_OK)) { + bool certFileOk = !access(certFile, R_OK); + bool keyFileOk = !access(keyFile, R_OK); + if (certFileOk && keyFileOk) { sslSock = new cVdrmanagerServerSocket(); if (sslSock == NULL || !sslSock->Create(sslPort, password, forceCheckSvdrp, compressionMode, certFile, keyFile)) { return false; } } else { sslSock = NULL; - esyslog("[vdrmanager] SSL key files %s and %s can't be read. SSL disabled.", certFile, keyFile); + if (!certFileOk) + esyslog("[vdrmanager] SSL cert file %s can't be read (errno %d). SSL disabled.", certFile, errno); + if (!keyFileOk) + esyslog("[vdrmanager] SSL key file %s can't be read (errno %d). SSL disabled.", keyFile, errno); } // register server sockets |