Skip to content

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

Description

@kofemann

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions