--- faketime-0.9.10/debian/changelog 2022-08-13 13:58:42.000000000 -0500 +++ faketime-0.9.10/debian/changelog 2024-02-13 10:56:37.000000000 -0600 @@ -1,3 +1,11 @@ +faketime (0.9.10-2.1ubuntu1) noble; urgency=medium + + * Fix faketime to stat(1) and ls(1) (LP: #2052986) + - Take upstream commit titled 'adding support for faking statx', + thanks to upstream contributor 'v-gb'. + + -- Dalton Durst Tue, 13 Feb 2024 10:56:37 -0600 + faketime (0.9.10-2.1) unstable; urgency=medium * Non-maintainer upload diff -Nru faketime-0.9.10/debian/control faketime-0.9.10/debian/control --- faketime-0.9.10/debian/control 2022-08-13 13:58:42.000000000 -0500 +++ faketime-0.9.10/debian/control 2024-02-13 10:56:37.000000000 -0600 @@ -1,7 +1,8 @@ Source: faketime Section: utils Priority: optional -Maintainer: Daniel Kahn Gillmor +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Daniel Kahn Gillmor Build-Depends: debhelper-compat (= 13), Standards-Version: 4.6.0 diff -Nru faketime-0.9.10/debian/patches/series faketime-0.9.10/debian/patches/series --- faketime-0.9.10/debian/patches/series 2022-08-13 13:58:42.000000000 -0500 +++ faketime-0.9.10/debian/patches/series 2024-02-13 10:46:19.000000000 -0600 @@ -1,2 +1,3 @@ 0001-tests-avoid-testing-syscall-snippets-if-DINTERCEPT_S.patch fix_time_t_in_test_on_32bits.patch +support-statx.patch diff -Nru faketime-0.9.10/debian/patches/support-statx.patch faketime-0.9.10/debian/patches/support-statx.patch --- faketime-0.9.10/debian/patches/support-statx.patch 1969-12-31 18:00:00.000000000 -0600 +++ faketime-0.9.10/debian/patches/support-statx.patch 2024-02-13 10:56:37.000000000 -0600 @@ -0,0 +1,70 @@ +Subject: adding support for faking statx +Origin: upstream, https://github.com/wolfcw/libfaketime/commit/942b30e9400d50cc95b19b7fb3d81c2def1f984a +Bug: https://github.com/wolfcw/libfaketime/issues/417 +Bug-Ubuntu: LP: #2052986 +Forwarded: not-needed +Author: Valentin Gatien-Baron +Last-Update: 2024-02-13 +--- + +--- a/src/libfaketime.c ++++ b/src/libfaketime.c +@@ -189,6 +189,9 @@ static int (*real_xstat64) + static int (*real_fxstat64) (int, int , struct stat64 *); + static int (*real_fxstatat64) (int, int , const char *, struct stat64 *, int); + static int (*real_lxstat64) (int, const char *, struct stat64 *); ++#ifdef STATX_TYPE ++static int (*real_statx) (int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf); ++#endif + static time_t (*real_time) (time_t *); + static int (*real_ftime) (struct timeb *); + static int (*real_gettimeofday) (struct timeval *, void *); +@@ -1086,6 +1089,38 @@ int __lxstat64 (int ver, const char *pat + #endif + #endif + ++#ifdef STATX_TYPE ++static inline void fake_statx_timestamp(struct statx_timestamp* p) ++{ ++ struct timespec t = {p->tv_sec,p->tv_nsec}; ++ fake_clock_gettime(CLOCK_REALTIME, &t); ++ p->tv_sec = t.tv_sec; ++ p->tv_nsec = t.tv_nsec; ++} ++ ++static inline void fake_statxbuf (struct statx *buf) { ++ lock_for_stat(); ++ if (buf->stx_mask & STATX_ATIME) { ++ fake_statx_timestamp(&buf->stx_atime); ++ } ++ if (buf->stx_mask & STATX_CTIME) { ++ fake_statx_timestamp(&buf->stx_ctime); ++ } ++ if (buf->stx_mask & STATX_MTIME) { ++ fake_statx_timestamp(&buf->stx_mtime); ++ } ++ if (buf->stx_mask & STATX_BTIME) { ++ fake_statx_timestamp(&buf->stx_btime); ++ } ++ unlock_for_stat(); ++} ++ ++int statx(int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf) ++{ ++ STAT_HANDLER_COMMON(statx, statxbuf, fake_statxbuf, dirfd, pathname, flags, mask, statxbuf) ++} ++#endif ++ + #ifdef FAKE_FILE_TIMESTAMPS + #ifdef MACOS_DYLD_INTERPOSE + int macos_utime(const char *filename, const struct utimbuf *times) +@@ -2558,6 +2593,9 @@ static void ftpl_init(void) + real_fxstat64 = dlsym(RTLD_NEXT, "__fxstat64"); + real_fxstatat64 = dlsym(RTLD_NEXT, "__fxstatat64"); + real_lxstat64 = dlsym(RTLD_NEXT, "__lxstat64"); ++#ifdef STATX_TYPE ++ real_statx = dlsym(RTLD_NEXT, "statx"); ++#endif + real_time = dlsym(RTLD_NEXT, "time"); + real_ftime = dlsym(RTLD_NEXT, "ftime"); + real_timespec_get = dlsym(RTLD_NEXT, "timespec_get");