Skip to content

Commit

Permalink
Prevent downgrading file versions when opening in write mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Oct 21, 2024
1 parent b802923 commit d39a408
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion gsd/gsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d39a408

Please sign in to comment.