Ticket #4860: mythtv-4860-scaled_preview_filesystem_permissions-makeFileAccessible-20080728.patch
File mythtv-4860-scaled_preview_filesystem_permissions-makeFileAccessible-20080728.patch, 3.6 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/previewgenerator.cpp
463 463 QByteArray fname = filename.toAscii(); 464 464 if (small_img.save(fname.constData(), "PNG")) 465 465 { 466 chmod(fname.constData(), 0666); // Let anybody update it466 makeFileAccessible(fname.constData()); // Let anybody update it 467 467 468 468 VERBOSE(VB_PLAYBACK, LOC + 469 469 QString("Saved preview '%0' %1x%2") … … 478 478 if (QFileInfo(fname.constData()).exists() && 479 479 small_img.save(newfilea.constData(), "PNG")) 480 480 { 481 chmod(newfilea.constData(), 0666);481 makeFileAccessible(newfilea.constData()); 482 482 rename(newfilea.constData(), fname.constData()); 483 483 484 484 VERBOSE(VB_PLAYBACK, LOC + -
libs/libmythtv/datadirect.cpp
1639 1639 1640 1640 VERBOSE(VB_GENERAL, "SaveLineupToCache("<<lineupid<<") -- success"); 1641 1641 1642 chmod(fna.constData(), 0666); // Let anybody update it1642 makeFileAccessible(fna.constData()); // Let anybody update it 1643 1643 1644 1644 return true; 1645 1645 } -
libs/libmyth/util.h
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 MPUBLIC unsigned long long myth_get_approximate_large_file_size( 62 63 const QString &fname); 63 64 -
libs/libmyth/util.cpp
804 804 return tmpFileName; 805 805 } 806 806 807 /** \fn makeFileAccessible(QString) 808 * \brief Makes a file accessible to all frontends/backends. 809 * 810 * This function abstracts the functionality of making a file accessible to 811 * all frontends and backends. Currently it contains a permissions hack that 812 * makes a file accessible even on a system with an improperly configured 813 * environment (umask/group) where the frontend and backend are being run as 814 * different users or where a NFS share is used but UID's/GID's differ on 815 * different hosts. 816 * 817 * Though the function currently only changes the file mode to 0666, by 818 * abstracting the functionality, it will be easier to make changes in the 819 * future if a better approach is chosen. Similarly, using this function 820 * allows the hack to be applied only when required if code is written to 821 * detect or allow the user to specify their system is misconfigured. 822 * 823 * \param filename Path of file to make accessible 824 */ 825 void makeFileAccessible(QString filename) 826 { 827 chmod(filename.ascii(), 0666); 828 } 829 807 830 double MythGetPixelAspectRatio(void) 808 831 { 809 832 float pixelAspect = 1.0; -
programs/mythbackend/mythxml.cpp
1236 1236 QByteArray fname = pRequest->m_sFileName.toAscii(); 1237 1237 img.save( fname.constData(), "PNG" ); 1238 1238 1239 makeFileAccessible(fname.constData()); 1240 1239 1241 delete pImage; 1240 1242 } 1241 1243