m4 directory is required for autotools generation, the use of bootstrap
script is nice helper, however, the autoreconf -ivf should be usable
for autotools based checkout without any other action.
these days the bootstrap script is kinda useless, in the old days it was
a very complex set of autoconf/automake/libtool/gettext commands.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
An EOF is signalled through a POLLIN event and subsequen recvs return
always 0. Handle this condition and reconnect. Otherwise we might
deadlock here.
Signed-off-by: Peter Lieven <pl@kamp.de>
- Disable multithreading in fuse_nfs
- Add -Wall and -Werror compiler flags (and fix issues found by it)
- Add nfs-cat utility
- Switch to using nfs_[f]stat64 instead of the deprecated nfs_[f]stat call
in all examples
- If the server does not return any atttributes for entries in READDIRPLUS
then try to fetch them using lookup instead.
- Reconnection fixes
- Enforce the max pdu size and add sanity checks when reading PDUs from
the socket.
- Stop using ioctl(FIONREAD) to find out how many bytes to read, and treat
0 as an indication of a problem. Some applications call their POLLIN handlers
spuriosly even when there is no data to read, which breaks this check in
libnfs.
- Add basic support to do logging.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
only logging to stderr is supported at the moment. Per default
there is no output. Its possible to set the log level via
debug url parameter.
Example:
nfs-ls nfs://127.0.0.1/export?debug=2
Signed-off-by: Peter Lieven <pl@kamp.de>
the write limit of libnfs has been 1M since a long time.
Restrict rtmax and wrmax to 1M and error out otherwise.
Limit the PDU size when reading from socket to rule out
malicious servers forcing us to allocate a lot of memory.
Signed-off-by: Peter Lieven <pl@kamp.de>
under Linux poll might return POLLIN even if there are no bytes available for read.
See select(2) manpage for surious readiness under BUGS.
As a consequence we start dropping TCP connections which are still alive.
Signed-off-by: Peter Lieven <pl@kamp.de>
Conflicts:
lib/socket.c
Some servers sometimes do not return attrivbutes for files in the RDP
replies. So we need to fallback to using LOOKUPs for these entries
just like we always have to do in the READDIR case.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
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>
The BSD license requires that it is included with binary distributions.
Including the text in a separate file makes it easier for distros to do
this.
Also include the license files in the source tarball.
Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Update the configure to add some sanity -W arguments.
A good start is probably :
-Wall -Werror -Wshadow -Wno-write-strings -Wstrict-prototypes
-Wpointer-arith -Wcast-align -Wno-strict-aliasing
Fixup the paces in the code that triggers.
(one of which is readahead code which is perhaps broken?)
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>
- Auto-traverse mounts. With this option (default to on) libnfs will
autodiscover and handle any nested submounts.
- Remove nfs_get_current_offset. Applications should use seek instead of this function.
- Add umask() support.
- Change set_tcp_sockopt() to be static.
- Android fix for nfs-ls
- Make S_IFLNK available on windows.
- Fix a use after free.
- Fix a bug where truncate() treated offset as 32bit.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Make the continue_int field we use through the internal callbacks a uint64_t
instead of an int.
This fixes a bug for the truncate function where we pass the offset to truncate
to via this field.
The bug is that otherwise we first truncate the field to an int and then
in the callback we cast this int back to a uint64_t again.
If the user called truncate with an offset that is >= 2^31
then :
IF the 1<<31 bit is cleared then we would truncate to (offset & 0xffffffff)
IF the 1<<31 bit is set, we would instead truncate to (offset | 0xffffffff00000000)
Reported-by: doktorstick at github
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Fix retrieving the attributes for a submount in nfs_opendir when
the submount is an entry of '/'.
Signed-off-by: Ross Lagerwall <rosslagerwall@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>
When opendir_cb encounters an entry that refers to a nested mount, then
replace the attributes with those attributes we collected for this export
during the mount and return those instead.
This makes traversing a director that crosses into a different filesystem
on the server transparent to the client.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Durng nfs_lookuppath_async, check if the requested path traverses into
a nested mountpoint and if so, skip resolving that part of thre path and just
use the filehandle for the nested mount.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>