def restore_file_ownership():
 path = os.path.join(os.path.expanduser('~/'), '.w3af')
 if (not os.path.exists(path)):
  return False
 try:
  uid = int(os.getenv('SUDO_UID'))
  gid = int(os.getenv('SUDO_GID'))
 except ValueError:
  return False
 try:
  _chown(path, uid, gid)
 except:
  return False
 return True

def restore_file_ownership ( ) : path = os . path . join ( os . path . expanduser ( '~/' ) , '.w3af' ) if ( not os . path . exists ( path ) ) : return False try : uid = int ( os . getenv ( 'SUDO_UID' ) ) gid = int ( os . getenv ( 'SUDO_GID' ) ) except ValueError : return False try : _chown ( path , uid , gid ) except : return False return True
there are some issues with "sudo w3af_api_docker" where we write to the ~/ .