Ronnie Sahlberg [Sat, 26 Oct 2013 14:44:29 +0000 (07:44 -0700)]
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.
Ronnie Sahlberg [Fri, 25 Oct 2013 23:16:43 +0000 (16:16 -0700)]
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.
Ronnie Sahlberg [Thu, 24 Oct 2013 02:18:41 +0000 (19:18 -0700)]
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>
Ronnie Sahlberg [Sun, 20 Oct 2013 23:31:32 +0000 (16:31 -0700)]
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
Ronnie Sahlberg [Tue, 28 May 2013 04:35:26 +0000 (21:35 -0700)]
New version 1.6
Add AROS/Amiga support
Chose initial XID value better to reduce probability for collissions
Fix bug in the initial default credentials and use getgid() instead of -1
Ronnie Sahlberg [Sat, 25 May 2013 13:24:15 +0000 (06:24 -0700)]
On unix systems, when creating the default authentication token
use getgid() as the group instead of -1.
Recent linux knfsd do not allow grp==-1
On windows there are no uid/gids in the traditional sense so there I still specify a default credential of uid==gid==-1 :
rpc->auth = authunix_create("LibNFS", 65535, 65535, 0, NULL);
This is I think the sanest/safest thing to do since most servers will have
special handing of -1 meaning 'nobody' or similar.
This should work on many/most servers and give the user the minimum available
access allowed for 'nobody'.
I think on windows (or AROS for that matter) applications will probably have
to invoke and set the credentials themself explicitely.
Those apps probably, unfortunately, also need to have a configuration
setting to select which uid/gid to use when talking to the server.
(or they could hardcode it)
rpc_set_auth(rpc, libnfs_authunix_create("hostname", uid, gid, 0, NULL))
should do the trick if they call immediately after creating the rpc/nfs context.
But dont set it to 0,0 root/root for uid/gid.
First of all, most servers have root-squash so they will re-map this uid/gid
to 'nobody' internally.
But, if the user uses a server that does not do root-squash, then setting this to 0,0 would mean that your app now access the nfs share as root which is probably not what you want.
Ronnie Sahlberg [Tue, 16 Apr 2013 03:42:44 +0000 (20:42 -0700)]
Allow nfs_lookuppath_async to have path[0]=='\0' this happens when we
want to create an object straight under the root directory of what we
mounted.
As always, the actual object to create is then a string starting after the \0 byte
Ronnie Sahlberg [Sat, 13 Apr 2013 15:01:05 +0000 (08:01 -0700)]
AROS: Add an example for using the SYNC API to AROS
While the ASYNC API is probably always preferable, the SYNC API is easier
to use. The SYNC API is probably what most users want.
Ronnie Sahlberg [Sat, 13 Apr 2013 10:39:12 +0000 (03:39 -0700)]
AROS: We have to provide the correct nfds to WaitSelect
When copying the poll() compatibility function from win32 to AROS
we need to update it to set nfds correctly.
While win32 does not care what nfds is set to and works even if nfds is always
0, other platforms, like AROS do care.
Ronnie Sahlberg [Fri, 12 Apr 2013 13:12:58 +0000 (06:12 -0700)]
AROS: it is called IoctlSocket/CloseSocket and WaitSelect on AROS.
Additionally add a aros_init_socket() function to open the bsd socket library and set up networking
Ronnie Sahlberg [Sun, 25 Nov 2012 15:57:40 +0000 (07:57 -0800)]
New version 1.4
- Add trackig of freed context and assert on using a context after it has been
freed.
- Windows x64 support and fixes.
- Switch to using our own version of xdr_int64() since the one in libtirpc
crashes on some platforms.
- Fix memory leak in an error path for addrinfo.
- Fix bug dereferencing a null pointer in the mount callback on error.
Ronnie Sahlberg [Sun, 4 Nov 2012 23:55:05 +0000 (15:55 -0800)]
MOUNT: when processing the mount response, check status before dereferencing data pointer
If status is non-zero in the mount callback, then the datapointer might be NULL
so we should not dereference it into an exports pointer before we have checked the status.