From 1f737a42fb30c4cd8a55c92aa25511c12eb60f3b Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 27 Dec 2024 00:03:24 +0000 Subject: [PATCH] include some missing includes --- configure.ac | 9 +++++++-- ftpfs-ls.c | 1 + ftpfs.c | 4 +++- ftpfs.h | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 79e6d39..36e266f 100644 --- a/configure.ac +++ b/configure.ac @@ -12,14 +12,19 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH PKG_CHECK_MODULES(GLIB, [glib-2.0]) PKG_CHECK_MODULES(FUSE, [fuse3 >= 3.16]) +PKG_CHECK_MODULES(BSD, [libbsd]) LIBCURL_CHECK_CONFIG([yes], [7.17.0], [], [AC_MSG_ERROR(["libcurl not found"])]) if test "$libcurl_protocol_FTP" != yes; then AC_MSG_ERROR(["We need libcurl with support for FTP protocol."]) fi -CFLAGS="$CFLAGS -Wall -W -Wno-sign-compare -D_REENTRANT $GLIB_CFLAGS $FUSE_CFLAGS $LIBCURL_CPPFLAGS" -LIBS="$GLIB_LIBS $FUSE_LIBS $LIBCURL" +# _POSIX_C_SOURCE>=200809L causes glibc to provide `dprintf` in stdio.h +# - +# also used by time.h for strptime +# fuse3 requires _off_t to be 8 bytes, and advises to add _FILE_OFFSET_BITS=64 for 32bit platforms. +CFLAGS="$CFLAGS -Wall -W -Wno-sign-compare -D_REENTRANT -D_POSIX_C_SOURCE=200809L -D_FILE_OFFSET_BITS=64 $BSD_CFLAGS $GLIB_CFLAGS $FUSE_CFLAGS $LIBCURL_CPPFLAGS" +LIBS="$BSD_LIBS $GLIB_LIBS $FUSE_LIBS $LIBCURL" have_fuse_opt_parse=no AC_CHECK_FUNC([fuse_opt_parse], [have_fuse_opt_parse=yes]) diff --git a/ftpfs-ls.c b/ftpfs-ls.c index eb8a657..5bc7127 100644 --- a/ftpfs-ls.c +++ b/ftpfs-ls.c @@ -21,6 +21,7 @@ #include #include +#include "cache.h" #include "ftpfs.h" #include "charset_utils.h" #include "ftpfs-ls.h" diff --git a/ftpfs.c b/ftpfs.c index 88bad7e..e6a3296 100644 --- a/ftpfs.c +++ b/ftpfs.c @@ -8,6 +8,7 @@ #include "config.h" +#include #include #include #include @@ -1702,6 +1703,7 @@ static void checkpasswd(const char *kind, /* for what purpose */ if(!ptr) { /* no password present, prompt for one */ char *passwd; + char passwd_buf[256]; char prompt[256]; size_t passwdlen; size_t userlen = strlen(*userpwd); @@ -1713,7 +1715,7 @@ static void checkpasswd(const char *kind, /* for what purpose */ kind, *userpwd); /* get password */ - passwd = getpass(prompt); + passwd = readpassphrase(prompt, passwd_buf, 256, 0 /* flags */); passwdlen = strlen(passwd); /* extend the allocated memory area to fit the password too */ diff --git a/ftpfs.h b/ftpfs.h index 8e895b7..1bbc86b 100644 --- a/ftpfs.h +++ b/ftpfs.h @@ -13,6 +13,7 @@ #include #include #include +#include struct ftpfs { char* host;