forked from public-mirrors/BorgExtend
		
	fixing bug in prep scripts
This commit is contained in:
		
							parent
							
								
									7df740a225
								
							
						
					
					
						commit
						7df5d78ec1
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		|  | @ -257,10 +257,12 @@ class Backup(object): | |||
|                     os.makedirs(tmpdir, exist_ok = True) | ||||
|                     os.chmod(tmpdir, mode = 0o0700) | ||||
|                     for idx, prep in enumerate(repo['prep']): | ||||
|                         exec_tmp = tempfile.mkstemp(prefix = '_borgextend.', | ||||
|                         exec_fd, exec_tmp = tempfile.mkstemp(prefix = '_borgextend.', | ||||
|                                                              suffix = '._tmpexc', | ||||
|                                                              text = True, | ||||
|                                                              dir = tmpdir)[1] | ||||
|                         # D'oh. I need to close the FD before messing with it. | ||||
|                         os.close(exec_fd) | ||||
|                         os.chmod(exec_tmp, mode = 0o0700) | ||||
|                         with open(exec_tmp, 'w') as f: | ||||
|                             f.write(prep) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue