Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
a86186ce
Commit
a86186ce
authored
10 years ago
by
Giuseppe Lo Presti
Browse files
Options
Downloads
Patches
Plain Diff
Temporary modification to pass pfn2 as well, needs some proper refactoring
parent
27d14676
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
castor/tape/tapeserver/file/DiskFile.cpp
+9
-2
9 additions, 2 deletions
castor/tape/tapeserver/file/DiskFile.cpp
with
9 additions
and
2 deletions
castor/tape/tapeserver/file/DiskFile.cpp
+
9
−
2
View file @
a86186ce
...
...
@@ -31,6 +31,7 @@
#include
<rfio_api.h>
#include
<xrootd/XrdCl/XrdClFile.hh>
#include
<radosstriper/libradosstriper.hpp>
#include
<uuid/uuid.h>
#include
<algorithm>
#include
<cryptopp/base64.h>
#include
<cryptopp/osrng.h>
...
...
@@ -389,6 +390,7 @@ XrootC2FSReadFile::XrootC2FSReadFile(const std::string &url,
m_signedURL
=
m_URL
;
// Turn the bare URL into a Castor URL, by adding opaque tags:
// ?castor.pfn1=/srv/castor/... (duplication of the path in practice)
// ?castor.pfn2=0:diskManagerPort:transferId
// ?castor.pool=xxx optional ceph pool
// ?castor.exptime=(unix time)
// ?castor.txtype=tape
...
...
@@ -407,10 +409,14 @@ XrootC2FSReadFile::XrootC2FSReadFile(const std::string &url,
std
::
string
(
"In XrootC2FSReadFile::XrootC2FSReadFile could not path in URL "
+
url
));
std
::
string
path
=
url
.
substr
(
pathPos
+
1
);
// Build signature block
time_t
expTime
=
time
(
NULL
)
+
3600
;
uuid_t
uuid
;
char
suuid
[
100
];
uuid_generate
(
uuid
);
uuid_unparse
(
uuid
,
suuid
);
std
::
stringstream
signatureBlock
;
signatureBlock
<<
path
<<
"0"
<<
expTime
<<
"tape"
;
// Build signature block
signatureBlock
<<
path
<<
"0:15511:"
<<
suuid
<<
"0"
<<
expTime
<<
"tape"
;
// Sign the block
std
::
string
signature
=
CryptoPPSigner
::
sign
(
signatureBlock
.
str
(),
xrootPrivateKey
);
...
...
@@ -419,6 +425,7 @@ XrootC2FSReadFile::XrootC2FSReadFile(const std::string &url,
opaqueBloc
<<
"?castor.pfn1="
<<
path
;
if
(
pool
.
size
())
opaqueBloc
<<
"&castor.pool="
<<
pool
;
opaqueBloc
<<
"&castor.pfn2=0:15511:"
<<
suuid
;
opaqueBloc
<<
"&castor.exptime="
<<
expTime
;
opaqueBloc
<<
"&castor.txtype=tape"
;
opaqueBloc
<<
"&castor.signature="
<<
signature
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment