diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4d206e58..bdda408e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,13 @@ Change Log 3.x --- +3.4.1 (2024-10-21) +^^^^^^^^^^^^^^^^^^ + +*Fixed:* + +* Prevent downgrading file versions when opening in write mode. + 3.4.0 (2024-10-18) ^^^^^^^^^^^^^^^^^^ diff --git a/gsd/gsd.c b/gsd/gsd.c index 07997408..7b0ffdfa 100644 --- a/gsd/gsd.c +++ b/gsd/gsd.c @@ -1617,7 +1617,7 @@ inline static int gsd_initialize_handle(struct gsd_handle* handle) // minor version. if ((handle->open_flags == GSD_OPEN_READWRITE || handle->open_flags == GSD_OPEN_APPEND) && (handle->header.gsd_version - != gsd_make_version(GSD_CURRENT_FILE_VERSION_MAJOR, GSD_CURRENT_FILE_VERSION_MINOR)) + <= gsd_make_version(GSD_CURRENT_FILE_VERSION_MAJOR, GSD_CURRENT_FILE_VERSION_MINOR)) && (handle->header.gsd_version >> (sizeof(uint32_t) * 4) == GSD_CURRENT_FILE_VERSION_MAJOR)) { handle->header.gsd_version