Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultVOMSTrustStore fails to initialize TrustStore if a single .lsc file is broken #33

Open
kofemann opened this issue Nov 23, 2023 · 0 comments

Comments

@kofemann
Copy link
Contributor

The DefaultVOMSTrustStore#loadLSCFromDirectory parses .lsc file is a loop and fails to initialize the trust store if a single file is broken:

      LSCInfo info = null;

      info = lscParser.parse(voName, hostname, lsc);

      Set<LSCInfo> localLscForVo = localLSCInfo.get(voName);

      if (localLscForVo == null) {
        localLscForVo = new HashSet<LSCInfo>();
        localLSCInfo.put(voName, localLscForVo);
      }

      localLscForVo.add(info);
      listener.notifyLSCLoadEvent(info, lsc);
    }

The correct behaviour should be ignoring the broken file (with an appropriate log message) and keeping the trust store functional:

      try {
          LSCInfo info = lscParser.parse(voName, hostname, lsc);
          Set<LSCInfo> localLscForVo = localLSCInfo.get(voName);

          if (localLscForVo == null) {
            localLscForVo = new HashSet<LSCInfo>();
            localLSCInfo.put(voName, localLscForVo);
          }

          localLscForVo.add(info);
          listener.notifyLSCLoadEvent(info, lsc);
      } catch (VOMSError e) {
         // log the broken LSC file
      }
    }

See: dCache/dcache#7428

@kofemann kofemann changed the title DefaultVOMSTrustStore fails to initialize TrustStore is a single .lsc file is broken DefaultVOMSTrustStore fails to initialize TrustStore if a single .lsc file is broken Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant