include some missing includes
This commit is contained in:
@@ -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(GLIB, [glib-2.0])
|
||||||
PKG_CHECK_MODULES(FUSE, [fuse3 >= 3.16])
|
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"])])
|
LIBCURL_CHECK_CONFIG([yes], [7.17.0], [], [AC_MSG_ERROR(["libcurl not found"])])
|
||||||
if test "$libcurl_protocol_FTP" != yes; then
|
if test "$libcurl_protocol_FTP" != yes; then
|
||||||
AC_MSG_ERROR(["We need libcurl with support for FTP protocol."])
|
AC_MSG_ERROR(["We need libcurl with support for FTP protocol."])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CFLAGS="$CFLAGS -Wall -W -Wno-sign-compare -D_REENTRANT $GLIB_CFLAGS $FUSE_CFLAGS $LIBCURL_CPPFLAGS"
|
# _POSIX_C_SOURCE>=200809L causes glibc to provide `dprintf` in stdio.h
|
||||||
LIBS="$GLIB_LIBS $FUSE_LIBS $LIBCURL"
|
# - <https://linux.die.net/man/3/dprintf>
|
||||||
|
# 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
|
have_fuse_opt_parse=no
|
||||||
AC_CHECK_FUNC([fuse_opt_parse], [have_fuse_opt_parse=yes])
|
AC_CHECK_FUNC([fuse_opt_parse], [have_fuse_opt_parse=yes])
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
#include "cache.h"
|
||||||
#include "ftpfs.h"
|
#include "ftpfs.h"
|
||||||
#include "charset_utils.h"
|
#include "charset_utils.h"
|
||||||
#include "ftpfs-ls.h"
|
#include "ftpfs-ls.h"
|
||||||
|
4
ftpfs.c
4
ftpfs.c
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <bsd/readpassphrase.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -1702,6 +1703,7 @@ static void checkpasswd(const char *kind, /* for what purpose */
|
|||||||
if(!ptr) {
|
if(!ptr) {
|
||||||
/* no password present, prompt for one */
|
/* no password present, prompt for one */
|
||||||
char *passwd;
|
char *passwd;
|
||||||
|
char passwd_buf[256];
|
||||||
char prompt[256];
|
char prompt[256];
|
||||||
size_t passwdlen;
|
size_t passwdlen;
|
||||||
size_t userlen = strlen(*userpwd);
|
size_t userlen = strlen(*userpwd);
|
||||||
@@ -1713,7 +1715,7 @@ static void checkpasswd(const char *kind, /* for what purpose */
|
|||||||
kind, *userpwd);
|
kind, *userpwd);
|
||||||
|
|
||||||
/* get password */
|
/* get password */
|
||||||
passwd = getpass(prompt);
|
passwd = readpassphrase(prompt, passwd_buf, 256, 0 /* flags */);
|
||||||
passwdlen = strlen(passwd);
|
passwdlen = strlen(passwd);
|
||||||
|
|
||||||
/* extend the allocated memory area to fit the password too */
|
/* extend the allocated memory area to fit the password too */
|
||||||
|
Reference in New Issue
Block a user