[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#26529: Patches for kdat crashes under KDE 2.x
From:       "Lawrence E. Widman" <widman () cardiothink ! com>
Date:       2001-08-05 20:05:43
[Download RAW message or body]

kdat is a valuable sysadmin tool that doesn't work in 
kde 2.x.  It has no maintainer and has been dropped 
from the default installation list, although the source
is retained in the distribution.  One reason for not
installing the binary is that it crashes with a segfault
whenever almost any operation is attempted.

The following patches to kdat prevent it from crashing
during common operations, specficially when profiles are
managed and during dumps.  One patch also eliminates
creation of duplicate backup profiles.  (Note: data can
be restored from kdat backups by untarring the SECOND
file on the tape, which requires THREE "tar" commands to
/dev/nst0 on my system.)  (Another note: the patches
don't fix any errors in the code.  The original code
nests function calls, which may be exposing errors in
the compiler or the GUI toolkit.  The critical patches
simply unnest these calls.)

These patches are being released to allow people to use
kdat for its most common uses.  They are released under
the GNU license.  I will work on the remaining
well-known bugs, which seem to occur exclusively during
selective restore operations, as time permits.

The packages used were:
  kdeadmin-2.1.1
  qt-2.3.0

Questions and comments to: widman-kdat@cardiothink.com

      --------------------------------------------

diff -rc kdat/BackupProfile.cpp kdat.new/BackupProfile.cpp
*** kdat/BackupProfile.cpp	Sat Aug  5 14:45:50 2000
--- kdat.new/BackupProfile.cpp	Sat Aug  4 23:35:31 2001
***************
*** 105,111 ****
--- 105,118 ----
  void BackupProfile::save()
  {
      QString filename = locateLocal( "appdata", _lastSavedName + ".bp");
+     bool    null_name_p = _lastSavedName.isEmpty();
+ 
+     _lastSavedName = _name.copy();
      
+     if( TRUE == null_name_p ){
+       return;
+     }
+ 
      unlink( QFile::encodeName(filename) );
  
      FILE* fptr = fopen( QFile::encodeName(filename), "w" );
***************
*** 128,135 ****
      fprintf( fptr, "%d\n", _removeSnapshot );
  
      fclose( fptr );
- 
-     _lastSavedName = _name.copy();
  }
  
  QString BackupProfile::getName()
--- 135,140 ----
diff -rc kdat/BackupProfileInfoWidget.cpp kdat.new/BackupProfileInfoWidget.cpp
*** kdat/BackupProfileInfoWidget.cpp	Sat Aug  5 14:45:50 2000
--- kdat.new/BackupProfileInfoWidget.cpp	Fri Aug  3 08:42:56 2001
***************
*** 109,115 ****
          return TRUE;
      }
  
!     if ( _profile->getWorkingDirectory() != _backupProfile->getWorkingDirectory() ) {
          return TRUE;
      }
  
--- 109,119 ----
          return TRUE;
      }
  
!     QString one = _backupProfile->getWorkingDirectory();
!     QString two = _profile->getWorkingDirectory();
!     // 7/31/01: this breaks
!     //    if ( _profile->getWorkingDirectory() != _backupProfile->getWorkingDirectory() ) {
!     if( one != two ){
          return TRUE;
      }
  
diff -rc kdat/BackupProfileWidget.cpp kdat.new/BackupProfileWidget.cpp
*** kdat/BackupProfileWidget.cpp	Sat Aug  5 14:45:51 2000
--- kdat.new/BackupProfileWidget.cpp	Fri Aug  3 08:49:52 2001
***************
*** 141,148 ****
  
  void BackupProfileWidget::slotWorkingDirActivated( const QString & text )
  {
!     while ( !_relativeFiles.isEmpty() ) {
!         _relativeFiles.remove(_relativeFiles.first());
      }
      _files->clear();
  
--- 141,149 ----
  
  void BackupProfileWidget::slotWorkingDirActivated( const QString & text )
  {
!     while ( FALSE == _relativeFiles.isEmpty() ) {
!       QString my_first = _relativeFiles.first();
!       _relativeFiles.remove( my_first );
      }
      _files->clear();
  
***************
*** 173,185 ****
  
      if ( !backupProfile->getWorkingDirectory().isNull() ) {
          for ( int ii = 0; ii < _workingDir->count(); ii++ ) {
!             if ( _workingDir->text( ii ) == backupProfile->getWorkingDirectory() ) {
                  _workingDir->setCurrentItem( ii );
                  break;
              }
          }
      }
!     slotWorkingDirActivated( _workingDir->currentText() );
  
      _oneFilesystem->setChecked( backupProfile->isOneFilesystem() );
      _incremental->setChecked( backupProfile->isIncremental() );
--- 174,192 ----
  
      if ( !backupProfile->getWorkingDirectory().isNull() ) {
          for ( int ii = 0; ii < _workingDir->count(); ii++ ) {
!             QString one = _workingDir->text( ii );
!             QString two = backupProfile->getWorkingDirectory();
! 	      // if ( _workingDir->text( ii ) == backupProfile->getWorkingDirectory() ) {
!             if( one == two ){
                  _workingDir->setCurrentItem( ii );
                  break;
              }
          }
      }
! 
!     //    slotWorkingDirActivated( _workingDir->currentText() );
!     QString one = _workingDir->currentText();
!     slotWorkingDirActivated( one );
  
      _oneFilesystem->setChecked( backupProfile->isOneFilesystem() );
      _incremental->setChecked( backupProfile->isIncremental() );

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic