public Endpoint attach(PresentationSyntax syntax) throws IOException { if (attached) throw new RpcException("Transport already attached."); //with the first flag an access denied exception occurs //with the second one file not found. so changing code here. /*pipe = new SmbNamedPipe(address, (0x2019f << 16) | SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_DCE_TRANSACT); * */ pipe = new SmbNamedPipe(address, SmbNamedPipe.PIPE_TYPE_DCE_TRANSACT); in2 = pipe.getInputStream(); out = pipe.getNamedPipeOutputStream(); in = pipe.getNamedPipeInputStream(); attached = true; return new ConnectionOrientedEndpoint(this, syntax); }
public void close() throws IOException { pipe.close(); } public void write( int b ) throws IOException {
public Principal getPrincipal() { if (this instanceof DcerpcPipeHandle) return ((DcerpcPipeHandle)this).pipe.getPrincipal(); return null; } public String toString() {
public Endpoint attach(PresentationSyntax syntax) throws IOException { if (attached) throw new RpcException("Transport already attached."); //with the first flag an access denied exception occurs //with the second one file not found. so changing code here. /*pipe = new SmbNamedPipe(address, (0x2019f << 16) | SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_DCE_TRANSACT); * */ pipe = new SmbNamedPipe(address, SmbNamedPipe.PIPE_TYPE_DCE_TRANSACT); in2 = pipe.getInputStream(); out = pipe.getNamedPipeOutputStream(); in = pipe.getNamedPipeInputStream(); attached = true; return new ConnectionOrientedEndpoint(this, syntax); }
protected void doSendFragment(byte[] buf, int off, int length, boolean isDirect) throws IOException { if (out != null && out.isOpen() == false) throw new IOException("DCERPC pipe is no longer open"); if (in == null) in = (SmbFileInputStream)pipe.getNamedPipeInputStream(); if (out == null) out = (SmbFileOutputStream)pipe.getNamedPipeOutputStream(); if (isDirect) { out.writeDirect( buf, off, length, 1 ); return; } out.write(buf, off, length); } protected void doReceiveFragment(byte[] buf, boolean isDirect) throws IOException {
public DcerpcPipeHandle(String url, SmbExtendedAuthenticator auth) throws UnknownHostException, MalformedURLException, DcerpcException { url = init(url); pipe = new SmbNamedPipe(url, pipeFlags, auth); }
/** * @param url * @param tc * @param unshared * @throws DcerpcException * @throws MalformedURLException */ public DcerpcPipeHandle ( String url, CIFSContext tc, boolean unshared ) throws DcerpcException, MalformedURLException { super(tc, DcerpcHandle.parseBinding(url)); this.pipe = new SmbNamedPipe(makePipeUrl(), pipeFlags, unshared, tc); this.handle = this.pipe.openPipe().unwrap(SmbPipeHandleInternal.class); }
public void write( byte[] b, int off, int len ) throws IOException { if( len < 0 ) { len = 0; } if(( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_CALL ) == SmbNamedPipe.PIPE_TYPE_CALL ) { pipe.send( new TransWaitNamedPipe( path ), new TransWaitNamedPipeResponse() ); pipe.send( new TransCallNamedPipe( path, b, off, len ), new TransCallNamedPipeResponse( pipe )); } else if(( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_TRANSACT ) == SmbNamedPipe.PIPE_TYPE_TRANSACT ) { ensureOpen(); TransTransactNamedPipe req = new TransTransactNamedPipe( pipe.fid, b, off, len ); if (dcePipe) { req.maxDataCount = 1024; } pipe.send( req, new TransTransactNamedPipeResponse( pipe )); } } }
public String getServer() { if (this instanceof DcerpcPipeHandle) return ((DcerpcPipeHandle)this).pipe.getServer(); return null; } public Principal getPrincipal() {
url.append(namedPipePath); setPipe(new SmbNamedPipe(url.toString(), SmbNamedPipe.PIPE_TYPE_RDWR, auth)); setOut(new DataOutputStream(getPipe().getNamedPipeOutputStream())); setIn(new DataInputStream( new BufferedInputStream( getPipe().getNamedPipeInputStream(), bufferSize)));
protected void doSendFragment(byte[] buf, int off, int length, boolean isDirect) throws IOException { if (out != null && out.isOpen() == false) throw new IOException("DCERPC pipe is no longer open"); if (in == null) in = (SmbFileInputStream)pipe.getNamedPipeInputStream(); if (out == null) out = (SmbFileOutputStream)pipe.getNamedPipeOutputStream(); if (isDirect) { out.writeDirect( buf, off, length, 1 ); return; } out.write(buf, off, length); } protected void doReceiveFragment(byte[] buf, boolean isDirect) throws IOException {
public DcerpcPipeHandle(String url, NtlmPasswordAuthentication auth) throws UnknownHostException, MalformedURLException, DcerpcException { url = init(url); pipe = new SmbNamedPipe(url, pipeFlags, auth); }
/** * @param url * @param tc * @param unshared * @throws DcerpcException * @throws MalformedURLException */ public DcerpcPipeHandle ( String url, CIFSContext tc, boolean unshared ) throws DcerpcException, MalformedURLException { super(tc, DcerpcHandle.parseBinding(url)); this.pipe = new SmbNamedPipe(makePipeUrl(), pipeFlags, unshared, tc); this.handle = this.pipe.openPipe().unwrap(SmbPipeHandleInternal.class); }
public void write( byte[] b, int off, int len ) throws IOException { if( len < 0 ) { len = 0; } if(( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_CALL ) == SmbNamedPipe.PIPE_TYPE_CALL ) { pipe.send( new TransWaitNamedPipe( path ), new TransWaitNamedPipeResponse() ); pipe.send( new TransCallNamedPipe( path, b, off, len ), new TransCallNamedPipeResponse( pipe )); } else if(( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_TRANSACT ) == SmbNamedPipe.PIPE_TYPE_TRANSACT ) { ensureOpen(); TransTransactNamedPipe req = new TransTransactNamedPipe( pipe.fid, b, off, len ); if (dcePipe) { req.maxDataCount = 1024; } pipe.send( req, new TransTransactNamedPipeResponse( pipe )); } } }
public String getServer() { if (this instanceof DcerpcPipeHandle) return ((DcerpcPipeHandle)this).pipe.getServer(); return null; } public Principal getPrincipal() {
public Endpoint attach ( PresentationSyntax syntax ) throws IOException { if ( attached ) throw new RpcException ( "Transport already attached." ); //with the first flag an access denied exception occurs //with the second one file not found. so changing code here. /*pipe = new SmbNamedPipe(address, (0x2019f << 16) | SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_DCE_TRANSACT); * */ pipe = new SmbNamedPipe ( address, SmbNamedPipe.PIPE_TYPE_DCE_TRANSACT ); in2 = pipe.getInputStream (); out = pipe.getNamedPipeOutputStream (); in = pipe.getNamedPipeInputStream (); attached = true; return new ConnectionOrientedEndpoint ( this, syntax ); }
protected void doSendFragment(byte[] buf, int off, int length, boolean isDirect) throws IOException { if (out != null && out.isOpen() == false) throw new IOException("DCERPC pipe is no longer open"); if (in == null) in = (SmbFileInputStream)pipe.getNamedPipeInputStream(); if (out == null) out = (SmbFileOutputStream)pipe.getNamedPipeOutputStream(); if (isDirect) { out.writeDirect( buf, off, length, 1 ); return; } out.write(buf, off, length); } protected void doReceiveFragment(byte[] buf, boolean isDirect) throws IOException {
/** * * {@inheritDoc} * * @see jcifs.CIFSContext#getPipe(java.lang.String, int) */ @Override public SmbPipeResource getPipe ( String url, int pipeType ) throws CIFSException { try { return new SmbNamedPipe(url, pipeType, this); } catch ( MalformedURLException e ) { throw new CIFSException("Invalid URL " + url, e); } }
public void close() throws IOException { pipe.close(); } public void write( int b ) throws IOException {
public void write( byte[] b, int off, int len ) throws IOException { if( len < 0 ) { len = 0; } if(( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_CALL ) == SmbNamedPipe.PIPE_TYPE_CALL ) { pipe.send( new TransWaitNamedPipe( path ), new TransWaitNamedPipeResponse() ); pipe.send( new TransCallNamedPipe( path, b, off, len ), new TransCallNamedPipeResponse( pipe )); } else if(( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_TRANSACT ) == SmbNamedPipe.PIPE_TYPE_TRANSACT ) { ensureOpen(); TransTransactNamedPipe req = new TransTransactNamedPipe( pipe.fid, b, off, len ); if (dcePipe) { req.maxDataCount = 1024; } pipe.send( req, new TransTransactNamedPipeResponse( pipe )); } } }