Download tasks/codeql_python_benchmark51_v2/pyvul-e305522c703de57f9ede/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.72 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-e305522c703de57f9ede/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_python_benchmark51_v2/pyvul-e305522c703de57f9ede/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-e305522c703de57f9ede/patch.diff
1.72 kB
| diff --git a/keylime/registrar_common.py b/keylime/registrar_common.py | |
| index 1fd97cd..7f15ae4 100644 | |
| --- a/keylime/registrar_common.py | |
| +++ b/keylime/registrar_common.py | |
| class UnprotectedHandler(BaseHandler): | |
| try: | |
| port = int(port) | |
| if port < 1 or port > 65535: | |
| - logger.warning("Contact port for agent %s is not a number between 1 and got: %s.", agent_id, port) | |
| + logger.warning( | |
| + "Contact port for agent %s is not a number between 1 and 65535 got: %s.", agent_id, port | |
| + ) | |
| port = None | |
| except ValueError: | |
| logger.warning("Contact port for agent %s is not a valid number got: %s.", agent_id, port) | |
| class UnprotectedHandler(BaseHandler): | |
| logger.error("SQLAlchemy Error: %s", e) | |
| raise | |
| else: | |
| - raise Exception(f"Auth tag {auth_tag} does not match expected value {ex_mac}") | |
| + if agent_id and session.query(RegistrarMain).filter_by(agent_id=agent_id).delete(): | |
| + try: | |
| + session.commit() | |
| + except SQLAlchemyError as e: | |
| + logger.error("SQLAlchemy Error: %s", e) | |
| + raise | |
| + | |
| + raise Exception( | |
| + f"Auth tag {auth_tag} for agent {agent_id} does not match expected value. The agent has been deleted from database, and a restart of it will be required" | |
| + ) | |
| web_util.echo_json_response(self, 200, "Success") | |
| logger.info("PUT activated: %s", agent_id) | |