Commit Graph

306 Commits (c022471e52d3ea679139cdf026dcde179c8de23c)

Author SHA1 Message Date
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
Ronnie Sahlberg ece9f02c59 Dont include config.h from libnfs-zdr.h 2013-04-14 10:44:14 -07:00
Ronnie Sahlberg 4945f30750 we can always include netinet/in.h all platforms have it 2013-04-14 10:34:33 -07:00
Ronnie Sahlberg 108c622a95 more include cleanups it starts to look almost decent now 2013-04-14 10:32:01 -07:00
Ronnie Sahlberg 00748f36c5 more header include cleanups 2013-04-14 10:11:48 -07:00
Ronnie Sahlberg 2142af5d47 WIN32: More ifdef cleanups 2013-04-14 09:02:23 -07:00
Ronnie Sahlberg 622489d36e WIN32: get rid of some ifdefs 2013-04-14 08:50:38 -07:00
Ronnie Sahlberg 099be710b6 SOCKET: Use recv/send for all socket io on all platforms
instead of only on windows and aros  and read/write on the others
2013-04-14 08:43:59 -07:00
Ronnie Sahlberg 18337b7151 AROS: we dont need to protect aros_compat.c with an ifdef 2013-04-13 08:13:31 -07:00
Ronnie Sahlberg a41dbfe25a 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.
2013-04-13 08:01:05 -07:00
Ronnie Sahlberg 9a9126c3d9 AROS: add inet_pton emulation and make sure we use recv/send and not read/write 2013-04-13 07:40:46 -07:00
Ronnie Sahlberg 03aea5e929 AROS: Add copyright boilerplate for aros_compat.c 2013-04-13 04:20:57 -07:00
Ronnie Sahlberg f95e1d1108 AROS: implement their weird errno handling 2013-04-13 04:13:05 -07:00
Ronnie Sahlberg e267bb128c AROS: Update README and list AROS as supported and provide build instruction for it 2013-04-13 03:49:15 -07:00
Ronnie Sahlberg a7954132ce 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.
2013-04-13 03:39:12 -07:00
Ronnie Sahlberg 0f9fe7c64d SOCKADDR_STORAGE: it is called HAVE_SOCKADDR_LEN not HAVE_SA_LEN 2013-04-12 19:13:11 -07:00
Ronnie Sahlberg 5c9c5f15f1 AROS: we need htons to convert socket port to network order 2013-04-12 18:12:56 -07:00
Ronnie Sahlberg f69bd55482 AROS more stuff. The listservers example now compiles and links
it sends packets to the host  but something is still not working.
2013-04-12 17:38:44 -07:00
Ronnie Sahlberg 2cdf4fcb07 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
2013-04-12 06:12:58 -07:00
Ronnie Sahlberg e77d093c37 AROS: getting closer to link. only a handful of missing symbols now 2013-04-11 18:37:05 -07:00
Ronnie Sahlberg d7c6e9aaa9 Initial AROS support.
The test app doesnt link yet since we are missing a bunch of symbols

but it is a start
2013-04-10 20:28:40 -07:00
Ronnie Sahlberg 5ba63317ac Merge pull request #32 from hulu/master
[PATCH] randomize the initial rpc xid to avoid reply cache collision
2013-02-26 06:40:23 -08:00
Steve Cai a27561934c randomize the initial rpc xid to avoid reply cache collision 2013-02-25 16:40:29 -08:00
Ronnie Sahlberg 273850767d README: We dont need tirpc for cygwin builds anymore 2013-01-03 18:13:05 -08:00
Ronnie Sahlberg ec70621f42 Remove all remaining references to RPC 2012-12-04 18:55:32 -08:00
Ronnie Sahlberg 30b0750702 Merge pull request #31 from clandmeter/master
Remove rpcgen check
2012-12-04 18:43:52 -08:00
Carlo Landmeter 12106f4908 Remove rpcgen check as it is not needed anymore 2012-12-05 00:43:21 +01:00
Ronnie Sahlberg 8afcdc959f New version 1.5
- Switch to our own builtin RPC/XDR replacement
- Android support
2012-12-03 06:38:18 -08:00
Ronnie Sahlberg e803ae5760 Rearrange the header files.
Move the headers we install to ./include/nfsc
and start including nfsc/libnfs-zdr.h  from all the other header files.
2012-11-28 20:21:53 -08:00
Ronnie Sahlberg f9bb21ad7d Add ifndef's to protect libnfs-raw.h from being included multiple times 2012-11-28 19:26:54 -08:00
Ronnie Sahlberg 717cc58e61 Merge pull request #30 from theuni/android
[droid] Support building for android
2012-11-28 19:19:09 -08:00
Cory Fields 252aa90dc8 [droid] Support building for android
These are the changes necessary to build for android. Working status is yet
untested.
2012-11-28 12:04:10 -05:00
Ronnie Sahlberg db0c9f4212 Install libnfs-zdr.h 2012-11-28 06:36:06 -08:00
Ronnie Sahlberg f816bf4c76 Merge branch 'zdr'
Manually fixyp some merge conflicts in :
	lib/init.c
	lib/pdu.c
	lib/socket.c
	nfs/Makefile.am
	nfs/nfs.x
	nlm/Makefile.am
2012-11-27 18:22:27 -08:00
Ronnie Sahlberg aab6538bbd Implement 'rejected_reply' and switch to RFC5531 definitions
Switch to using fields and names from RFC5531. that is the standard
for RPC.
2012-11-26 19:42:10 -08:00