We need to allow users to specify escaped characters as part of the 'path'
field of a URL.
For example, '?' is used to separate the part and the optional list of
arguments.
IF 'path' contains a '?' character then that must be escaped as %3F.
So that libnfs will be able to tell it apart from the '?' separator.
I.e.
nfs://127.0.0.1/my?path/?version=4
must be escaped as
nfs://127.0.0.1/my%3Fpath/?version=4
before passed to any of the URL parsing functions.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
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>
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.
This only allow selecting the version for the context.
There is still no real v4 support and all I/O is still using v3.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
For NFS sessions, change the autoreconnect options to be :
-1: (default) retry connectiong back to the server forever. Just like
normal NFS clients do.
0: Do not attempt reconnecting at all. Immediately fail and return an
error back to the application on session loss.
>=1: Retry connecting to the server this many times before giving up.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
`nfs_set_interface` and `rpc_set_interface` APIs, or via the
NFS URL `if=<interface>` parameter. This feature requires
`root` permissions.
NOTE: This has only been compiled and tested on Ubuntu 14.04. It's
unlikely that it'll work on other platforms without modification,
particularly around the inclusion of <net/if.h> and IFNAMSIZ define
in `libnfs-private.h`.
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>
Add a URL argument to enable/disable the use of automatic traversal of nested
mounts for a libnfs context. Default it to enabled.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Add a prebuilt manpage for nfs-ls and change the makefiles to not build the
manpage by default. This is because the manpages change rarely and this removes
the need for an internet connection when building the library.
(previously building the library required downloading a template from
sourceforge)
Update the README and mention that you now need to manually rebuild the
manpages if the manpage sources change.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Add chdir and getcwd and store cwd in the nfs_context.
Add functions to process the paths specified and normalize them
by performing the transforms :
// -> /
/./ -> /
^/../ -> error
^[^/] -> error
/string/../ -> /
/$ -> \0
/.$ -> \0
^/..$ -> error
/string/..$ -> /
Update the path lookup function to allow specifying relative paths based on
cwd for all functions.
Add chdir and getcwd and store cwd in the nfs_context.
Add functions to process the paths specified and normalize them
by performing the transforms :
// -> /
/./ -> /
^/../ -> error
^[^/] -> error
/string/../ -> /
/$ -> \0
/.$ -> \0
^/..$ -> error
/string/..$ -> /
Update the path lookup function to allow specifying relative paths based on
cwd for all functions.