Opened 14 years ago

Closed 14 years ago

#1585 closed patch (fixed)

Change permissions on preview .png files

Reported by: sbower@… Owned by: danielk
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

See http://www.gossamer-threads.com/lists/mythtv/dev/191628#191628

This patch implements these changes to the PreviewGenerator? save functionality:

  • After updating the preview .png file, change its permissions to 0666 so that other processes running as different UIDs can update it if they need to.
  • If saving the file failes, and the .png file exists, attempt to save the preview to .png.new, and then move it over the old .png file. Also set perms to 0666.
  • If both of the above fail, and !localOnly, use RemotePreviewRun? to ask the backend to do it for us.

It might be better to do the third test in the Run() method so that LocalPreviewRun? never invokes RemotePreviewRun? itself, I can adapt it if desired.

The part of the message above that I haven't addressed is the possibility that a remote backend is attempting to update the preview and fails (it will have localOnly set, so won't fall back to RemotePreviewRun?). Doing so would require changing the definition of the localOnly argument, and then verifying that the backend that invoked us isn't the backend that recorded the show. Of course, if the backend that recorded the show fails to update the .png, there are probably bigger issues... :-)

danielk is the only one who has touched previewgenerator.cpp, so assigning to him.

Attachments (1)

pdiff (1.6 KB) - added by sbower@… 14 years ago.
patch to previewgenerator.cpp

Download all attachments as: .zip

Change History (3)

Changed 14 years ago by sbower@…

Attachment: pdiff added

patch to previewgenerator.cpp

comment:1 Changed 14 years ago by sbower@…

Owner: changed from daneilk to danielk
Version: head

be nice if I could spell... :-)

comment:2 Changed 14 years ago by danielk

Resolution: fixed
Status: newclosed

(In [9571]) Closes #1585. Adds chmod hacks to avoid problems with common (mis/under)configuration with NFS shares (patch from sbower).

The original patch was accidentally committed in [9566]. This cleans the patch up a bit, but it is functionally unchanged.

Note: See TracTickets for help on using tickets.