Ticket #4860: mythtv-scaled_preview_filesystem_permissions-makeFileAccessible-20080307.patch
| File mythtv-scaled_preview_filesystem_permissions-makeFileAccessible-20080307.patch, 3.5 KB (added by , 18 years ago) |
|---|
-
libs/libmythtv/datadirect.cpp
old new bool DataDirectProcessor::SaveLineupToCa 1561 1561 1562 1562 VERBOSE(VB_GENERAL, "SaveLineupToCache("<<lineupid<<") -- success"); 1563 1563 1564 chmod(fn.ascii(), 0666); // Let anybody update it1564 makeFileAccessible(fn); // Let anybody update it 1565 1565 1566 1566 return true; 1567 1567 } -
libs/libmythtv/previewgenerator.cpp
old new bool PreviewGenerator::SavePreview(QStri 461 461 462 462 if (small_img.save(filename, "PNG")) 463 463 { 464 chmod(filename.ascii(), 0666); // Let anybody update it464 makeFileAccessible(filename); // Let anybody update it 465 465 466 466 VERBOSE(VB_PLAYBACK, LOC + 467 467 QString("Saved preview '%0' %1x%2") … … bool PreviewGenerator::SavePreview(QStri 475 475 if (QFileInfo(filename.ascii()).exists() && 476 476 small_img.save(newfile.ascii(), "PNG")) 477 477 { 478 chmod(newfile.ascii(), 0666);478 makeFileAccessible(newfile); 479 479 rename(newfile.ascii(), filename.ascii()); 480 480 481 481 VERBOSE(VB_PLAYBACK, LOC + -
programs/mythbackend/mythxml.cpp
old new void MythXML::GetPreviewImage( HTTPReque 1237 1237 1238 1238 img.save( pRequest->m_sFileName.ascii(), "PNG" ); 1239 1239 1240 makeFileAccessible(pRequest->m_sFileName); 1241 1240 1242 delete pImage; 1241 1243 } 1242 1244 -
libs/libmyth/util.cpp
old new QString createTempFile(QString name_temp 927 927 return tmpFileName; 928 928 } 929 929 930 /** \fn makeFileAccessible(QString) 931 * \brief Makes a file accessible to all frontends/backends. 932 * 933 * This function abstracts the functionality of making a file accessible to 934 * all frontends and backends. Currently it contains a permissions hack that 935 * makes a file accessible even on a system with an improperly configured 936 * environment (umask/group) where the frontend and backend are being run as 937 * different users or where a NFS share is used but UID's/GID's differ on 938 * different hosts. 939 * 940 * Though the function currently only changes the file mode to 0666, by 941 * abstracting the functionality, it will be easier to make changes in the 942 * future if a better approach is chosen. Similarly, using this function 943 * allows the hack to be applied only when required if code is written to 944 * detect or allow the user to specify their system is misconfigured. 945 * 946 * \param filename Path of file to make accessible 947 */ 948 void makeFileAccessible(QString filename) 949 { 950 chmod(filename.ascii(), 0666); 951 } 952 930 953 double MythGetPixelAspectRatio(void) 931 954 { 932 955 float pixelAspect = 1.0; -
libs/libmyth/util.h
old new MPUBLIC bool telnet(const QString &host, 79 79 MPUBLIC long long copy(QFile &dst, QFile &src, uint block_size = 0); 80 80 MPUBLIC QString createTempFile(QString name_template = "/tmp/mythtv_XXXXXX", 81 81 bool dir = false); 82 MPUBLIC void makeFileAccessible(QString filename); 82 83 MPUBLIC unsigned long long myth_get_approximate_large_file_size( 83 84 const QString &fname); 84 85
