Commit Graph

614 Commits (ec3a3afeae85e3e39b4e25964c75da5781590068)

Author SHA1 Message Date
Ronnie Sahlberg b8c28d541e Add a simple LD_PRELOAD toy to make cat and cp nfs-aware 2014-02-02 18:03:50 -08:00
Ronnie Sahlberg be7b4360ac We need to pass a filehandle back for open(O_TRUNC) or else the app will
be unhappy
2014-02-02 17:39:04 -08:00
Ronnie Sahlberg 22a0f15bee 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)
2014-02-02 12:16:07 -08:00
Ronnie Sahlberg 3cea44dc54 Rename the nfs_open() argument from mode to flags 2014-02-02 11:41:22 -08:00
Ronnie Sahlberg 6ec481d3fa 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.
2014-02-02 08:45:21 -08:00
Ronnie Sahlberg 34edf264dc Empty paths are no longer an error. Translate it to '.' instead. 2014-02-01 08:03:12 -08:00
Ronnie Sahlberg f893b680f2 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.
2014-01-30 20:06:57 -08:00
Ronnie Sahlberg 0a63cc7258 Remove chdir changes for now. Needs more testing. 2014-01-30 18:30:25 -08:00
Ronnie Sahlberg 0df47959c4 Revert "Add support for chdir and getcwd"
This reverts commit fb6f315257.
2014-01-30 18:26:39 -08:00
Ronnie Sahlberg 1d95217b2f New version 1.9.1
Add back the libnfs-raw-*.h headers to make install
2014-01-28 06:41:31 -08:00
Ronnie Sahlberg bcb4f1bd1c 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.
2014-01-28 06:35:52 -08:00
Ronnie Sahlberg fb6f315257 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.
2014-01-27 20:54:59 -08:00
Ronnie Sahlberg 5392b1cfbc 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.
2014-01-27 20:47:24 -08:00
Ronnie Sahlberg 37e3eace2a Merge pull request #50 from asgeirn/master
Fixed SPEC file to work with Red Hat 6.3 x64.
2014-01-16 06:25:35 -08:00
Asgeir Storesund Nilsen 9304ad516e Fixed SPEC file to work with Red Hat 6.3 x64. 2014-01-16 10:03:14 +00:00
Ronnie Sahlberg f537d520d1 Merge pull request #49 from Memphiz/win32fix4
Win32fix4
2014-01-13 18:14:19 -08:00
Memphiz e6a8481ffd [win32] - fix comilation by removing a unused "int i;" - though i have no
clue why this fails with "';' missing before 'Typ'"
2014-01-13 19:52:58 +01:00
Memphiz 18bfd0b2a2 [win32] - add new missing files to vs project 2014-01-13 19:52:06 +01:00
Memphiz 4938ed42f3 [win32/nlm] - add missing typedef for u_quad_t and quad_t 2014-01-13 19:50:59 +01:00
Ronnie Sahlberg ecbd14a153 Make sure cookie is initialized before we use it. 2014-01-13 06:36:38 -08:00
Ronnie Sahlberg 9180287b27 Export the three new nfs_set_* functions from the windows library/dll 2014-01-13 06:30:43 -08:00
Ronnie Sahlberg 6bdc803366 Merge pull request #48 from plieven/master
make adjustments for v6 of the qemu NFS driver
2014-01-13 06:28:46 -08:00
Peter Lieven d43a8953f5 make adjustments for v6 of the qemu NFS driver
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-01-13 11:22:21 +01:00
Ronnie Sahlberg c9cc77a538 Merge pull request #47 from Memphiz/win32fix3
[win32] - fixed bad number casting when using libnfs on 64bit win8 syste...
2014-01-12 15:18:59 -08:00
Memphiz be184101ca [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 2014-01-12 14:42:56 +01:00
Ronnie Sahlberg 2d22ee9662 Merge pull request #45 from maksbotan/master
Adjust Makefile.am's to support out-of-source builds
2014-01-08 06:32:07 -08:00
Maxim Koltsov 5581436f5f Adjust Makefile.am's to support out-of-source builds 2014-01-08 12:36:09 +04:00
Ronnie Sahlberg 7bda8bad00 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()
2013-12-31 16:25:01 -08:00
Ronnie Sahlberg 2452c57f9b Assign the whole nfs_fh3 structure instead of element by element when possible 2013-12-31 16:11:11 -08:00
Ronnie Sahlberg 1a5b83c98c Change rpc_nfs_readdirplus to rpc_nfs3_readdirplus 2013-12-31 15:58:59 -08:00
Ronnie Sahlberg a64a16a2e9 Change rpc_nfs_readdir to rpc_nfs3_readir 2013-12-31 15:53:40 -08:00
Ronnie Sahlberg 7cd23ccc67 Change rpc_nfs_readlink to rpc_nfs3_readlink 2013-12-31 15:46:32 -08:00
Ronnie Sahlberg 87f81c853a Change rpc_nfs_symlink to rpc_nfs3_symlink 2013-12-31 15:44:15 -08:00
Ronnie Sahlberg 560f94344d Chane rpc_nfs_link to rpc_nfs3_link 2013-12-31 15:43:00 -08:00
Ronnie Sahlberg 5940c705a6 Change rpc_nfs_rename to rpc_nfs3_rename 2013-12-31 15:37:40 -08:00
Ronnie Sahlberg b17cb0a255 Change rpc_nfs_mknod to rpc_nfs3_mknod 2013-12-31 15:33:36 -08:00
Ronnie Sahlberg a0a5aa26f1 Change rpc_nfs_remove to rpc_nfs3_remove 2013-12-31 15:23:44 -08:00
Ronnie Sahlberg 789c3f1205 Change rpc_nfs_create to rpc_nfs3_create 2013-12-31 15:21:20 -08:00
Ronnie Sahlberg bf817ee694 Change rpc_nfs_rmdir to rpc_nfs3_rmdir 2013-12-31 15:20:28 -08:00
Ronnie Sahlberg acabd6bf14 Change rpc_nfs_mkdir to rpc_nfs3_mkdir 2013-12-31 15:17:16 -08:00
Ronnie Sahlberg 1a5636ffa7 Change rpc_nfs_commit to rpc_nfs3_commit 2013-12-31 15:16:02 -08:00
Ronnie Sahlberg b701254d40 Change rpc_nfs_setattr to rpc_nfs3_setattr 2013-12-31 15:12:32 -08:00
Ronnie Sahlberg 0249c17be0 Change all calls to rpc_nfs_fsstat to rpc_nfs3_fsstat 2013-12-31 15:08:11 -08:00
Ronnie Sahlberg c4ba61c51c Change all calls to rpc_nfs_fsinfo to rpc_nfs3_fsinfo 2013-12-31 15:06:25 -08:00
Ronnie Sahlberg 8aab33e33c Merge pull request #44 from plieven/master
fix 3 flaws detected by valgrind and bump version to intermediate version
2013-12-26 11:00:04 -08:00
Ronnie Sahlberg 3f30ac7800 Create SOCURRENT/SOREVISION/SOAGE in lib/Makefile.am 2013-12-26 10:52:43 -08:00
Ronnie Sahlberg dc3ed8c3ab Fix some compiler warnings and bugs
Add missing %s to two example programs and fix incorrect argument to
rpc_nfs3_fsinfo_async()
2013-12-26 10:40:37 -08:00
Ronnie Sahlberg eda77ec3f3 Change rpc_mount_* to rpc_mount3_* and make it explicit which version of
the protocol we are using.
2013-12-26 09:11:05 -08:00
Ronnie Sahlberg 20d6926ed6 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.
2013-12-26 09:08:26 -08:00
Peter Lieven 22fbc5dad8 nfs-cp: don't leave file_context->url unitialized
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-26 14:03:57 +01:00