Explanation of the bug:
- nfs_opendir_cb() queues a READDIR when it receives RPC_STATUS_ERROR.
- rpc_purge_all_pdus() explicitly says that no further pdus should be
queued when rpc_purge_all_pdus() is invoked and the outqueue is being
cleared.
- Since nfs_opendir_cb() is called in rpc_purge_all_pdus() with
status=RPC_STATUS_ERROR, this invariant is broken.
Fix:
- Invoke check_nfs3_error() which will invoke the appropriate
callback with the right error.
- Disallow queueing a request in the if block
Add two arguments to set which port to use for MOUNT (only used in NFSv3)
as well as for the NFS protocols.
When set to non-zero libnfs will connect directly to that port and bypass
the use of portmapper completely.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
It didn't fail if pwd.h is missing because #includes must be seperated with a newline, a comma won't work.
The compile works anyway because the "struct passwd *pwd" implicitly declares an anonymus struct type "passwd"
and using an undeclared function is an implicit function declaration. Here's the output of configure in that case:
configure:13381: checking whether getpwnam() is available
configure:13396: i686-w64-mingw32-gcc -c -I/home/daniel/fsetmp/dokany/src/dokan_fuse/include/ -I/home/daniel/fsetmp/dokany/src/dokan_fuse/include/ conftest.c >&5
conftest.c:23:23: warning: extra tokens at end of #include directive
#include <sys/types.h>, #include <pwd.h>
^
conftest.c: In function 'main':
conftest.c:28:30: warning: implicit declaration of function 'getpwnam' [-Wimplicit-function-declaration]
struct passwd *pwd = getpwnam("nobody");
^~~~~~~~
conftest.c:28:30: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
configure:13396: $? = 0
configure:13403: result: yes
we already convert this into "65534" anyway so there is no point in
also logging an error if we failed the name to uid/gid mapping.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Some nfsv4 servers return a user/group name in the attributes instead
of a uid/gid number. At least for the "nobody" user.
For those, try to use getpwnam() where available to map the string back
to a uid/gid or return uid/gid==65534 (common value for nobody)
if not available or failing.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
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