Creates libceph1-java package that contains
the libcephfs Java wrappers .jar file and the
JNI library.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Adds --enable-cephfs-java and --with-jdk to build
the libcephfs Java bindings and specify the default
JDK directory, respectively.
Also adds default JDK paths to avoid --with-jdk in
the common case. Currently setup for the default
provided by Debian's default-jdk package, but other
default search paths can easily be added.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
O_RDONLY is 0 in glibc, so we have to assume the
flags bits are mutually exclusive, otherwise we always
request read perms and write-only modes break.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
This fixes up the chmod test to use a unique
filename to test with, and avoid clobbering of
other tests and commonly named files.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Posix allows creating/opening a file with
open() with a mode that doesn't allow write (or read)
access but flags that request it: O_CREAT|O_WRONLY.
This means that correct permissions checking against
the mode on open() only happens if the file already exists.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Instead of just ,. Currently "foo.com, bar.com" will fail because of the
space after the comma. This patches fixes that, and makes all delim
chars interchangeable.
Signed-off-by: Sage Weil <sage@inktank.com>
We introduced a bug on the monitor store a couple of commits back that
would trigger a EEXIST error message when the store tried to make sure
a directory exists by trying to 'mkdir' it.
We now check if 'errno' is EEXIST and, if so, we ignore the error.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 717207 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "tid" is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Sage Weil <sage@inktank.com>
Stat of symlinks that are relative to their location
would return -ENOENT because the symlink target is
being appended to the path rather than replacing it.
This fix replaces the symlink component with the path
of the symlink target (in the case that its a relative
symlink), and avoids updating the inode to point the
symlink (keeps at the parent).
Signed-off-by: Sam Lang <sam.lang@inktank.com>
lstat is meant to not follow symbolic links in
the given path, whereas stat does. This adds a
stat function to Client and libcephfs and changes
the behavior of lstat to not follow symlinks.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
CID 716854: Unchecked return value (CHECKED_RETURN)
At (10): Calling function "rename(tfn, fn)" without checking return value.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 728081: Unchecked return value (CHECKED_RETURN)
At (5): Calling function "mkdir(dfn, 493U)" without checking return value.
CID 716853: Unchecked return value (CHECKED_RETURN)
At (2): Calling function "mkdir(fn, 493U)" without checking return value.
CID 716855: Unchecked return value (CHECKED_RETURN)
At (2): Calling function "mkdir(fn, 493U)" without checking return value.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 728083: Argument cannot be negative (NEGATIVE_RETURNS)
At (22): "dirfd" is passed to a parameter that cannot be negative.
At (29): "dirfd" is passed to a parameter that cannot be negative.
CID 717445: Argument cannot be negative (NEGATIVE_RETURNS)
At (3): "dirfd" is passed to a parameter that cannot be negative.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 716850: Unchecked return value (CHECKED_RETURN)
At (14): Calling function "KeyServer::get_auth(EntityName const &,
EntityAuth &) const" without checking return value.
CID 716849: Unchecked return value (CHECKED_RETURN)
At (14): Calling function "EntityName::from_str(std::string const &)"
without checking return value.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 716851: Unchecked return value (CHECKED_RETURN)
At (51): Calling function "ceph::buffer::list::write_fd(int) const"
without checking return value.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 716947 (#1 of 2): Missing unlock (LOCK)
CID 716947 (#2 of 2): Missing unlock (LOCK)
At (25): Returning without unlocking "this->lock._m".
There were a couple of cases in Monitor::init() that could lead us to
return without properly unlocking. Coverity gets mad props for uncovering
this.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 717443: Dereference after null check (FORWARD_NULL)
At (14): Passing null pointer "detailbl" to function
"ceph::buffer::list::append(std::string const &)", which dereferences it.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Users of the libcephfs api (fuse in particular)
don't check the mode against the open flags. This
commit does the proper checks to grant/deny access
to the file. The check_mode() function constructs
a requested mode based on the flags, and compares that
to the mode of the file.
Signed-off-by: Sam Lang <sam.lang@inktank.com>