ACE Patch in 1.2.7

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ACE Patch in 1.2.7

Thomas Bley
Hi Mike,

I just looked at the ACE-Patch in 1.2.7 and succeeded in merging it.
The ACE works pretty good (I tested WinXP and W2k3Sp1 [with
Ad/Exchange], see screenshot:
http://www.simple-groupware.de/cms/uploads/WebDisk/screenshot_ace.jpg).
I've also written some small code to do an LDAP-lookup for translating
the SIDs (about 30 lines).
Since Samba4 will also have LDAP onboard I think it's a good way to
resolve the SIDs this way when there is no other code available.
Can the patch be added to the standard version? (After applying the
patch I got problems with Input/OutputStream, maybe I patched somewhere
wrong ...)

Best regards,
Thomas

Reply | Threaded
Open this post in threaded view
|

Re: ACE Patch in 1.2.7

Michael B Allen-4
On Sat, 28 Jan 2006 22:37:24 +0100
Thomas Bley <[hidden email]> wrote:

> Hi Mike,
>
> I just looked at the ACE-Patch in 1.2.7 and succeeded in merging it.
> The ACE works pretty good (I tested WinXP and W2k3Sp1 [with
> Ad/Exchange], see screenshot).
> I've also written some small code to do an LDAP-lookup for translating
> the SIDs (about 30 lines).
> Since Samba4 will also have LDAP onboard I think it's a good way to
> resolve the SIDs this way when there is no other code available.
> Can the patch be added to the standard version? (After applying the

No. I don't have time to go through a stabilization cycle. We're pretty
much in maintainence mode only right now.

But don't let that stop you from posting patchs for new fixes. I
suspect someone will eventually produce a jcifs package with all the
new stuff like jcifs-ext did.

> patch I got problems with Input/OutputStream, maybe I patched somewhere
> wrong ...)

Someone posted the fix for this a month or two ago. If you find it,
fix it, and have 'diff' please post a revised patch to the list and I'll
replace it in the patches directory.

Thanks,
Mike
Reply | Threaded
Open this post in threaded view
|

Re: ACE Patch in 1.2.7

Thomas Bley-2
The patch looks like this:

diff -Naur jcifs_1.1.11/src/jcifs/smb/SmbComTransaction.java
jcifs_1.1.11acl2/src/jcifs/smb/SmbComTransaction.java
--- jcifs_1.1.11/src/jcifs/smb/SmbComTransaction.java   2005-05-04
23:10:46.000000000 -0400
+++ jcifs_1.1.11acl2/src/jcifs/smb/SmbComTransaction.java   2005-05-10
22:09:32.000000000 -0400
@@ -32,44 +32,47 @@
     private static final int PRIMARY_SETUP_OFFSET        = 61;
     private static final int SECONDARY_PARAMETER_OFFSET  = 51;
 
-    private static final int DISCONNECT_TID      = 0x01;
+    private static final int DISCONNECT_TID   = 0x01;
     private static final int ONE_WAY_TRANSACTION = 0x02;

Maybe jcifs 1.1.11 is my problem ? The patch has several lines marked as
changed although there is nothing changed ...

Is there any other guy from the samba team who is also a java guru ?

best regards,
Thomas Bley


Michael B Allen wrote:

> On Sat, 28 Jan 2006 22:37:24 +0100
> Thomas Bley <[hidden email]> wrote:
>
>  
>> Hi Mike,
>>
>> I just looked at the ACE-Patch in 1.2.7 and succeeded in merging it.
>> The ACE works pretty good (I tested WinXP and W2k3Sp1 [with
>> Ad/Exchange], see screenshot).
>> I've also written some small code to do an LDAP-lookup for translating
>> the SIDs (about 30 lines).
>> Since Samba4 will also have LDAP onboard I think it's a good way to
>> resolve the SIDs this way when there is no other code available.
>> Can the patch be added to the standard version? (After applying the
>>    
>
> No. I don't have time to go through a stabilization cycle. We're pretty
> much in maintainence mode only right now.
>
> But don't let that stop you from posting patchs for new fixes. I
> suspect someone will eventually produce a jcifs package with all the
> new stuff like jcifs-ext did.
>
>  
>> patch I got problems with Input/OutputStream, maybe I patched somewhere
>> wrong ...)
>>    
>
> Someone posted the fix for this a month or two ago. If you find it,
> fix it, and have 'diff' please post a revised patch to the list and I'll
> replace it in the patches directory.
>
> Thanks,
> Mike
>
>  

Reply | Threaded
Open this post in threaded view
|

RE: Re: ACE Patch in 1.2.7

James Maupin
Thomas,

Have a look at the following post
http://lists.samba.org/archive/jcifs/2005-December/005758.html. It describes
how to get the inputstream read to work.

In short, change the following line in SmbComNtCreateAndX.java:

  super( andx );
  this.path = name;
  command = SMB_COM_NT_CREATE_ANDX;

  // desiredAccess
  desiredAccess = access;
- desiredAccess |= FILE_READ_EA | FILE_READ_ATTRIBUTES;
+ desiredAccess |= FILE_READ_EA | FILE_READ_ATTRIBUTES | FILE_READ_DATA;

  // extFileAttributes
  this.extFileAttributes = extFileAttributes;

  // shareAccess
  this.shareAccess = shareAccess;

regards,
James

-------------------------------------
James Maupin
Business Development Engineer, Energy

MetaCarta, Inc. ( www.metacarta.com )
1155 Dairy Ashford
Suite 201
Houston, TX 77079

Tel: (832) 300-8800 USA
Mob: (832) 746-6802 USA
[hidden email]

-----Original Message-----
From: jcifs-bounces+james.maupin=[hidden email]
[mailto:jcifs-bounces+james.maupin=[hidden email]]On
Behalf Of Thomas Bley
Sent: Saturday, January 28, 2006 6:17 PM
To: Michael B Allen; [hidden email]
Subject: [jcifs] Re: ACE Patch in 1.2.7


The patch looks like this:

diff -Naur jcifs_1.1.11/src/jcifs/smb/SmbComTransaction.java
jcifs_1.1.11acl2/src/jcifs/smb/SmbComTransaction.java
--- jcifs_1.1.11/src/jcifs/smb/SmbComTransaction.java   2005-05-04
23:10:46.000000000 -0400
+++ jcifs_1.1.11acl2/src/jcifs/smb/SmbComTransaction.java   2005-05-10
22:09:32.000000000 -0400
@@ -32,44 +32,47 @@
     private static final int PRIMARY_SETUP_OFFSET        = 61;
     private static final int SECONDARY_PARAMETER_OFFSET  = 51;

-    private static final int DISCONNECT_TID      = 0x01;
+    private static final int DISCONNECT_TID   = 0x01;
     private static final int ONE_WAY_TRANSACTION = 0x02;

Maybe jcifs 1.1.11 is my problem ? The patch has several lines marked as
changed although there is nothing changed ...

Is there any other guy from the samba team who is also a java guru ?

best regards,
Thomas Bley


Michael B Allen wrote:

> On Sat, 28 Jan 2006 22:37:24 +0100
> Thomas Bley <[hidden email]> wrote:
>
>
>> Hi Mike,
>>
>> I just looked at the ACE-Patch in 1.2.7 and succeeded in merging it.
>> The ACE works pretty good (I tested WinXP and W2k3Sp1 [with
>> Ad/Exchange], see screenshot).
>> I've also written some small code to do an LDAP-lookup for translating
>> the SIDs (about 30 lines).
>> Since Samba4 will also have LDAP onboard I think it's a good way to
>> resolve the SIDs this way when there is no other code available.
>> Can the patch be added to the standard version? (After applying the
>>
>
> No. I don't have time to go through a stabilization cycle. We're pretty
> much in maintainence mode only right now.
>
> But don't let that stop you from posting patchs for new fixes. I
> suspect someone will eventually produce a jcifs package with all the
> new stuff like jcifs-ext did.
>
>
>> patch I got problems with Input/OutputStream, maybe I patched somewhere
>> wrong ...)
>>
>
> Someone posted the fix for this a month or two ago. If you find it,
> fix it, and have 'diff' please post a revised patch to the list and I'll
> replace it in the patches directory.
>
> Thanks,
> Mike
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Re: ACE Patch in 1.2.7

Thomas Bley
Thank you!

I'll try it tomorrow.
my setPathInformation and SmbComNtCreateAndX.java doen't look like this,
maybe that's it.


I found a list of well-known SIDs (like "everyone","Administrators",
"Users") at:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q243330

(e.g. everyone can be automatically mapped without lookups)

Best regards,
Thomas


James Maupin wrote:

> Thomas,
>
> Have a look at the following post
> http://lists.samba.org/archive/jcifs/2005-December/005758.html. It describes
> how to get the inputstream read to work.
>
> In short, change the following line in SmbComNtCreateAndX.java:
>
>   super( andx );
>   this.path = name;
>   command = SMB_COM_NT_CREATE_ANDX;
>
>   // desiredAccess
>   desiredAccess = access;
> - desiredAccess |= FILE_READ_EA | FILE_READ_ATTRIBUTES;
> + desiredAccess |= FILE_READ_EA | FILE_READ_ATTRIBUTES | FILE_READ_DATA;
>
>   // extFileAttributes
>   this.extFileAttributes = extFileAttributes;
>
>   // shareAccess
>   this.shareAccess = shareAccess;
>
> regards,
> James
>
> -------------------------------------
> James Maupin
> Business Development Engineer, Energy
>
> MetaCarta, Inc. ( www.metacarta.com )
> 1155 Dairy Ashford
> Suite 201
> Houston, TX 77079
>
> Tel: (832) 300-8800 USA
> Mob: (832) 746-6802 USA
> [hidden email]
>
> -----Original Message-----
> From: jcifs-bounces+james.maupin=[hidden email]
> [mailto:jcifs-bounces+james.maupin=[hidden email]]On
> Behalf Of Thomas Bley
> Sent: Saturday, January 28, 2006 6:17 PM
> To: Michael B Allen; [hidden email]
> Subject: [jcifs] Re: ACE Patch in 1.2.7
>
>
> The patch looks like this:
>
> diff -Naur jcifs_1.1.11/src/jcifs/smb/SmbComTransaction.java
> jcifs_1.1.11acl2/src/jcifs/smb/SmbComTransaction.java
> --- jcifs_1.1.11/src/jcifs/smb/SmbComTransaction.java   2005-05-04
> 23:10:46.000000000 -0400
> +++ jcifs_1.1.11acl2/src/jcifs/smb/SmbComTransaction.java   2005-05-10
> 22:09:32.000000000 -0400
> @@ -32,44 +32,47 @@
>      private static final int PRIMARY_SETUP_OFFSET        = 61;
>      private static final int SECONDARY_PARAMETER_OFFSET  = 51;
>
> -    private static final int DISCONNECT_TID      = 0x01;
> +    private static final int DISCONNECT_TID   = 0x01;
>      private static final int ONE_WAY_TRANSACTION = 0x02;
>
> Maybe jcifs 1.1.11 is my problem ? The patch has several lines marked as
> changed although there is nothing changed ...
>
> Is there any other guy from the samba team who is also a java guru ?
>
> best regards,
> Thomas Bley
>
>
> Michael B Allen wrote:
>  
>> On Sat, 28 Jan 2006 22:37:24 +0100
>> Thomas Bley <[hidden email]> wrote:
>>
>>
>>    
>>> Hi Mike,
>>>
>>> I just looked at the ACE-Patch in 1.2.7 and succeeded in merging it.
>>> The ACE works pretty good (I tested WinXP and W2k3Sp1 [with
>>> Ad/Exchange], see screenshot).
>>> I've also written some small code to do an LDAP-lookup for translating
>>> the SIDs (about 30 lines).
>>> Since Samba4 will also have LDAP onboard I think it's a good way to
>>> resolve the SIDs this way when there is no other code available.
>>> Can the patch be added to the standard version? (After applying the
>>>
>>>      
>> No. I don't have time to go through a stabilization cycle. We're pretty
>> much in maintainence mode only right now.
>>
>> But don't let that stop you from posting patchs for new fixes. I
>> suspect someone will eventually produce a jcifs package with all the
>> new stuff like jcifs-ext did.
>>
>>
>>    
>>> patch I got problems with Input/OutputStream, maybe I patched somewhere
>>> wrong ...)
>>>
>>>      
>> Someone posted the fix for this a month or two ago. If you find it,
>> fix it, and have 'diff' please post a revised patch to the list and I'll
>> replace it in the patches directory.
>>
>> Thanks,
>> Mike
>>
>>
>>    
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: Re: ACE Patch in 1.2.7

Thomas Bley
In reply to this post by James Maupin
Hello James,

I tried again with the changes, InputStream works, but OutputStream fails.

maybe it's again this in SmbComNtCreateAndX.java:
        // desiredAccess
         desiredAccess = access;
        desiredAccess |= FILE_READ_EA | FILE_READ_ATTRIBUTES |
FILE_READ_DATA;

I think expanding with WRITE_DATA  is not good for inputstream (only
needs read rights) and therefore I removed the access parameter and used
this:

        // desiredAccess
        if (flags <= 0x10000) {
            desiredAccess = ( flags >>> 16 ) & 0xFFFF; // the original
from Mike
        } else {
            desiredAccess = flags; // used for SmbFile.getSecurity()
        }
        desiredAccess |= FILE_READ_EA | FILE_READ_ATTRIBUTES;

Best regards,
Thomas Bley


James Maupin wrote:

> Thomas,
>
> Have a look at the following post
> http://lists.samba.org/archive/jcifs/2005-December/005758.html. It describes
> how to get the inputstream read to work.
>
> In short, change the following line in SmbComNtCreateAndX.java:
>
>   super( andx );
>   this.path = name;
>   command = SMB_COM_NT_CREATE_ANDX;
>
>   // desiredAccess
>   desiredAccess = access;
> - desiredAccess |= FILE_READ_EA | FILE_READ_ATTRIBUTES;
> + desiredAccess |= FILE_READ_EA | FILE_READ_ATTRIBUTES | FILE_READ_DATA;
>
>   // extFileAttributes
>   this.extFileAttributes = extFileAttributes;
>
>   // shareAccess
>   this.shareAccess = shareAccess;
>
> regards,
> James
>
> -------------------------------------
> James Maupin
> Business Development Engineer, Energy
>
> MetaCarta, Inc. ( www.metacarta.com )
> 1155 Dairy Ashford
> Suite 201
> Houston, TX 77079
>
> Tel: (832) 300-8800 USA
> Mob: (832) 746-6802 USA
> [hidden email]
>
> -----Original Message-----
> From: jcifs-bounces+james.maupin=[hidden email]
> [mailto:jcifs-bounces+james.maupin=[hidden email]]On
> Behalf Of Thomas Bley
> Sent: Saturday, January 28, 2006 6:17 PM
> To: Michael B Allen; [hidden email]
> Subject: [jcifs] Re: ACE Patch in 1.2.7
>
>
> The patch looks like this:
>
> diff -Naur jcifs_1.1.11/src/jcifs/smb/SmbComTransaction.java
> jcifs_1.1.11acl2/src/jcifs/smb/SmbComTransaction.java
> --- jcifs_1.1.11/src/jcifs/smb/SmbComTransaction.java   2005-05-04
> 23:10:46.000000000 -0400
> +++ jcifs_1.1.11acl2/src/jcifs/smb/SmbComTransaction.java   2005-05-10
> 22:09:32.000000000 -0400
> @@ -32,44 +32,47 @@
>      private static final int PRIMARY_SETUP_OFFSET        = 61;
>      private static final int SECONDARY_PARAMETER_OFFSET  = 51;
>
> -    private static final int DISCONNECT_TID      = 0x01;
> +    private static final int DISCONNECT_TID   = 0x01;
>      private static final int ONE_WAY_TRANSACTION = 0x02;
>
> Maybe jcifs 1.1.11 is my problem ? The patch has several lines marked as
> changed although there is nothing changed ...
>
> Is there any other guy from the samba team who is also a java guru ?
>
> best regards,
> Thomas Bley
>
>
> Michael B Allen wrote:
>  
>> On Sat, 28 Jan 2006 22:37:24 +0100
>> Thomas Bley <[hidden email]> wrote:
>>
>>
>>    
>>> Hi Mike,
>>>
>>> I just looked at the ACE-Patch in 1.2.7 and succeeded in merging it.
>>> The ACE works pretty good (I tested WinXP and W2k3Sp1 [with
>>> Ad/Exchange], see screenshot).
>>> I've also written some small code to do an LDAP-lookup for translating
>>> the SIDs (about 30 lines).
>>> Since Samba4 will also have LDAP onboard I think it's a good way to
>>> resolve the SIDs this way when there is no other code available.
>>> Can the patch be added to the standard version? (After applying the
>>>
>>>      
>> No. I don't have time to go through a stabilization cycle. We're pretty
>> much in maintainence mode only right now.
>>
>> But don't let that stop you from posting patchs for new fixes. I
>> suspect someone will eventually produce a jcifs package with all the
>> new stuff like jcifs-ext did.
>>
>>
>>    
>>> patch I got problems with Input/OutputStream, maybe I patched somewhere
>>> wrong ...)
>>>
>>>      
>> Someone posted the fix for this a month or two ago. If you find it,
>> fix it, and have 'diff' please post a revised patch to the list and I'll
>> replace it in the patches directory.
>>
>> Thanks,
>> Mike
>>
>>
>>    
>
>
>