From 667bedab828d2726988eef0a63279b845c9fd0d8 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 26 Oct 2024 05:17:24 +0300 Subject: [PATCH] engine: client: allow reading upper directories for clc_fileconsistency. Initialize md5 digest, add note about servers relying on uninitialized md5 value in some cases. --- engine/client/cl_parse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 839eebe8..67e48382 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -1617,7 +1617,7 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto ) vec3_t mins, maxs; string filename; CRC32_t crcFile; - byte md5[16]; + byte md5[16] = { 0 }; consistency_t *pc; int i, pos; @@ -1633,6 +1633,8 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto ) MSG_StartBitWriting( msg ); } + FS_AllowDirectPaths( true ); + for( i = 0; i < cl.num_consistency; i++ ) { qboolean have_file = true; @@ -1661,6 +1663,8 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto ) switch( pc->check_type ) { case force_exactfile: + // servers rely on md5 not being initialized after previous file + // if current file doesn't exist MD5_HashFile( md5, filename, NULL ); memcpy( &pc->value, md5, sizeof( pc->value )); LittleLongSW( pc->value ); @@ -1709,6 +1713,8 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto ) } } + FS_AllowDirectPaths( false ); + MSG_WriteOneBit( msg, 0 ); if( proto == PROTO_GOLDSRC )