Examples of VerifierNone


Examples of org.apache.hadoop.oncrpc.security.VerifierNone

        LOG.info("Wrong RPC AUTH flavor, " + credentials.getFlavor()
            + " is not AUTH_SYS or RPCSEC_GSS.");
        XDR reply = new XDR();
        RpcDeniedReply rdr = new RpcDeniedReply(xid,
            RpcReply.ReplyState.MSG_ACCEPTED,
            RpcDeniedReply.RejectState.AUTH_ERROR, new VerifierNone());
        rdr.write(reply);

        ChannelBuffer buf = ChannelBuffers.wrappedBuffer(reply.asReadOnlyWrap()
            .buffer());
        RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());
        RpcUtil.sendRpcResponse(ctx, rsp);
        return;
      }
    }

    if (!isIdempotent(rpcCall)) {
      RpcCallCache.CacheEntry entry = rpcCallCache.checkOrAddToCache(client,
          xid);
      if (entry != null) { // in cache
        if (entry.isCompleted()) {
          LOG.info("Sending the cached reply to retransmitted request " + xid);
          RpcUtil.sendRpcResponse(ctx, entry.getResponse());
          return;
        } else { // else request is in progress
          LOG.info("Retransmitted request, transaction still in progress "
              + xid);
          // Ignore the request and do nothing
          return;
        }
      }
    }
   
    SecurityHandler securityHandler = getSecurityHandler(credentials,
        rpcCall.getVerifier());
   
    NFS3Response response = null;
    if (nfsproc3 == NFSPROC3.NULL) {
      response = nullProcedure();
    } else if (nfsproc3 == NFSPROC3.GETATTR) {
      response = getattr(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.SETATTR) {
      response = setattr(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.LOOKUP) {
      response = lookup(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.ACCESS) {
      response = access(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.READLINK) {
      response = readlink(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.READ) {
      if (LOG.isDebugEnabled()) {
          LOG.debug(Nfs3Utils.READ_RPC_START + xid);
      }   
      response = read(xdr, securityHandler, client);
      if (LOG.isDebugEnabled() && (nfsproc3 == NFSPROC3.READ)) {
        LOG.debug(Nfs3Utils.READ_RPC_END + xid);
      }
    } else if (nfsproc3 == NFSPROC3.WRITE) {
      if (LOG.isDebugEnabled()) {
          LOG.debug(Nfs3Utils.WRITE_RPC_START + xid);
      }
      response = write(xdr, channel, xid, securityHandler, client);
      // Write end debug trace is in Nfs3Utils.writeChannel
    } else if (nfsproc3 == NFSPROC3.CREATE) {
      response = create(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.MKDIR) {     
      response = mkdir(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.SYMLINK) {
      response = symlink(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.MKNOD) {
      response = mknod(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.REMOVE) {
      response = remove(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.RMDIR) {
      response = rmdir(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.RENAME) {
      response = rename(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.LINK) {
      response = link(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.READDIR) {
      response = readdir(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.READDIRPLUS) {
      response = readdirplus(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.FSSTAT) {
      response = fsstat(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.FSINFO) {
      response = fsinfo(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.PATHCONF) {
      response = pathconf(xdr, securityHandler, client);
    } else if (nfsproc3 == NFSPROC3.COMMIT) {
      response = commit(xdr, securityHandler, client);
    } else {
      // Invalid procedure
      RpcAcceptedReply.getInstance(xid,
          RpcAcceptedReply.AcceptState.PROC_UNAVAIL, new VerifierNone()).write(
          out);
    }
    if (response == null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("No sync response, expect an async response for request XID="
            + rpcCall.getXid());
      }
      return;
    }
    // TODO: currently we just return VerifierNone
    out = response.writeHeaderAndResponse(out, xid, new VerifierNone());
    ChannelBuffer buf = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap()
        .buffer());
    RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());

    if (!isIdempotent(rpcCall)) {
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

  }
 
  static void createPortmapXDRheader(XDR xdr_out, int procedure) {
    // TODO: Move this to RpcRequest
    RpcCall.getInstance(0, 100000, 2, procedure, new CredentialsNone(),
        new VerifierNone()).write(xdr_out);
   
    /*
    xdr_out.putInt(1); //unix auth
    xdr_out.putVariableOpaque(new byte[20]);
    xdr_out.putInt(0);
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

  static XDR create() {
    XDR request = new XDR();
    RpcCall.getInstance(0x8000004c, Nfs3Constant.PROGRAM, Nfs3Constant.VERSION,
        Nfs3Constant.NFSPROC3.CREATE.getValue(), new CredentialsNone(),
        new VerifierNone()).write(request);

    SetAttr3 objAttr = new SetAttr3();
    CREATE3Request createReq = new CREATE3Request(new FileHandle("/"),
        "out-of-order-write" + System.currentTimeMillis(), 0, objAttr, 0);
    createReq.serialize(request);
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

  static XDR write(FileHandle handle, int xid, long offset, int count,
      byte[] data) {
    XDR request = new XDR();
    RpcCall.getInstance(xid, Nfs3Constant.PROGRAM, Nfs3Constant.VERSION,
        Nfs3Constant.NFSPROC3.CREATE.getValue(), new CredentialsNone(),
        new VerifierNone()).write(request);

    WRITE3Request write1 = new WRITE3Request(handle, offset, count,
        WriteStableHow.UNSTABLE, ByteBuffer.wrap(data));
    write1.serialize(request);
    return request;
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

        Procedure.PMAPPROC_SET.getValue());
    request.writeInt(AuthFlavor.AUTH_NONE.getValue());
    Credentials credential = new CredentialsNone();
    credential.write(request);
    request.writeInt(AuthFlavor.AUTH_NONE.getValue());
    Verifier verifier = new VerifierNone();
    verifier.write(request);
    return mapping.serialize(request);
  }
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

    AcceptState.fromValue(6);
  }
 
  @Test
  public void testConstructor() {
    Verifier verifier = new VerifierNone();
    RpcAcceptedReply reply = new RpcAcceptedReply(0, RpcMessage.Type.RPC_REPLY,
        ReplyState.MSG_ACCEPTED, verifier, AcceptState.SUCCESS);
    assertEquals(0, reply.getXid());
    assertEquals(RpcMessage.Type.RPC_REPLY, reply.getMessageType());
    assertEquals(ReplyState.MSG_ACCEPTED, reply.getState());
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

    } else if (portmapProc == Procedure.PMAPPROC_GETVERSADDR) {
      out = getport(xid, in, out);
    } else {
      LOG.info("PortmapHandler unknown rpc procedure=" + portmapProc);
      RpcAcceptedReply reply = RpcAcceptedReply.getInstance(xid,
          RpcAcceptedReply.AcceptState.PROC_UNAVAIL, new VerifierNone());
      reply.write(out);
    }

    ChannelBuffer buf = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap().buffer());
    RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

/**
* Helper utility for sending portmap response.
*/
public class PortmapResponse {
  public static XDR voidReply(XDR xdr, int xid) {
    RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
    return xdr;
  }
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

    RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
    return xdr;
  }

  public static XDR intReply(XDR xdr, int xid, int value) {
    RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
    xdr.writeInt(value);
    return xdr;
  }
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.VerifierNone

    xdr.writeInt(value);
    return xdr;
  }

  public static XDR booleanReply(XDR xdr, int xid, boolean value) {
    RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
    xdr.writeBoolean(value);
    return xdr;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.