|  | @@ -105,6 +105,19 @@ def set_win_colors(config):
 | 
	
		
			
				|  |  |              config.set_value("Global", "colors", 'no')
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +def set_umask(config):
 | 
	
		
			
				|  |  | +    # set umask before creating/opening any files
 | 
	
		
			
				|  |  | +    try:
 | 
	
		
			
				|  |  | +        umask = config.get_value("Global", "umask")
 | 
	
		
			
				|  |  | +        if re.search(r'^\d{4}$', umask):
 | 
	
		
			
				|  |  | +            os.umask(int(umask))
 | 
	
		
			
				|  |  | +        else:
 | 
	
		
			
				|  |  | +            raise ValueError
 | 
	
		
			
				|  |  | +    except ValueError:
 | 
	
		
			
				|  |  | +        print("Could not determine umask from config!")
 | 
	
		
			
				|  |  | +        sys.exit(2)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  def get_conf_options(args, OSX):
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      global _saveconfig
 | 
	
	
		
			
				|  | @@ -122,17 +135,8 @@ def get_conf_options(args, OSX):
 | 
	
		
			
				|  |  |      if args.algo:
 | 
	
		
			
				|  |  |              config.set_value("Encryption", "algorithm", args.algo)
 | 
	
		
			
				|  |  |              _saveconfig = False
 | 
	
		
			
				|  |  | -    # set umask before creating/opening any files
 | 
	
		
			
				|  |  | -    try:
 | 
	
		
			
				|  |  | -        umask = config.get_value("Global", "umask")
 | 
	
		
			
				|  |  | -        if re.search(r'^\d{4}$', umask):
 | 
	
		
			
				|  |  | -            os.umask(int(umask))
 | 
	
		
			
				|  |  | -        else:
 | 
	
		
			
				|  |  | -            raise ValueError
 | 
	
		
			
				|  |  | -    except ValueError:
 | 
	
		
			
				|  |  | -        print("Could not determine umask from config!")
 | 
	
		
			
				|  |  | -        sys.exit(2)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    set_umask(config)
 | 
	
		
			
				|  |  |      dbtype = config.get_value("Database", "type")
 | 
	
		
			
				|  |  |      if not dbtype:
 | 
	
		
			
				|  |  |          print("Could not read the Database type from the config!")
 |