# HG changeset patch # User Marcin Lulek # Date 2016-11-28 21:38:45 # Node ID ef1cd4f93e0315f4a9af5fa83b299a4d462bd5b5 # Parent 3ed6ccb0e2a057ace33537aea36dcf9d889db6ba channelstream: use sha256 for history filename hashes diff --git a/rhodecode/lib/channelstream.py b/rhodecode/lib/channelstream.py --- a/rhodecode/lib/channelstream.py +++ b/rhodecode/lib/channelstream.py @@ -18,16 +18,14 @@ # RhodeCode Enterprise Edition, including its added features, Support services, # and proprietary license terms, please see https://rhodecode.com/licenses/ +import hashlib +import itsdangerous import logging import os - -import itsdangerous import requests - from dogpile.core import ReadWriteMutex import rhodecode.lib.helpers as h - from rhodecode.lib.auth import HasRepoPermissionAny from rhodecode.lib.ext_json import json from rhodecode.model.db import User @@ -169,7 +167,9 @@ def parse_channels_info(info_result, inc def log_filepath(history_location, channel_name): - filename = '{}.log'.format(channel_name.encode('hex')) + hasher = hashlib.sha256() + hasher.update(channel_name.encode('utf8')) + filename = '{}.log'.format(hasher.hexdigest()) filepath = os.path.join(history_location, filename) return filepath