Commit Graph

614 Commits (ec3a3afeae85e3e39b4e25964c75da5781590068)

Author SHA1 Message Date
Peter Lieven eb2759c62b bump version to 1.8.90
I need this to detect that we have (almost) version 1.9.0 in qemu,
but I think we should do some more testing before releasing 1.9.0.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-26 12:49:28 +01:00
Peter Lieven b70567b62c nfs_parse_url: initialize memory
the urls struct was accidently left unitialized.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-26 12:48:21 +01:00
Peter Lieven 1f1b1c5c93 nfs_parse_url_incomplete: fix use after free in param parsing
if no server is specified flagsp points into urls->server.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-26 10:43:15 +01:00
Ronnie Sahlberg 36f488dc7a Create a new function rpc_set_context_args where we parse and set the context
arguments.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2013-12-25 16:57:52 -08:00
Ronnie Sahlberg eca514653d MOUNT: The wrappers for the old MOUNT rpc calls should call the new functions and not recurse 2013-12-25 16:46:52 -08:00
Ronnie Sahlberg b2a4b99ee9 Add the url parsing functions to libnfs-win32.def 2013-12-25 16:29:00 -08:00
Ronnie Sahlberg 0961765a56 Document the URL syntax 2013-12-25 16:27:10 -08:00
Ronnie Sahlberg 6d89ace041 Merge pull request #43 from plieven/master
URL parsing functions and minor fixes + enhancements
2013-12-25 16:11:29 -08:00
Ronnie Sahlberg 767a479c37 Write the total number of bytes copied by nfs-cp, not just the last block written. 2013-12-24 13:05:04 -08:00
Ronnie Sahlberg 35280fd7a4 Grow the marshalling buffer from 64k to 1M so we can marshall really large WRITE3s 2013-12-24 13:03:50 -08:00
Ronnie Sahlberg 04e9034165 MOUNT: Add RPC support for MOUNTv1 2013-12-24 12:20:41 -08:00
Ronnie Sahlberg f38aacf8c9 Add NFSv2 RPC support 2013-12-24 11:28:56 -08:00
Ronnie Sahlberg 463d59bf8e NFS: Add new function signatures for rpc_nfs3_ that takes *3args arguments
to match the XDR.

Leave the existing ad-hoc rpc_nfs_* functions for backward compatibility.
2013-12-24 11:16:21 -08:00
Ronnie Sahlberg 21668dcef4 Add missing symbols to libnfs-win32.def and make them EXTERN 2013-12-24 08:54:28 -08:00
Ronnie Sahlberg cd954dd55e NFS: Update compile_rpc and regenerate the nfs marshalling/unmarshalling code
We had some manual changes to the nfs code to handle ANDROID and WIN32.
Update the rpc generation target to add these extra define.
2013-12-24 08:34:38 -08:00
Peter Lieven 17d3cbb136 examples/nfs-ls: add discovery mode
this adds the ability for nfs-ls to discover

a) local NFS servers

examples/nfs-ls -D nfs://

b) NFS shares on a server

examples/nfs-ls -D nfs://10.0.0.1

c) all shares on local NFS servers

examples/nfs-ls -D -R nfs://

Enjoy!

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 15:12:50 +01:00
Peter Lieven 6bdcd5b676 examples: add nfs-io example
this simple example tool allows to
- creat and unlink files
- mkdir and rmdir directories
- stat

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:50:09 +01:00
Peter Lieven 82f5df21eb examples/nfs-cp: use nfs_parse_url_full
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:07:01 +01:00
Peter Lieven 9126c9c036 add uid and gid URL param to specify alternate uid and/or gid
This allows to connect with an alternate uid or gid than that
of the current user.

Example:
 examples/nfs-ls nfs://10.0.0.1/export?uid=1000&gid=33

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:03:26 +01:00
Peter Lieven 1c8b4547ce add tcp-syncnt URL param to adjust TCP_SYNCNT sockopt
This allows indirect support for a configurable connect timeout.

Linux uses a exponential backoff for SYN retries starting
with 1 second.

This means for a value n for TCP_SYNCNT, the connect will
effectively timeout after 2^(n+1)-1 seconds.

Example:
 examples/nfs-ls nfs://10.0.0.1/export?tcp-syncnt=1

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:03:18 +01:00
Peter Lieven d2ec73c75a add URL parsing functions
this adds the following 4 functions. see libnfs.h for details.

struct nfs_url *nfs_parse_url_full(struct nfs_context *nfs, char *url);
struct nfs_url *nfs_parse_url_dir(struct nfs_context *nfs, char *url);
struct nfs_url *nfs_parse_url_incomplete(struct nfs_context *nfs, char *url);
void nfs_destroy_url(struct nfs_url *url);

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:03:00 +01:00
Peter Lieven 1f3f0d5853 libnfs_zdr_opaque: make valgrind happy
valgrind complains about unitialized memory

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 12:46:31 +01:00
Peter Lieven 1dc9ea0d52 examples/nfs-ls: recursion and summary support
this adds recusrion and summary support, fixes some compiler warnings,
fixes exit codes and avoids a possible sprintf buffer overflow.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 12:46:26 +01:00
Ronnie Sahlberg 696a507497 Merge pull request #40 from plieven/master
minor fixes
2013-12-17 06:34:23 -08:00
Peter Lieven d47c989d88 libnfs.pc.in: fix pkg-config --cflags
pkg-config --cflags libnfs returns an error with
this line:

$ pkg-config --cflags libnfs
Package @LIBNFS_PC_REQ_PRIVATE@ was not found in the pkg-config search path.
Perhaps you should add the directory containing `@LIBNFS_PC_REQ_PRIVATE@.pc'
to the PKG_CONFIG_PATH environment variable
Package '@LIBNFS_PC_REQ_PRIVATE@', required by 'libnfs', not found

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-17 12:06:29 +01:00
Peter Lieven fadbf8cf56 nfs_creat1_cb: fix memleak
data is not freed in case of a failure.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-17 11:50:00 +01:00
Peter Lieven b554c8e8d2 libnfs_authunix_create: make valgrind happy
valgrind complains about uninitialized memory.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-17 11:47:59 +01:00
Ronnie Sahlberg 1e7a5136de Finish the NSM support 2013-11-06 06:56:44 -08:00
Ronnie Sahlberg 9096d370e7 Remove some residuals from the nlm.c->nsm.c copy 2013-11-05 17:40:31 -08:00
Ronnie Sahlberg ed09b5676f Initial support for NSM 2013-11-05 17:37:16 -08:00
Ronnie Sahlberg b4598f416f Remove some debug residuals from fuse_nfs 2013-11-04 06:36:50 -08:00
Ronnie Sahlberg 8ca7b275f8 We don't need -odebug for the fuse nfs client anymore 2013-11-03 21:01:11 -08:00
Ronnie Sahlberg c6bd90a235 Add a simple FUSE filesystem based on libnfs. 2013-11-03 19:36:57 -08:00
Ronnie Sahlberg 558aefc736 New version 1.8
Fix nasty memory leak
2013-10-30 18:17:49 -07:00
Ronnie Sahlberg 751770fd43 Dont leak every single buffer we read from the socket. 2013-10-30 18:15:03 -07:00
Ronnie Sahlberg 8733f38d23 Add an async helper function to connect an rpc context to a program/version 2013-10-26 13:16:09 -07:00
Ronnie Sahlberg 3b943d2f68 Add a mechanism to control what the next XID value on a session will be.
This makes it possible for multiple processes/contexts to use the same
target and (with some synchronization) avoid XID collissions across processes/contexts.
2013-10-26 07:44:29 -07:00
Ronnie Sahlberg 6fda9871a0 Mix in the pid in the top 16 bits for the initial xid.
This helps for users which rapidly fork a lot of processes that then
immediately create a new context (I am looking at you dbench)
to awoid having lots of processes starting and using overlapping xid values.
2013-10-25 16:16:43 -07:00
Ronnie Sahlberg e7f3a78172 Don't clamp write3 max to 32k
We use our own XDR and RPC layer nowadays and do not have
any external dependencies to XDR or RPC.

As such we no longer need to clamp the write size to max 32kb
since we never link to the system rpc/xdr libraries.
(and thus dont have to clamp in case the system library is broken for
pdu's > 32k)

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2013-10-23 19:18:41 -07:00
Volker Lendecke cd67ec7d6b Fix typos 2013-10-23 19:13:00 -07:00
Ronnie Sahlberg b93082da2b Make xid be a uint32_t and not either unsigned long or unsigned int 2013-10-21 19:15:11 -07:00
Ronnie Sahlberg 31820d2727 New version 1.7
- Allow nested eventloops so that a sync function can be called from a callback.
 - Fix a bug in unmarshalling a uint64.
 - Add PATHCONF support.
 - WIN32/64 updates
 - AROS updates
2013-10-20 16:31:32 -07:00
Ronnie Sahlberg dd97d43aad Reset the receive buffer processing the received PDU.
This allows us to have recursive eventloops and do synchronous
rpc calls from a callback.
2013-10-20 13:16:45 -07:00
Ronnie Sahlberg c81e7d8921 Make sure the the value is unsigned before we OR it into the uint64_t
or else the sign might be extended.
2013-10-20 12:41:56 -07:00
Ronnie Sahlberg 6f914247fb Add support for NFS/PATHCONF 2013-10-20 10:07:19 -07:00
Ronnie Sahlberg 6683cec917 Merge pull request #36 from Memphiz/win32fix2
[win32] - fix missing preprocessor define for using 32bit time_t in
2013-07-10 11:39:05 -07:00
Memphiz 584346331d [win32] - fix missing preprocessor define for using 32bit time_t in
release target of vs project (fixes crashing with xbmc)
2013-07-10 19:53:54 +02:00
Ronnie Sahlberg 6061db5800 AROS: Add an install target to the makefile
Copy libnfs.a to GCC:lib and the header files to
INCLUDE:nfsc
2013-06-08 13:06:17 -07:00
Ronnie Sahlberg 7e66b28947 Merge branch 'master' of github.com:sahlberg/libnfs 2013-05-30 17:59:24 -07:00
Ronnie Sahlberg 4e019b25b5 On Windows, use 65534/65534 instead of 65535/65535 for the default uid/gid 2013-05-30 17:58:29 -07:00