Skip to content

Commit

Permalink
S3: remove libcap dependency - remove http.trace all from default con…
Browse files Browse the repository at this point in the history
…fig file - add a log message into ObjectStore::PutObject
  • Loading branch information
apeters1971 committed May 30, 2024
1 parent 946f7e9 commit cd1a917
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 5 deletions.
10 changes: 10 additions & 0 deletions cmake/FindCap.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

FIND_LIBRARY(CAP_LIB cap
HINTS
/usr
PATH_SUFFIXES lib lib64
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cap DEFAULT_MSG CAP_LIB)

1 change: 1 addition & 0 deletions cmake/XRootDDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ option( ENABLE_XRDEC "Enable erasure coding component."
option( ENABLE_ASAN "Enable adress sanitizer." FALSE )
option( ENABLE_TSAN "Enable thread sanitizer." FALSE )
option( ENABLE_XRDCLHTTP "Enable xrdcl-http plugin." TRUE )
option( ENABLE_XRDS3 "Enable XrdS3 plugin." TRUE )
cmake_dependent_option( ENABLE_SCITOKENS "Enable SciTokens plugin." TRUE "NOT XRDCL_ONLY" FALSE )
cmake_dependent_option( ENABLE_MACAROONS "Enable Macaroons plugin." TRUE "NOT XRDCL_ONLY" FALSE )
option( FORCE_ENABLED "Fail build if enabled components cannot be built." FALSE )
Expand Down
5 changes: 5 additions & 0 deletions cmake/XRootDFindLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if( ZLIB_FOUND )
endif()

find_package( TinyXml )
find_package( TinyXml2 )

find_package( LibXml2 )
if( LIBXML2_FOUND )
Expand Down Expand Up @@ -215,3 +216,7 @@ if( ENABLE_XRDCLHTTP )
set( BUILD_XRDCLHTTP FALSE )
endif()
endif()

if( ENABLE_XRDS3 )
set (BUILD_XRDS3 TRUE )
endif()
2 changes: 2 additions & 0 deletions cmake/XRootDSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ component_status( VOMSXRD BUILD_VOMS VOMS_FOUND )
component_status( XRDCL ENABLE_XRDCL TRUE_VAR )
component_status( XRDCLHTTP ENABLE_XRDCLHTTP DAVIX_FOUND )
component_status( XRDEC BUILD_XRDEC TRUE_VAR )
component_status( XRDS3 ENABLE_XRDS3 BUILD_XRDS3 )

message( STATUS "----------------------------------------" )
message( STATUS "Installation path: " ${CMAKE_INSTALL_PREFIX} )
Expand All @@ -29,6 +30,7 @@ message( STATUS "Ceph support: " ${STATUS_CEPH} )
message( STATUS "Readline support: " ${STATUS_READLINE} )
message( STATUS "FUSE support: " ${STATUS_FUSE} )
message( STATUS "Kerberos5 support: " ${STATUS_KRB5} )
message( STATUS "XrdS3 support: " ${STATUS_XRDS3} )
message( STATUS "XrdCl: " ${STATUS_XRDCL} )
message( STATUS "XrdClHttp: " ${STATUS_XRDCLHTTP} )
message( STATUS "HTTP support: " ${STATUS_HTTP} )
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ if( BUILD_XRDEC )
add_subdirectory( XrdEc )
endif()

if( BUILD_XRDS3 )
add_subdirectory( XrdS3 )
endif()

if( NOT XRDCL_ONLY )
include( XrdServer )
include( XrdDaemons )
Expand Down
4 changes: 0 additions & 4 deletions src/XrdS3/XrdS3Api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,6 @@ int S3Api::PutObjectHandler(XrdS3Req& req) {
}
}

S3::S3Handler::Logger()->Log(S3::DEBUG, "Api", "GetObject");

S3ObjectStore::Object obj;
err = objectStore.GetObject(bucket, req.object, obj);
if (err == S3Error::None) {
Expand All @@ -543,8 +541,6 @@ int S3Api::PutObjectHandler(XrdS3Req& req) {
ValidatePreconditions(etag, last_modified, req.lowercase_headers))
}

S3::S3Handler::Logger()->Log(S3::DEBUG, "Api", "ObjectStore::PutObject");

std::map<std::string, std::string> headers;
RET_ON_ERROR(objectStore.PutObject(req, bucket, length, chunked, headers))

Expand Down
3 changes: 3 additions & 0 deletions src/XrdS3/XrdS3ObjectStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "XrdPosix/XrdPosixExtern.hh"
#include "XrdS3Auth.hh"
#include "XrdS3Req.hh"
#include "XrdS3.hh"
#include "XrdS3ScopedFsId.hh"
//------------------------------------------------------------------------------

Expand Down Expand Up @@ -938,6 +939,8 @@ S3Error S3ObjectStore::PutObject(XrdS3Req &req, const S3Auth::Bucket &bucket,
ScopedFsId scope(bucket.owner.uid,bucket.owner.gid);
auto final_path = bucket.path / req.object;

S3::S3Handler::Logger()->Log(S3::DEBUG, "ObjectStore", "PutObject: uid=%u gid=%u path=%s chuncked=%d size=%lu", bucket.owner.uid, bucket.owner.gid, bucket.path.c_str(), chunked, size);

struct stat buf;
if (!XrdPosix_Stat(final_path.c_str(), &buf) && S_ISDIR(buf.st_mode)) {
return S3Error::ObjectExistAsDir;
Expand Down
2 changes: 1 addition & 1 deletion src/XrdS3/config/xrootd-s3.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ xrd.protocol XrdHttp:8443 libXrdHttp.so
xrd.tls /etc/grid-security/xrootd/hostcert.pem /etc/grid-security/xrootd/hostkey.pem detail
xrd.tlsca certdir /etc/grid-security/certificates/
http.gridmap /etc/grid-security/grid-mapfile
http.trace all
#http.trace all


# ------------------------------------------------------------------------------
Expand Down

0 comments on commit cd1a917

Please sign in to comment.