deb_libnfs.git
13 years agoDont allow a tcp _connect to a UDP context
Ronnie Sahlberg [Sun, 26 Jun 2011 08:32:06 +0000 (18:32 +1000)] 
Dont allow a tcp _connect to a UDP context

13 years agoadd capability to read UDP datagrams from the socket and pass them to the parser
Ronnie Sahlberg [Sun, 26 Jun 2011 08:30:26 +0000 (18:30 +1000)] 
add capability to read UDP datagrams from the socket and pass them to the parser

13 years agoadd a sockaddr_storage so we can store the socket UPD packets came in from
Ronnie Sahlberg [Sun, 26 Jun 2011 08:29:49 +0000 (18:29 +1000)] 
add a sockaddr_storage so we can store the socket UPD packets came in from

13 years agofor UDP sockets, we ONLY wait for pollin events
Ronnie Sahlberg [Sun, 26 Jun 2011 08:26:34 +0000 (18:26 +1000)] 
for UDP sockets, we ONLY wait for pollin events
since upd sockets are always writeable.
they just silently drop packets when congested

13 years agoadd support for sending and receiving udp pdu
Ronnie Sahlberg [Sun, 26 Jun 2011 08:24:24 +0000 (18:24 +1000)] 
add support for sending and receiving udp pdu

13 years agoadd a sockaddr_storage to the rpc context so we can store the socket a upd packet...
Ronnie Sahlberg [Sun, 26 Jun 2011 08:22:45 +0000 (18:22 +1000)] 
add a sockaddr_storage to the rpc context so we can store the socket a upd packet came in from

13 years agoadd a 'is broadcast' flag to the rpc context structure
Ronnie Sahlberg [Sun, 26 Jun 2011 08:18:59 +0000 (18:18 +1000)] 
add a 'is broadcast' flag to the rpc context structure
this is used for broadcast udp rpc calls (==pormatp/callit)

13 years agoin allocate pdu, if context is udp, dont allocate space for a record marker
Ronnie Sahlberg [Sun, 26 Jun 2011 07:30:00 +0000 (17:30 +1000)] 
in allocate pdu, if context is udp, dont allocate space for a record marker

13 years agoadd function to request a UDP context
Ronnie Sahlberg [Sun, 26 Jun 2011 07:27:40 +0000 (17:27 +1000)] 
add function to request a UDP context
(private use only since we dont want applications to use UDP)

13 years agoadd rpc_context field to track if a UDP connection was requested
Ronnie Sahlberg [Sun, 26 Jun 2011 07:17:59 +0000 (17:17 +1000)] 
add rpc_context field to track if a UDP connection was requested

13 years agoadd test reading from non-0 offset to the sync api example
Ronnie Sahlberg [Sat, 25 Jun 2011 05:05:50 +0000 (15:05 +1000)] 
add test reading from non-0 offset to the sync api example

13 years agoadd RPC definition for the portmapper/callit function
Ronnie Sahlberg [Sat, 25 Jun 2011 03:59:12 +0000 (13:59 +1000)] 
add RPC definition for the portmapper/callit function

13 years agoredo the previous patch to instead initialize max_offset correctly before we invoke...
Ronnie Sahlberg [Sat, 25 Jun 2011 02:23:52 +0000 (12:23 +1000)] 
redo the previous patch to instead initialize max_offset correctly before we invoke the chunks.

this is the correct way to fix this bug.

13 years agohandle the case where we try a multi-read that is completely beyond the end of file.
Ronnie Sahlberg [Sat, 25 Jun 2011 02:13:11 +0000 (12:13 +1000)] 
handle the case where we try a multi-read that is completely beyond the end of file.

when a multi-read was completely beyond the end of file, this caused us to invoke the callback with a 'read-count' of <0  which the callback would treat as a failure.
This would then cause the callback to treat the data pointer as an error string and try to use it for nfs_set_error().
Since the data pointer was actually a real binary databuffer and not an error string this would cause the NFS error string to look like it contained garbage data.

In this case, where the multi-read fails to read any data at all since it if fully beyond end of file,  make sure to invoke the callback with a read-count of 0

13 years agofix crash in mount/export
Ronnie Sahlberg [Sat, 25 Jun 2011 01:06:53 +0000 (11:06 +1000)] 
fix crash in mount/export

need to check that status is OK before we start dereferencing the 'export' pointers or else we will segv.
this could happen if trying to pull the list of exports from a host that does not have mountd running, or if we can not connect at all to the host.

13 years agoAdd a very subtle bug in nfs_set_error()
Ronnie Sahlberg [Tue, 21 Jun 2011 08:33:50 +0000 (18:33 +1000)] 
Add a very subtle bug in nfs_set_error()
when nfs_set_error is called with error_string being the result of a lower layer
problem so it is passed as "rpc_get_error()"

This meant that since free that nfs->rpc->error_string before we reference it a few lines further down in the vasprintf(..., error_string,
adn memory corruption triggers.

Valgrind found this, Valgrind rules!

13 years agoWhen doping chunked multi-reads of a blob bigger than the max readsize,
Ronnie Sahlberg [Mon, 20 Jun 2011 20:07:29 +0000 (06:07 +1000)] 
When doping chunked multi-reads of a blob bigger than the max readsize,
a read can sometimes span beyond the end of file.

In which case individual smal read chunks beyond the end of file will return OK, 0 bytes of data and EOF==1

For this case, trap when len==0 and ignore these chunks.
Do not update the read-count if / when len is 0.

13 years agoFrom Paul van der Zwan
Ronnie Sahlberg [Sun, 19 Jun 2011 15:02:48 +0000 (01:02 +1000)] 
From Paul van der Zwan

Set the directory bit in st_mode properly.

13 years agoRedo the buffer handling for input buffers and make sure we only read one PDU at...
Ronnie Sahlberg [Sun, 19 Jun 2011 14:56:47 +0000 (00:56 +1000)] 
Redo the buffer handling for input buffers and make sure we only read one PDU at a time

13 years agoremove the need for an explicit rpc context for the highlevel function mount_getexports()
Ronnie Sahlberg [Sun, 19 Jun 2011 13:20:35 +0000 (23:20 +1000)] 
remove the need for an explicit rpc context for the highlevel function mount_getexports()

13 years agoadd a sync function to get the export list from a server and add an example of how...
Ronnie Sahlberg [Sun, 19 Jun 2011 12:31:34 +0000 (22:31 +1000)] 
add a sync function to get the export list from a server and add an example of how to use this functio n to nfsclient-sync

13 years agoAdd a high-level async function to read the export list
Ronnie Sahlberg [Sun, 19 Jun 2011 04:54:17 +0000 (14:54 +1000)] 
Add a high-level async function to read the export list

13 years agoAdd example for how to call MOUNT/EXPORT and get the exports list using the raw lowle...
Ronnie Sahlberg [Sun, 19 Jun 2011 00:28:25 +0000 (10:28 +1000)] 
Add example for how to call MOUNT/EXPORT and get the exports list using the raw lowlevel api.

13 years agoget rid of all remaining printfs from the library
Ronnie Sahlberg [Sat, 18 Jun 2011 23:38:20 +0000 (09:38 +1000)] 
get rid of all remaining printfs from the library

add a helper function nfs_set_error() to use instead of the printfs

13 years agoget rid of compiler warning
Ronnie Sahlberg [Sat, 18 Jun 2011 23:05:20 +0000 (09:05 +1000)] 
get rid of compiler warning

13 years agoremove all printf's and replace them with rpc_set_error()
Ronnie Sahlberg [Sat, 18 Jun 2011 23:03:04 +0000 (09:03 +1000)] 
remove all printf's and replace them with rpc_set_error()

also change all error return codes to always return -1

13 years agoAdd support in read/pread to be aware of the Maximum Read size that the server
Ronnie Sahlberg [Sat, 18 Jun 2011 22:43:28 +0000 (08:43 +1000)] 
Add support in read/pread to be aware of the Maximum Read size that the server
suggested.

When a read/pread operation that is 'oversize' is issued, the read/pread command will internally chop this up into smaller chunsk and send then concurrently to the server.
As replies come back from the server we add the data to a reassembly buffer
and as soon as all replies have been received we invoke the callback and pass the reassembly buffer back to the application.

13 years agoRemove the _sync postfix for the synchronous functions
Ronnie Sahlberg [Sat, 18 Jun 2011 05:07:53 +0000 (15:07 +1000)] 
Remove the _sync  postfix for the synchronous functions

13 years agoMerge pull request #5 from OpenELEC/libnfs-destdir
Ronnie Sahlberg [Sat, 11 Jun 2011 23:10:09 +0000 (16:10 -0700)] 
Merge pull request #5 from OpenELEC/libnfs-destdir

(Re)Adding DESTDIR support, adding support to set --includedir at configure time, disable ldconfig for crosscompiling

13 years agoMerge pull request #4 from Memphiz/readme
Ronnie Sahlberg [Sat, 11 Jun 2011 23:07:09 +0000 (16:07 -0700)] 
Merge pull request #4 from Memphiz/readme

- adapted README with tested plattforms

13 years agoadd DESTDIR support, needed for crosscompiling; dont hardcode /usr/include - use...
Stephan Raue [Sat, 11 Jun 2011 21:25:07 +0000 (23:25 +0200)] 
add DESTDIR support, needed for crosscompiling; dont hardcode /usr/include - use --includedir= instead on configure time

Signed-off-by: Stephan Raue <stephan@openelec.tv>
13 years agoDisable run of ldconfig if crosscompiling too
Stephan Raue [Sat, 11 Jun 2011 21:22:19 +0000 (23:22 +0200)] 
Disable run of ldconfig if crosscompiling too

Signed-off-by: Stephan Raue <stephan@openelec.tv>
13 years ago- adapted README with tested plattforms
Memphiz [Sat, 11 Jun 2011 17:37:28 +0000 (19:37 +0200)] 
- adapted README with tested plattforms

13 years agoMerge pull request #3 from Memphiz/originalnfs2
Ronnie Sahlberg [Fri, 10 Jun 2011 22:04:51 +0000 (15:04 -0700)] 
Merge pull request #3 from Memphiz/originalnfs2

"Last" pull ...

13 years ago- add configure option for disabling the call to ldconfig on make install
Memphis [Wed, 8 Jun 2011 15:19:32 +0000 (17:19 +0200)] 
- add configure option for disabling the call to ldconfig on make install
- this is needed because we use a prefix which is writable by the user - calling ldconfig
would need root rights which we have to avoid...

13 years ago- make unsigned hyper overridable by cmdline by specifying -DU_INT64_PLATTFORM_TYPE...
Memphiz [Tue, 7 Jun 2011 22:23:59 +0000 (00:23 +0200)] 
- make unsigned hyper overridable by cmdline by specifying -DU_INT64_PLATTFORM_TYPE to rpcgen

13 years ago- honor @cc@,@CLFAGS@ and @LDFLAGS@ which is important for cross compilation
Memphiz [Tue, 7 Jun 2011 22:23:04 +0000 (00:23 +0200)] 
- honor @cc@,@CLFAGS@ and @LDFLAGS@ which is important for cross compilation
- use a more generic regexp for renaming the generated rpc header includes - because the include is without subpath on darwin/ios
- make linkerstuff and so names dynamic according to @is_darwin@
- create install directorys if they don't exist
- use $(prefix) instead of $(DESTDIR) for installation
- build examples only if @ENABLE_EXAMPLES@ is set (default is on)
- rm -rf bin on clean because darwin adds directories here on compilation
- use u_int64_t for rpcgen on darwin instead of unsigned hyper (it is not known to the darwin rpcgen...)

13 years ago- no ldconfig for darwin
Memphiz [Tue, 7 Jun 2011 22:22:37 +0000 (00:22 +0200)] 
- no ldconfig for darwin
- add variable is_darwin - used in Makefile.in for building the proper dynamic lib
- add option --without-examples for disable build of examples

13 years ago - fixed library path for mac osx (there is no lib64 path here...)
Memphiz [Mon, 6 Jun 2011 22:02:17 +0000 (00:02 +0200)] 
 - fixed library path for mac osx (there is no lib64 path here...)

13 years agoAdd support for version 2 of the rquota protocol
Ronnie Sahlberg [Thu, 2 Jun 2011 12:16:42 +0000 (22:16 +1000)] 
Add support for version 2 of the rquota protocol

13 years agoAdd RQUOTA1/GETACTIVEQUOTA call to the raw low level API
Ronnie Sahlberg [Thu, 2 Jun 2011 12:06:25 +0000 (22:06 +1000)] 
Add RQUOTA1/GETACTIVEQUOTA call to the raw low level API

13 years agoMerge pull request #1 from Memphiz/originalnfs
Ronnie Sahlberg [Thu, 2 Jun 2011 07:48:03 +0000 (00:48 -0700)] 
Merge pull request #1 from Memphiz/originalnfs

First pullrequests for beeing some more plattform compatible :)

13 years ago- missing rpc/rpc.h for new rquota too
Memphiz [Wed, 1 Jun 2011 17:10:23 +0000 (19:10 +0200)] 
- missing rpc/rpc.h for new rquota too

13 years ago- linux, osx, and ios need rpc/rpc.h includede before rpc/xdr.h
Memphis [Wed, 1 Jun 2011 16:06:15 +0000 (18:06 +0200)] 
- linux, osx, and ios need rpc/rpc.h includede before rpc/xdr.h
- fixed some missing includes for bzero, malloc and free

13 years ago- include string.h for memcpy
Memphis [Wed, 1 Jun 2011 16:05:50 +0000 (18:05 +0200)] 
- include string.h for memcpy

13 years ago- refactored parametername from reserved keyword "export" to "exportname"
Memphis [Wed, 1 Jun 2011 16:05:18 +0000 (18:05 +0200)] 
- refactored parametername from reserved keyword "export" to "exportname"

13 years ago- removed unneeded dependency to libpopt
Memphis [Wed, 1 Jun 2011 16:04:53 +0000 (18:04 +0200)] 
- removed unneeded dependency to libpopt

13 years agoUse HAVE_SOCK_SIN_LEN and set ->sin_len
Ronnie Sahlberg [Wed, 1 Jun 2011 11:31:40 +0000 (21:31 +1000)] 
Use HAVE_SOCK_SIN_LEN and set ->sin_len
for legacy unixens (AIX)
so that we will compile and run on those systems with a "weird"
sockaddr_in definition.

13 years agoInitial support for RQUOTA protocol
Ronnie Sahlberg [Wed, 1 Jun 2011 10:55:27 +0000 (20:55 +1000)] 
Initial support for RQUOTA protocol

13 years agoget rid of some compiler warnings
Ronnie Sahlberg [Tue, 31 May 2011 14:12:55 +0000 (00:12 +1000)] 
get rid of some compiler warnings

13 years agoRead the max read/write sizes supported when connecting to NFS
Ronnie Sahlberg [Tue, 31 May 2011 14:08:29 +0000 (00:08 +1000)] 
Read the max read/write sizes supported when connecting to NFS
and store in the nfs context.
Privide accessor functions to read the max sizes.

13 years agoAdd example of NFS/FSINFO async call
Ronnie Sahlberg [Tue, 31 May 2011 13:50:44 +0000 (23:50 +1000)] 
Add example of NFS/FSINFO async call

13 years agoAdd support for async version of NFS/FSINFO3 call
Ronnie Sahlberg [Tue, 31 May 2011 13:50:18 +0000 (23:50 +1000)] 
Add support for async version of NFS/FSINFO3 call

13 years agoUse getsockopt to extract better failure condition when tcp layer receives a failure
Ronnie Sahlberg [Mon, 7 Feb 2011 11:11:12 +0000 (22:11 +1100)] 
Use getsockopt to extract better failure condition when tcp layer receives a failure

13 years agoREADME: mention that you need "insecure" to use libnfs as non-root user
Ronnie Sahlberg [Sun, 6 Feb 2011 05:39:37 +0000 (16:39 +1100)] 
README: mention that you need "insecure" to use libnfs as non-root user

13 years agoinitial libnfs checkin
Ronnie Sahlberg [Sun, 6 Feb 2011 04:45:09 +0000 (15:45 +1100)] 
initial libnfs checkin