Arne Redlich [Mon, 17 Feb 2014 22:22:02 +0000 (23:22 +0100)]
nfs_fchown_async: fix nullptr dereference
nfs_chown_data is hooked up under nfs_cb_data->continue_data but
no ->free_continue_data is configured, so once free_nfs_cb_data is
invoked it will trip over a nullptr.
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
Arne Redlich [Mon, 17 Feb 2014 21:17:04 +0000 (22:17 +0100)]
libnfs-raw.h: rename export -> exportname to avoid clash with C++ keyword
From http://en.cppreference.com/w/cpp/keyword/export :
Until C++11:
"Used to mark a template definition exported, which allows the same
template to be declared, but not defined, in other translation units."
Since C++11:
"The keyword is unused and reserved."
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
Arne Redlich [Thu, 13 Feb 2014 21:36:54 +0000 (22:36 +0100)]
nfs_normalize_path: fix using the results of assignments in while loops
Spotted by clang:
../../libnfs.git/lib/libnfs.c:1002:13: warning: using the result of an assignment as a condition without parentheses
[-Wparentheses]
while (str = strstr(path, "//")) {
~~~~^~~~~~~~~~~~~~~~~~~~
../../libnfs.git/lib/libnfs.c:1002:13: note: place parentheses around the assignment to silence this warning
while (str = strstr(path, "//")) {
^
( )
../../libnfs.git/lib/libnfs.c:1002:13: note: use '==' to turn this assignment into an equality comparison
while (str = strstr(path, "//")) {
^
==
Make the intent clear by adding extra parentheses, and also
remove trailing whitespace from libnfs.c while at it.
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
Ronnie Sahlberg [Sun, 2 Feb 2014 20:16:07 +0000 (12:16 -0800)]
Add support for O_TRUNC with nfs_open()
O_TRUNC will attempt to truncate the file when opened with O_RDWR
or O_WRONLY.
Normal posix open(O_RDONLY|O_TRUNC) is undefined.
libnfs nfs_open() only uses the O_TRUNC flag when used in combination with either O_RDWR or O_WRONLY.
When O_TRUNC is used together with O_RDONLY libnfs will silently ignore the O_TRUNC flag.
Libnfs nfs_open(O_RDONLY|O_TRUNC) is thus the same as nfs_open(O_RDONLY)
Ronnie Sahlberg [Sun, 2 Feb 2014 16:45:21 +0000 (08:45 -0800)]
Add a rpc_set_fd() fucntion which can be used to swap the underlying socket file descriptor
This is mainly needed when having to track and control the file descriptors that are used by libnfs, for example when trying to emulate dup2() ontop
of libnfs.
Ronnie Sahlberg [Tue, 28 Jan 2014 04:54:14 +0000 (20:54 -0800)]
Add support for chdir and getcwd
Add chdir and getcwd and store cwd in the nfs_context.
Add functions to process the paths specified and normalize them
by performing the transforms :
// -> /
/./ -> /
^/../ -> error
^[^/] -> error
/string/../ -> /
/$ -> \0
/.$ -> \0
^/..$ -> error
/string/..$ -> /
Update the path lookup function to allow specifying relative paths based on
cwd for all functions.
Ronnie Sahlberg [Tue, 28 Jan 2014 14:35:52 +0000 (06:35 -0800)]
We need the libnfs-raw-*.h files in include/Makefile.am
or else the autotools (which I dont really understand how it works)
will not install the headers.
Ronnie Sahlberg [Tue, 28 Jan 2014 04:54:14 +0000 (20:54 -0800)]
Add support for chdir and getcwd
Add chdir and getcwd and store cwd in the nfs_context.
Add functions to process the paths specified and normalize them
by performing the transforms :
// -> /
/./ -> /
^/../ -> error
^[^/] -> error
/string/../ -> /
/$ -> \0
/.$ -> \0
^/..$ -> error
/string/..$ -> /
Update the path lookup function to allow specifying relative paths based on
cwd for all functions.
Ronnie Sahlberg [Tue, 28 Jan 2014 04:47:24 +0000 (20:47 -0800)]
New version : 1.9.0
- Use _stat64 on windows so file sizes become 64bit always.
- Increase default marshalling buffer so we can marshall large PDUs.
- RPC layer support for NFSv2
- Win32 updates and fixes
- Add URL parsing functions and URL argument support.
- New utility: nfs-io
- nfs-ls enhancements
- RPC layer support for NSM
- Add example FUSE filesystem.
- Minor fixes.
Memphiz [Sun, 12 Jan 2014 13:42:56 +0000 (14:42 +0100)]
[win32] - fixed bad number casting when using libnfs on 64bit win8 systems - force the usage of struct __stat64 as its done on other platforms implicitly
Ronnie Sahlberg [Wed, 1 Jan 2014 00:25:01 +0000 (16:25 -0800)]
Add uid/gid to the stat data returned in the readdir directoryentry
We also get uid/gid for free when using READDIRPLU3 (and READDIRPLUS3 emulation)
so store these too so applications that needs to look at the uid/gid can avoid
the extra call to nfs_stat()
Ronnie Sahlberg [Thu, 26 Dec 2013 17:08:26 +0000 (09:08 -0800)]
Change rpc_set_context_args to nfs_set_context_args and make it static
It only makes sense to pass url arguments to an nfs URL and thus a nfs context.
While some arguments may apply to the underlying raw rpc context (uid, gid,
tcp settings etc) some future arguments may need to apply to the nfs context
instead, such as selecting nfs version, whether or not to force sync writes
etc.
Peter Lieven [Tue, 17 Dec 2013 11:06:29 +0000 (12:06 +0100)]
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