Program: 113468
Project: 113468
Buggy source:
private ErrorResponse processAuthenticate(OSDRequest rq){
  final Capability rqCap=rq.getCapability();
  if (Logging.isDebug()) {
    Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str",rqCap.getXCap().toString().replace('\n','/'));
  }
  if (rqCap.getFileId().length() == 0) {
    return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EINVAL,"String_Node_Str");
  }
  if (rqCap.getEpochNo() < 0) {
    return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EINVAL,"String_Node_Str");
  }
  if (ignoreCaps)   return null;
  if (!rqCap.getFileId().equals(rq.getFileId())) {
    return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str");
  }
  boolean isValid=false;
  LRUCache<String,Capability> cachedCaps=capCache.get(rqCap.getFileId());
  if (cachedCaps != null) {
    final Capability cap=cachedCaps.get(rqCap.getSignature());
    if (cap != null) {
      if (Logging.isDebug()) {
        Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str",cap.getFileId(),cap.getSignature());
      }
      isValid=!cap.hasExpired();
    }
  }
  if (!isValid) {
    isValid=rqCap.isValid();
    if (isValid) {
      if (cachedCaps == null) {
        cachedCaps=new LRUCache<String,Capability>(MAX_CAP_CACHE);
        capCache.put(rqCap.getFileId(),cachedCaps);
      }
      cachedCaps.put(rqCap.getSignature(),rqCap);
    }
  }
  if (!isValid) {
    if (rqCap.hasExpired())     return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str");
    if (!rqCap.hasValidSignature())     return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str");
    return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
private ErrorResponse processAuthenticate(OSDRequest rq){
  final Capability rqCap=rq.getCapability();
  if (Logging.isDebug()) {
    Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str",rqCap.getXCap().toString().replace('\n','/'));
  }
  if (rqCap.getFileId().length() == 0) {
    return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EINVAL,"String_Node_Str");
  }
  if (rqCap.getEpochNo() < 0) {
    return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EINVAL,"String_Node_Str");
  }
  if (ignoreCaps)   return null;
  boolean isValid=false;
  LRUCache<String,Capability> cachedCaps=capCache.get(rqCap.getFileId());
  if (cachedCaps != null) {
    final Capability cap=cachedCaps.get(rqCap.getSignature());
    if (cap != null) {
      if (Logging.isDebug()) {
        Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str",cap.getFileId(),cap.getSignature());
      }
      isValid=!cap.hasExpired();
    }
  }
  if (!isValid) {
    isValid=rqCap.isValid();
    if (isValid) {
      if (cachedCaps == null) {
        cachedCaps=new LRUCache<String,Capability>(MAX_CAP_CACHE);
        capCache.put(rqCap.getFileId(),cachedCaps);
      }
      cachedCaps.put(rqCap.getSignature(),rqCap);
    }
  }
  if (!isValid) {
    if (rqCap.hasExpired())     return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str");
    if (!rqCap.hasValidSignature())     return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str");
    return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str");
  }
  if (!rqCap.getFileId().equals(rq.getFileId())) {
    return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str");
  }
  if (rq.getOperation().getProcedureId() == OSDServiceConstants.PROC_ID_READ) {
    if ((rqCap.getAccessMode() & (SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_WRONLY.getNumber())) != 0)     return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str" + rqCap.getFileId());
  }
 else   if (rq.getOperation().getProcedureId() == OSDServiceConstants.PROC_ID_WRITE) {
    if ((rqCap.getAccessMode() & (SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_CREAT.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_WRONLY.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber())) == 0)     return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str" + rqCap.getFileId());
  }
 else   if (rq.getOperation().getProcedureId() == OSDServiceConstants.PROC_ID_TRUNCATE) {
    if ((rqCap.getAccessMode() & SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_TRUNC.getNumber()) == 0)     return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str" + rqCap.getFileId());
  }
 else   if (rq.getOperation().getProcedureId() == OSDServiceConstants.PROC_ID_UNLINK) {
    if ((rqCap.getAccessMode() & 010000000) == 0)     return ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EACCES,"String_Node_Str" + rqCap.getFileId());
  }
  return null;
}