Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
57c5f7c8
Commit
57c5f7c8
authored
Nov 28, 2014
by
Giuseppe Lo Presti
Browse files
Temporary modification to pass pfn2 as well, needs some proper refactoring
parent
41464911
Changes
1
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/file/DiskFile.cpp
View file @
57c5f7c8
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment