Commit Graph

430 Commits (b6619d88e6dd99e3aa07e6f333f4a6456a0b7207)

Author SHA1 Message Date
Arne Redlich b6619d88e6 nfs_fchown_async: plug potential memleak
Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:47:50 -08:00
Arne Redlich a128749648 nfs_creat_async: plug potential memleak
Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:47:27 -08:00
Arne Redlich feb2fc2f92 nfs_mknod_async: plug potential memory leak
Pointed out by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:47:02 -08:00
Arne Redlich e59193c9f9 nfs_lookuppath_async: plug potential memleak
Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:46:09 -08:00
Arne Redlich b2fc5c54d9 nfs_opendir_cb: plug potential memory leak
Spotted by clang analyzer.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:45:33 -08:00
Arne Redlich e94d5a7d51 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>
2014-02-19 18:43:16 -08:00
Arne Redlich d48be00c5e libnfs.h: wrap in extern "C" for C++ compatibility
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:42:03 -08:00
Arne Redlich 4b1ae88abb 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>
2014-02-19 18:41:34 -08:00
Arne Redlich a81c5ea1d2 libnfs-zdr.h: wrap in extern "C" for C++ compatibility
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:40:30 -08:00
Arne Redlich 4641d36ef4 libnfs-raw.h: wrap in extern "C" for C++ compatibility
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:40:11 -08:00
Arne Redlich 324234ee10 libnfs-private.h: wrap in extern "C" for C++ compatibility
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:39:52 -08:00
Arne Redlich 17876230a9 slist.h: add include guards
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:39:28 -08:00
Arne Redlich 83a446dd8d libnfs-private.h: add include guards
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:38:59 -08:00
Arne Redlich 3751901fc4 libnfs-raw.h: remove trailing whitespace
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:38:34 -08:00
Arne Redlich 52014ebf37 libnfs.h: add include guards
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2014-02-19 18:37:59 -08:00
Ronnie Sahlberg d84d168f0f Change license for the ld preload hack to gplv3 2014-02-11 18:36:24 -08:00
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