Skip to content

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

@kofemann

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions