mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-10-26 05:31:04 +03:00 
			
		
		
		
	Fix for an Issue #588
This commit is contained in:
		
							parent
							
								
									9b4b070ecf
								
							
						
					
					
						commit
						854a55166c
					
				|  | @ -104,6 +104,7 @@ class Database(object): | ||||||
| class Task(object): | class Task(object): | ||||||
|     def __init__(self, taskid): |     def __init__(self, taskid): | ||||||
|         self.process = None |         self.process = None | ||||||
|  |         self.temporary_directory = False | ||||||
|         self.output_directory = None |         self.output_directory = None | ||||||
|         self.options = None |         self.options = None | ||||||
|         self._original_options = None |         self._original_options = None | ||||||
|  | @ -144,12 +145,23 @@ class Task(object): | ||||||
|         self.options = AttribDict(self._original_options) |         self.options = AttribDict(self._original_options) | ||||||
| 
 | 
 | ||||||
|     def set_output_directory(self): |     def set_output_directory(self): | ||||||
|  |         if self.get_option("oDir"): | ||||||
|  |             if os.path.isdir(self.get_option("oDir")): | ||||||
|  |                 self.output_directory = self.get_option("oDir") | ||||||
|  |             else: | ||||||
|  |                 try: | ||||||
|  |                     os.makedirs(self.get_option("oDir")) | ||||||
|  |                     self.output_directory = self.get_option("oDir") | ||||||
|  |                 except OSError: | ||||||
|  |                     pass | ||||||
|  | 
 | ||||||
|         if not self.output_directory or not os.path.isdir(self.output_directory): |         if not self.output_directory or not os.path.isdir(self.output_directory): | ||||||
|             self.output_directory = tempfile.mkdtemp(prefix="sqlmapoutput-") |             self.output_directory = tempfile.mkdtemp(prefix="sqlmapoutput-") | ||||||
|  |             self.temporary_directory = True | ||||||
|             self.set_option("oDir", self.output_directory) |             self.set_option("oDir", self.output_directory) | ||||||
| 
 | 
 | ||||||
|     def clean_filesystem(self): |     def clean_filesystem(self): | ||||||
|         if self.output_directory: |         if self.output_directory and self.temporary_directory: | ||||||
|             shutil.rmtree(self.output_directory) |             shutil.rmtree(self.output_directory) | ||||||
| 
 | 
 | ||||||
|     def engine_start(self): |     def engine_start(self): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user