Ticket #4860: mythtv-4860-scaled_preview_filesystem_permissions-makeFileAccessible.2.patch
| File mythtv-4860-scaled_preview_filesystem_permissions-makeFileAccessible.2.patch, 3.8 KB (added by , 17 years ago) |
|---|
-
libs/libmythtv/previewgenerator.cpp
old new 480 480 QByteArray fname = filename.toAscii(); 481 481 if (small_img.save(fname.constData(), "PNG")) 482 482 { 483 chmod(fname.constData(), 0666); // Let anybody update it483 makeFileAccessible(fname.constData()); // Let anybody update it 484 484 485 485 VERBOSE(VB_PLAYBACK, LOC + 486 486 QString("Saved preview '%0' %1x%2") … … 495 495 if (QFileInfo(fname.constData()).exists() && 496 496 small_img.save(newfilea.constData(), "PNG")) 497 497 { 498 chmod(newfilea.constData(), 0666);498 makeFileAccessible(newfilea.constData()); 499 499 rename(newfilea.constData(), fname.constData()); 500 500 501 501 VERBOSE(VB_PLAYBACK, LOC + -
libs/libmythtv/datadirect.cpp
old new 1670 1670 1671 1671 VERBOSE(VB_GENERAL, "SaveLineupToCache("<<lineupid<<") -- success"); 1672 1672 1673 chmod(fna.constData(), 0666); // Let anybody update it1673 makeFileAccessible(fna.constData()); // Let anybody update it 1674 1674 1675 1675 return true; 1676 1676 } -
libs/libmyth/util.h
old new 61 61 MPUBLIC long long copy(QFile &dst, QFile &src, uint block_size = 0); 62 62 MPUBLIC QString createTempFile(QString name_template = "/tmp/mythtv_XXXXXX", 63 63 bool dir = false); 64 MPUBLIC void makeFileAccessible(QString filename); 64 65 65 66 MPUBLIC double MythGetPixelAspectRatio(void); 66 67 -
libs/libmyth/util.cpp
old new 1153 1153 return tmpFileName; 1154 1154 } 1155 1155 1156 /** \fn makeFileAccessible(QString) 1157 * \brief Makes a file accessible to all frontends/backends. 1158 * 1159 * This function abstracts the functionality of making a file accessible to 1160 * all frontends and backends. Currently it contains a permissions hack that 1161 * makes a file accessible even on a system with an improperly configured 1162 * environment (umask/group) where the frontend and backend are being run as 1163 * different users or where a NFS share is used but UID's/GID's differ on 1164 * different hosts. 1165 * 1166 * Though the function currently only changes the file mode to 0666, by 1167 * abstracting the functionality, it will be easier to make changes in the 1168 * future if a better approach is chosen. Similarly, using this function 1169 * allows the hack to be applied only when required if code is written to 1170 * detect or allow the user to specify their system is misconfigured. 1171 * 1172 * \param filename Path of file to make accessible 1173 */ 1174 void makeFileAccessible(QString filename) 1175 { 1176 QByteArray fname = filename.toAscii(); 1177 chmod(fname.constData(), 0666); 1178 } 1179 1156 1180 double MythGetPixelAspectRatio(void) 1157 1181 { 1158 1182 float pixelAspect = 1.0; -
programs/mythbackend/mythxml.cpp
old new 1207 1207 QByteArray fname = pRequest->m_sFileName.toAscii(); 1208 1208 img.save( fname.constData(), "PNG" ); 1209 1209 1210 makeFileAccessible(fname.constData()); 1211 1210 1212 delete pImage; 1211 1213 } 1212 1214
