jcifs-1.2.9 from tgz
authorFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:36:47 +0000 (16:36 +0200)
committerFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:36:47 +0000 (16:36 +0200)
Tue Apr  4 15:44:43 EDT 2006
jcifs-1.2.9 released / Java 1.5 Compiler Issue

The 1.2.8 release was compiled with Java 1.5.0_06. Under certain conditions
this  could  cause  an  error:  <tt>java.lang.LinkageError: ... Unsupported
major.minor  version 49.0</tt>. I have rebuilt the entire package using the
compiler I used previously (1.4.2_08).

README.txt
build.xml
patches/jcifs1.2.8_aclresolve.patch [new file with mode: 0644]
src/jcifs/ntlmssp/NtlmMessage.java

index a6f6ad5..12f21c8 100644 (file)
@@ -1,3 +1,11 @@
+Tue Apr  4 15:44:43 EDT 2006
+jcifs-1.2.9 released / Java 1.5 Compiler Issue
+
+The 1.2.8 release was compiled with Java 1.5.0_06. Under certain conditions
+this  could  cause  an  error:  <tt>java.lang.LinkageError: ... Unsupported
+major.minor  version 49.0</tt>. I have rebuilt the entire package using the
+compiler I used previously (1.4.2_08). 
+
 Fri Mar 24 23:14:35 EST 2006
 jcifs-1.2.8 released / Deadlock Fix, ACLs, DFS, NTLM HTTP Filter, and More
 
index 4ed372d..0c8dfdb 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,7 @@
 <project name="jcifs" default="usage" basedir=".">
 
-    <property name="version" value="1.2.8"/>
-    <property name="reldate" value="Mar 28, 2006"/>
+    <property name="version" value="1.2.9"/>
+    <property name="reldate" value="Apr 4, 2006"/>
 
     <target name="usage">
         <echo>
diff --git a/patches/jcifs1.2.8_aclresolve.patch b/patches/jcifs1.2.8_aclresolve.patch
new file mode 100644 (file)
index 0000000..5fadcd7
--- /dev/null
@@ -0,0 +1,898 @@
+diff -N -r Code/jcifs_1.2.8/src/jcifs/rpc/LsaRPC.java temp/jcifs_1.2.8/src/jcifs/rpc/LsaRPC.java
+1,124d0
+< package jcifs.rpc;
+< 
+< import java.io.IOException;
+< import java.io.UnsupportedEncodingException;
+< import java.util.Properties;
+< 
+< import jcifs.smb.NtStatus;
+< import jcifs.smb.ACE;
+< import jcifs.smb.SID;
+< 
+< /**
+<  * @author Martin Pedersen, mdp@visanti.com
+<  *
+<  */
+< public class LsaRPC extends LsaStub {
+< 
+<   String servername;
+< 
+<   public LsaRPC(String servername) {
+<       init(servername,null);
+<   }
+<   
+<   public LsaRPC(String servername, Properties prop) {
+<       init(servername,prop);
+<   }
+<   
+<   private void init(String servername, Properties prop) {
+<       this.servername = servername;
+<       setAddress("ncacn_np:" + servername + "[\\PIPE\\lsarpc]");
+<       if(prop!=null)
+<           setProperties(prop);
+<   }
+<   
+<   private static String uniCodeToString(UnicodeString in) throws UnsupportedEncodingException {
+<       if(in==null || (in.length==0 && in.buffer==null)) {
+<           return null;
+<       }
+<       byte[] s = new byte[in.length];
+<       for(int idx=0; idx < in.buffer.length; idx++) {
+<           int p = idx*2;
+<           s[p] = (byte)(in.buffer[idx] & 0x00FF);
+<           s[p+1] = (byte) (in.buffer[idx] & 0xFF00);
+<       }
+<       return new String(s,"UTF-16LE");
+<   }
+<   
+<   private RpcTypes.policy_handle openPolicy() throws IOException {
+<       RpcTypes.policy_handle handle = new RpcTypes.policy_handle();
+<       ObjectAttributes attrs = new ObjectAttributes();
+<       QosInfo qos = new QosInfo();
+< 
+<       handle.uuid = new RpcTypes.uuid_t();
+< 
+<       qos.length = 12;
+<       qos.impersonation_level = 2;
+<       qos.context_mode = 1;
+< 
+<       attrs.length = 24;
+<       attrs.security_quality_of_service = qos;
+< 
+<       OpenPolicy req = new OpenPolicy("\\", attrs, 0x02000000, handle);
+<       call(0, req);
+<       return handle;
+<   }
+<   private void closePolicy(RpcTypes.policy_handle handle) throws IOException {
+<       ClosePolicy req = new ClosePolicy(handle);
+<       call(0, req);
+<   }
+<   
+<   private RpcTypes.sid_t SIDToRpcType(SID p_sid) {
+<       RpcTypes.sid_t val = new RpcTypes.sid_t();
+<       val.revision = p_sid.getRevision();
+<       val.identifier_authority = new byte[6];
+<       int[] subAuth = p_sid.getSubAuthority();
+<       val.sub_authority_count = (byte)subAuth.length;
+<       val.sub_authority = new int[val.sub_authority_count];
+<       for(int idx=0; idx < val.sub_authority_count; idx++) {
+<           val.sub_authority[idx] = subAuth[idx];
+<       }
+<       byte[] b = p_sid.getIdentifierAuthority();
+<       for(int idx=0; idx < b.length; idx++) {
+<           val.identifier_authority[idx] = b[idx];
+<       }
+<       return val;     
+<   }
+<   
+<   /**
+<    * 
+<    * @param aces Array of ACE/SIDs to be resolved. The input array is modified with the resolved name
+<    * @throws IOException
+<    */
+<   public void lookupSids(ACE[] aces) throws IOException {
+<       RpcTypes.policy_handle handle = null;
+<       handle = openPolicy();
+<       RefDomainList rd = new RefDomainList();
+<       rd.count=0;
+<       TransNameArray tna = new TransNameArray();
+<       
+<       SidArray sa = new SidArray();
+<       sa.num_sids=aces.length;
+<       sa.sids= new SidPtr[sa.num_sids];
+<       for(int idx = 0; idx < sa.num_sids; idx++) {
+<           sa.sids[idx] = new SidPtr();
+<           sa.sids[idx].sid= SIDToRpcType(aces[idx].getSID());
+<       }
+<       
+<       LookupSids ls = new LookupSids(handle,sa,rd,tna,(short)1,0);
+<       call(0,ls);
+<       if(ls.retval==NtStatus.NT_STATUS_OK ||
+<               ls.retval==NtStatus.NT_STATUS_SOME_NOT_MAPPED) {
+<           for(int idx = 0; idx < tna.count; idx++) {
+<               int type = tna.names[idx].sid_type;
+<               if(type != SID.TYPE_UNKNOWN) {
+<                   String domain = uniCodeToString(rd.domains[tna.names[idx].sid_index].name);
+<                   String name = uniCodeToString(tna.names[idx].name);
+<                   aces[idx].getSID().setResolved(domain,name,type);
+<               }
+<           }
+<       }
+<       closePolicy(handle);
+<       detach();
+<   }
+< }
+< 
+diff -N -r Code/jcifs_1.2.8/src/jcifs/rpc/LsaStub.java temp/jcifs_1.2.8/src/jcifs/rpc/LsaStub.java
+1,485d0
+< package jcifs.rpc;
+< import rpc.*;
+< import ndr.*;
+< 
+< public class LsaStub extends Stub {
+< 
+<     protected String getSyntax() {
+<         return "12345778-1234-abcd-ef00-0123456789ab:0.0";
+<     }
+< 
+<     public static class UnicodeString extends NdrObject {
+< 
+<         public short length=0;
+<         public short maximum_length=0;
+<         public short[] buffer;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_short(length);
+<             _dst.enc_ndr_short(maximum_length);
+<             _dst.enc_ndr_referent(buffer, 1);
+< 
+<             int _buffers = maximum_length / 2;
+<             _dst.enc_ndr_long(_buffers);
+<             _dst.enc_ndr_long(0);
+<             int _bufferl = maximum_length / 2;
+<             _dst.enc_ndr_long(_bufferl);
+<             for (int _i = 0; _i < _bufferl; _i++) {
+<                 _dst.enc_ndr_short(buffer[_i]);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             length = (short)_src.dec_ndr_short();
+<             maximum_length = (short)_src.dec_ndr_short();
+<             int _bufferp = _src.dec_ndr_long();
+< 
+<             int _buffers = _src.dec_ndr_long();
+<             _src.dec_ndr_long();
+<             int _bufferl = _src.dec_ndr_long();
+<             int _bufferi = _src.index;
+<             _src.advance(2 * _bufferl);
+< 
+<             _src = _src.derive(_bufferi);
+<             if (buffer == null) {
+<                 if (_buffers > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 buffer = new short[_buffers];
+<             }
+<             for (int _i = 0; _i < _bufferl; _i++) {
+<                 buffer[_i] = (short)_src.dec_ndr_short();
+<             }
+<         }
+<     }
+<     public static class QosInfo extends NdrObject {
+< 
+<         public int length;
+<         public short impersonation_level;
+<         public byte context_mode;
+<         public byte effective_only;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_long(length);
+<             _dst.enc_ndr_short(impersonation_level);
+<             _dst.enc_ndr_small(context_mode);
+<             _dst.enc_ndr_small(effective_only);
+< 
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             length = (int)_src.dec_ndr_long();
+<             impersonation_level = (short)_src.dec_ndr_short();
+<             context_mode = (byte)_src.dec_ndr_small();
+<             effective_only = (byte)_src.dec_ndr_small();
+< 
+<         }
+<     }
+<     public static class ObjectAttributes extends NdrObject {
+< 
+<         public int length;
+<         public NdrSmall root_directory;
+<         public UnicodeString object_name;
+<         public int attributes;
+<         public int security_descriptor;
+<         public QosInfo security_quality_of_service;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_long(length);
+<             _dst.enc_ndr_referent(root_directory, 1);
+<             _dst.enc_ndr_referent(object_name, 1);
+<             _dst.enc_ndr_long(attributes);
+<             _dst.enc_ndr_long(security_descriptor);
+<             _dst.enc_ndr_referent(security_quality_of_service, 1);
+< 
+<             if (root_directory != null) {
+<                 _dst = _dst.deferred;
+<                 root_directory.encode(ndr, _dst);
+<             }
+<             if (object_name != null) {
+<                 _dst = _dst.deferred;
+<                 object_name.encode(ndr, _dst);
+<             }
+<             if (security_quality_of_service != null) {
+<                 _dst = _dst.deferred;
+<                 security_quality_of_service.encode(ndr, _dst);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             length = (int)_src.dec_ndr_long();
+<             int _root_directoryp = _src.dec_ndr_long();
+<             int _object_namep = _src.dec_ndr_long();
+<             attributes = (int)_src.dec_ndr_long();
+<             security_descriptor = (int)_src.dec_ndr_long();
+<             int _security_quality_of_servicep = _src.dec_ndr_long();
+< 
+<             if (_root_directoryp != 0) {
+<                 _src = _src.deferred;
+<                 root_directory.decode(ndr, _src);
+<             }
+<             if (_object_namep != 0) {
+<                 _src = _src.deferred;
+<                 object_name.decode(ndr, _src);
+<             }
+<             if (_security_quality_of_servicep != 0) {
+<                 _src = _src.deferred;
+<                 security_quality_of_service.decode(ndr, _src);
+<             }
+<         }
+<     }
+< 
+<     public static class ClosePolicy extends NdrObject {
+< 
+<         public int getOpnum() { return 0x00; }
+< 
+<         public int retval;
+<         public RpcTypes.policy_handle handle;
+< 
+<         public ClosePolicy(RpcTypes.policy_handle handle) {
+<             this.handle = handle;
+<         }
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             handle.encode(ndr, _dst);
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             handle.decode(ndr, _src);
+<             retval = (int)_src.dec_ndr_long();
+<         }
+<     }
+<     public static class OpenPolicy extends NdrObject {
+< 
+<         public int getOpnum() { return 0x2c; }
+< 
+<         public int retval;
+<         public String system_name;
+<         public ObjectAttributes object_attributes;
+<         public int desired_access;
+<         public RpcTypes.policy_handle policy_handle;
+< 
+<         public OpenPolicy(String system_name,
+<                     ObjectAttributes object_attributes,
+<                     int desired_access,
+<                     RpcTypes.policy_handle policy_handle) {
+<             this.system_name = system_name;
+<             this.object_attributes = object_attributes;
+<             this.desired_access = desired_access;
+<             this.policy_handle = policy_handle;
+<         }
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_referent(system_name, 1);
+<                 _dst.enc_ndr_string(system_name);
+<             object_attributes.encode(ndr, _dst);
+<             _dst.enc_ndr_long(desired_access);
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             policy_handle.decode(ndr, _src);
+<             retval = (int)_src.dec_ndr_long();
+<         }
+<     }
+<     public static class TranslatedName extends NdrObject {
+< 
+<         public short sid_type;
+<         public UnicodeString name = new UnicodeString();
+<         public int sid_index;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_short(sid_type);
+<             _dst.enc_ndr_short(name.length);
+<             _dst.enc_ndr_short(name.maximum_length);
+<             _dst.enc_ndr_referent(name.buffer, 1);
+<             _dst.enc_ndr_long(sid_index);
+< 
+<             int _name_buffers = name.maximum_length / 2;
+<             _dst.enc_ndr_long(_name_buffers);
+<             _dst.enc_ndr_long(0);
+<             int _name_bufferl = name.maximum_length / 2;
+<             _dst.enc_ndr_long(_name_bufferl);
+< 
+<             for (int _i = 0; _i < _name_bufferl; _i++) {
+<                 _dst.enc_ndr_short(name.buffer[_i]);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             sid_type = (short)_src.dec_ndr_short();
+<             _src.dec_ndr_short(); // ????
+<             name.length = (short)_src.dec_ndr_short();
+<             name.maximum_length = (short)_src.dec_ndr_short();
+<             int _name_bufferp = _src.dec_ndr_long();
+<             sid_index = (int)_src.dec_ndr_long();
+< 
+<             int _name_buffers = _src.dec_ndr_long();
+<             _src.dec_ndr_long();
+<             int _name_bufferl = _src.dec_ndr_long();
+< 
+<             if (name.buffer == null) {
+<                 if (_name_buffers > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 name.buffer = new short[_name_buffers];
+<             }
+<             for (int _i = 0; _i < _name_bufferl; _i++) {
+<                 name.buffer[_i] = (short)_src.dec_ndr_short();
+<             }
+<         }
+<     }
+<     public static class TransNameArray extends NdrObject {
+< 
+<         public int count;
+<         public TranslatedName[] names;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_long(count);
+< 
+<             int _namess = count;
+<             _dst.enc_ndr_long(_namess);
+< 
+<             for (int _i = 0; _i < _namess; _i++) {
+<                 names[_i].encode(ndr, _dst);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             count = (int)_src.dec_ndr_long();
+<             int _namesp = _src.dec_ndr_long();
+<             if(_namesp==0)
+<               return;
+< 
+<             int _namess = _src.dec_ndr_long();
+<             if (names == null) {
+<                 if (_namess > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 names = new TranslatedName[_namess];
+<             }
+<             for (int _i = 0; _i < _namess; _i++) {
+<                 if (names[_i] == null) {
+<                     names[_i] = new TranslatedName();
+<                 }
+<                 names[_i].sid_type = (short)_src.dec_ndr_short();
+<                 _src.dec_ndr_short(); // ????
+<                 names[_i].name.maximum_length = (short)_src.dec_ndr_short();
+<                 int _size = _src.dec_ndr_short();
+<                 int _charp = _src.dec_ndr_long();
+<                 names[_i].sid_index=_src.dec_ndr_long();
+<             }
+<             for (int _i = 0; _i < _namess; _i++) {
+<               int _buflen = names[_i].name.maximum_length/2;
+<               if(_buflen > 0) {
+<                   _src.dec_ndr_long(); // Max Count
+<                   _src.dec_ndr_long(); // Offset 
+<                   _src.dec_ndr_long(); // Actual Count
+<                   
+<                   names[_i].name.length=(short)(_buflen*2);
+<                   names[_i].name.buffer=new short[_buflen];
+<                   for(int idx=0; idx < _buflen; idx++) {
+<                       names[_i].name.buffer[idx]=(short)_src.dec_ndr_short();
+<                   }
+<               }
+<             }
+< 
+<         }
+<     }
+<     public static class SidPtr extends NdrObject {
+< 
+<         public RpcTypes.sid_t sid;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             if (sid != null) {
+<                 _dst = _dst.deferred;
+<                 sid.encode(ndr, _dst);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             int _sidp = _src.dec_ndr_long();
+< 
+<             if (_sidp != 0) {
+<                 _src = _src.deferred;
+<                 sid.decode(ndr, _src);
+<             }
+<         }
+<     }
+<     public static class SidArray extends NdrObject {
+< 
+<         public int num_sids;
+<         public SidPtr[] sids;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_long(num_sids);
+<             _dst.enc_ndr_referent(sids, 1);
+< 
+<             int _sidss = num_sids;
+<             _dst.enc_ndr_long(_sidss);
+< 
+<             for(int _i=0; _i < _sidss; _i++) {
+<               _dst.enc_ndr_referent(sids[_i], 1);
+<             }
+<             
+<             for (int _i = 0; _i < _sidss; _i++) {
+<                 sids[_i].encode(ndr, _dst);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             num_sids = (int)_src.dec_ndr_long();
+<             int _sidsp = _src.dec_ndr_long();
+< 
+<             int _sidss = _src.dec_ndr_long();
+<             int _sidsi = _src.index;
+<             _src.advance(4 * _sidss);
+< 
+<             _src = _src.derive(_sidsi);
+<             if (sids == null) {
+<                 if (_sidss > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 sids = new SidPtr[_sidss];
+<             }
+<             for (int _i = 0; _i < _sidss; _i++) {
+<                 if (sids[_i] == null) {
+<                     sids[_i] = new SidPtr();
+<                 }
+<                 sids[_i].decode(ndr, _src);
+<             }
+<         }
+<     }
+<     public static class TrustInformation extends NdrObject {
+< 
+<         public UnicodeString name = new UnicodeString();
+<         public RpcTypes.sid_t sid = new RpcTypes.sid_t();
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_short(name.length);
+<             _dst.enc_ndr_short(name.maximum_length);
+<             _dst.enc_ndr_referent(name.buffer, 1);
+<             _dst.enc_ndr_referent(sid, 1);
+< 
+<             int _name_buffers = name.maximum_length / 2;
+<             _dst.enc_ndr_long(_name_buffers);
+<             _dst.enc_ndr_long(0);
+<             int _name_bufferl = name.maximum_length / 2;
+<             _dst.enc_ndr_long(_name_bufferl);
+< 
+<             for (int _i = 0; _i < _name_bufferl; _i++) {
+<                 _dst.enc_ndr_short(name.buffer[_i]);
+<             }
+<             if (sid != null) {
+<                 _dst = _dst.deferred;
+<                 sid.encode(ndr, _dst);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             name.length = (short)_src.dec_ndr_short();
+<             name.maximum_length = (short)_src.dec_ndr_short();
+<             int _name_bufferp = _src.dec_ndr_long();
+<             int _sidp = _src.dec_ndr_long();
+< 
+<             int _name_buffers = _src.dec_ndr_long();
+<             _src.dec_ndr_long();
+<             int _name_bufferl = _src.dec_ndr_long();
+< 
+<             if (name.buffer == null) {
+<                 if (_name_buffers > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 name.buffer = new short[_name_buffers];
+<             }
+<             for (int _i = 0; _i < _name_bufferl; _i++) {
+<                 name.buffer[_i] = (short)_src.dec_ndr_short();
+<             }
+<             if (_sidp != 0) {
+<               _src.dec_ndr_short();
+<               _src.dec_ndr_long();
+<                 sid.decode(ndr, _src);
+<             }
+<         }
+<     }
+<     public static class RefDomainList extends NdrObject {
+< 
+<         public int count;
+<         public TrustInformation[] domains;
+<         public int max_count;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_long(count);
+<             _dst.enc_ndr_referent(domains, 1);
+<             _dst.enc_ndr_long(max_count);
+< 
+<             int _domainss = count;
+<             _dst.enc_ndr_long(_domainss);
+< 
+<             for (int _i = 0; _i < _domainss; _i++) {
+<                 domains[_i].encode(ndr, _dst);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<           int _domainlp = _src.dec_ndr_long();
+<           if(_domainlp==0)
+<               return;
+<             count = (int)_src.dec_ndr_long();
+<             int _domainsp = _src.dec_ndr_long();
+<             max_count = (int)_src.dec_ndr_long();
+<             if(_domainsp==0)
+<               return;
+<             int _domainss = _src.dec_ndr_long();
+< 
+<             if (domains == null) {
+<                 if (_domainss > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 domains = new TrustInformation[_domainss];
+<             }
+<             for (int _i = 0; _i < _domainss; _i++) {
+<                 if (domains[_i] == null) {
+<                     domains[_i] = new TrustInformation();
+<                 }
+<                 short _len =(short)_src.dec_ndr_short();
+<                 short _size =(short)_src.dec_ndr_short();
+<                 int _charref = _src.dec_ndr_long();
+<                 if(_charref==0) {
+<                     domains[_i].name=null;
+<                 }
+<                 int _sidref  = _src.dec_ndr_long();
+<             }
+<             for (int _i = 0; _i < _domainss; _i++) {
+<                 if(domains[_i].name!=null) {
+<                     domains[_i].name.maximum_length = (short)(_src.dec_ndr_long()*2);
+<                     int _offset = _src.dec_ndr_long();
+<                     int _buflen = _src.dec_ndr_long();
+<                     domains[_i].name.length = (short)(_buflen*2);
+<                     domains[_i].name.buffer = new short[_buflen];
+<                     for(int idx = 0; idx < _buflen; idx++) {
+<                         domains[_i].name.buffer[idx] = (short)_src.dec_ndr_short();
+<                     }
+<                 }
+<               int _count = _src.dec_ndr_long();
+<               domains[_i].sid.decode(ndr,_src);
+<             }
+<         }
+<     }
+<     public static class LookupSids extends NdrObject {
+< 
+<         public int getOpnum() { return 0x0f; }
+< 
+<         public int retval;
+<         public RpcTypes.policy_handle handle;
+<         public SidArray sids;
+<         public RefDomainList domains;
+<         public TransNameArray names;
+<         public short level;
+<         public int numMapped;
+< 
+<         public LookupSids(RpcTypes.policy_handle handle,
+<                     SidArray sids,
+<                     RefDomainList domains,
+<                     TransNameArray names,
+<                     short level,
+<                     int count) {
+<             this.handle = handle;
+<             this.sids = sids;
+<             this.domains = domains;
+<             this.names = names;
+<             this.level = level;
+<             this.numMapped = count;
+<         }
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             handle.encode(ndr, _dst);
+<             sids.encode(ndr, _dst);
+<             names.encode(ndr, _dst);
+<             _dst.enc_ndr_short(level);
+<             _dst.enc_ndr_long(numMapped);
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             domains.decode(ndr, _src);
+<             names.decode(ndr, _src);
+<             numMapped = (int)_src.dec_ndr_long();
+<             retval = (int)_src.dec_ndr_long();
+<         }
+<     }
+< }
+diff -N -r Code/jcifs_1.2.8/src/jcifs/rpc/RpcTypes.java temp/jcifs_1.2.8/src/jcifs/rpc/RpcTypes.java
+1,128d0
+< package jcifs.rpc;
+< import ndr.*;
+< 
+< public class RpcTypes {
+< 
+<     public static class uuid_t extends NdrObject {
+< 
+<         public int time_low;
+<         public short time_mid;
+<         public short time_hi_and_version;
+<         public byte clock_seq_hi_and_reserved;
+<         public byte clock_seq_low;
+<         public byte[] node;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_long(time_low);
+<             _dst.enc_ndr_short(time_mid);
+<             _dst.enc_ndr_short(time_hi_and_version);
+<             _dst.enc_ndr_small(clock_seq_hi_and_reserved);
+<             _dst.enc_ndr_small(clock_seq_low);
+<             int _nodes = 6;
+<             for (int _i = 0; _i < _nodes; _i++) {
+<                 _dst.enc_ndr_small(node[_i]);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             time_low = (int)_src.dec_ndr_long();
+<             time_mid = (short)_src.dec_ndr_short();
+<             time_hi_and_version = (short)_src.dec_ndr_short();
+<             clock_seq_hi_and_reserved = (byte)_src.dec_ndr_small();
+<             clock_seq_low = (byte)_src.dec_ndr_small();
+<             int _nodes = 6;
+<             int _nodei = _src.index;
+<             _src.advance(6);
+< 
+<             _src = _src.derive(_nodei);
+<             if (node == null) {
+<                 if (_nodes > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 node = new byte[_nodes];
+<             }
+<             for (int _i = 0; _i < _nodes; _i++) {
+<                 node[_i] = (byte)_src.dec_ndr_small();
+<             }
+<         }
+<     }
+<     public static class policy_handle extends NdrObject {
+< 
+<         public int type;
+<         public uuid_t uuid;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_long(type);
+<             _dst.enc_ndr_long(uuid.time_low);
+<             _dst.enc_ndr_short(uuid.time_mid);
+<             _dst.enc_ndr_short(uuid.time_hi_and_version);
+<             _dst.enc_ndr_small(uuid.clock_seq_hi_and_reserved);
+<             _dst.enc_ndr_small(uuid.clock_seq_low);
+<             int _uuid_nodes = 6;
+<             for (int _i = 0; _i < _uuid_nodes; _i++) {
+<                 _dst.enc_ndr_small(uuid.node[_i]);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {
+<             type = (int)_src.dec_ndr_long();
+<             uuid.time_low = (int)_src.dec_ndr_long();
+<             uuid.time_mid = (short)_src.dec_ndr_short();
+<             uuid.time_hi_and_version = (short)_src.dec_ndr_short();
+<             uuid.clock_seq_hi_and_reserved = (byte)_src.dec_ndr_small();
+<             uuid.clock_seq_low = (byte)_src.dec_ndr_small();
+<             int _uuid_nodes = 6;
+<             int _uuid_nodei = _src.index;
+<             _src.advance(6);
+< 
+<             _src = _src.derive(_uuid_nodei);
+<             if (uuid.node == null) {
+<                 if (_uuid_nodes > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 uuid.node = new byte[_uuid_nodes];
+<             }
+<             for (int _i = 0; _i < _uuid_nodes; _i++) {
+<                 uuid.node[_i] = (byte)_src.dec_ndr_small();
+<             }
+<         }
+<     }
+<     public static class sid_t extends NdrObject {
+< 
+<         public byte revision;
+<         public byte sub_authority_count;
+<         public byte[] identifier_authority;
+<         public int[] sub_authority;
+< 
+<         public void encode(NetworkDataRepresentation ndr, NdrBuffer _dst) throws NdrException {
+<             _dst.enc_ndr_long(sub_authority_count);
+<             _dst.enc_ndr_small(revision);
+<             _dst.enc_ndr_small(sub_authority_count);
+<             int _identifier_authoritys = 6;
+<             int _sub_authoritys = sub_authority_count;
+< 
+<             for (int _i = 0; _i < _identifier_authoritys; _i++) {
+<                 _dst.enc_ndr_small(identifier_authority[_i]);
+<             }
+<             for (int _i = 0; _i < _sub_authoritys; _i++) {
+<                 _dst.enc_ndr_long(sub_authority[_i]);
+<             }
+<         }
+<         public void decode(NetworkDataRepresentation ndr, NdrBuffer _src) throws NdrException {            
+<             revision = (byte)_src.dec_ndr_small();
+<             sub_authority_count = (byte)_src.dec_ndr_small();
+<             int _sub_authoritys = sub_authority_count;
+<             int _identifier_authoritys = 6;
+< 
+<             if (identifier_authority == null) {
+<                 if (_identifier_authoritys > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 identifier_authority = new byte[_identifier_authoritys];
+<             }
+<             for (int _i = 0; _i < _identifier_authoritys; _i++) {
+<                 identifier_authority[_i] = (byte)_src.dec_ndr_small();
+<             }
+< 
+<             if (sub_authority == null) {
+<                 if (_sub_authoritys > 0xFFFF) throw new NdrException("invalid array dimensions");
+<                 sub_authority = new int[_sub_authoritys];
+<             }
+<             for (int _i = 0; _i < _sub_authoritys; _i++) {
+<                 sub_authority[_i] = (int)_src.dec_ndr_long();
+<             }
+<         }
+<     }
+< }
+diff -N -r Code/jcifs_1.2.8/src/jcifs/smb/ACE.java temp/jcifs_1.2.8/src/jcifs/smb/ACE.java
+7,14c7,24
+<   // NT ACE Flags
+<   public final static byte FLAG_AUDIT_FAILED      = (byte)0x80;
+<   public final static byte FLAG_AUDIT_SUCCESS     = (byte)0x40;
+<   public final static byte FLAG_INHERIT_PARENT    = (byte)0x10;
+<   public final static byte FLAG_INHERIT_ONLY      = (byte)0x08;
+<   public final static byte FLAG_INHERIT_NONPROP   = (byte)0x04;
+<   public final static byte FLAG_INHERIT_CONTAINER = (byte)0x02;
+<   public final static byte FLAG_INHERIT_OBJECT    = (byte)0x01;
+---
+>     public static final int FILE_READ_DATA        = 0x00000001; // 1
+>     public static final int FILE_WRITE_DATA       = 0x00000002; // 2
+>     public static final int FILE_APPEND_DATA      = 0x00000004; // 3
+>     public static final int FILE_READ_EA          = 0x00000008; // 4
+>     public static final int FILE_WRITE_EA         = 0x00000010; // 5
+>     public static final int FILE_EXECUTE          = 0x00000020; // 6
+>     public static final int FILE_DELETE           = 0x00000040; // 7
+>     public static final int FILE_READ_ATTRIBUTES  = 0x00000080; // 8
+>     public static final int FILE_WRITE_ATTRIBUTES = 0x00000100; // 9
+>     public static final int DELETE                = 0x00010000; // 16
+>     public static final int READ_CONTROL          = 0x00020000; // 17
+>     public static final int WRITE_DAC             = 0x00040000; // 18
+>     public static final int WRITE_OWNER           = 0x00080000; // 19
+>     public static final int SYNCHRONIZE           = 0x00100000; // 20
+>     public static final int GENERIC_ALL           = 0x10000000; // 28
+>     public static final int GENERIC_EXECUTE       = 0x20000000; // 29
+>     public static final int GENERIC_WRITE         = 0x40000000; // 30
+>     public static final int GENERIC_READ          = 0x80000000; // 31
+16,45d25
+<   // Specific Rights
+<   public final static int RIGHT_FOLDER_LIST    = (int)0x00000001;
+<   public final static int RIGHT_DATA_READ      = (int)0x00000001;
+<   public final static int RIGHT_FILE_CREATE    = (int)0x00000002;
+<   public final static int RIGHT_DATA_WRITE     = (int)0x00000002;
+<   public final static int RIGHT_FOLDER_CREATE  = (int)0x00000004;
+<   public final static int RIGHT_DATA_APPEND    = (int)0x00000004;
+<   public final static int RIGHT_EAS_READ       = (int)0x00000008;
+<   public final static int RIGHT_EAS_WRITE      = (int)0x00000010;
+<   public final static int RIGHT_FOLDER_TRAVERSE= (int)0x00000020;
+<   public final static int RIGHT_FILE_EXECUTE   = (int)0x00000020;
+<     public static final int RIGHT_FILE_DELETE    = (int)0x00000040;   
+<   public final static int RIGHT_ATTR_READ      = (int)0x00000080;
+<   public final static int RIGHT_ATTR_WRITE     = (int)0x00000100;
+<   // Standard Rights
+<   public final static int RIGHT_DELETE         = (int)0x00010000;
+<   public final static int RIGHT_DAC_READ       = (int)0x00020000;
+<   public final static int RIGHT_DAC_WRITE      = (int)0x00040000;
+<   public final static int RIGHT_OWNER_WRITE    = (int)0x00080000;
+<   public final static int RIGHT_SYNCHRONIZE    = (int)0x00100000;
+<   
+<     // Generic Rights
+<     public static final int RIGHT_GENERIC_FULL     = 0x10000000; // 28
+<     public static final int RIGHT_GENERIC_EXECUTE  = 0x20000000; // 29
+<     public static final int RIGHT_GENERIC_WRITE    = 0x40000000; // 30
+<     public static final int RIGHT_GENERIC_READ     = 0x80000000; // 31
+<     
+<     public static final boolean STATE_ALLOW = true;
+<     public static final boolean STATE_DENY = false;
+<     
+55c35
+<         return (flags & FLAG_INHERIT_PARENT) != 0;
+---
+>         return (flags & 0x10) != 0;
+75,82d54
+<   public boolean checkRights(int p_rights) {
+<       return ((access & p_rights) == p_rights);
+<   }
+<   
+<   public boolean checkFlags(byte p_flags) {
+<       return ((flags & p_flags) == p_flags); 
+<   }
+<     
+diff -N -r Code/jcifs_1.2.8/src/jcifs/smb/NtStatus.java temp/jcifs_1.2.8/src/jcifs/smb/NtStatus.java
+28d27
+<     public static final int NT_STATUS_SOME_NOT_MAPPED = 0x00000107;    
+diff -N -r Code/jcifs_1.2.8/src/jcifs/smb/SID.java temp/jcifs_1.2.8/src/jcifs/smb/SID.java
+2a3
+> import java.util.*;
+6,17c7,8
+<   public final static int TYPE_UNRESOLVED       = 0;
+<   public final static int TYPE_USER             = 1;
+<   public final static int TYPE_GROUP            = 2;
+<   public final static int TYPE_ALIAS            = 4;
+<   public final static int TYPE_WELL_KNOWN_GROUP = 5;
+<   public final static int TYPE_UNKNOWN          = 8;
+<   
+<   private String domain = null;
+<   private String name = null;
+<   private int type = TYPE_UNRESOLVED;
+<   
+<     byte revision;
+---
+> 
+>     int revision;
+37,63d27
+<       String ret = getSID();
+<         String resolve = getResolved();
+<         if(resolve!=null) {
+<           ret += ":"+resolve;
+<         }
+<         return ret;
+<     }
+<     
+<     public void setResolved(String domain, String name, int type) {
+<       this.domain=domain;
+<       this.name=name;
+<       this.type=type;
+<     }
+<     
+<     public byte getRevision() {
+<       return revision;
+<     }
+<     
+<     public int[] getSubAuthority() {
+<       return sub_authority;
+<     }
+<     
+<     public byte[] getIdentifierAuthority() {
+<       return identifier_authority;
+<     }
+<     
+<     public String getSID() {
+80a45
+> 
+83,90d47
+<     
+<     public String getResolved() {
+<       if(type>TYPE_UNRESOLVED && type < TYPE_UNKNOWN) {
+<           return domain+'\\'+name;
+<       } else {
+<           return null;
+<       }
+<     }
+diff -N -r Code/jcifs_1.2.8/src/jcifs/smb/SmbFile.java temp/jcifs_1.2.8/src/jcifs/smb/SmbFile.java
+31d30
+< import jcifs.rpc.LsaRPC;
+2526,2533c2525,2526
+<         LsaRPC lsa = new LsaRPC(getServer());
+<         try {
+<           lsa.lookupSids(response.aces);
+<         } catch(IOException e) {
+<           throw new SmbException("Unable to resolve SIDs",e);
+<         } finally {
+<           close( f, 0L );
+<         }
+---
+> 
+>         close( f, 0L );
+diff -N -r Code/jcifs_1.2.8/src/jcifs/smb/TransactNamedPipeOutputStream.java temp/jcifs_1.2.8/src/jcifs/smb/TransactNamedPipeOutputStream.java
+60,61c60
+<             //pipe.open(SmbFile.O_EXCL, pipe.pipeType & 0xFFFF0000, SmbFile.ATTR_NORMAL, 0 );
+<           pipe.open(( pipe.pipeType & 0xFF0000 ) | SmbFile.O_EXCL,0, SmbFile.ATTR_NORMAL, 0 );
+---
+>             pipe.open(SmbFile.O_EXCL, pipe.pipeType & 0xFFFF0000, SmbFile.ATTR_NORMAL, 0 );
index 5464f4d..17dc55d 100644 (file)
@@ -34,7 +34,7 @@ public abstract class NtlmMessage implements NtlmFlags {
         (byte) 'S', (byte) 'S', (byte) 'P', (byte) 0
     };
 
-    private static final String OEM_ENCODING = Config.getProperty("jcifs.encoding", "Cp850" );
+    private static final String OEM_ENCODING = Config.getProperty("jcifs.encoding", "Cp850");
 
     private int flags;