Ticket #4860: mythtv-4860-scaled_preview_filesystem_permissions-makeFileAccessible.patch
File mythtv-4860-scaled_preview_filesystem_permissions-makeFileAccessible.patch, 3.4 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/datadirect.cpp
1618 1618 1619 1619 VERBOSE(VB_GENERAL, "SaveLineupToCache("<<lineupid<<") -- success"); 1620 1620 1621 chmod(fn.ascii(), 0666); // Let anybody update it1621 makeFileAccessible(fn); // Let anybody update it 1622 1622 1623 1623 return true; 1624 1624 } -
libs/libmythtv/previewgenerator.cpp
460 460 461 461 if (small_img.save(filename, "PNG")) 462 462 { 463 chmod(filename.ascii(), 0666); // Let anybody update it463 makeFileAccessible(filename); // Let anybody update it 464 464 465 465 VERBOSE(VB_PLAYBACK, LOC + 466 466 QString("Saved preview '%0' %1x%2") … … 474 474 if (QFileInfo(filename.ascii()).exists() && 475 475 small_img.save(newfile.ascii(), "PNG")) 476 476 { 477 chmod(newfile.ascii(), 0666);477 makeFileAccessible(newfile); 478 478 rename(newfile.ascii(), filename.ascii()); 479 479 480 480 VERBOSE(VB_PLAYBACK, LOC + -
programs/mythbackend/mythxml.cpp
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
928 928 return tmpFileName; 929 929 } 930 930 931 /** \fn makeFileAccessible(QString) 932 * \brief Makes a file accessible to all frontends/backends. 933 * 934 * This function abstracts the functionality of making a file accessible to 935 * all frontends and backends. Currently it contains a permissions hack that 936 * makes a file accessible even on a system with an improperly configured 937 * environment (umask/group) where the frontend and backend are being run as 938 * different users or where a NFS share is used but UID's/GID's differ on 939 * different hosts. 940 * 941 * Though the function currently only changes the file mode to 0666, by 942 * abstracting the functionality, it will be easier to make changes in the 943 * future if a better approach is chosen. Similarly, using this function 944 * allows the hack to be applied only when required if code is written to 945 * detect or allow the user to specify their system is misconfigured. 946 * 947 * \param filename Path of file to make accessible 948 */ 949 void makeFileAccessible(QString filename) 950 { 951 chmod(filename.ascii(), 0666); 952 } 953 931 954 double MythGetPixelAspectRatio(void) 932 955 { 933 956 float pixelAspect = 1.0; -
libs/libmyth/util.h
83 83 MPUBLIC long long copy(QFile &dst, QFile &src, uint block_size = 0); 84 84 MPUBLIC QString createTempFile(QString name_template = "/tmp/mythtv_XXXXXX", 85 85 bool dir = false); 86 MPUBLIC void makeFileAccessible(QString filename); 86 87 MPUBLIC unsigned long long myth_get_approximate_large_file_size( 87 88 const QString &fname); 88 89