[mythtv-commits] Ticket #3475: Check value of mythfilldatabase log path before using
MythTV
mythtv at cvs.mythtv.org
Fri May 18 17:58:00 UTC 2007
#3475: Check value of mythfilldatabase log path before using
----------------------------------------------+-----------------------------
Reporter: sphery <mtdean at thirdcontact.com> | Owner: ijr
Type: patch | Status: new
Priority: minor | Milestone: unknown
Component: mythtv | Version: head
Severity: medium |
----------------------------------------------+-----------------------------
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.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/3475>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list