Skip to content

Commit

Permalink
xrootd: throw FileNotFoundException if vomsdir doesn't exist
Browse files Browse the repository at this point in the history
Motivation:

If /etc/grid-security/vomsdir doesn't exist, dCache throws a stacktrace when xrootd is starting.

Modification:

Check, if vomsdir is an existing directory before setting the variable and throw a FileNotFoundException if it doesn't exist.

Result:

Error logging without a stacktrace if the directory doesn't exist.

Target: master
Request: 9.1
Request: 9.0
Request: 8.2
Require-notes: yes
Require-book: no
Acked-by: Al
  • Loading branch information
svemeyer committed Jul 14, 2023
1 parent a3ca140 commit 1e54a50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -20,6 +20,9 @@
import static java.util.Arrays.asList;

import eu.emi.security.authn.x509.X509CertChainValidatorExt;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -61,7 +64,10 @@ public void initialize() {
certChainValidator);
}

public void setVomsDir(String vomsDir) {
public void setVomsDir(String vomsDir) throws FileNotFoundException {
if(!new File(vomsDir).isDirectory()) {
throw new FileNotFoundException("Local trust directory does not exist: " + vomsDir);
}
this.vomsDir = vomsDir;
}

Expand Down
Expand Up @@ -4,6 +4,8 @@
import static com.google.common.collect.Iterables.any;

import com.google.common.collect.Lists;

import java.io.FileNotFoundException;
import java.util.List;
import java.util.ServiceLoader;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -149,7 +151,7 @@ private ChannelHandlerFactory createAuthorizationHandlerFactory(String name) thr
throw new IllegalArgumentException("Authorization plugin not found: " + name);
}

private ProxyDelegationClientFactory createProxyDelegationClientFactory(String name) {
private ProxyDelegationClientFactory createProxyDelegationClientFactory(String name) throws FileNotFoundException {
for (ProxyDelegationClientFactory factory : _clientFactories) {
if (factory instanceof GSIProxyDelegationClientFactory) {
((GSIProxyDelegationClientFactory) factory)
Expand All @@ -165,7 +167,7 @@ private ProxyDelegationClientFactory createProxyDelegationClientFactory(String n
return null;
}

private ProxyDelegationStore getGsiProxyDelegationProvider() {
private ProxyDelegationStore getGsiProxyDelegationProvider() throws FileNotFoundException {
LOGGER.debug("get ProxyDelegationProvider called");

/*
Expand Down

0 comments on commit 1e54a50

Please sign in to comment.