summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-04-02 10:06:31 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2017-04-02 10:06:31 +0200
commitf39d31631b9a7949a348a61a0d910e47139291ad (patch)
treed2b330eb4ea7e61ca3301f4a38f82e2128e75d92
parent8d3ae53bcd62ac659c3105b791ead80ed729b317 (diff)
downloadvdr-f39d31631b9a7949a348a61a0d910e47139291ad.tar.gz
vdr-f39d31631b9a7949a348a61a0d910e47139291ad.tar.bz2
The file 'cam.data' is no longer written if it is read-only
-rw-r--r--HISTORY3
-rw-r--r--ci.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index c72cc530..dd2fd0fc 100644
--- a/HISTORY
+++ b/HISTORY
@@ -8925,7 +8925,7 @@ Video Disk Recorder Revision History
- Now stopping any ongoing recordings before stopping the plugins, to avoid
a crash when stopping VDR while recording.
-2017-04-01: Version 2.3.4
+2017-04-02: Version 2.3.4
- The functionality of HandleRemoteModifications(), which synchronizes changes to
timers between peer VDR machines, has been moved to timers.[ch] and renamed to
@@ -8937,3 +8937,4 @@ Video Disk Recorder Revision History
"event id" in vdr.5 explicitly mentioned this parameter to be 32 bit in size!
The members of cEvent have been slightly rearranged to minimize the memory
requirements on both 32 and 64 bit systems.
+- The file 'cam.data' is no longer written if it is read-only.
diff --git a/ci.c b/ci.c
index 71623d88..db2f1404 100644
--- a/ci.c
+++ b/ci.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ci.c 4.9 2017/03/25 14:09:23 kls Exp $
+ * $Id: ci.c 4.10 2017/04/02 10:02:13 kls Exp $
*/
#include "ci.h"
@@ -2663,6 +2663,13 @@ void cChannelCamRelations::Load(const char *FileName)
void cChannelCamRelations::Save(void)
{
cMutexLock MutexLock(&mutex);
+ struct stat st;
+ if (stat(fileName, &st) == 0) {
+ if ((st.st_mode & S_IWUSR) == 0) {
+ dsyslog("not saving %s (file is read-only)", *fileName);
+ return;
+ }
+ }
dsyslog("saving %s", *fileName);
cSafeFile f(fileName);
if (f.Open()) {