Opened 4 months ago

Closed 4 months ago

#13522 closed Patch - Feature (fixed)

Feature patch - Remove potential legacy clear text credentials from videosource Schedules Direct grabber removal

Reported by: Gary Buhrmaster Owned by: gigem
Priority: minor Milestone: 31.0
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

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;
 }
 

Change History (2)

comment:1 Changed 4 months ago by gigem

Milestone: needs_triage31.0
Owner: set to gigem
Status: newassigned

comment:2 Changed 4 months ago by David Engel <dengel@…>

Resolution: fixed
Status: assignedclosed

In 40c031a971/mythtv:

Fix some minor issues with videosource entries.

Allow userid to be NULL. Change empty userids to NULL. Change
obsolete, datadirect credentials to NULL.

Based on patches from Gary Buhrmaster <gary.buhrmaster@…>.

Fixes #13521
Fixes #13522

Note: See TracTickets for help on using tickets.