[mythtv-commits] Ticket #12169: Patch: Allow mythfilldatabase logging when full pathname is used in mythtv-setup

MythTV noreply at mythtv.org
Mon Jun 9 18:29:31 UTC 2014


#12169: Patch: Allow mythfilldatabase logging when full pathname is used in mythtv-
setup
-------------------------------------+-----------------------------
 Reporter:  Biill Meek <keemllib@…>  |          Owner:  wagnerrp
     Type:  Patch - Bug Fix          |         Status:  new
 Priority:  minor                    |      Milestone:  unknown
Component:  MythTV - Housekeeper     |        Version:  Master Head
 Severity:  medium                   |     Resolution:
 Keywords:                           |  Ticket locked:  0
-------------------------------------+-----------------------------

Comment (by mdean):

 For MythTV 0.19, the default value of "mythfilldatabse Path" was changed
 from "mythfilldatabase" to gContext->GetInstallPrefix() +
 "/bin/mythfilldatabase" because someone complained that with just
 "mythfilldatabase" (as in 0.18), an evil user on the local system could
 use a PATH-based attack to execute a script with the permissions of the
 user running the backend by placing a similarly-named script in an
 earlier-in-the-PATH directory.  The default stayed this way in 0.20, but
 0.21 was fixed to use the current approach, which uses "mythfilldatabase"
 as the default value for "mythfilldatabase Path".

 With the current approach, "mythfilldatabase"--only and exactly that
 string, with no path--is not a command.  It's a sentinel value that says
 to run mythfilldatabase from the program's INSTALL_PREFIX (which /is/
 supplied as part of the command to run mythfilldatabase if the
 "mythfilldatabase Path" is set to "mythfilldatabase" to prevent PATH-based
 attacks) and to assume it is the packaged-with-MythTV-source version of
 mythfilldatabase and that it will use MythTV's logging options, so it
 should be passed the same logging options as mythbackend (unless other
 logging options were explicitly specified).

 If any other string is provided for "mythfilldatabase Path" (even
 /usr/bin/mythfilldatabase or /usr/local/bin/mythfilldatabase), it is
 assumed to be a user-override of defaults and the command is executed as
 supplied (so users can provide path-less commands and rely on environment
 PATH settings or can provide absolute paths to the commands and ensure a
 program at the specified location is executed).

 Whether all programs called mythfilldatabase (regardless of path) should
 be considered to be the "canonical" mythfilldatabase application/should be
 given mythbackend's logging options is a question I'll leave for someone
 else to decide.  The current design is simple, but provides flexibility
 for user-/distro-provided scripts.

 That said, I do not think a simple endsWith("mythfilldatabase") check for
 whether to pass mythbackend logging options is appropriate (i.e. users may
 make "mymythfilldatabase" or "/usr/local/bin/custommythfilldatabase" which
 probably should be considered "not the default").  Even an
 endsWith("/mythfilldatabase") is probably not appropriate as users may
 have created a custom script at /home/mythtv/mythfilldatabase or may even
 have MythTV installed to /usr , but created a
 /usr/local/bin/mythfilldatabase script for providing guide data/managing
 guide data retrieval.

 Rather than a "use default command" setting (or even a UI element that
 resets the existing "mythfilldatabase Path" to its default value), it
 would be nice to provide a mechanism within the settings editor that
 allows any setting to be reset to its default value.

 And remember that without any changes, the (presumably small) percentage
 of users who initialized their MythTV database with MythTV 0.18 or 0.19
 can reset their "mythfilldatabase Path" setting to "mythfilldatabase"
 (removing any path component) if they are using direct calls to the
 canonical mythfilldatabase application so that logging is performed
 according to the options specified to mythbackend.  Alternatively, custom
 logging options can be specified in the "Guide data arguments" setting so
 that mythfilldatabase always uses the same logging options, regardless of
 those specified for mythbackend.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/12169#comment:2>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list