From: Andreas Schneider Date: Tue, 27 Jun 2023 10:18:53 +0000 (+0200) Subject: swrap: Make sure we do not redirect (f)open(at)() or fcntl() X-Git-Tag: socket_wrapper-1.4.2~6 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=bbe14cc3200ca553b13ed49357e2e88ba487eeaa;p=socket_wrapper.git swrap: Make sure we do not redirect (f)open(at)() or fcntl() Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index dc07b53..addad4c 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -44,6 +44,12 @@ #include "config.h" +/* + * Make sure we do not redirect (f)open(at)() or fcntl() to their 64bit + * variants + */ +#undef _FILE_OFFSET_BITS + #include #include #include @@ -94,6 +100,10 @@ #include "socket_wrapper.h" +#ifdef __USE_FILE_OFFSET64 +#error -D_FILE_OFFSET_BITS=64 should not be set for socket_wrapper! +#endif + enum swrap_dbglvl_e { SWRAP_LOG_ERROR = 0, SWRAP_LOG_WARN, @@ -4625,6 +4635,7 @@ static FILE *swrap_fopen(const char *name, const char *mode) return fp; } +#undef fopen /* Needed for LFS handling */ FILE *fopen(const char *name, const char *mode) { return swrap_fopen(name, mode); @@ -4676,6 +4687,7 @@ static int swrap_vopen(const char *pathname, int flags, va_list ap) return ret; } +#undef open /* Needed for LFS handling */ int open(const char *pathname, int flags, ...) { va_list ap; @@ -4781,6 +4793,7 @@ static int swrap_vopenat(int dirfd, const char *path, int flags, va_list ap) return ret; } +#undef openat /* Needed for LFS handling */ int openat(int dirfd, const char *path, int flags, ...) { va_list ap; @@ -8505,6 +8518,7 @@ static int swrap_vfcntl(int fd, int cmd, va_list va) return rc; } +#undef fcntl /* Needed for LFS handling */ int fcntl(int fd, int cmd, ...) { va_list va;