Discussion:
Patches for DFS implementation
(too old to reply)
Matthieu Patou
2010-05-12 16:32:45 UTC
Permalink
Hello this is a serie of 6 patches made for implementing Domain referral
in samba4.

Those patches are made to allow s4 to respond to domain DFS referral
requests.

This is highly desirable when you have more than 1 DC.
Please note that it's not the server side implementation of the DFS
replication protocol.
Here is the detail of the patches:

0001-pidl-fix-errors-and-improve-idl-in-dfsblobs.patch, This is a few
fixes for idl that I made in december that were found during the
developpement of the patches.
0002-s4-fix-trailling-whitespace-in-trans2.c.patch, This is a formatting
patch for trans2.c
0003-s4-Implement-GET_DFS_REFERRAL-for-domain-referral-re.patch, This is
the implementation of trans2/getreferrals requests for domain referrals
requests.
0004-s4-torture-test-Adapt-ndr-dfsblobs-torture-test-to-n.patch, This
patch is to adapt the torture test to the renaming of functions in
dfsblobs.idl
0005-s4-torture-Add-tests-for-dfs-referrals-handling-in-S.patch, This
patch is to add unittest for smb/trans2 requests. It has also been
tested with success against w2k8r2 server.
0006-s4-add-dfs-smbtorture-to-selftests.patch, This patch is to add the
smbtorture tests to make tests.

After I'm willing to change provision so that DC have the host msdfs =
yes parameter, andrew what's your point of view ?

Jeremy, the torture tests will be a good start for us to tests the
capacity of s3 to handle get dfs referral requests when "plugged" into s4.

Ps: this patches pass make test

Regards.


Matthieu





-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-s4-torture-test-Adapt-ndr-dfsblobs-torture-test-to-n.patch
Type: text/x-patch
Size: 1090 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100512/a4958825/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-s4-torture-Add-tests-for-dfs-referrals-handling-in-S.patch
Type: text/x-patch
Size: 24484 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100512/a4958825/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-s4-add-dfs-smbtorture-to-selftests.patch
Type: text/x-patch
Size: 1471 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100512/a4958825/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pidl-fix-errors-and-improve-idl-in-dfsblobs.patch
Type: text/x-patch
Size: 2766 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100512/a4958825/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-s4-Implement-GET_DFS_REFERRAL-for-domain-referral-re.patch
Type: text/x-patch
Size: 27621 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100512/a4958825/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s4-fix-trailling-whitespace-in-trans2.c.patch
Type: text/x-patch
Size: 8564 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100512/a4958825/attachment-0005.bin>
Stefan (metze) Metzmacher
2010-05-13 19:37:46 UTC
Permalink
Post by Matthieu Patou
Hello this is a serie of 6 patches made for implementing Domain referral
in samba4.
Those patches are made to allow s4 to respond to domain DFS referral
requests.
This is highly desirable when you have more than 1 DC.
Please note that it's not the server side implementation of the DFS
replication protocol.
0001-pidl-fix-errors-and-improve-idl-in-dfsblobs.patch, This is a few
fixes for idl that I made in december that were found during the
developpement of the patches.
0002-s4-fix-trailling-whitespace-in-trans2.c.patch, This is a formatting
patch for trans2.c
0003-s4-Implement-GET_DFS_REFERRAL-for-domain-referral-re.patch, This is
the implementation of trans2/getreferrals requests for domain referrals
requests.
0004-s4-torture-test-Adapt-ndr-dfsblobs-torture-test-to-n.patch, This
patch is to adapt the torture test to the renaming of functions in
dfsblobs.idl
0005-s4-torture-Add-tests-for-dfs-referrals-handling-in-S.patch, This
patch is to add unittest for smb/trans2 requests. It has also been
tested with success against w2k8r2 server.
0006-s4-add-dfs-smbtorture-to-selftests.patch, This patch is to add the
smbtorture tests to make tests.
After I'm willing to change provision so that DC have the host msdfs =
yes parameter, andrew what's your point of view ?
Jeremy, the torture tests will be a good start for us to tests the
capacity of s3 to handle get dfs referral requests when "plugged" into s4.
Ps: this patches pass make test
For me it crashes in samba4.dfs.domain

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: out.txt.gz
Type: application/x-gzip
Size: 11342 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100513/362ac3d8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100513/362ac3d8/attachment.pgp>
Sassy Natan
2010-05-13 20:00:27 UTC
Permalink
Same goes here ! - "Failed to find our own NTDS Settings objectGUID in the ldb"

Sassy

On Thu, May 13, 2010 at 10:37 PM, Stefan (metze) Metzmacher
Post by Stefan (metze) Metzmacher
Post by Matthieu Patou
Hello this is a serie of 6 patches made for implementing Domain referral
in samba4.
Those patches are made to allow s4 to respond to domain DFS referral
requests.
This is highly desirable when you have more than 1 DC.
Please note that it's not the server side implementation of the DFS
replication protocol.
0001-pidl-fix-errors-and-improve-idl-in-dfsblobs.patch, This is a few
fixes for idl that I made in december that were found during the
developpement of the patches.
0002-s4-fix-trailling-whitespace-in-trans2.c.patch, This is a formatting
patch for trans2.c
0003-s4-Implement-GET_DFS_REFERRAL-for-domain-referral-re.patch, This is
the implementation of trans2/getreferrals requests for domain referrals
requests.
0004-s4-torture-test-Adapt-ndr-dfsblobs-torture-test-to-n.patch, This
patch is to adapt the torture test to the renaming of functions in
dfsblobs.idl
0005-s4-torture-Add-tests-for-dfs-referrals-handling-in-S.patch, This
patch is to add unittest for smb/trans2 requests. It has also been
tested with success against w2k8r2 server.
0006-s4-add-dfs-smbtorture-to-selftests.patch, This patch is to add the
smbtorture tests to make tests.
After I'm willing to change provision so that DC have the host msdfs =
yes parameter, andrew what's your point of view ?
Jeremy, the torture tests will be a good start for us to tests the
capacity of s3 to handle get dfs referral requests when "plugged" into s4.
Ps: this patches pass make test
For me it crashes in samba4.dfs.domain
metze
Matthieu Patou
2010-05-13 20:11:46 UTC
Permalink
Post by Sassy Natan
Same goes here ! - "Failed to find our own NTDS Settings objectGUID in the ldb"
Do you have a crash or just this message ?
Because this message is just a "warning" left by Anatoli (as far as I
understand).
Post by Sassy Natan
Sassy
On Thu, May 13, 2010 at 10:37 PM, Stefan (metze) Metzmacher
Post by Stefan (metze) Metzmacher
Post by Matthieu Patou
Hello this is a serie of 6 patches made for implementing Domain referral
in samba4.
Those patches are made to allow s4 to respond to domain DFS referral
requests.
This is highly desirable when you have more than 1 DC.
Please note that it's not the server side implementation of the DFS
replication protocol.
0001-pidl-fix-errors-and-improve-idl-in-dfsblobs.patch, This is a few
fixes for idl that I made in december that were found during the
developpement of the patches.
0002-s4-fix-trailling-whitespace-in-trans2.c.patch, This is a formatting
patch for trans2.c
0003-s4-Implement-GET_DFS_REFERRAL-for-domain-referral-re.patch, This is
the implementation of trans2/getreferrals requests for domain referrals
requests.
0004-s4-torture-test-Adapt-ndr-dfsblobs-torture-test-to-n.patch, This
patch is to adapt the torture test to the renaming of functions in
dfsblobs.idl
0005-s4-torture-Add-tests-for-dfs-referrals-handling-in-S.patch, This
patch is to add unittest for smb/trans2 requests. It has also been
tested with success against w2k8r2 server.
0006-s4-add-dfs-smbtorture-to-selftests.patch, This patch is to add the
smbtorture tests to make tests.
After I'm willing to change provision so that DC have the host msdfs =
yes parameter, andrew what's your point of view ?
Jeremy, the torture tests will be a good start for us to tests the
capacity of s3 to handle get dfs referral requests when "plugged" into s4.
Ps: this patches pass make test
For me it crashes in samba4.dfs.domain
metze
Sassy Natan
2010-05-14 09:06:04 UTC
Permalink
No the message is keep on running and nothing happened. It just get stuck


Sassy


On Thu, May 13, 2010 at 11:11 PM, Matthieu Patou
Post by Matthieu Patou
Post by Sassy Natan
Same goes here ! - "Failed to find our own NTDS Settings objectGUID in the ldb"
Do you have a crash or just this message ?
Because this message is just a "warning" left by Anatoli (as far as I
understand).
Post by Sassy Natan
Sassy
On Thu, May 13, 2010 at 10:37 PM, Stefan (metze) Metzmacher
Post by Stefan (metze) Metzmacher
Post by Matthieu Patou
Hello this is a serie of 6 patches made for implementing Domain referral
in samba4.
Those patches are made to allow s4 to respond to domain DFS referral
requests.
This is highly desirable when you have more than 1 DC.
Please note that it's not the server side implementation of the DFS
replication protocol.
0001-pidl-fix-errors-and-improve-idl-in-dfsblobs.patch, This is a few
fixes for idl that I made in december that were found during the
developpement of the patches.
0002-s4-fix-trailling-whitespace-in-trans2.c.patch, This is a formatting
patch for trans2.c
0003-s4-Implement-GET_DFS_REFERRAL-for-domain-referral-re.patch, This is
the implementation of trans2/getreferrals requests for domain referrals
requests.
0004-s4-torture-test-Adapt-ndr-dfsblobs-torture-test-to-n.patch, This
patch is to adapt the torture test to the renaming of functions in
dfsblobs.idl
0005-s4-torture-Add-tests-for-dfs-referrals-handling-in-S.patch, This
patch is to add unittest for smb/trans2 requests. It has also been
tested with success against w2k8r2 server.
0006-s4-add-dfs-smbtorture-to-selftests.patch, This patch is to add the
smbtorture tests to make tests.
After I'm willing to change provision so that DC have the host msdfs =
yes parameter, andrew what's your point of view ?
Jeremy, the torture tests will be a good start for us to tests the
capacity of s3 to handle get dfs referral requests when "plugged" into s4.
Ps: this patches pass make test
For me it crashes in samba4.dfs.domain
metze
Matthieu Patou
2010-05-13 21:53:09 UTC
Permalink
Hi Metze,
Thank for your tests.
I'm a bit puzzled, as your trace show that requestedname is
\samba.example.com\sysvol

#14 0x00000000006edbab in dodc_or_sysvol_referral (ctx=0x1e24e30, dfsreq=
{max_referral_level = 4, servername = 0xe47f90
"\\samba.example.com\\sysvol"}, requestedname=0xe47f90
"\\samba.example.com\\sysvol", ldb=0xb03d70,
trans=0x24709d0, req=0x174f370, lp_ctx=0xae8820)
at ../smb_server/smb/trans2.c:1484
nb_entries = 1
current = 1

And in the code of dodc_or_sysvol_referral the parameter is passed
without modification (well normally)
status =
fill_normal_dfs_referraltype(referral,

dfsreq.max_referral_level, requestedname,

talloc_asprintf(referral,"\\%s\\%s",set[i]->names[j],share), j==0);

and the error in your trace is at
#8 0x00000000005c2219 in ndr_push_dfs_normal_referral (ndr=0x1e19910,
ndr_flags=2, r=0x2860a88) at default/librpc/gen_ndr/ndr_dfsblobs.c:384
_status = 32767
_flags_save_string = 2

It's when pushing DFS_path which is in fact requestedname.

I tried running this with valgrind and found errors of course but they
were due to bad parenting and occured after talloc_free(context) when
your occured before.
In anycase now valgrind is clean.

I attached a patch for fixing error can you try it and tell me if you
still have pbs ?

Thanks.

Matthieu.
Post by Stefan (metze) Metzmacher
Post by Matthieu Patou
Hello this is a serie of 6 patches made for implementing Domain referral
in samba4.
Those patches are made to allow s4 to respond to domain DFS referral
requests.
This is highly desirable when you have more than 1 DC.
Please note that it's not the server side implementation of the DFS
replication protocol.
0001-pidl-fix-errors-and-improve-idl-in-dfsblobs.patch, This is a few
fixes for idl that I made in december that were found during the
developpement of the patches.
0002-s4-fix-trailling-whitespace-in-trans2.c.patch, This is a formatting
patch for trans2.c
0003-s4-Implement-GET_DFS_REFERRAL-for-domain-referral-re.patch, This is
the implementation of trans2/getreferrals requests for domain referrals
requests.
0004-s4-torture-test-Adapt-ndr-dfsblobs-torture-test-to-n.patch, This
patch is to adapt the torture test to the renaming of functions in
dfsblobs.idl
0005-s4-torture-Add-tests-for-dfs-referrals-handling-in-S.patch, This
patch is to add unittest for smb/trans2 requests. It has also been
tested with success against w2k8r2 server.
0006-s4-add-dfs-smbtorture-to-selftests.patch, This patch is to add the
smbtorture tests to make tests.
After I'm willing to change provision so that DC have the host msdfs =
yes parameter, andrew what's your point of view ?
Jeremy, the torture tests will be a good start for us to tests the
capacity of s3 to handle get dfs referral requests when "plugged" into s4.
Ps: this patches pass make test
For me it crashes in samba4.dfs.domain
metze
Stefan (metze) Metzmacher
2010-05-14 06:49:08 UTC
Permalink
Post by Matthieu Patou
Hi Metze,
Thank for your tests.
I'm a bit puzzled, as your trace show that requestedname is
\samba.example.com\sysvol
#14 0x00000000006edbab in dodc_or_sysvol_referral (ctx=0x1e24e30, dfsreq=
{max_referral_level = 4, servername = 0xe47f90
"\\samba.example.com\\sysvol"}, requestedname=0xe47f90
"\\samba.example.com\\sysvol", ldb=0xb03d70,
trans=0x24709d0, req=0x174f370, lp_ctx=0xae8820)
at ../smb_server/smb/trans2.c:1484
nb_entries = 1
current = 1
And in the code of dodc_or_sysvol_referral the parameter is passed
without modification (well normally)
status =
fill_normal_dfs_referraltype(referral,
dfsreq.max_referral_level, requestedname,
talloc_asprintf(referral,"\\%s\\%s",set[i]->names[j],share), j==0);
and the error in your trace is at
#8 0x00000000005c2219 in ndr_push_dfs_normal_referral (ndr=0x1e19910,
ndr_flags=2, r=0x2860a88) at default/librpc/gen_ndr/ndr_dfsblobs.c:384
_status = 32767
_flags_save_string = 2
It's when pushing DFS_path which is in fact requestedname.
I tried running this with valgrind and found errors of course but they
were due to bad parenting and occured after talloc_free(context) when
your occured before.
In anycase now valgrind is clean.
I attached a patch for fixing error can you try it and tell me if you
still have pbs ?
it still crashes

metze
-------------- next part --------------
A non-text attachment was scrubbed...
Name: out2.txt.gz
Type: application/x-gzip
Size: 11352 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100514/5129296f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100514/5129296f/attachment.pgp>
Matthieu Patou
2010-05-14 09:32:43 UTC
Permalink
Post by Stefan (metze) Metzmacher
it still crashes
metze
Ok I find the reason, it was an error of using v3 structure when doing
v4 response. In MS-DFSC they are the same but due to optional padding in
v3 structure our pidl is a bit different, it seems that under 64bits
this small difference cause misalignment when in 32bit it's ok.

I also fixed the int/uint32_t, int/unsigned int and the white space
(that cames from out of space I guess), I also fixed a few parenting pb
found by valgrind.

I reattached the new version and it's also available here:
http://repo.or.cz/w/Samba/ekacnet.git/shortlog/refs/heads/dfs.

Cheers.

Matthieu.

Matthias Dieter Wallnöfer
2010-05-13 20:57:03 UTC
Permalink
Hi ekacnet,

the patches do look very nice overall.
+ for(j=0; j< set[i]->count; j++) {
"set[i]->count" is of type "uint32_t" therefore also "j" should be of
(and not "int") - please change that kind of inattention mistakes.
for (i=0; i<=num_domain; i++) {
You've defined "i" as unsigned but "num_domains" as signed (was there a
special reason?).
+ /* Flags will be used later to indicate things like least-expensive or same-site options*/
+ const char *attrs_none[] = { NULL };
+ const char *attrs3[] = { "name", NULL };
+ struct ldb_dn *configdn, *sitedn, *dn, *sitescontainerdn;
+ struct ldb_result *r;
+ struct ldb_message_element *el;
+ struct dc_set **set_list;
+ unsigned int i;
^^^ since the mix of both does really look bad.

Greets,
Matthias
Continue reading on narkive:
Loading...