Skip to content

Commit

Permalink
Motivation:
Browse files Browse the repository at this point in the history
https://rb.dcache.org/r/13855/
master@40dc86223b1f664f6dad5eff4ec222fae5631d3e

was intended to allow upload (for xrootd, POSC)
when there are Multitargeted Restrictions from
tokens.  However, as

#7129 (comment)
`Transfer with xroot using POSC fails for token with storage.modify`

indicates, there is a bug which is erroneously
excluding user roots equivalent to '/'.

Modification:

Remove the conditional excluding '/'.

Result:

POSC works with tokens when user root is '/'.

Target: master
Request: 9.0
Request: 8.2
Request: 8.1
Request: 8.0
Request: 7.2
Closes: #7129
Requires-notes: yes
Patch: https://rb.dcache.org/r/13973/
Acked-by: Dmitry
  • Loading branch information
alrossi committed May 3, 2023
1 parent 7817174 commit 1484e3f
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -143,7 +143,8 @@ private LoginReply convertLoginReply(org.dcache.gplazma.LoginReply gPlazmaLoginR
* authorisation.
*/
if (mtRestrictions.isEmpty()) {
userRoots.stream().map(_createPrefixRestriction).forEach(loginAttributes::add);
userRoots.stream().filter(p->!p.toString().equals("/"))
.map(_createPrefixRestriction).forEach(loginAttributes::add);
} else {
handleMultiTargetedRestrictions(userRoots, mtRestrictions, loginAttributes);
}
Expand Down Expand Up @@ -183,10 +184,7 @@ private void findAttributesAndUserRoots(Set<Object> sessionAttributes,
loginAttributes.add((LoginAttribute) attr);
if (attr instanceof RootDirectory) {
RootDirectory rootDir = (RootDirectory) attr;
String root = rootDir.getRoot();
if (!root.equals("/")) {
userRoots.add(FsPath.create(root));
}
userRoots.add(FsPath.create(rootDir.getRoot()));
}
}
}
Expand Down

0 comments on commit 1484e3f

Please sign in to comment.