vfs_gpfs: Protect against timestamps before the Unix epoch
[samba.git] / source3 / modules / vfs_gpfs.c
index 1f3d803e1c5e86eaffda273985b58ea2dbab129f..779627f8115e8117f99af593c81dcbb19c36e528 100644 (file)
@@ -1679,10 +1679,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;
        }