Commit Graph

340 Commits (d47c989d886e5398143d43d3b6d25fdf7210cb11)

Author SHA1 Message Date
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
Ronnie Sahlberg fc0da5c64c Merge pull request #34 from Memphiz/win32fix2
Win32fix2
2013-05-29 19:28:27 -07:00
Memphiz 292e2d9097 [win32] - add projects for examples to the solution and make them compile (all compile but nfsclient-bcast) 2013-05-29 18:41:31 +02:00
Memphiz 21eeb9f5e3 [win32] - include time.h through win32_compat.h for getting rid of undefined symbol warnings 2013-05-29 18:41:23 +02:00
Memphiz e7b4eb0a33 [cosmetics] - removed trailing semicolon 2013-05-29 18:41:17 +02:00
Memphiz 067ece8bf2 [win32] - fix visual studio project for allowing compilation for windows 2013-05-29 18:41:10 +02:00
Ronnie Sahlberg c5e346e15c More AROS fixes. AROS compiles and works again. 2013-05-28 22:49:19 -07:00
Ronnie Sahlberg 0556ee05e1 Aros fixes 2013-05-28 22:41:54 -07:00
Ronnie Sahlberg 265276038a AROS fixes 2013-05-28 22:13:08 -07:00
Ronnie Sahlberg c022471e52 Add configure test for arpa/inet.h 2013-05-28 21:25:08 -07:00
Ronnie Sahlberg 833d5b9da1 Include ifdef cleanup 2013-05-28 21:20:00 -07:00
Ronnie Sahlberg 2384420387 Configure check for sys/time.h 2013-05-28 18:08:02 -07:00
Ronnie Sahlberg bff8fe460d Some more configure checks for headers 2013-05-28 17:54:12 -07:00
Ronnie Sahlberg 7057e733c1 Add configure checks for sys/socket.h 2013-05-28 17:43:47 -07:00
Ronnie Sahlberg 728970051c Add configure checks for whether netinet/in.h is available or not 2013-05-28 17:38:37 -07:00
Ronnie Sahlberg cb5b8be2eb Try making the initial port used a little more random 2013-05-28 17:22:28 -07:00
Ronnie Sahlberg 67a9f57e67 WIN32 fixes 2013-05-28 16:15:16 -07:00
Ronnie Sahlberg e083c2a090 READE update the location of the tarballs 2013-05-27 21:50:24 -07:00
Ronnie Sahlberg a60caa0945 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
2013-05-27 21:35:26 -07:00
Ronnie Sahlberg 43e0e7a7e6 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.
2013-05-25 06:24:15 -07:00
Ronnie Sahlberg 3d574b1eab Change nfs-cp.c example to use lseek+read/write instead of pread/pwrite since some platforms (==amiga) dont have pread/pwrite
Build nfs-ls and nfs-cp for amiga/aros
2013-04-16 18:28:50 -07:00
Ronnie Sahlberg a6bc1707f7 Add two more examples: nfs-ls and nfs-cp 2013-04-15 21:41:38 -07:00
Ronnie Sahlberg 0c1a9d7a6b Fix a bug when returning the filehandle in creat() and return the filehandle
of the object we created and not the filehandle of the parent directory
2013-04-15 21:37:03 -07:00
Ronnie Sahlberg 73f4ae7cca 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
2013-04-15 20:42:44 -07:00
Ronnie Sahlberg c40efafc33 remove obsolete comment 2013-04-14 10:46:08 -07:00