Ticket #4860: mythtv-4860-scaled_preview_filesystem_permissions-makeFileAccessible-20080927.patch
File mythtv-4860-scaled_preview_filesystem_permissions-makeFileAccessible-20080927.patch, 3.8 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/previewgenerator.cpp
old new 466 466 QByteArray fname = filename.toAscii(); 467 467 if (small_img.save(fname.constData(), "PNG")) 468 468 { 469 chmod(fname.constData(), 0666); // Let anybody update it469 makeFileAccessible(fname.constData()); // Let anybody update it 470 470 471 471 VERBOSE(VB_PLAYBACK, LOC + 472 472 QString("Saved preview '%0' %1x%2") … … 481 481 if (QFileInfo(fname.constData()).exists() && 482 482 small_img.save(newfilea.constData(), "PNG")) 483 483 { 484 chmod(newfilea.constData(), 0666);484 makeFileAccessible(newfilea.constData()); 485 485 rename(newfilea.constData(), fname.constData()); 486 486 487 487 VERBOSE(VB_PLAYBACK, LOC + -
libs/libmythtv/datadirect.cpp
old new 1644 1644 1645 1645 VERBOSE(VB_GENERAL, "SaveLineupToCache("<<lineupid<<") -- success"); 1646 1646 1647 chmod(fna.constData(), 0666); // Let anybody update it1647 makeFileAccessible(fna.constData()); // Let anybody update it 1648 1648 1649 1649 return true; 1650 1650 } -
libs/libmyth/util.h
old new 58 58 MPUBLIC long long copy(QFile &dst, QFile &src, uint block_size = 0); 59 59 MPUBLIC QString createTempFile(QString name_template = "/tmp/mythtv_XXXXXX", 60 60 bool dir = false); 61 MPUBLIC void makeFileAccessible(QString filename); 61 62 62 63 MPUBLIC double MythGetPixelAspectRatio(void); 63 64 -
libs/libmyth/util.cpp
old new 802 802 return tmpFileName; 803 803 } 804 804 805 /** \fn makeFileAccessible(QString) 806 * \brief Makes a file accessible to all frontends/backends. 807 * 808 * This function abstracts the functionality of making a file accessible to 809 * all frontends and backends. Currently it contains a permissions hack that 810 * makes a file accessible even on a system with an improperly configured 811 * environment (umask/group) where the frontend and backend are being run as 812 * different users or where a NFS share is used but UID's/GID's differ on 813 * different hosts. 814 * 815 * Though the function currently only changes the file mode to 0666, by 816 * abstracting the functionality, it will be easier to make changes in the 817 * future if a better approach is chosen. Similarly, using this function 818 * allows the hack to be applied only when required if code is written to 819 * detect or allow the user to specify their system is misconfigured. 820 * 821 * \param filename Path of file to make accessible 822 */ 823 void makeFileAccessible(QString filename) 824 { 825 QByteArray fname = filename.toAscii(); 826 chmod(fname.constData(), 0666); 827 } 828 805 829 double MythGetPixelAspectRatio(void) 806 830 { 807 831 float pixelAspect = 1.0; -
programs/mythbackend/mythxml.cpp
old new 1196 1196 QByteArray fname = pRequest->m_sFileName.toAscii(); 1197 1197 img.save( fname.constData(), "PNG" ); 1198 1198 1199 makeFileAccessible(fname.constData()); 1200 1199 1201 delete pImage; 1200 1202 } 1201 1203