[mythtv-commits] Ticket #6358: checkTimeZone() with old backends can crash

MythTV mythtv at cvs.mythtv.org
Sun Mar 15 22:03:51 UTC 2009


#6358: checkTimeZone() with old backends can crash
------------------------------+---------------------------------------------
 Reporter:  nigel             |        Owner:  ijr    
     Type:  defect            |       Status:  new    
 Priority:  minor             |    Milestone:  unknown
Component:  MythTV - General  |      Version:  unknown
 Severity:  medium            |   Resolution:         
  Mlocked:  0                 |  
------------------------------+---------------------------------------------

Comment(by anonymous):

 Slightly related to [18792]. The call is coming from mythbackend's main().
 It would be possible to checking the result from QUERY_TIME_ZONE, but I
 think it is easiest to have an earlier call to CheckProtoVersion(), to
 weed out backends that are too old to support QUERY_TIME_ZONE, '''and'''
 this host as a slave backend:
 {{{
 Index: main.cpp
 ===================================================================
 --- main.cpp    (revision 20211)
 +++ main.cpp    (working copy)
 @@ -826,7 +826,12 @@
                          gContext->GetSetting("MasterServerIP",
 "127.0.0.1"),
                          gContext->GetNumSetting("MasterServerPort",
 6543)))
          {
 -            QStringList tempMonitorDone("DONE");
 +            if (!CheckProtoVersion(tempMonitorConnection))
 +            {
 +                VERBOSE(VB_IMPORTANT, "Master backend is incompatible
 with "
 +                                      "this backend. Cannot become a
 slave.");
 +                return BACKEND_EXIT_NO_CONNECT;
 +            }

              QStringList tempMonitorAnnounce("ANN Monitor tzcheck 0");
              tempMonitorConnection->writeStringList(tempMonitorAnnounce);
 @@ -856,6 +861,8 @@
                          QString("Backend is running in %1 time zone.")
                          .arg(getTimeZoneID()));
              }
 +
 +            QStringList tempMonitorDone("DONE");
              tempMonitorConnection->writeStringList(tempMonitorDone);
          }
          tempMonitorConnection->DownRef();

 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/6358#comment:1>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list