diff -Nur vdr-1.3.27.org/recording.c vdr-1.3.27/recording.c
--- vdr-1.3.27.org/recording.c	2005-06-05 16:11:45.000000000 +0200
+++ vdr-1.3.27/recording.c	2005-08-04 18:39:54.000000000 +0200
@@ -199,7 +199,7 @@
 bool cResumeFile::Save(int Index)
 {
   if (fileName) {
-     int f = open(fileName, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+     int f = open(fileName, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE);
      if (f >= 0) {
         if (safe_write(f, &Index, sizeof(Index)) < 0)
            LOG_ERROR_STR(fileName);
@@ -974,7 +974,7 @@
         else if (!Record)
            isyslog("missing index file %s", fileName);
         if (Record) {
-           if ((f = open(fileName, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) >= 0) {
+           if ((f = open(fileName, O_WRONLY | O_CREAT | O_APPEND, DEFFILEMODE)) >= 0) {
               if (delta) {
                  esyslog("ERROR: padding index file with %d '0' bytes", delta);
                  while (delta--)
diff -Nur vdr-1.3.27.org/tools.c vdr-1.3.27/tools.c
--- vdr-1.3.27.org/tools.c	2005-05-29 12:18:26.000000000 +0200
+++ vdr-1.3.27/tools.c	2005-08-04 18:39:54.000000000 +0200
@@ -308,7 +308,7 @@
         struct stat fs;
         if (stat(s, &fs) != 0 || !S_ISDIR(fs.st_mode)) {
            dsyslog("creating directory %s", s);
-           if (mkdir(s, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == -1) {
+           if (mkdir(s, ACCESSPERMS) == -1) {
               LOG_ERROR_STR(s);
               result = false;
               break;
@@ -451,7 +451,7 @@
       if (access(buf, F_OK) != 0) { // the file does not exist
          timeval tp1, tp2;
          gettimeofday(&tp1, NULL);
-         int f = open(buf, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+         int f = open(buf, O_WRONLY | O_CREAT, DEFFILEMODE);
          // O_SYNC doesn't work on all file systems
          if (f >= 0) {
             if (fdatasync(f) < 0)
@@ -843,7 +843,7 @@
   if (f < 0 && fileName) {
      time_t Timeout = time(NULL) + WaitSeconds;
      do {
-        f = open(fileName, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+        f = open(fileName, O_WRONLY | O_CREAT | O_EXCL, DEFFILEMODE);
         if (f < 0) {
            if (errno == EEXIST) {
               struct stat fs;
diff -Nur vdr-1.3.27.org/tools.h vdr-1.3.27/tools.h
--- vdr-1.3.27.org/tools.h	2005-05-29 12:24:54.000000000 +0200
+++ vdr-1.3.27/tools.h	2005-08-04 18:39:54.000000000 +0200
@@ -158,7 +158,7 @@
   cFile(void);
   ~cFile();
   operator int () { return f; }
-  bool Open(const char *FileName, int Flags, mode_t Mode = S_IRUSR | S_IWUSR | S_IRGRP);
+  bool Open(const char *FileName, int Flags, mode_t Mode = DEFFILEMODE);
   bool Open(int FileDes);
   void Close(void);
   bool IsOpen(void) { return f >= 0; }
diff -Nur vdr-1.3.27.org/videodir.c vdr-1.3.27/videodir.c
--- vdr-1.3.27.org/videodir.c	2004-12-26 12:52:12.000000000 +0100
+++ vdr-1.3.27/videodir.c	2005-08-04 18:39:54.000000000 +0200
@@ -137,7 +137,7 @@
            }
         }
      }
-  int Result = open(ActualFileName, Flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+  int Result = open(ActualFileName, Flags, DEFFILEMODE);
   if (ActualFileName != FileName)
      free((char *)ActualFileName);
   return Result;
