GithubHelp home page GithubHelp logo

fuse-nfs's Introduction

fuse-nfs
========

This is a fuse module that implements the NFS protocol.

Building
========

$ sudo apt-get install libfuse-dev libnfs13 libnfs-dev libtool m4 automake libnfs-dev xsltproc
$ ./setup.sh
$ ./configure
$ make
$ sudo make install

FUSE OPTIONS
============

	[-?|--help]

	fuse-nfs options :
	[-U NFS_UID|--fusenfs_uid=NFS_UID]
		The uid passed within the rpc credentials within the mount point
		This is the same as passing the uid within the url, however if both are defined then the url's one is used
	[-G NFS_GID|--fusenfs_gid=NFS_GID]
		The gid passed within the rpc credentials within the mount point
		This is the same as passing the gid within the url, however if both are defined then the url's one is used
	[-o|--fusenfs_allow_other_own_ids]
		Allow fuse-nfs with allow_user activated to update the rpc credentials with the current (other) user credentials instead
		of using the mount user credentials or (if defined) the custom credentials defined with -U/-G / url
		This option activate allow_other, note that allow_other need user_allow_other to be defined in fuse.conf

	libnfs options :
	[-n SHARE|--nfs_share=SHARE]
		The server export to be mounted
	[-m MNTPOINT|--mountpoint=MNTPOINT]
		The client mount point

	fuse options (see man mount.fuse):
	[-p [0|1]|--default_permissions=[0|1]
		The fuse default_permissions option do not have any argument, 
		for compatibility with previous fuse-nfs version default is activated (1)
		with the possibility to overwrite this behavior (0)
	[-t [0|1]|--multithread=[0|1]]
		Single threaded by default (0) , may have issue with nfs and fuse multithread (1)
	[-a|--allow_other]
		This option overrides the security measure restricting file access to the filesystem owner, 
		so that all users (including root) can access the files.
	[-r|--allow_root]
		This option is similar to allow_other but file access is limited to the filesystem owner and root.  
		This option and allow_other are mutually exclusive.
	[-u FUSE_UID|--uid=FUSE_UID]
		Specifies the numeric uid of the mount owner. 
		Override the st_uid field set by the filesystem.
	[-g FUSE_GID|--gid=FUSE_GID]
		Specifies the numeric gid of the mount owner.
		Override the st_uid field set by the filesystem.
	[-K UMASK|--umask=UMASK]
		Override the permission bits in st_mode set by the filesystem. 
		The resulting permission bits are the ones missing from the given umask value.  
		The value is given in octal representation.
	[-d|--direct_io]
		This option disables the use of page cache (file content  cache) in the kernel for this filesystem. 
		This has several affects:
		       1.	Each read or write system call will initiate one or more read or write operations, data will not be cached in the kernel.
		       2.	The return value of the read and write system calls will correspond to the return values of the read and write operations. 
		       		This is useful for example if the file size is not known in advance (before reading it).
	[-k|--kernel_cache]
		This option disables flushing the cache of the file contents on every open.
		This should only be enabled on filesystems, where the file data is never changed externally (not through the mounted FUSE filesystem).  
		Thus it is not suitable for network filesystems and other "intermediate" filesystems.
	[-c|--auto_cache]
		This option is an alternative to kernel_cache. 
		Instead of unconditionally keeping cached data, the cached data is invalidated on open if the modification time or the size of the file has changed since it was last opened.
	[-E TIMEOUT|--entry_timeout=TIMEOUT]
		The timeout in seconds for which name lookups will be cached.
		The default is 1.0 second. For all the timeout options, it is possible to give fractions of a second as well (e.g. entry_timeout=2.8)
	[-N TIMEOUT|--negative_timeout=TIMEOUT]
		The timeout in seconds for which a negative lookup will be cached.
		This means, that if file did not exist (lookup retuned ENOENT), the lookup will only be redone after the timeout, and the file/directory will be assumed to not exist until then.
		The default is 0.0 second, meaning that caching negative lookups are disabled.		
	[-T TIMEOUT|--attr_timeout=TIMEOUT]
		The timeout in seconds for which file/directory attributes are cached. 
		The default is 1.0 second.
	[-C TIMEOUT|--ac_attr_timeout=TIMEOUT]
		The timeout in seconds for which file attributes are cached for the purpose of checking if auto_cache should flush the file data on open. 
		The default is the value of attr_timeout
	[-l|--large_read]
		This can improve performance for some filesystems, but can also degrade performance. 
		This option is only useful on 2.4.X kernels, as on 2.6 kernels requests size is automatically determined for optimum performance.

ROOT vs NON-ROOT
================
By default, most NFS servers will only allow access from clients that are
using a system port (i.e. a port < 1024).
Since these ports by default can only be used by the root user this will
prevent non-root users from conencting to the NFS server or mounting the
filesystem.

There are two ways to solve this:
1, cap_net_bind_service
-----------------------
On Linux, when this capability is set the kernel will allow that program
to use system ports for any user that runs that program.

  sudo setcap 'cap_net_bind_service=+ep' ./fuse/fuse-nfs

Setting this capability will allow normal non-root users to access the NFS
server.

2, insecure
-----------
Alternatively you can often disable the "chack that the client connects from
a system port" in the NFS server itself.
On Linux NFS servers this is done by adding the "insecure" keyword to
the /etc/exports file.


LIBNFS URL-FORMAT:
===========
Libnfs uses RFC2224 style URLs extended with libnfs specific url arguments some minor extensions.
The basic syntax of these URLs is :

nfs://<server|ipv4|ipv6>/path[?arg=val[&arg=val]*]

Arguments supported by libnfs are :
 tcp-syncnt=<int>  : Number of SYNs to send during the session establish
                     before failing setting up the tcp connection to the
                     server.
 uid=<int>         : UID value to use when talking to the server.
                     default it 65534 on Windows and getuid() on unixen.
 gid=<int>         : GID value to use when talking to the server.
                     default it 65534 on Windows and getgid() on unixen.
 readahead=<int>   : Enable readahead for files and set the maximum amount
                     of readahead to <int>.
 auto-traverse-mounts=<0|1>
                   : Should libnfs try to traverse across nested mounts
					automatically or not. Default is 1 == enabled.
 dircache=<0|1>    : Disable/enable directory caching. Enabled by default.
 if=<interface>    : Interface name (e.g., eth1) to bind; requires `root`
 version=<3|4>     : NFS version to use. Version 3 is the default.


To mount a filesystem:
======================
fuse-nfs -n nfs://127.0.0.1/data/tmp -m /my/mountpoint


To unmount a filesystem:
========================
fusermount -u /my/mountpoint


NFSv4 support:
==============
NFSv4 is supported when used with a recent enough version of libnfs.
To enable NFSv4 support you need to specify version=4 as an URL argument:
fuse-nfs -n nfs://127.0.0.1/data/tmp?version=4 -m /my/mountpoint


Windows
=======
The following are ports to windows:

* Daniel Abrech (https://github.com/Daniel-Abrecht) has ported this fuse module
  to windows using the dokany filesystem/fuse wrapper.

  Windows builds for this module can be downloaded from :
  https://github.com/Daniel-Abrecht/fuse-nfs-crossbuild-scripts/releases

* Bill Zissimopoulos (https://github.com/billziss-gh) has ported this fuse
  module to windows using WinFsp.

  The NFS-Win port (including MSI installers) can be found here:
  https://github.com/billziss-gh/nfs-win

fuse-nfs's People

Contributors

agraf avatar andyw-dh avatar billziss-gh avatar daniel-abrecht avatar davidgaleano avatar kchiu avatar mheijkoop avatar sahlberg avatar smaillan avatar tyrxuann avatar unkn0w avatar zeppelinen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fuse-nfs's Issues

Failing to compile

I'm trying to compile/install the project on a setup which has no connection to the internet. (I succeeded with downloading the project and the relevant libraries with different methods). But when I reach the "make", I get some errors like:

make[2]: Entering directory '/home/ubuntu/fuse-nfs/doc'
test -z "/usr/bin/xsltproc" || /usr/bin/xsltproc -o fuse-nfs.1 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl fuse-nfs.xml
error : Resource temporarily unavailable
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl

Is it not possible to compile without internet connection ? (I get that it seems there's no point in installing it without internet, but I'm trying something else).

Thanks

SIGSEGV in fuse_nfs_readdir due to permission denied on NFS server

I am trying to port this fuse-nfs to Crossmeta FUSE on Windows https://github.com/crossmeta/cxfuse and amazingly in less than a hour, I could have the program running.
While testing I encountered this problem with fuse_nfs_readdir() when it tried to read directory with no permission and it received NFS error 13. But in the code I do not see check for status and instead start filling the directory entries and accessed NULL nfsdir pointer.

diff --git a/fuse/fuse-nfs.c b/fuse/fuse-nfs.c
index 0bddb30..fa4ef90 100755
--- a/fuse/fuse-nfs.c
+++ b/fuse/fuse-nfs.c
@@ -303,6 +303,8 @@ fuse_nfs_readdir(const char *path, void *buf, fuse_fill_dir_
                return ret;
        }
        wait_for_nfs_reply(nfs, &cb_data);
+       if (cb_data.status)
+               return cb_data.status;
 
        nfsdir = cb_data.return_data;
        while ((nfsdirent = nfs_readdir(nfs, nfsdir)) != NULL) {

Readme Markdown Document has error in option part

I found that the README document states that the "umask" option is specified with "-U", but the source code handles the "umask" option with "-K"

READNE.md

[-U UMASK|--umask=UMASK]
		Override the permission bits in st_mode set by the filesystem. 
		The resulting permission bits are the ones missing from the given umask value.  
		The value is given in octal representation.

fuse-nfs.c

case 'K':
			snprintf(fuse_Umask_arg, sizeof(fuse_Umask_arg), "-oumask=%s", optarg);
			fuse_nfs_argv[fuse_nfs_argc++] = fuse_Umask_arg;
			break;

Print help also has same error

Failed to mount nfs share : mount_cb: RPC error: Mount failed with error MNT3ERR_ACCES(13) Permission denied(13)

Failed to mount nfs share : mount_cb: RPC error: Mount failed with error MNT3ERR_ACCES(13) Permission denied(13)

rpcinfo -p 192.168.0.98
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100005 1 udp 20048 mountd
100005 1 tcp 20048 mountd
100005 2 udp 20048 mountd
100005 2 tcp 20048 mountd
100005 3 udp 20048 mountd
100005 3 tcp 20048 mountd
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 39647 nlockmgr
100021 3 tcp 39647 nlockmgr
100021 4 tcp 39647 nlockmgr
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 56298 nlockmgr
100021 3 udp 56298 nlockmgr
100021 4 udp 56298 nlockmgr
fuse-nfs -n nfs://192.168.0.98/media/usbhd-sdb1 -m /mnt/work1
Failed to mount nfs share : mount_cb: RPC error: Mount failed with error MNT3ERR_ACCES(13) Permission denied(13)

cat exports
/media/usbhd-sdb1 *(rw,no_root_squash,sync,insecure)

Not able to write to mounted system

I am using fuse-nfs to mount NFS version 4 shares in an Apptainer container running on Rocky Linux 8. I can read the data on mounted directory but cannot write. The remote file server is running CentOS 6 and has this line in /etc/exports:

/data1 10.11.12.13(rw,no_root_squash,sync,insecure)

On the container I am running this command:

fuse-nfs -a -n "nfs://172.28.50.50/data1/?version=4" -m /data1

All the mounted directories are shown as being owned by root : root , but even if the directory permission is 777 it is not writable.

fuse-nfs.c:39:21: error: storage size of ‘nfs_st’ isn’t known

Compilation issue:

Making all in doc
make[1]: Entering directory /home/ali/git/fuse-nfs/doc' test -z "/usr/bin/xsltproc" || /usr/bin/xsltproc -o fuse-nfs.1 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl fuse-nfs.xml /bin/bash: /usr/bin/xsltproc: No such file or directory make[1]: [fuse-nfs.1] Error 127 (ignored) make[1]: Leaving directory/home/ali/git/fuse-nfs/doc'
Making all in fuse
make[1]: Entering directory /home/ali/git/fuse-nfs/fuse' gcc -DPACKAGE_NAME=\"fuse-nfs\" -DPACKAGE_TARNAME=\"fuse-nfs\" -DPACKAGE_VERSION=\"1.0.0\" -DPACKAGE_STRING=\"fuse-nfs\ 1.0.0\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"fuse-nfs\" -DVERSION=\"1.0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -I. -g -O2 -D_FILE_OFFSET_BITS=64 -MT fuse-nfs.o -MD -MP -MF .deps/fuse-nfs.Tpo -c -o fuse-nfs.o fuse-nfs.c fuse-nfs.c: In function ‘fuse_nfs_getattr’: fuse-nfs.c:39:21: error: storage size of ‘nfs_st’ isn’t known struct nfs_stat_64 nfs_st; ^ make[1]: *** [fuse-nfs.o] Error 1 make[1]: Leaving directory/home/ali/git/fuse-nfs/fuse'
make: *** [all-recursive] Error 1

?uid=x&gid=x only sort of works

We've been looking into the possibility of using fuse-nfs with the uid/gid flags in order to set the effective user for a mount to be different from the currently running user. What we've found is that it doesn't work very well unless the currently running user is root.

The reason is that while it works fine for write operations--the file owner information is sent as the specified arbitrary uid/gid, for list/stat operations, the uid/gid is not translated back to the uid of the running user.

So, if as a non-root user, I mount a volume with some other uid/gid:
fuse-nfs -n "nfs://127.0.0.1/export/share1?uid=2000&gid=2000" -m ./mymount2

I can write new files to the volume, but then, because the client OS doesn't think the resulting files are owned by the current user, I cannot edit them:

vcap@vagrant-ubuntu-trusty-64:/home/vagrant/mymount2$ echo "strange" > strangeness
vcap@vagrant-ubuntu-trusty-64:/home/vagrant/mymount2$ cat strangeness
strange
vcap@vagrant-ubuntu-trusty-64:/home/vagrant/mymount2$ echo "strange" >> strangeness
bash: strangeness: Permission denied
vcap@vagrant-ubuntu-trusty-64:/home/vagrant/mymount2$ cat strangeness
strange

We found that we can resolve this by just adding a check to fuse_nfs_getattr() to test if the file is owned by the UID set in the mount URL, and set the current user UID into stbuf instead, but we are wondering if this is really a bug, or if we are just misunderstanding the intent of putting UID and GID in as options to begin with.

Use the poll polyfill from win32/win32_compat.h from libnfs for windows builds

Poll isn't available on windows, but the usage of the async apis needs it. libnfs has win32/win32_compat.{h,c} compatiblity files which provide a poll implementation. I've already checked that they would indeed work. The problem is, the win32/win32_compat.h header isn't included in libnfs.h, and it isn't in the "include/" folder in libnfs either. What would the best course of action be here? One possibillity would be to move win32/win32_compat.h to "include/win32/win32_compat.h" and include it in fuse-nfs.c. Another possibillity would be to include it in libnfs.h directly. An in either case, poll.h doesn't exist in windows, so an additional ifndef check should be added to fuse-nfs.c.

I can make pull requests for these changes, but I need to know what the prefered way to resolve this problem would be.

Can't connect to remote NFS drive

I have a server in Finland (Linux) which NFS connects to successfully.
I am now trying to connect to my Windows 10 Pro, I write
fuse-nfs -n nfs://Server_IPv4:/mnt/storage?version=4 -m J:

But I get no output, no errors. I can successfully connect my drive to other Linux machines but it doesn't work on Windows, I just get an empty output. Any ideas?

Android: stat struct [patch]?

In fuse/fuse-nfs.c: function fuse_nfs_getattr
You use st_atim, but this member structure isn't defined in the android header files.

I've changed st_atim.tv_sec to st_atime and st_atim.tv_nsec to st_atime_nsec. It compiled and tested it on my device and worked (could mount nfs on my phone). I know not only there need to be tests but it must compile on all the platforms you support. So I don't know if this "solution" doesn't break on your main platforms.

In any case, this works(?) when using the cross compiler for android:

diff --git a/fuse/fuse-nfs.c b/fuse/fuse-nfs.c
index fb5457b..29e0db6 100644
--- a/fuse/fuse-nfs.c
+++ b/fuse/fuse-nfs.c
@@ -50,12 +50,12 @@ static int fuse_nfs_getattr(const char *path, struct stat *stbuf)
        stbuf->st_size         = nfs_st.nfs_size;
        stbuf->st_blksize      = nfs_st.nfs_blksize;
        stbuf->st_blocks       = nfs_st.nfs_blocks;
-       stbuf->st_atim.tv_sec  = nfs_st.nfs_atime;
-       stbuf->st_atim.tv_nsec = nfs_st.nfs_atime_nsec;
-       stbuf->st_mtim.tv_sec  = nfs_st.nfs_mtime;
-       stbuf->st_mtim.tv_nsec = nfs_st.nfs_mtime_nsec;
-       stbuf->st_ctim.tv_sec  = nfs_st.nfs_ctime;
-       stbuf->st_ctim.tv_nsec = nfs_st.nfs_ctime_nsec;
+       stbuf->st_atime        = nfs_st.nfs_atime;
+       stbuf->st_atime_nsec   = nfs_st.nfs_atime_nsec;
+       stbuf->st_mtime        = nfs_st.nfs_mtime;
+       stbuf->st_mtime_nsec   = nfs_st.nfs_mtime_nsec;
+       stbuf->st_ctime        = nfs_st.nfs_ctime;
+       stbuf->st_ctime_nsec   = nfs_st.nfs_ctime_nsec;

        return ret;
 }

Multi-threaded support

Hey Guys,
I am newbie to fuse world and would like to explore multi-threading for this fuse-nfs client.
Multi-threading will make it usable in environments with higher throughput.
Could you please share your thoughts if it's feasible and worth doing it?
Thanks & Regards,
Deepak

data write issue with v4 mounts in latest fuse-nfs

I can consistently reproduce this issue manually and in our test automation. Seems like there is some problem in the v4 code path, particularly having to do with data writes:

root@8cb85777-ed10-4e6a-5e5f-651c612dade9:/tmp/build/5bbc57d5# fuse-nfs -a -n "nfs://testnfsserver.gorgophone.cf-app.com/export2/certs?gid=2000&uid=2000&version=4" -m /tmp/volumes/nfs-volume-name --multithread=1
root@8cb85777-ed10-4e6a-5e5f-651c612dade9:/tmp/build/5bbc57d5# 
root@8cb85777-ed10-4e6a-5e5f-651c612dade9:/tmp/build/5bbc57d5# touch /tmp/volumes/nfs-volume-name/grak
root@8cb85777-ed10-4e6a-5e5f-651c612dade9:/tmp/build/5bbc57d5# echo "food" > !$
echo "food" > /tmp/volumes/nfs-volume-name/grak
bash: echo: write error: Numerical result out of range

NFSv4 issue

Hello Team,

Using this lib, we are trying to mount NFSv4 protocol based server directory into local. But getting below exception.
Failed to mount nfs share : nfs_service failed ERR libnfs error: rpc_service: socket error Connection timed out(110).

please could you confirm is this issue is related to protocol version or something else.

/home/app/bin/fuse-nfs -n "nfs://x.x.x.x/workspace/workspace?uid=10110&gid=10111&version=4" -m /home/app/nfs

Regards
Lingesh M

Mount goes OK, but first access results in "Software caused connection abort" error

Hello,

# fuse-nfs -n 'nfs://REDACTED/REDACTED/REDACTED/?if=venet0&version=4' -m /mnt2
   -> Shows no messages, exit status ($?) is 0 

# ls /mnt2
   ls: reading directory /mnt2: Software caused connection abort

# ls /mnt2
   ls: cannot open directory /mnt2: Transport endpoint is not connected

I'm running in an old platform (RHEL6 with kernel 2.6.32, and I can't upgrade, please don't ask why) but all other FUSE filesystems (ENCFS, etc) works OK.

There's no other output, including syslog and dmesg. I can see no "--verbose" or equivalent options for this module.

How can I debug this?

Thanks in advance.

Cygwin should not use Winsock2

As a follow up to sahlberg/libnfs@e35a44e the same problem exists on fuse-nfs: it appears that the winsock2 library is erroneously included by the configure.ac script.

From https://github.com/sahlberg/fuse-nfs/blob/master/configure.ac#L54-L59:

OLD_LIBS=$LIBS
LIBS+=" -lws2"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]], [[gethostbyname ("");]])], [], [LIBS=$OLD_LIBS])
OLD_LIBS=$LIBS
LIBS+=" -lws2_32"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]], [[gethostbyname ("");]])], [], [LIBS=$OLD_LIBS])

I am not well versed in autoconf, but looking at config.log this checks if this minimal program compiles:

#include <winsock2.h>
int main()
{
    gethostbyname ("");
    return 0;
}

Unfortunately this program does compile on Cygwin (at least on my machine), which results in Cygwin picking up the -lws2_32 option, which is erroneous as discussed in sahlberg/libnfs@e35a44e.

I have a crude patch that just comments out this section, but perhaps a better solution would be to not do this test at all on Cygwin. Unfortunately my knowledge of autoconf is not enough to competently produce a patch here, but I am happy to test if someone else does.


UPDATE

My gcc compiler reports the following as include directories:

$ gcc -E -Wp,-v - </dev/null
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/include"
ignoring duplicate directory "/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/lib/../lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include
 /usr/include
 /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/../include/w32api
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"

The /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../lib/../include/w32api is really /usr/include/w32api, which contains the Win32 headers (including winsock2.h).

I am under the impression that the /usr/include/w32api directory should not be included in the default header searches, so this may be a change with recent Cygwin.

Mac Support

I have managed to compile the library for macos with a few changes, but it doesn't run properly.
This was tested on an M2 mac.

When I try to mount I get this message:

xadmin@r131-20 ~ % sudo fuse-nfs -S -i -n 'nfs://my-server?version=4' -m Fairy
Failed to mount nfs share : nfs_service failed

This is probably an issue with libnfs but I want to raise it here as I was using fuse-nfs. Libnfs mentions it was working on 10.4 but this is now 13.4.
If you need any further information I would love to provide it.

Besides, is there an option to pass arguments to osxfuse? The original reason why I was trying out this library is that there has been an issue with the builtin nfs client and I wanted to try the "local" option to get it working, which has worked with bindfs which is another fuse file system.

lock() & flock() methods not implemented

One of our users pointed out to us that flock applied on fuse-nfs mounts doesn't enforce locking between different clients. After confirming that

  1. It's true and
  2. kernel NFS mounts do enforce flock locks between clients
    We took a look at the fuse-nfs implementation and noticed that fuse-nfs just treats lock() and flock() as no-ops.

So, we are wondering if you left the locking implementation out because you didn't get to it, or if you left it out because NFS locking is flaky and inconsistent between servers and could cause stuff to hang or fail or is otherwise a bad idea.

If it is the former, are you open to a PR to include a locking implementation? And if so do you have an opinion about where the synchronous implementation of rpc_nlm4_lock_async() should live? (presumably either in libnfs or in fuse-nfs)

EFS NFS Mount - Input/output error

I have successfully connected to an AWS EFS mount. However, after a short period any attempt to use the mount reports a generic "Input/output error".

I connect successfully using this command:

fuse-nfs -a -n "nfs://1.2.3.4/?version=4" -m /data/

I cannot work out how to debug this or get a more meaningful error.

Using killall fuse-nfs stops the error and returns an empty directory again.

I have built this on Ubuntu 20.04 using the supplied instructions in the README file.

Unable to build

Hey there,

We grabbed your code today and tried building it but ran into the following issue:-

root@vagrant-ubuntu-trusty-64:/home/vagrant/fuse-nfs# make
make  all-recursive
make[1]: Entering directory `/home/vagrant/fuse-nfs'
Making all in doc
make[2]: Entering directory `/home/vagrant/fuse-nfs/doc'
test -z "/usr/bin/xsltproc" || /usr/bin/xsltproc -o fuse-nfs.1 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl fuse-nfs.xml
/bin/bash: /usr/bin/xsltproc: No such file or directory
make[2]: [fuse-nfs.1] Error 127 (ignored)
make[2]: Leaving directory `/home/vagrant/fuse-nfs/doc'
Making all in fuse
make[2]: Entering directory `/home/vagrant/fuse-nfs/fuse'
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -D_FILE_OFFSET_BITS=64 -MT fuse-nfs.o -MD -MP -MF .deps/fuse-nfs.Tpo -c -o fuse-nfs.o fuse-nfs.c
fuse-nfs.c: In function ‘fuse_nfs_getattr’:
fuse-nfs.c:40:21: error: storage size of ‘nfs_st’ isn’t known
  struct nfs_stat_64 nfs_st;
                     ^
fuse-nfs.c: In function ‘main’:
fuse-nfs.c:384:7: warning: assignment makes pointer from integer without a cast [enabled by default]
  urls = nfs_parse_url_dir(nfs, url);
       ^
fuse-nfs.c:391:27: error: dereferencing pointer to incomplete type
  ret = nfs_mount(nfs, urls->server, urls->path);
                           ^
fuse-nfs.c:391:41: error: dereferencing pointer to incomplete type
  ret = nfs_mount(nfs, urls->server, urls->path);
                                         ^
make[2]: *** [fuse-nfs.o] Error 1
make[2]: Leaving directory `/home/vagrant/fuse-nfs/fuse'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vagrant/fuse-nfs'
make: *** [all] Error 2

Focussing on just fuse-nfs.c:40:21: error: storage size of ‘nfs_st’ isn’t known we saw this snippet during configure:-

...
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
./configure: line 12355: PKG_PROG_PKG_CONFIG: command not found
checking whether to enable assertions... yes
checking fuse.h usability... yes
checking fuse.h presence... no
configure: WARNING: fuse.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: fuse.h: proceeding with the compiler's result
checking for fuse.h... yes
checking nfsc/libnfs.h usability... yes
checking nfsc/libnfs.h presence... yes
checking for nfsc/libnfs.h... yes
...

Any clues?

Much appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.