Without this argument it's impossible to pass an object instance to procedure
callbacks which basically forces users to either use global variables or to
write additional boilerplate code and find object instances from rpc_context
pointer values.
This mostly consists of creating one slave nfs_context for each nfs
thread to track the error-string.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
We must make sure that we prepare and process all the returned data
before we wake the thread that is waiting for the i/o to complete
or else we will have a race between waking the thread and copying
the returned data in the service thread.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This patch fixes various issues around chmod/chown/utimes:
- The chmod/chown/utimes approach uses open_async_internal, which only works
for files. This patch uses lookup_path so that chmod/chown is also
possible on directories.
- Implements SET_TO_SERVER for utimes
I never succeeded in getting all tests passing even without
these changes. Nor did I succeed in getting the CMake compilation to
work. Sorry. The patch includes extra unit tests for these calls.
We use the libary as part of a test harness to test an NFS server
implementation, so I am reasonably confident that the changes work.
They are also manually tested against the Linux Kernel NFS Server.
add the possiblity of faking the uid and the gid in the nfs context.
uid and gid value are read from env variables LD_NFS_UID and LD_NFS_GID.
This can be useful on "insecure" enabled NFS share to make the server
trust you as a root.
Few lines added to the README to document the feature.
add hook on : __fxstatat(), __fxstatat64(), fchmodat(), fchown(),
chown(), fchownat() to support new implementation of chmod and to add
support for chown
This fixes build with options such as --as-needed that require correct positional argument passing. They also ensure that the right dependency library is used.
Remove the fuse module from the examples subdirectory.
This module is now a standalone repo :
https://github.com/sahlberg/fuse-nfs
And it comes with proper build rules, documentation etc etc.
It is a useful module and it has now graduated to become its own
repo.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
The fuse framework allows us to directly expose symlinks from NFS to the user,
just like a real NFS mount would. All we need to do is call lstat rather
than stat and implement a readlink function.
With this patch I can successfully chroot into a rootfs mounted using
fuse_nfs.
Signed-off-by: Alexander Graf <agraf@suse.de>
At least in my version of glibc the members st_mtim, st_ctim and st_atim
are defined as struct timespec rather than struct timeval, thus
containing a tv_nsec field rather than tv_usec.
Use the proper struct fields instead, fixing compilation on Linux.
Signed-off-by: Alexander Graf <agraf@suse.de>
The old nfs_[f]stat calls are deprecated. Convert to the newer
nfs_[f]stat64 call that takes struct nfs_stat_64
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
If we blindly spawn new threads based on existing open NFS shares, all
threads will concurrently still run on the same file descriptors for NFS
traffic, colliding sooner or later.
This is what happens with the fuse-nfs example program. To steer us back
into safety, we can just tell fuse to not do multi-threading which this
patch does.
This patch fixes random connection aborts with fuse_nfs for me.
Signed-off-by: Alexander Graf <agraf@suse.de>