Index: libs/libmythtv/previewgenerator.cpp
===================================================================
--- libs/libmythtv/previewgenerator.cpp.orig	2008-12-31 15:55:03.000000000 -0500
+++ libs/libmythtv/previewgenerator.cpp	2009-01-13 16:18:55.000000000 -0500
@@ -480,7 +480,7 @@
     QByteArray fname = filename.toAscii();
     if (small_img.save(fname.constData(), "PNG"))
     {
-        chmod(fname.constData(), 0666); // Let anybody update it
+        makeFileAccessible(fname.constData()); // Let anybody update it
 
         VERBOSE(VB_PLAYBACK, LOC +
                 QString("Saved preview '%0' %1x%2")
@@ -495,7 +495,7 @@
     if (QFileInfo(fname.constData()).exists() &&
         small_img.save(newfilea.constData(), "PNG"))
     {
-        chmod(newfilea.constData(), 0666);
+        makeFileAccessible(newfilea.constData());
         rename(newfilea.constData(), fname.constData());
 
         VERBOSE(VB_PLAYBACK, LOC +
Index: libs/libmythtv/datadirect.cpp
===================================================================
--- libs/libmythtv/datadirect.cpp.orig	2009-01-13 14:44:07.000000000 -0500
+++ libs/libmythtv/datadirect.cpp	2009-01-13 16:18:55.000000000 -0500
@@ -1670,7 +1670,7 @@
 
     VERBOSE(VB_GENERAL, "SaveLineupToCache("<<lineupid<<") -- success");
 
-    chmod(fna.constData(), 0666); // Let anybody update it
+    makeFileAccessible(fna.constData()); // Let anybody update it
 
     return true;
 }
Index: libs/libmyth/util.h
===================================================================
--- libs/libmyth/util.h.orig	2008-12-31 15:55:04.000000000 -0500
+++ libs/libmyth/util.h	2009-01-13 16:18:55.000000000 -0500
@@ -61,6 +61,7 @@
 MPUBLIC long long copy(QFile &dst, QFile &src, uint block_size = 0);
 MPUBLIC QString createTempFile(QString name_template = "/tmp/mythtv_XXXXXX",
                                bool dir = false);
+MPUBLIC void makeFileAccessible(QString filename);
 
 MPUBLIC double MythGetPixelAspectRatio(void);
 
Index: libs/libmyth/util.cpp
===================================================================
--- libs/libmyth/util.cpp.orig	2009-01-13 16:10:22.000000000 -0500
+++ libs/libmyth/util.cpp	2009-01-13 16:18:55.000000000 -0500
@@ -1153,6 +1153,30 @@
     return tmpFileName;
 }
 
+/** \fn makeFileAccessible(QString)
+ *  \brief Makes a file accessible to all frontends/backends.
+ *
+ *   This function abstracts the functionality of making a file accessible to
+ *   all frontends and backends.  Currently it contains a permissions hack that
+ *   makes a file accessible even on a system with an improperly configured
+ *   environment (umask/group) where the frontend and backend are being run as
+ *   different users or where a NFS share is used but UID's/GID's differ on
+ *   different hosts.
+ *
+ *   Though the function currently only changes the file mode to 0666, by
+ *   abstracting the functionality, it will be easier to make changes in the
+ *   future if a better approach is chosen.  Similarly, using this function
+ *   allows the hack to be applied only when required if code is written to
+ *   detect or allow the user to specify their system is misconfigured.
+ *
+ *  \param filename   Path of file to make accessible
+ */
+void makeFileAccessible(QString filename)
+{
+    QByteArray fname = filename.toAscii();
+    chmod(fname.constData(), 0666);
+}
+
 double MythGetPixelAspectRatio(void)
 {
     float pixelAspect = 1.0;
Index: programs/mythbackend/mythxml.cpp
===================================================================
--- programs/mythbackend/mythxml.cpp.orig	2009-01-13 16:11:04.000000000 -0500
+++ programs/mythbackend/mythxml.cpp	2009-01-13 16:18:55.000000000 -0500
@@ -1207,6 +1207,8 @@
     QByteArray fname = pRequest->m_sFileName.toAscii();
     img.save( fname.constData(), "PNG" );
 
+    makeFileAccessible(fname.constData());
+
     delete pImage;
 }
 
