Opened 17 years ago

Closed 17 years ago

#3475 closed patch (fixed)

Check value of mythfilldatabase log path before using

Reported by: sphery <mtdean@…> Owned by: Anduin Withers
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The attached patch performs several checks on the value of mythfilldatabase log path before using it to call mythfilldatabase. Currently, if the user specifies an invalid value (a directory, an unwritable file, or a file in a non-existent directory), the mythfilldatabase run fails when the shell is unable to set up stdout/stderr.

The attached patch checks for invalid values and does its best to correct them:

  • If the user specifies the path of an existing filesystem object, verify that it's writable and if not disable logging with an error message in mythbackend's log file.
  • If the writable filesystem object is a directory, append "/mythfilldatabase.log" and verify that the new "default" file within that directory will be writable. If not, disable logging with an error message in mythbackend's log file.
  • If the user specifies the path of a non-existent filesystem object, treat it as a file path and verify that the directory path exists and is writable. If not, disable logging with an error message in mythbackend's log file.

Even when logging is disabled by the above checks, mythfilldatabase will run (as if the user did not provide a value for mythfilldatabase log path), so the patch attempts to fail-safely in all situations. It should handle any value the user may provide.

Although this does obviate the need to specify the name of a valid file for mythfilldatabase log path, I still recommend applying the patch in #3474 as it better explains that the user /can/ specify a file path for mythfilldatabase log path.

Attachments (1)

mythtv-mythfilldatabase_log_path_checks.patch (2.8 KB) - added by sphery <mtdean@…> 17 years ago.

Download all attachments as: .zip

Change History (3)

Changed 17 years ago by sphery <mtdean@…>

comment:1 Changed 17 years ago by Anduin Withers

Owner: changed from Isaac Richards to Anduin Withers

comment:2 Changed 17 years ago by Anduin Withers

Resolution: fixed
Status: newclosed

(In [13508]) Closes #3474, #3475

Tanks to Michael T. Dean for these patches. I've modified them slightly so any bugs introduced are my own.

Allow the mythfilldatabase log location the housekeeper uses to point to a file or a directory. Prior to this commit a directory in this setting would cause the housekeeper run mythfilldatabase to fail.

Note: See TracTickets for help on using tickets.