[mythtv-commits] Ticket #13522: Feature patch - Remove potential legacy clear text credentials from videosource Schedules Direct grabber removal

MythTV noreply at mythtv.org
Tue Nov 26 22:26:59 UTC 2019


#13522: Feature patch - Remove potential legacy clear text credentials from
videosource Schedules Direct grabber removal
----------------------------------+--------------------------
     Reporter:  Gary Buhrmaster   |      Owner:  (none)
         Type:  Patch - Feature   |     Status:  new
     Priority:  minor             |  Milestone:  needs_triage
    Component:  MythTV - General  |    Version:  Master Head
     Severity:  medium            |   Keywords:
Ticket locked:  0                 |
----------------------------------+--------------------------
 With the removal of the internal schedules direct grabber (in
 3260e981b0aacf5b1b32be114a8cc07169792568 ), there may still be clear text
 credentials left in the database which are no longer usable, and depending
 on how the user reconfigures their videosources, they may linger for quite
 some time.

 The proposed patch removes those clear text credentials.

 Arguable, the code should be similar to the code in videosource.cpp which
 is now a "NOT IN ( 'technovera' )" rather than the "IN ( .... )", but the
 IN tends to make it explicit that the cleanup is IRT to the removal of the
 internal grabber.

 Lightly tested on test mule.

 Proposed patch follows:

 {{{
 diff --git a/mythtv/bindings/perl/MythTV.pm
 b/mythtv/bindings/perl/MythTV.pm
 index cbce2da3ad..cf891b4a97 100644
 --- a/mythtv/bindings/perl/MythTV.pm
 +++ b/mythtv/bindings/perl/MythTV.pm
 @@ -116,7 +116,7 @@ package MythTV;
  # schema version supported in the main code.  We need to check that the
 schema
  # version in the database is as expected by the bindings, which are
 expected
  # to be kept in sync with the main code.
 -    our $SCHEMA_VERSION = "1357";
 +    our $SCHEMA_VERSION = "1358";

  # NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and
 is
  # the number of items in a ProgramInfo QStringList group used by
 diff --git a/mythtv/bindings/python/MythTV/static.py
 b/mythtv/bindings/python/MythTV/static.py
 index 09814c18ee..94f884b705 100644
 --- a/mythtv/bindings/python/MythTV/static.py
 +++ b/mythtv/bindings/python/MythTV/static.py
 @@ -5,7 +5,7 @@ Contains any static and global variables for MythTV Python
 Bindings
  """

  OWN_VERSION = (30,0,-1,0)
 -SCHEMA_VERSION = 1357
 +SCHEMA_VERSION = 1358
  NVSCHEMA_VERSION = 1007
  MUSICSCHEMA_VERSION = 1024
  PROTO_VERSION = '91'
 diff --git a/mythtv/libs/libmythbase/mythversion.h
 b/mythtv/libs/libmythbase/mythversion.h
 index 33eadd1db5..4d0e9f19a4 100644
 --- a/mythtv/libs/libmythbase/mythversion.h
 +++ b/mythtv/libs/libmythbase/mythversion.h
 @@ -75,7 +75,7 @@
   *      mythtv/bindings/php/MythBackend.php
   */

 -#define MYTH_DATABASE_VERSION "1357"
 +#define MYTH_DATABASE_VERSION "1358"


   MBASE_PUBLIC  const char *GetMythSourceVersion();
 diff --git a/mythtv/libs/libmythtv/dbcheck.cpp
 b/mythtv/libs/libmythtv/dbcheck.cpp
 index 5f4b313863..a702a4c3da 100644
 --- a/mythtv/libs/libmythtv/dbcheck.cpp
 +++ b/mythtv/libs/libmythtv/dbcheck.cpp
 @@ -3522,6 +3522,19 @@ nullptr
              return false;
      }

 +    if (dbver == "1357")
 +    {
 +        // Remove potential clear text credentials no longer usable
 +        const char *updates[] = {
 +            "UPDATE videosource "
 +            "  SET userid = '', password = NULL "
 +            "  WHERE xmltvgrabber IN ('schedulesdirect1', 'datadirect')",
 +            nullptr
 +        };
 +        if (!performActualUpdate(updates, "1358", dbver))
 +            return false;
 +    }
 +
      return true;
  }

 }}}

-- 
Ticket URL: <https://code.mythtv.org/trac/ticket/13522>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list