diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2017-04-02 10:06:31 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2017-04-02 10:06:31 +0200 |
commit | f39d31631b9a7949a348a61a0d910e47139291ad (patch) | |
tree | d2b330eb4ea7e61ca3301f4a38f82e2128e75d92 /ci.c | |
parent | 8d3ae53bcd62ac659c3105b791ead80ed729b317 (diff) | |
download | vdr-f39d31631b9a7949a348a61a0d910e47139291ad.tar.gz vdr-f39d31631b9a7949a348a61a0d910e47139291ad.tar.bz2 |
The file 'cam.data' is no longer written if it is read-only
Diffstat (limited to 'ci.c')
-rw-r--r-- | ci.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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()) { |