[mythtv-commits] Ticket #3865: inuseprograms table is not updated properly when using symlinks for storage directories

MythTV mythtv at cvs.mythtv.org
Mon Aug 20 21:37:10 UTC 2007


#3865: inuseprograms table is not updated properly when using symlinks for storage
directories
-----------------------+----------------------------------------------------
 Reporter:  anonymous  |       Owner:  ijr    
     Type:  defect     |      Status:  new    
 Priority:  minor      |   Milestone:  unknown
Component:  mythtv     |     Version:  head   
 Severity:  medium     |     Mlocked:  0      
-----------------------+----------------------------------------------------
 The inuseprograms table is not updated when a new recording starts when
 the target storage directory is a symlink to the actual storage directory.
 The following error is printed in the backend's log:

 {{{
 INSERT INTO inuseprograms  (chanid, starttime, recusage, hostname,
 lastupdatetime, rechost, recdir )  VALUES  ('2025', '2007-08-20T14:13:00',
 'recorder', 'horus', '2007-08-20T14:13:20',  'horus', NULL);
 Driver error was [2/1048]:
 QMYSQL3: Unable to execute query
 Database error was:
 Column 'recdir' cannot be null
 }}}

 The following code from programinfo.cpp - MarkAsInUse will incorrectly
 detect the symlinked directory as a filename and cut off the last portion
 of the path.  Using a filename such as '/video' will leave the pathname as
 null and the DB update fails.

 {{{
         if (testFile.exists())
         {
             if (testFile.isFile() || testFile.isSymLink())
                 recDir = pathname.section("/", 0, -2);
             else if (testFile.isDir())
                 recDir = pathname;
         }
         else
         {
             testFile.setFile(pathname.section("/", 0, -2));
             if (testFile.exists() && testFile.isDir())
                 recDir = testFile.filePath();
         }
 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/3865>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list