Changeset 799


Ignore:
Timestamp:
12/12/2008 3:40:22 AM (6 years ago)
Author:
lowjoel
Message:

-Add the task into the list of tasks, broadcast the task added event THEN queue the task. This prevents the task started event from reaching the event handlers before the task added event, in essence forcing the task to start without having been added
-Securely remove the old files and folders, simple deletion leaves the files behind and forensic analysis can tell users when the volume was erased
-Make the file names used for erasing as long as possible (within MAX_PATH)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/DirectExecutor.cs

    r798 r799  
    7676            //Add the task to the set of tasks 
    7777            lock (tasksLock) 
    78             { 
    7978                tasks.Add(task.ID, task); 
    80  
    81                 //If the task is scheduled to run now, break the waiting thread and 
    82                 //run it immediately 
    83                 if (task.Schedule == Schedule.RunNow) 
    84                 { 
    85                     QueueTask(task); 
    86                 } 
    87                 //If the task is scheduled, add the next execution time to the list 
    88                 //of schduled tasks. 
    89                 else if (task.Schedule != Schedule.RunOnRestart) 
    90                 { 
    91                     ScheduleTask(task); 
    92                 } 
    93             } 
    9479 
    9580            //Call all the event handlers who registered to be notified of tasks 
    9681            //being added. 
    9782            OnTaskAdded(task); 
     83 
     84            //If the task is scheduled to run now, break the waiting thread and 
     85            //run it immediately 
     86            if (task.Schedule == Schedule.RunNow) 
     87            { 
     88                QueueTask(task); 
     89            } 
     90            //If the task is scheduled, add the next execution time to the list 
     91            //of schduled tasks. 
     92            else if (task.Schedule != Schedule.RunOnRestart) 
     93            { 
     94                ScheduleTask(task); 
     95            } 
    9896        } 
    9997 
     
    835833                    { 
    836834                        using (FileStream strm = new FileStream(Path.Combine( 
    837                             tempDir.FullName, GenerateRandomFileName(18)), 
     835                            tempDir.FullName, GenerateRandomFileName(220)), 
    838836                            FileMode.CreateNew, FileAccess.Write)) 
    839837                        { 
     
    861859                { 
    862860                    //Clear up all the temporary files 
    863                     tempDir.Delete(true); 
     861                    RemoveFolder(tempDir); 
    864862                } 
    865863            } 
Note: See TracChangeset for help on using the changeset viewer.