OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   04-Nov-2005 19:06:40
  Branch: OPENPKG_2_5_SOLID                Handle: 2005110418064000

  Modified files:           (Branch: OPENPKG_2_5_SOLID)
    openpkg-src/lftp        lftp.patch lftp.spec

  Log:
    apply vendor patch from 3.3.2: fixed a coredump caused by double-free

  Summary:
    Revision    Changes     Path
    1.5.4.1     +139 -0     openpkg-src/lftp/lftp.patch
    1.83.2.3    +1  -1      openpkg-src/lftp/lftp.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/lftp/lftp.patch
  ============================================================================
  $ cvs diff -u -r1.5 -r1.5.4.1 lftp.patch
  --- openpkg-src/lftp/lftp.patch       13 Jun 2005 12:47:12 -0000      1.5
  +++ openpkg-src/lftp/lftp.patch       4 Nov 2005 18:06:40 -0000       1.5.4.1
  @@ -30,3 +30,142 @@
    #endif
    }
    
  +Index: src/ProcWait.cc
  +--- src/ProcWait.cc  2004-01-14 09:23:46 +0100
  ++++ src/ProcWait.cc  2005-10-17 13:39:32 +0200
  +@@ -159,6 +159,6 @@
  + void ProcWait::DeleteAll()
  + {
  +    Signal(false);
  +-   while(chain)
  +-      Delete(chain);
  ++   for(ProcWait *scan=chain; scan; scan=scan->next)
  ++      scan->deleting=true;
  + }
  +Index: src/SMTask.cc
  +--- src/SMTask.cc    2005-06-22 10:04:21 +0200
  ++++ src/SMTask.cc    2005-10-17 12:47:42 +0200
  +@@ -114,21 +114,18 @@
  +       if(*scan==this)
  +       {
  +      *scan=next;
  +-     break;
  ++     return;
  +       }
  +       scan=&((*scan)->next);
  +    }
  ++   assert(!"SMTask dtor called with unregistered task");
  + }
  + 
  + void SMTask::Delete(SMTask *task)
  + {
  +    if(!task)
  +       return;
  +-   if(task->deleting)
  +-      return;
  +    task->deleting=true;
  +-   if(!task->running)
  +-      delete task;
  + }
  + 
  + void SMTask::Enter(SMTask *task)
  +@@ -166,6 +163,28 @@
  +      && (max_time==0 || now<time_limit));
  + }
  + 
  ++int SMTask::CollectGarbage()
  ++{
  ++   int count=0;
  ++   bool repeat_gc;
  ++   do {
  ++      repeat_gc=false;
  ++      SMTask *scan=chain;
  ++      while(scan)
  ++      {
  ++     if(!scan->running && scan->deleting)
  ++     {
  ++        delete replace_value(scan,scan->next);
  ++        repeat_gc=true;
  ++        count++;
  ++        continue;
  ++     }
  ++     scan=scan->next;
  ++      }
  ++   } while(repeat_gc);
  ++   return count;
  ++}
  ++
  + void SMTask::Schedule()
  + {
  +    SMTask *scan;
  +@@ -189,32 +208,20 @@
  +      scan=scan->next;
  +      continue;
  +       }
  ++
  +       if(repeat)
  +      scan->block.SetTimeout(0); // little optimization
  + 
  +-      int res=STALL;
  +-
  +-      Enter(scan);  // mark it current and running.
  +-      SMTask *entered=current;
  +-      if(!current->deleting)
  +-     res=current->Do(); // let it run unless it is dying.
  +-      assert(current==entered);
  +-      scan=scan->next;      // move to a next task.
  +-      SMTask *to_delete=0;
  +-      if(current->deleting)
  +-     to_delete=current;
  +-      if(res!=MOVED && current->block.GetTimeout()==0)
  +-     res=MOVED;
  +-#if 0
  +-      if(res==MOVED)
  +-     printf("MOVED:%p\n",current);
  +-#endif
  +-      Leave(current);       // unmark it running and change current.
  ++      Enter(scan);     // mark it current and running.
  ++      int res=scan->Do();  // let it run.
  ++      Leave(scan);     // unmark it running and change current.
  + 
  +-      delete to_delete;
  +-      if(res==MOVED || to_delete)
  ++      if(res==MOVED || scan->block.GetTimeout()==0)
  +      repeat=true;
  ++      scan=scan->next;         // move to a next task.
  +    }
  ++   if(CollectGarbage())
  ++      repeat=true;
  +    if(repeat)
  +    {
  +       sched_total.SetTimeout(0);
  +@@ -274,6 +281,7 @@
  + 
  + void SMTask::Cleanup()
  + {
  ++  CollectGarbage();
  +   delete init_task;
  + }
  + 
  +Index: src/SMTask.h
  +--- src/SMTask.h     2005-08-04 12:08:11 +0200
  ++++ src/SMTask.h     2005-10-17 12:23:48 +0200
  +@@ -67,6 +67,7 @@
  +    static void UpdateNow() { now.SetToCurrentTime(); }
  + 
  +    static void Schedule();
  ++   static int CollectGarbage();
  +    static void Block() { sched_total.Block(); }
  + 
  +    void Suspend();
  +Index: src/lftp.cc
  +--- src/lftp.cc      2005-05-18 15:25:17 +0200
  ++++ src/lftp.cc      2005-10-17 12:47:43 +0200
  +@@ -112,6 +112,7 @@
  +    {
  +       tty=isatty(0);
  +       ctty=(tcgetpgrp(0)!=(pid_t)-1);
  ++      add_newline=false;
  +       to_free=0;
  +       eof_count=0;
  +       for_history=0;
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/lftp/lftp.spec
  ============================================================================
  $ cvs diff -u -r1.83.2.2 -r1.83.2.3 lftp.spec
  --- openpkg-src/lftp/lftp.spec        15 Oct 2005 06:16:57 -0000      1.83.2.2
  +++ openpkg-src/lftp/lftp.spec        4 Nov 2005 18:06:40 -0000       1.83.2.3
  @@ -33,7 +33,7 @@
   Group:        FTP
   License:      GPL
   Version:      3.3.1
  -Release:      2.5.0
  +Release:      2.5.1
   
   #   list of sources
   Source0:      
http://ftp.yars.free.net/pub/source/lftp/lftp-%{version}.tar.bz2
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to