Skip to content

fix: interpret permission validity timestamps as UTC#6474

Open
Functionhx wants to merge 1 commit into
eProsima:masterfrom
Functionhx:fix/permission-timestamps-utc
Open

fix: interpret permission validity timestamps as UTC#6474
Functionhx wants to merge 1 commit into
eProsima:masterfrom
Functionhx:fix/permission-timestamps-utc

Conversation

@Functionhx

@Functionhx Functionhx commented Jul 12, 2026

Copy link
Copy Markdown

std::mktime interprets timezone-unspecified broken-down time as local
time, causing identical permission files to produce different validity
periods depending on the host timezone.

Use timegm on POSIX and _mkgmtime on Windows so the currently supported
timezone-unspecified timestamp format is interpreted consistently as UTC.

This change does not add parsing for explicit Z or +/-HH:MM timezone
suffixes.

Fixes #6403.

@Functionhx
Functionhx force-pushed the fix/permission-timestamps-utc branch from 5f5f297 to b8c8df5 Compare July 12, 2026 04:05
@Functionhx Functionhx changed the title fix: use timegm/_mkgmtime instead of std::mktime for permission timestamps fix: interpret permission validity timestamps as UTC Jul 12, 2026
std::mktime interprets timezone-unspecified broken-down time as local
time, causing identical permission files to produce different validity
periods depending on the host timezone.

Use timegm on POSIX and _mkgmtime on Windows so the currently supported
timezone-unspecified timestamp format is interpreted consistently as UTC.

This change does not add parsing for explicit Z or +/-HH:MM timezone
suffixes.

Fixes eProsima#6403.

Signed-off-by: Functionhx <2994114386@qq.com>
Signed-off-by: Yuchen Fan <functionhx@gmail.com>
@Functionhx
Functionhx force-pushed the fix/permission-timestamps-utc branch from b8c8df5 to c378ca0 Compare July 12, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: validity datetime parsed as local time in PermissionsParser shifts credential lifecycle by host TZ/DST

1 participant