mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
vfs_gpfs: Protect against timestamps before the Unix epoch
In addition tob954d181cd
we should also protect against timestamps before the epoch. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15151 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Sep 23 06:50:17 UTC 2022 on sn-devel-184 (cherry picked from commitf6b391e04a
)
This commit is contained in:
parent
08383bedc3
commit
04e54799b2
@ -1713,10 +1713,10 @@ static int timespec_to_gpfs_time(
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ts.tv_sec > UINT32_MAX) {
|
||||
DBG_WARNING("GPFS uses 32-bit unsigned timestamps, "
|
||||
"%ju is too large\n",
|
||||
(uintmax_t)ts.tv_sec);
|
||||
if (ts.tv_sec < 0 || ts.tv_sec > UINT32_MAX) {
|
||||
DBG_NOTICE("GPFS uses 32-bit unsigned timestamps "
|
||||
"and cannot handle %jd.\n",
|
||||
(intmax_t)ts.tv_sec);
|
||||
errno = ERANGE;
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user