Re: [SCM] Samba Shared Repository - branch master updated

2015-02-10 Thread Stefan (metze) Metzmacher
Hi Andrew,

> - Log -
> commit c8c2c850d47a6cdaee5afd84c8ebaa03586c1277
> Author: Andrew Bartlett 
> Date:   Tue Feb 10 12:26:56 2015 +1300
> 
> Update mailing list references to point at lists.samba.org
> 
> The mailing lists are on lists.samba.org, but there are many references 
> that use the shorthand of samba.org
> 
> Some references to samba@ have been changed to samba-technical@ where 
> this make more sense.
> 
> Signed-off-by: Andrew Bartlett 
> Reviewed-by: Garming Sam 
> 
> Autobuild-User(master): Andrew Bartlett 
> Autobuild-Date(master): Tue Feb 10 07:08:28 CET 2015 on sn-devel-104

Can you prepare backports of this for our current release branches?
v4-{0,1,2}-test?

Thanks!
metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2014-08-05 Thread Stefan (metze) Metzmacher
Am 05.08.2014 um 22:08 schrieb Stefan (metze) Metzmacher:
> Am 05.08.2014 um 22:06 schrieb Stefan (metze) Metzmacher:
>> Am 05.08.2014 um 09:36 schrieb autobuild:
>>> The autobuild test system has detected an intermittent failing test in 
>>> the current master tree.
>>>
>>> The autobuild log of the failure is available here:
>>>
>>>http://git.samba.org/autobuild.flakey/2014-08-05-0936/flakey.log
>>>
>>> The samba build logs are available here:
>>>
>>>http://git.samba.org/autobuild.flakey/2014-08-05-0936/samba.stderr
>>
>> I fear the recent glibc security update causes segfaults...
>> I'll have a look at it tomorrow.
> 
> I just found https://bugs.launchpad.net/ubuntu/+bug/1352769

I did the following on sn and sn-devel-104

root@sn:~# /etc/init.d/nscd stop
root@sn:~# update-rc.d -f nscd remove

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2014-08-05 Thread Stefan (metze) Metzmacher
Am 05.08.2014 um 22:06 schrieb Stefan (metze) Metzmacher:
> Am 05.08.2014 um 09:36 schrieb autobuild:
>> The autobuild test system has detected an intermittent failing test in 
>> the current master tree.
>>
>> The autobuild log of the failure is available here:
>>
>>http://git.samba.org/autobuild.flakey/2014-08-05-0936/flakey.log
>>
>> The samba build logs are available here:
>>
>>http://git.samba.org/autobuild.flakey/2014-08-05-0936/samba.stderr
> 
> I fear the recent glibc security update causes segfaults...
> I'll have a look at it tomorrow.

I just found https://bugs.launchpad.net/ubuntu/+bug/1352769

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2014-08-05 Thread Stefan (metze) Metzmacher
Am 05.08.2014 um 09:36 schrieb autobuild:
> The autobuild test system has detected an intermittent failing test in 
> the current master tree.
> 
> The autobuild log of the failure is available here:
> 
>http://git.samba.org/autobuild.flakey/2014-08-05-0936/flakey.log
> 
> The samba build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2014-08-05-0936/samba.stderr

I fear the recent glibc security update causes segfaults...
I'll have a look at it tomorrow.

metze



signature.asc
Description: OpenPGP digital signature


Re: Flakey tests Re: autobuild: intermittent test failure detected

2014-01-04 Thread Stefan (metze) Metzmacher
Am 03.01.2014 17:10, schrieb Stefan (metze) Metzmacher:
> Am 23.12.2013 19:42, schrieb autobuild:
>> The autobuild test system has detected an intermittent failing test in 
>> the current master tree.
>>
>> The autobuild log of the failure is available here:
>>
>>http://git.samba.org/autobuild.flakey/2013-12-23-1942/flakey.log
>>
>> The samba3 build logs are available here:
>>
>>http://git.samba.org/autobuild.flakey/2013-12-23-1942/samba3.stderr
>>http://git.samba.org/autobuild.flakey/2013-12-23-1942/samba3.stdout
>>
>> The source4 build logs are available here:
>>
>>http://git.samba.org/autobuild.flakey/2013-12-23-1942/samba.stderr
>>http://git.samba.org/autobuild.flakey/2013-12-23-1942/samba.stdout
>>   
>> The top commit at the time of the failure was:
>>
>> commit 819e1f561df5074ae21db77c6558b34f4b0e1351
>> Author: Garming Sam 
>> Date:   Mon Dec 23 17:12:39 2013 +1300
>>
>> selftest: add rodc and other env tests for wbinfo
> 
> This introduced some problems with flakey builds, please find
> a workaround attached.
> 
> I'm currently doing manual autobuild with this, lets see if it gets better
> while build over the weekend.

Just 1 failed autobuild (with this patch) and about 13 (without it),
it would be nice if someone could give me a review+ and push it master.

metze


Flakey tests Re: autobuild: intermittent test failure detected

2014-01-03 Thread Stefan (metze) Metzmacher
Am 23.12.2013 19:42, schrieb autobuild:
> The autobuild test system has detected an intermittent failing test in 
> the current master tree.
> 
> The autobuild log of the failure is available here:
> 
>http://git.samba.org/autobuild.flakey/2013-12-23-1942/flakey.log
> 
> The samba3 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2013-12-23-1942/samba3.stderr
>http://git.samba.org/autobuild.flakey/2013-12-23-1942/samba3.stdout
> 
> The source4 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2013-12-23-1942/samba.stderr
>http://git.samba.org/autobuild.flakey/2013-12-23-1942/samba.stdout
>   
> The top commit at the time of the failure was:
> 
> commit 819e1f561df5074ae21db77c6558b34f4b0e1351
> Author: Garming Sam 
> Date:   Mon Dec 23 17:12:39 2013 +1300
> 
> selftest: add rodc and other env tests for wbinfo

This introduced some problems with flakey builds, please find
a workaround attached.

I'm currently doing manual autobuild with this, lets see if it gets better
while build over the weekend.

metze


Re: [SCM] Samba Shared Repository - branch master updated

2013-11-08 Thread Stefan (metze) Metzmacher
> commit 12a2230581b3ff5c7a29819532652d7ddfe61521
> Author: Andreas Schneider 
> Date:   Fri Nov 8 16:14:35 2013 +0100
> 
> s4-smb_server: Fix a use after free.
> 
> If we haven't allocated the smbsrv_session then we should not free it.
> 
> Signed-off-by: Andreas Schneider 
> Reviewed-by: Jeremy Allison 
>
> diff --git a/source4/smb_server/smb/sesssetup.c 
> b/source4/smb_server/smb/sesssetup.c
> index b26c128..4ebc0c4 100644
> --- a/source4/smb_server/smb/sesssetup.c
> +++ b/source4/smb_server/smb/sesssetup.c
> @@ -415,6 +415,7 @@ static void sesssetup_spnego(struct smbsrv_request *req, 
> union smb_sesssetup *se
>  {
>   NTSTATUS status;
>   struct smbsrv_session *smb_sess = NULL;
> + bool is_smb_sess_new = false;
>   struct sesssetup_spnego_state *s = NULL;
>   uint16_t vuid;
>   struct tevent_req *subreq;
> @@ -465,6 +466,7 @@ static void sesssetup_spnego(struct smbsrv_request *req, 
> union smb_sesssetup *se
>   status = NT_STATUS_INSUFFICIENT_RESOURCES;
>   goto failed;
>   }
> + is_smb_sess_new = true;
>   } else {
>   smb_sess = smbsrv_session_find_sesssetup(req->smb_conn, vuid);
>   }
> @@ -510,7 +512,9 @@ static void sesssetup_spnego(struct smbsrv_request *req, 
> union smb_sesssetup *se
>  nomem:
>   status = NT_STATUS_NO_MEMORY;
>  failed:
> - talloc_free(smb_sess);
> + if (is_smb_sess_new) {
> + talloc_free(smb_sess);
> + }
>   status = nt_status_squash(status);
>   smbsrv_sesssetup_backend_send(req, sess, status);

I think we need to talloc_steal(req, smb_sess) here.
This is similar to
https://git.samba.org/?p=samba.git;a=commitdiff;h=25494628a2e977568de0f634602ebe893d0a5b88

metze


Re: [SCM] CTDB repository - branch master updated - ctdb-2.1-47-g1c7adbc

2013-04-08 Thread Stefan (metze) Metzmacher
Hi Amitay,

> client: Set the socket non-blocking only after connect succeeds
> 
> If the socket is set non-blocking before connect, then we should catch
> EAGAIN errors and retry. Instead of adding a random number of retries,
> better to wait for connect to succeed and then set the socket to
> non-blocking.
> 
> Signed-off-by: Amitay Isaacs 

Why have you also moved the set_close_on_exec() call?

metze




signature.asc
Description: OpenPGP digital signature


FLAKEY: selftest: check that samba-tool gpo works for basic operations

2012-11-05 Thread Stefan (metze) Metzmacher
Hi Andrew,

can you have a look at this

https://git.samba.org/autobuild.flakey/2012-11-06-0314/samba.stdout
https://git.samba.org/autobuild.flakey/2012-11-06-0514/samba.stdout
https://git.samba.org/autobuild.flakey/2012-11-06-0713/samba.stdout

It seems that the  samba.tests.samba_tool.gpo(dc:local) test is flakey.

metze

Am 06.11.2012 00:13, schrieb Andrew Bartlett:
> The branch, master has been updated
>via  ab30a8b provision: Make dsacl2fsacl() take a security.dom_sid, 
> not str
>via  0334515 provision: Also walk directories checking ACLs
>via  ab5 wintest: Try harder to recover from apparent failure to 
> dcpromo
>via  0b7bb77 selftest: check that samba-tool gpo works for basic 
> operations
>via  26faa8f dsdb: Simplify DsCrackNameOneFilter a bit
>via  ec3cbb6 wafsamba.abi: Fix abi_match with both excludes and 
> includes.
>via  d02c8ba wafsamba.samba_abi: Add basic unit tests.
>via  97102fa buildtools: Remove extra space from global: line
>via  ea5ef95 wafsamba.samba_abi: Refactor abi_write_vscript to take 
> file argument.
>   from  3d93616 s3:smbd: pass the current time to make_connection[_smb1]()
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -
> commit ab30a8bf0fb9bd4ee3c907183132f3b9abb67c7a
> Author: Andrew Bartlett 
> Date:   Mon Nov 5 20:44:14 2012 +1100
> 
> provision: Make dsacl2fsacl() take a security.dom_sid, not str
> 
> Reviewed-by: Jelmer Vernooij 
> Signed-off-by: Andrew Bartlett 
> 
> Autobuild-User(master): Andrew Bartlett 
> Autobuild-Date(master): Tue Nov  6 00:12:43 CET 2012 on sn-devel-104
> 
> commit 033451587db21d6e4b829e89a64f894a32682131
> Author: Andrew Bartlett 
> Date:   Mon Nov 5 15:22:02 2012 +1100
> 
> provision: Also walk directories checking ACLs
> 
> The directory walk was missed due to a cut-and-paste error.
> 
> Andrew Bartlett
> 
> Reviewed-by: Jelmer Vernooij 
> Signed-off-by: Andrew Bartlett 
> 
> commit ab5cdc39b71c0f243ff1e660d1f35a4923e3
> Author: Andrew Bartlett 
> Date:   Mon Nov 5 19:35:51 2012 +1100
> 
> wintest: Try harder to recover from apparent failure to dcpromo
> 
> Reviewed-by: Jelmer Vernooij 
> Signed-off-by: Andrew Bartlett 
> 
> commit 0b7bb774ce836722d219d6e466a76b12c1a03de3
> Author: Andrew Bartlett 
> Date:   Mon Nov 5 12:57:17 2012 +1100
> 
> selftest: check that samba-tool gpo works for basic operations
> 
> Reviewed-by: Jelmer Vernooij 
> Signed-off-by: Andrew Bartlett 
> 
> commit 26faa8fe3a42f9d1278d81773c8808b05fcd76f8
> Author: Volker Lendecke 
> Date:   Sat Nov 3 09:36:29 2012 +0100
> 
> dsdb: Simplify DsCrackNameOneFilter a bit
> 
> For me "else" branches clutter my flow reading code. If we do a hard
> return at the end of an "if" branch, "else" is not required.
> 
> Signed-off-by: Andrew Bartlett 
> Reviewed-by: Andrew Bartlett 
> 
> commit ec3cbb6c476698523c9b5ac047787df101746891
> Author: Jelmer Vernooij 
> Date:   Mon Nov 5 19:36:30 2012 +0100
> 
> wafsamba.abi: Fix abi_match with both excludes and includes.
> 
> This fixes a regression introduced by 
> 9c3e294400234ebdf9b98031bae583524fd0b0ac
> which caused internal symbols in libldb to be exposed.
> 
> Bug: https://bugzilla.samba.org/show_bug.cgi?id=9357
> 
> Signed-off-by: Andrew Bartlett 
> Reviewed-by: Andrew Bartlett 
> Reviewed-by: Stephen Gallagher 
> 
> commit d02c8ba122cef7d8b254e5be3ae757eb3bb14235
> Author: Jelmer Vernooij 
> Date:   Mon Nov 5 19:36:29 2012 +0100
> 
> wafsamba.samba_abi: Add basic unit tests.
> 
> Signed-off-by: Andrew Bartlett 
> Reviewed-by: Andrew Bartlett 
> Reviewed-by: Stephen Gallagher 
> 
> commit 97102fa9963ba88f4ab72165a02071990031a73b
> Author: Andrew Bartlett 
> Date:   Tue Nov 6 07:48:52 2012 +1100
> 
> buildtools: Remove extra space from global: line
> 
> This makes it easier to put the expected values in a file
> as we will not have trailing whitespace that is against git style.
> 
> Andrew Bartlett
> 
> Signed-off-by: Andrew Bartlett 
> Reviewed-by: Jelmer Vernooij 
> 
> Reviewed-by: Andrew Bartlett 
> 
> commit ea5ef95fbebe28cca11f86a9015aab77522f5e18
> Author: Jelmer Vernooij 
> Date:   Mon Nov 5 19:36:28 2012 +0100
> 
> wafsamba.samba_abi: Refactor abi_write_vscript to take file argument.
> 
> Signed-off-by: Andr

Re: [SCM] Samba Shared Repository - branch master updated

2012-10-11 Thread Stefan (metze) Metzmacher
Hi Jelmer,

> - Log -
> commit c2d14747d608d406de6410556807d467cd0b85ef
> Author: Jelmer Vernooij 
> Date:   Thu Oct 11 14:45:10 2012 +0200
> 
> provision: Always create DNS user.
> 
> The DNS user is currently only used by the bind9 plugin. This makes it
> easier to later on switch between the builtin DNS server and bind
> backend.
> 
> In addition, ideally the internal DNS server would use that (separate)
> user too.

Why? Isn't that the job of samba_upgradedns?
I removed this behavior because I want us to match windows as much as
possible.

metze



signature.asc
Description: OpenPGP digital signature


Add mapping using uidNumber and gidNumber like idmap_ad

2012-06-16 Thread Stefan (metze) Metzmacher
Hi Andrew,

> commit 3c65bac0b6fc104f4bdf86beed775d13da00aaab
> Author: Andrew Bartlett 
> Date:   Sun Jun 10 15:52:14 2012 +1000
> 
> s4-idmap: Add mapping using uidNumber and gidNumber like idmap_ad
> 
> This is a solution for users who are upgrading from Samba 3.x in
> particuar, or have clients that will be using idmap_ad.  This avoids
> needing to have duplicate values in idmap.ldb and in the directory.
> 
> No check for conflicts is made with the idmap.ldb - the AD store always 
> wins.
> 
> Andrew Bartlett

I'm not ok with this patch, I asked you to add an option for this new
behavior!

This should not be the default behavior, there should be an option for
people
who want that magic.

This just leads to hard to debug installations.

We have enough of magic fallbacks to legacy mapping in the s3, which might
end up with inconsistent id mappings, if winbindd is not reachable for a
short time.

metze



signature.asc
Description: OpenPGP digital signature


Remove unused finddcs_nbt (Re: [SCM] Samba Shared Repository - branch master updated)

2012-06-08 Thread Stefan (metze) Metzmacher
Hi Andrew,

> commit 06c90cb6f55701effa4cbafaf189a4de8471949b
> Author: Andrew Bartlett 
> Date:   Thu Jun 7 14:21:25 2012 +1000
> 
> s4-libcli: Remove unused finddcs_nbt
> 
> This would only do the NBT getdc lookup for a single DC (but would
> find multiple DCs at first stage), but more particular it of course
> uses Netbios rather than DNS names.
> 
> In any case it was also unused, as we use CLDAP for reliable DC
> location these days.
> 
> Found by callcatcher

I think it's a bug that it's not used.

Samba3 DCs doesn't support CLDAP.

metze



signature.asc
Description: OpenPGP digital signature


Replace smbd_server_connection_loop_once() with tevent_loop_once() directly.

2012-02-16 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> - Log -
> commit ed85e9fe6a10d3c34b74788e6f862ea23dce4f2b
> Author: Jeremy Allison 
> Date:   Thu Feb 16 16:14:14 2012 -0800
> 
> Replace smbd_server_connection_loop_once() with tevent_loop_once() 
> directly.
> 
> We no longer need to call poll() directly inside smbd !
> 
> Autobuild-User: Jeremy Allison 
> Autobuild-Date: Fri Feb 17 02:49:13 CET 2012 on sn-devel-104

Are you sure you want to remove the START_PROFILE(smbd_idle); part?

metze



signature.asc
Description: OpenPGP digital signature


Re: s3: Avoid a winbind 100% cpu loop

2011-10-18 Thread Stefan (metze) Metzmacher
Hi Volker,

> - Log -
> commit fbf17489844a5cfc6d1da8c431ce0194ed4c3f72
> Author: Volker Lendecke 
> Date:   Tue Oct 18 21:36:44 2011 +0200
> 
> s3: Avoid a winbind 100% cpu loop
> 
> When a DC goes down hard, winbind can end up in a 100% CPU loop. The next
> (small) RPC request to the DC ends up as a trans2 request. If the 
> connection
> goes down, we end up trying to discard the request via the loop in
> cli_state_notify_pending(). Because this is a trans2 request,
> cli_smb_req_unset_pending will not kick in. Thus the pending array will 
> always
> remain at length 1.
> 
> Autobuild-User: Volker Lendecke 
> Autobuild-Date: Wed Oct 19 01:39:35 CEST 2011 on sn-devel-104
> 
> ---
> 
> Summary of changes:
>  source3/libsmb/async_smb.c |8 
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
> index efeb328..dce1b74 100644
> --- a/source3/libsmb/async_smb.c
> +++ b/source3/libsmb/async_smb.c
> @@ -287,6 +287,14 @@ static void cli_state_notify_pending(struct cli_state 
> *cli, NTSTATUS status)
>   req = cli->conn.pending[0];
>   state = tevent_req_data(req, struct cli_smb_state);
>  
> + if (NT_STATUS_EQUAL(status, NT_STATUS_PIPE_BROKEN)) {
> + /*
> +  * We're dead. No point waiting for trans2
> +  * replies.
> +  */
> + state->mid = 0;
> + }
> +
>   cli_smb_req_unset_pending(req);

Good catch, thanks!

Is there a reason why you only use state->mid = 0; on PIPE_BROKEN?
As cli_state_notify_pending() calls cli_state_disconnect(), I think we
should
always use state->mid = 0; without looking at the status.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2011-09-22 Thread Stefan (metze) Metzmacher
Am 23.09.2011 07:01, schrieb Matthieu Patou:
> On 22/09/2011 21:14, Stefan (metze) Metzmacher wrote:
>> Hi Matthieu,
>>
>>> diff --git a/source4/ntvfs/posix/python/pyxattr_tdb.c
>>> b/source4/ntvfs/posix/python/pyxattr_tdb.c
>>> index 2b28aca..a08557e 100644
>>> --- a/source4/ntvfs/posix/python/pyxattr_tdb.c
>>> +++ b/source4/ntvfs/posix/python/pyxattr_tdb.c
>>> @@ -60,9 +60,8 @@ static PyObject *py_wrap_setxattr(PyObject *self,
>>> PyObject *args)
>>>   status = push_xattr_blob_tdb_raw(eadb, mem_ctx, attribute,
>>> filename, -1,
>>>   &blob);
>>>   if (!NT_STATUS_IS_OK(status)) {
>>> -PyErr_FromNTSTATUS(status);
>>>   talloc_free(mem_ctx);
>>> -return NULL;
>>> +PyErr_NTSTATUS_IS_ERR_RAISE(status);
>>>   }
>>>   talloc_free(mem_ctx);
>>>   Py_RETURN_NONE;
>>> @@ -91,9 +90,8 @@ static PyObject *py_wrap_getxattr(PyObject *self,
>>> PyObject *args)
>>>   status = pull_xattr_blob_tdb_raw(eadb, mem_ctx, attribute,
>>> filename,
>>>-1, 100,&blob);
>>>   if (!NT_STATUS_IS_OK(status) || blob.length<  0) {
>>> -PyErr_FromNTSTATUS(status);
>>>   talloc_free(mem_ctx);
>>> -return NULL;
>>> +PyErr_NTSTATUS_IS_ERR_RAISE(status);
>> Why this changes? What was the problem?
>>
>> NT_STATUS_IS_ERR() is not the same as !NT_STATUS_IS_OK()
> Well the problem is that without this if your status was != OK you'll
> get error like instead of getting the right exception.
> "ERROR(): uncaught exception - error
> return without exception set"
> 
> 
> As PyErr_FromNTSTATUS(status) is not the same as PyErr_SetNTSTATUS(status)
> 
> If _IS_ERR is not the same then we need to have this code:
> if (!NT_STATUS_IS_OK(status)) {
> PyErr_SetNTSTATUS(status);
> talloc_free(mem_ctx);
> return NULL;
> }

yes, that looks more sane to me.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2011-09-22 Thread Stefan (metze) Metzmacher
Hi Matthieu,

> diff --git a/source4/ntvfs/posix/python/pyxattr_tdb.c 
> b/source4/ntvfs/posix/python/pyxattr_tdb.c
> index 2b28aca..a08557e 100644
> --- a/source4/ntvfs/posix/python/pyxattr_tdb.c
> +++ b/source4/ntvfs/posix/python/pyxattr_tdb.c
> @@ -60,9 +60,8 @@ static PyObject *py_wrap_setxattr(PyObject *self, PyObject 
> *args)
>   status = push_xattr_blob_tdb_raw(eadb, mem_ctx, attribute, filename, -1,
>&blob);
>   if (!NT_STATUS_IS_OK(status)) {
> - PyErr_FromNTSTATUS(status);
>   talloc_free(mem_ctx);
> - return NULL;
> + PyErr_NTSTATUS_IS_ERR_RAISE(status);
>   }
>   talloc_free(mem_ctx);
>   Py_RETURN_NONE;
> @@ -91,9 +90,8 @@ static PyObject *py_wrap_getxattr(PyObject *self, PyObject 
> *args)
>   status = pull_xattr_blob_tdb_raw(eadb, mem_ctx, attribute, filename, 
>-1, 
> 100, &blob);
>   if (!NT_STATUS_IS_OK(status) || blob.length < 0) {
> - PyErr_FromNTSTATUS(status);
>   talloc_free(mem_ctx);
> - return NULL;
> + PyErr_NTSTATUS_IS_ERR_RAISE(status);

Why this changes? What was the problem?

NT_STATUS_IS_ERR() is not the same as !NT_STATUS_IS_OK()

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2011-08-12 Thread Stefan (metze) Metzmacher
Hi Tridge,

> The autobuild log of the failure is available here:
> 
>http://git.samba.org/autobuild.flakey/2011-08-12-1305/flakey.log
> 
> The samba3 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2011-08-12-1305/samba3.stderr
>http://git.samba.org/autobuild.flakey/2011-08-12-1305/samba3.stdout
> 
> The source4 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2011-08-12-1305/samba4.stderr
>http://git.samba.org/autobuild.flakey/2011-08-12-1305/samba4.stdout
>   
> The top commit at the time of the failure was:
> 
> commit 6b3a12b0f4c38c87a1f1ff4227ab78ac7624289d
> Author: Andrew Tridgell 
> Date:   Fri Aug 12 14:37:04 2011 +1000
> 
> s4-test: use standard process model for 'dc' server
> 
> this provides us with both 'standard' and 'single' process models in
> selftest, ensuring that we test the standard process model in the
> build farm
> 
> Pair-Programmed-With: Andrew Bartlett 

I fear this change made autobuild a bit more unstable I saw the following
error a few times today:

[1064/1145 in 1h2m11s] samba4.nbt.winsreplication(dc)
Test if we always get back the same assoc_ctx
Setup wrepl connections
UNEXPECTED(failure): samba4.nbt.winsreplication.assoc_ctx2
REASON: _StringException: _StringException:
../source4/torture/nbt/winsreplication.c:200: status was
NT_STATUS_HOST_UNREACHABLE, expected NT_STATUS_OK: Incorrect status

I also noticed that samba4 make test needs over 1h 20 now.

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2011-08-09 Thread Stefan (metze) Metzmacher
Hi Andrew,

> The autobuild test system has detected an intermittent failing test in 
> the current master tree.
> 
> The autobuild log of the failure is available here:
> 
>http://git.samba.org/autobuild.flakey/2011-08-09-1406/flakey.log
> 
> The samba3 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2011-08-09-1406/samba3.stderr
>http://git.samba.org/autobuild.flakey/2011-08-09-1406/samba3.stdout
> 
> The source4 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2011-08-09-1406/samba4.stderr
>http://git.samba.org/autobuild.flakey/2011-08-09-1406/samba4.stdout

Do you have an idea why the samba3.blackbox.smbclient_auth.plain tests
are flakey?

I tried make test TESTS=secshare SMBD_VALGRIND="valgrind
--num-callers=30 --log-file=smbd.vg.log --trace-children=yes",
but didn't find anything.

UNEXPECTED(error): creating directory
/memdisk/autobuild/flakey/b28206/samba4/bin/ab/secserver/ncalrpc: File
exists

is very strange and I can't find the related code using "git grep
'creating directory'"

metze



signature.asc
Description: OpenPGP digital signature


nmbd FD_SET change for master/3.6

2011-06-30 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
> index a89f49c..0324c9d 100644
> --- a/source3/nmbd/nmbd_packets.c
> +++ b/source3/nmbd/nmbd_packets.c
> @@ -1698,7 +1698,12 @@ static bool create_listen_pollfds(struct pollfd **pfds,
>   for (subrec = FIRST_SUBNET;
>subrec != NULL;
>subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
> - count += 2; /* nmb_sock and dgram_sock */
> + if (subrec->nmb_sock != -1) {
> + count += 1;
> + }
> + if (subrec->dgram_sock != -1) {
> + count += 1;
> + }
>   if (subrec->nmb_bcast != -1) {
>   count += 1;
>   }

Can you please explain me where this can happen? I think
nmb_sock and dgram_sock are always valid.

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2011-06-16 Thread Stefan (metze) Metzmacher
Hi,

I think I've fixed the problems with this flakey test:
samba3.posix_s3.winbind.wbclient .wbcListUsers

See https://bugzilla.samba.org/show_bug.cgi?id=8215 for more details.

metze

> The autobuild test system has detected an intermittent failing test in 
> the current master tree.
> 
> The autobuild log of the failure is available here:
> 
>http://git.samba.org/autobuild.flakey/2011-06-16-0225/flakey.log
> 
> The samba3 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2011-06-16-0225/samba3.stderr
>http://git.samba.org/autobuild.flakey/2011-06-16-0225/samba3.stdout
> 
> The source4 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2011-06-16-0225/samba4.stderr
>http://git.samba.org/autobuild.flakey/2011-06-16-0225/samba4.stdout
>   



signature.asc
Description: OpenPGP digital signature


s3-param Remove special case for global_myname(), rename to lp_netbios_name()

2011-06-09 Thread Stefan (metze) Metzmacher
Hi Andrew,

while I like you changes to use lp_netbios_name(), lp_netbios_scope()
and lp_workgroup()
directly, I noticed that this changes changed the behavior if someone
specifies these
parameters on the command line.

lp_set_cmdline() doesn't cause the

lp_set_cmdline("netbios name", "foo");
doesn't trigger that
lp_netbios_name() will return "FOO", which would match the old behavior.

I guess we need something similar to handle_realm() and szRealmUpper.

metze



signature.asc
Description: OpenPGP digital signature


s3-param Remove special case for lp_workgroup()

2011-06-09 Thread Stefan (metze) Metzmacher
Hi Andrew,

commit 3ccc7609476139bc6a906110a2623605f3802159 introduced a regression
in rpcclient, which makes it unusable, as the lp_workgroup() returns
uninitialized memory.

I have put a fix for this into autobuild, but it would be nice if you could
add some blackbox tests for rpcclient, so that we'll detect things like
this in future.

Thanks!
metze



signature.asc
Description: OpenPGP digital signature


quiet enum warnings

2011-06-09 Thread Stefan (metze) Metzmacher
Hi Matthias,

>   case RAW_FILEINFO_GETATTR:
>   info->getattr.out.attrib = name->dos.attrib;
>   info->getattr.out.size   = name->st.st_size;
> @@ -333,9 +330,11 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state 
> *pvfs,
> 
> name->original_name);
>   NT_STATUS_HAVE_NO_MEMORY(info->all_info2.out.fname.s);
>   return NT_STATUS_OK;
> +
> + default:
> + return NT_STATUS_INVALID_LEVEL;
>   }
>  
> - return NT_STATUS_INVALID_LEVEL;
>  }

I think we should better fix this by adding the missing enum values
explicit instead of
using a default, as that will make sure we'll get a warning again if
someone adds a new
value.

metze



signature.asc
Description: OpenPGP digital signature


s3-testparm Warn more on incorrect use of 'password server'

2011-05-19 Thread Stefan (metze) Metzmacher
Hi Andrew,

> commit 06435acf3b9afa94019f7654cda4ad9386c6384b
> Author: Andrew Bartlett 
> Date:   Wed May 18 11:53:34 2011 +1000
> 
> s3-testparm Warn more on incorrect use of 'password server'

The usage of "password server" in "security = ads" setup is very common.

We should really only print a warning, so I guess we need to remove the
"ret = 1" there.

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2011-04-29 Thread Stefan (metze) Metzmacher
Am 29.04.2011 21:57, schrieb Jelmer Vernooij:
> On Fri, 2011-04-29 at 21:29 +0200, Stefan (metze) Metzmacher wrote:
>> Hi Tridge,
>>
>>>http://git.samba.org/autobuild.flakey/2011-04-28-0842/samba4.stderr
>>>http://git.samba.org/autobuild.flakey/2011-04-28-0842/samba4.stdout
>>
>> Any idea why
>>
>> UNEXPECTED(error): samba4.nbt.winsreplication.owned
>>
>> is an error know instead of a failure, which would be ignored,
>> because it's marked in knownfail?
>>
>> To me it seems that the knownfail feature doesn't work anymore.
> knownfail only works for failures (i.e. we check for a particular error
> but a different one was returned), not for errors (e.g. segfaults).
> 
> This is intentional; an error is often a sign of a broken testsuite.

I know, but that test used to generate a failure and not an error before.

So something seemed to be changed, because it started to be flakey again
arround
commit 1c5cc4a2d1449296a96e8a137dc177191df00c8d.

I'll change _NBT_ASSERT() and _NBT_ASSERT_STRING() to use the
torture_assert macros,
so that's a failure again, but we need to bisect why it is failing there
now,
while it didn't fail before with an error.

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2011-04-29 Thread Stefan (metze) Metzmacher
Hi Tridge,

>http://git.samba.org/autobuild.flakey/2011-04-28-0842/samba4.stderr
>http://git.samba.org/autobuild.flakey/2011-04-28-0842/samba4.stdout

Any idea why

UNEXPECTED(error): samba4.nbt.winsreplication.owned

is an error know instead of a failure, which would be ignored,
because it's marked in knownfail?

To me it seems that the knownfail feature doesn't work anymore.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2011-03-28 Thread Stefan (metze) Metzmacher
Hi Andrew,

> commit b32f155bae384bd3ae1d9ba9f246a0eca18a2511
> Author: Andrew Tridgell 
> Date:   Mon Mar 28 16:44:32 2011 +1100
> 
> s4-dsdb: perform FSMO transfers asynchronously
> 
> this gives the administrator a proper error message on the command
> line
> 
> Pair-Programmed-With: Andrew Bartlett 
> 
> commit 358892e8365d052d7b9300737a4c1dc92b26cc0c
> Author: Andrew Tridgell 
> Date:   Mon Mar 28 16:20:47 2011 +1100
> 
> s4-fsmo: make rootDSE modify for FSMO transfer async
> 
> this gives the ldap client the error code from the transfer
> 
> Pair-Programmed-With: Andrew Bartlett 

Not really related to your change, but I think we have a real problem
in this code, as rootdse_become_master() is called within a
transaction. Which may talks to another local process and then to a
remove server.

metze




signature.asc
Description: OpenPGP digital signature


s4-dsdb: allow modification of linked attribute targets with relax

2011-03-28 Thread Stefan (metze) Metzmacher
Hi Tridge,

> commit daeb6a02eab5822c557ab167fbc171aebe2ddf05
> Author: Andrew Tridgell 
> Date:   Tue Mar 29 16:14:18 2011 +1100
> 
> s4-dsdb: allow modification of linked attribute targets with relax
> 
> this is used to help recover a corrupt database.
> 
> Pair-Programmed-With: Andrew Bartlett 

Can we change that, so that's it's only allowed as SYSTEM?

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2011-03-22 Thread Stefan (metze) Metzmacher
Hi,

> commit 4928d66fc2f469b75090c34f8d233026485e4a1e
> Author: Stefan Metzmacher 
> Date:   Mon Mar 21 11:21:57 2011 +0100
> 
> libcli/security: make sure that we don't grant SEC_STD_DELETE to the 
> owner by default
> 
> In the file server SEC_STD_DELETE is granted on the file/directory
> or by FILE_DELETE_CHILD on the parent directory.
> 
> metze

I've pushed a fix for this to autobuild...

metze



signature.asc
Description: OpenPGP digital signature


pidl uid_t and gid_t

2011-02-28 Thread Stefan (metze) Metzmacher
Hi Andrew,

> commit 646aefd998c1af366dcaee6cbc2bad9359a71f45
> Author: Andrew Bartlett 
> Date:   Fri Feb 11 18:45:32 2011 +1100
> 
> pidl Add support for uid_t and gid_t types
> 
> These are mapped to uint64_t, which should be big enough.  This is
> proposed to be used for internal Samba representations, where it would
> be more painful to convert all the callers to an uint64_t calling
> convention.
> 
> Andrew Bartlett

> +/*
> +  push a gid_t
> +*/
> +_PUBLIC_ enum ndr_err_code ndr_push_gid_t(struct ndr_push *ndr, int 
> ndr_flags, gid_t g)
> +{
> + return ndr_push_udlong(ndr, NDR_SCALARS, (uint64_t)g);
> +}
> +
> +/*
> +  pull a gid_t
> +*/
> +_PUBLIC_ enum ndr_err_code ndr_pull_gid_t(struct ndr_pull *ndr, int 
> ndr_flags, gid_t *g)
> +{
> + uint64_t gg;
> + NDR_CHECK(ndr_pull_udlong(ndr, ndr_flags, &gg));
> + *g = (gid_t)gg;
> + if (unlikely(gg != *g)) {
> + DEBUG(0,(__location__ ": gid_t pull doesn't fit 0x%016llx\n",
> +  (unsigned long long)gg));
> + return NDR_ERR_NDR64;
> + }
> + return NDR_ERR_SUCCESS;
> +}
> +
> +
> +/*
>pull a ipv4address
>  */
>  _PUBLIC_ enum ndr_err_code ndr_pull_ipv4address(struct ndr_pull *ndr, int 
> ndr_flags, const char **address)
> @@ -1050,6 +1100,16 @@ _PUBLIC_ void ndr_print_time_t(struct ndr_print *ndr, 
> const char *name, time_t t
>   }
>  }
>  
> +_PUBLIC_ void ndr_print_uid_t(struct ndr_print *ndr, const char *name, uid_t 
> u)
> +{
> + ndr_print_dlong(ndr, name, u);
> +}
> +
> +_PUBLIC_ void ndr_print_gid_t(struct ndr_print *ndr, const char *name, gid_t 
> g)
> +{
> + ndr_print_dlong(ndr, name, g);
> +}
> +
>  _PUBLIC_ void ndr_print_union(struct ndr_print *ndr, const char *name, int 
> level, const char *type)
>  {
>   if (ndr->flags & LIBNDR_PRINT_ARRAY_HEX) {
> diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm
> index 3edb9b7..5ade5c1 100644
> --- a/pidl/lib/Parse/Pidl/NDR.pm
> +++ b/pidl/lib/Parse/Pidl/NDR.pm
> @@ -66,6 +66,8 @@ my $scalar_alignment = {
>   'string' => 4,
>   'string_array' => 4, #???
>   'time_t' => 4,
> + 'uid_t' => 8,
> + 'gid_t' => 8,
>   'NTTIME' => 4,
>   'NTTIME_1sec' => 4,
>   'NTTIME_hyper' => 8,

udlong aligns to 4 byte and not to 8 as hyper would do.

metze



signature.asc
Description: OpenPGP digital signature


file_name_hash vs. smb_name_hash

2011-01-26 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> The branch, master has been updated
>via  3272e16 Missed one debug printf of name_hash. Ensure always use 
> %x.
>via  4473273 Fix bug #7863 - Unlink may unlink wrong file when 
> hardlinks are involved.
>via  a65bce4 Add uint32_t name_hash argument (currently unused) to 
> get_file_infos().
>via  b97f1ce Add name_hash into the share mode entry struct (as yet 
> only use for renames to identify a specific path).
>via  76418e2 Add name_hash to files_struct. Set within 
> fsp_set_smb_fname().
>   from  6e22637 s4-test/delete_object: Remove global ldb connections
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master

> +static uint32_t smb_name_hash(const char *sharepath, const char *filename, 
> int *err)
> +{
> + TDB_DATA key;
> + char *fullpath = NULL;
> + int ret;
> + uint32_t name_hash;
> +
> + *err = 0;
> + ret = asprintf(&fullpath, "%s/%s", sharepath, filename);
> + if (ret == -1 || fullpath == NULL) {
> + *err = 1;
> + return 0;
> + }
> + key.dptr = (uint8_t *)fullpath;
> + key.dsize = strlen(fullpath);
> + name_hash = tdb_jenkins_hash(&key);
> + free(fullpath);
> + return name_hash;
> +}
> +

> +NTSTATUS file_name_hash(connection_struct *conn,
> +   const char *name, uint32_t *p_name_hash)
> +{
> +   TDB_DATA key;
> +   char *fullpath = NULL;
> +
> +   /* Set the hash of the full pathname. */
> +   fullpath = talloc_asprintf(talloc_tos(),
> +   "%s/%s",
> +   conn->connectpath,
> +   name);
> +   if (!fullpath) {
> +   return NT_STATUS_NO_MEMORY;
> +   }
> +   key = string_term_tdb_data(fullpath);
> +   *p_name_hash = tdb_jenkins_hash(&key);
> +
> +   DEBUG(10,("file_name_hash: %s hash 0x%x\n",
> +   fullpath,
> +   (unsigned int)*p_name_hash ));
> +
> +   TALLOC_FREE(fullpath);
> +   return NT_STATUS_OK;
> +}

These function don't calculate the same hash!
string_term_tdb_data() uses strlen()+1.

metze



signature.asc
Description: OpenPGP digital signature


Re: s3: Fix an infinite loop

2011-01-24 Thread Stefan (metze) Metzmacher
Hi Volker,

> On Mon, Jan 24, 2011 at 09:14:23AM +0100, Stefan (metze) Metzmacher wrote:
>> I think this change is wrong because, selret is a pointer and we already
>> have this check (directly above):
> 
> Gna. I have first done this in 3.5, where selrtn is not a
> pointer. I have then just taken the same patch and applied
> it to master, wrongly assuming that this is the same piece
> of code. The patch applied cleanly, so I did not check.
> Apologies for this false assumption.

No problem, I assumed something like that:-)

> By the way, where does 3.5 handle the selrtn==-1 case?

I think we need something like this there:

http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=22f0e9bf00fb8a3dc02b8c4e13d05b9f7a9adb6b
http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=d935696bc4559fe66f3420b8bbe0d9a595b41116

> I have just pushed the revert to autobuild.

Does my other changes make sense for you?

metze



signature.asc
Description: OpenPGP digital signature


s3: Fix an infinite loop

2011-01-24 Thread Stefan (metze) Metzmacher
Hi Volker,

I think this change is wrong because, selret is a pointer and we already
have this check (directly above):

if (*selrtn <= 0) {
/*
 * No fd ready
 */
return false;
}

I've done some more changes to implement the fd fairness
in lib/events.c instead of smbd/process.c.

Please have a look at:
http://gitweb.samba.org/?p=metze/samba/wip.git;a=shortlog;h=refs/heads/master3-tevent2

metze



signature.asc
Description: OpenPGP digital signature


Re: autobuild failure for task source4 during make

2011-01-19 Thread Stefan (metze) Metzmacher
I've pushed a change that marks samba4.tokengroups.python as knownfail.

metze

Am 19.01.2011 16:44, schrieb autobu...@samba.org:
> 
> Dear Developer,
> 
> Your autobuild failed when trying to test source4 with the following error:
>source4: [make] failed 'make -j' with status 2
> 
> the autobuild has been abandoned. Please fix the error and resubmit.
> 
> A summary of the autobuild process is here:
> 
>   http://git.samba.org/metze/samba-autobuild/autobuild.log
> 
> You can see logs of the failed task here:
> 
>   http://git.samba.org/metze/samba-autobuild/source4.stdout
>   http://git.samba.org/metze/samba-autobuild/source4.stderr
> 
> or you can get full logs of all tasks in this job here:
> 
>   http://git.samba.org/metze/samba-autobuild/logs.tar.gz
> 
> The top commit for the tree that was built was:
> 
> commit 3494e6b52d83a370b06b7cfa8857c06a6b9be6b4
> Author: Stefan Metzmacher 
> Date:   Sat Oct 30 16:23:49 2010 +0200
> 
> socket_wrapper: use swrap_sendmsg_before()/after() in swrap_writev()
> 
> metze
> 
> 



signature.asc
Description: OpenPGP digital signature


Re: autobuild: intermittent test failure detected

2010-12-11 Thread Stefan (metze) Metzmacher
Am 11.12.2010 06:44, schrieb Andrew Tridgell:
> The autobuild test system has detected an intermittent failing test in 
> the current master tree.
> 
> The autobuild log of the failure is available here:
> 
>http://git.samba.org/autobuild.flakey/2010-12-11-0644/flakey.log
> 
> The source3 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2010-12-11-0644/source3.stderr
>http://git.samba.org/autobuild.flakey/2010-12-11-0644/source3.stdout
> 
> The source4 build logs are available here:
> 
>http://git.samba.org/autobuild.flakey/2010-12-11-0644/source4.stderr
>http://git.samba.org/autobuild.flakey/2010-12-11-0644/source4.stdout
>   
> The top commit at the time of the failure was:
> 
> commit 35fbc7bbda5851f7172538f79fc79be201f1d521
> Author: Jelmer Vernooij 
> Date:   Sat Dec 11 03:26:31 2010 +0100
> 
> s4-smbtorture: Make test names lowercase and dot-separated.
> 
> This is consistent with the test names used by selftest, should
> make the names less confusing and easier to integrate with other tools.
> 
> Autobuild-User: Jelmer Vernooij 
> Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104

I wonder how this passed autobuild, as the "ECHO-UDP" test can never be
found...

I'm pushing fixes for it to autobuild now.

metze
metze



signature.asc
Description: OpenPGP digital signature


s4-param: +foo syntax

2010-12-08 Thread Stefan (metze) Metzmacher
Hi Andrew,

> s4-param Allow +foo syntax in smb.conf list parsing
> 
> The idea here is to allow an smb.conf file to work from the defaults,
> rather than override them.  For example, 'server services = +openchange'.

Wouldn't it be clearer to use 'server services += openchange'?

'+' might be a valid character in the list items.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-12-02 Thread Stefan (metze) Metzmacher
Hi Matthias,

> The branch, master has been updated
>via  7a5e47b s4:auth/sam.c-"authsam_expand_nested_groups" - don't fail 
> if we've memberships on non-SAM objects

> diff --git a/source4/auth/sam.c b/source4/auth/sam.c
> index b98830a..6203b96 100644
> --- a/source4/auth/sam.c
> +++ b/source4/auth/sam.c
> @@ -326,11 +326,11 @@ NTSTATUS authsam_expand_nested_groups(struct 
> ldb_context *sam_ctx,
>  
>   status = dsdb_get_extended_dn_sid(dn, &sid, "SID");
>   if (!NT_STATUS_IS_OK(status)) {
> - DEBUG(0, (__location__ ": when parsing DN %s we failed to find 
> our SID component, so we cannot calculate the group token: %s\n",
> -   ldb_dn_get_extended_linearized(tmp_ctx, dn, 1), 
> -   nt_errstr(status)));
> + /* If we fail finding a SID then this is no error since it could
> +  * be a non SAM object - e.g. a group with object class
> +  * "groupOfNames" */
>   talloc_free(tmp_ctx);
> - return NT_STATUS_INTERNAL_DB_CORRUPTION;
> + return NT_STATUS_OK;
>   }

Wouldn't it be better to just catch a specific error code
(NT_STATUS_OBJECT_NAME_NOT_FOUND)
rather than all failures?

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-11-28 Thread Stefan (metze) Metzmacher
Hi Matthias,

> commit b028a6001ad7e440fbd71faa45cad8b5966fac1c
> Author: Matthias Dieter Wallnöfer 
> Date:   Sun Nov 28 12:28:03 2010 +0100
> 
> replace:wscript - change the "bool" checks to be compatible with more 
> platforms
> 
> - If the type was found then we are fine and define "HAVE_BOOL"
> - Othewise we substitute it in "replace.h" as "_Bool" or if not possible 
> as "int"
> - This prevents lot of warnings on platforms where we don't have a "bool" 
> type as Tru64
> - The length check for "bool" is not really useful and therefore removed

That check is useful and I added a few weeks ago, please readd it.

It showed that sizeof(bool) is 1, that means that we might think about
changing the fallback to define 'bool' as 'unsigned char' instead of 'int'.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-11-06 Thread Stefan (metze) Metzmacher
Hi Tridge,

> commit a162b1a2d865c90441789640104adcd982e2bb75
> Author: Andrew Tridgell 
> Date:   Fri Nov 5 18:57:36 2010 +1100
> 
> s4-join: switch over to the new DC join in make test
> 
> commit 724599de635608f13e0f2d500a59b8830ceede84
> Author: Andrew Tridgell 
> Date:   Fri Nov 5 14:16:49 2010 +1100
> 
> samba-tool: deprecate samba-tool vampire command
> 

Does the python join code, use the same network operations
as the C code (and as Windows servers)?

I mean first join as workstation and then promote as dc
and all other details like using dcerpc assoc groups id's
across multiple drsuapi connections.

I think we should make sure a network capture of a samba dc join
and a windows dc join look exactly the same.


metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-11-03 Thread Stefan (metze) Metzmacher
Hi Matthias,

> commit 4902b71a607a0899d1a2d65b80eebdc121f4ef1d
> Author: Matthias Dieter Wallnöfer 
> Date:   Wed Nov 3 09:23:33 2010 +0100
> 
> s4:RPC server - always set the response pad data in base of the request 
> one
> 
> Otherwise it could remain uninitialised - should fix bug #7769.
...
> @@ -220,6 +221,8 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state 
> *call)
>   pkt.u.response.alloc_hint = stub.length;
>   pkt.u.response.context_id = call->pkt.u.request.context_id;
>   pkt.u.response.cancel_count = 0;
> + pkt.u.response._pad.data = call->pkt.u.request._pad.data;
> + pkt.u.response._pad.length = call->pkt.u.request._pad.length;
>   pkt.u.response.stub_and_verifier.data = stub.data;
>   pkt.u.response.stub_and_verifier.length = length;

I'm not sure this is the correct fix.

ndr_push_DATA_BLOB() called with NDR_ALIGN8, should never look at this
values
at all. And if we need to initialize them we should initialize them to zero.

metze



signature.asc
Description: OpenPGP digital signature


Invalid Netbios Names? Re: [SCM] Samba Shared Repository - branch master updated

2010-10-30 Thread Stefan (metze) Metzmacher
Hi Matthieu,

> Author: Matthieu Patou 
> Date:   Thu Oct 28 13:09:51 2010 +0400
> 
> provision: when deriving netbiosname from hostname force the netbiosname 
> to be compliant
> 
> It means no space/_/-/@ and less than 16 chars.

What's wrong with '-'? It's allowed in netbios and dns names.

See http://support.microsoft.com/kb/909264

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-10-27 Thread Stefan (metze) Metzmacher
Hi Matthieu,

> commit 04d63e973efb5b3e1bf677688f5d61ddf13cee42
> Author: Matthieu Patou 
> Date:   Wed Oct 27 00:50:41 2010 +0400
> 
> unit tests: remove smb2.dir
> 
> Tridge says that it's a hard to fix pb and that it's not the priority
> for 4.0.0
...
> diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
> index 3d3ac34..5877f4f 100755
> --- a/source4/selftest/tests.py
> +++ b/source4/selftest/tests.py
> @@ -314,7 +314,7 @@ plantestsuite_loadlist("samba4.ntp.signd", "dc:local", 
> [smb4torture, 'ncacn_np:$
>  # Tests against the NTVFS POSIX backend
>  ntvfsargs = ["--option=torture:sharedelay=1", 
> "--option=torture:oplocktimeout=3", 
> "--option=torture:writetimeupdatedelay=5"]
>  
> -smb2 = smb4torture_testsuites("SMB2-")
> +smb2 = filter(lambda x: "SMB2-DIR" not in x, smb4torture_testsuites("SMB2-"))

Shouldn't this be done, but just adding the test to the skip file?

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-10-22 Thread Stefan (metze) Metzmacher
Hi Matthieu,

>>> --
>>> commit c74ef7acf49f5e447373643c2e28c1dad56f451d
>>> Author: Matthieu Patou
>>> Date:   Fri Oct 22 01:01:53 2010 +0400
>>>
>>>  waf: Mark the replacement zlib private so that it can build on
>>> machine without a system zlib
>>>
>>>  Autobuild-User: Matthieu Patou
>>>  Autobuild-Date: Thu Oct 21 21:47:46 UTC 2010 on sn-devel-104
>>>
>>> commit 4ea7d4694a8353fc55ecd12cb09b9c91ffde7b3f
>>> Author: Matthieu Patou
>>> Date:   Thu Oct 21 02:14:39 2010 +0400
>>>
>>>  replace: use replace for non 'samba' compliant strptime
>>>
>>> commit 2d0ac59fcc490517b202180f49b178ab80c2534e
>>> Author: Matthieu Patou
>>> Date:   Thu Oct 21 00:13:54 2010 +0400
>>>
>>>  replace: use a wrapper around strtoll if it didn't behave as
>>> expected
>> We also need this wscript changes also for the autoconf build
>> in libreplace.m4.
>>
> Is it required for the s3 build ?

Yes and the standalone build in the build-farm also needs it.
See
http://build.samba.org/?tree=libreplace;function=Recent+Builds;sortby=status

It would be also good if we would backport the fixes to the release
branches.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-10-22 Thread Stefan (metze) Metzmacher
Hi Matthieu,

> --
> commit c74ef7acf49f5e447373643c2e28c1dad56f451d
> Author: Matthieu Patou 
> Date:   Fri Oct 22 01:01:53 2010 +0400
> 
> waf: Mark the replacement zlib private so that it can build on machine 
> without a system zlib
> 
> Autobuild-User: Matthieu Patou 
> Autobuild-Date: Thu Oct 21 21:47:46 UTC 2010 on sn-devel-104
> 
> commit 4ea7d4694a8353fc55ecd12cb09b9c91ffde7b3f
> Author: Matthieu Patou 
> Date:   Thu Oct 21 02:14:39 2010 +0400
> 
> replace: use replace for non 'samba' compliant strptime
> 
> commit 2d0ac59fcc490517b202180f49b178ab80c2534e
> Author: Matthieu Patou 
> Date:   Thu Oct 21 00:13:54 2010 +0400
> 
> replace: use a wrapper around strtoll if it didn't behave as expected

We also need this wscript changes also for the autoconf build
in libreplace.m4.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-10-21 Thread Stefan (metze) Metzmacher
Hi Jelmer,

> - Log -
> commit c529317fe2b48e045b35a613cfd1ad3f03b68435
> Author: Jelmer Vernooij 
> Date:   Thu Oct 21 21:43:13 2010 +0200
> 
> Lowercase socket_wrapper name.
> 
> Avoid linking against socket_wrapper outside of developer mode.
> 
> Autobuild-User: Jelmer Vernooij 
> Autobuild-Date: Thu Oct 21 20:26:11 UTC 2010 on sn-devel-104
> 
> ---
> 
> Summary of changes:
>  lib/socket_wrapper/wscript  |2 +-
>  lib/socket_wrapper/wscript_build|2 +-
>  lib/tdb/include/tdb.h   |1 +
>  lib/tdb/tdb.exports |1 +
>  lib/tdb/tdb.signatures  |1 +
>
> diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
> index 115c6fa..38d8197 100644
> --- a/lib/tdb/include/tdb.h
> +++ b/lib/tdb/include/tdb.h
> @@ -101,6 +101,7 @@ void tdb_set_max_dead(struct tdb_context *tdb, int 
> max_dead);
>  
>  int tdb_reopen(struct tdb_context *tdb);
>  int tdb_reopen_all(int parent_longlived);
> +__attribute__((deprecated)) void tdb_logging_function(struct tdb_context 
> *tdb, tdb_log_func);
>  void tdb_set_logging_function(struct tdb_context *tdb, const struct 
> tdb_logging_context *log_ctx);
>  enum TDB_ERROR tdb_error(struct tdb_context *tdb);
>  const char *tdb_errorstr(struct tdb_context *tdb);
> diff --git a/lib/tdb/tdb.exports b/lib/tdb/tdb.exports
> index 73b8fd6..09b9a96 100644
> --- a/lib/tdb/tdb.exports
> +++ b/lib/tdb/tdb.exports
> @@ -23,6 +23,7 @@
> tdb_freelist_size;
> tdb_get_flags;
> tdb_get_logging_private;
> +   tdb_logging_function;
> tdb_get_seqnum;
> tdb_hash_size;
> tdb_increment_seqnum_nonblock;
> diff --git a/lib/tdb/tdb.signatures b/lib/tdb/tdb.signatures
> index 7706d18..1201077 100644
> --- a/lib/tdb/tdb.signatures
> +++ b/lib/tdb/tdb.signatures
> @@ -56,6 +56,7 @@ void tdb_increment_seqnum_nonblock (struct tdb_context *);
>  void tdb_remove_flags (struct tdb_context *, unsigned int);
>  void tdb_setalarm_sigptr (struct tdb_context *, volatile sig_atomic_t *);
>  void tdb_set_logging_function (struct tdb_context *, const struct 
> tdb_logging_context *);
> +void tdb_logging_function(struct tdb_context *tdb, tdb_log_func);
>  void tdb_set_max_dead (struct tdb_context *, int);
>  int tdb_check (struct tdb_context *, int (*) (TDB_DATA, TDB_DATA, void *), 
> void *);
>  TDB_DATA tdb_null;


What have this tdb changes todo with the rest?

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-10-21 Thread Stefan (metze) Metzmacher
Hi Matthias,

> - Log -
> commit 8044a20d8d84e740ca5c6d76bacaa977d691f3d0
> Author: Matthias Dieter Wallnöfer 
> Date:   Thu Oct 21 08:51:46 2010 +0200
> 
> ldb:ldb_modules.c - if we don't find the associated dynamic object then 
> please close the handle
> 
> Autobuild-User: Matthias Dieter Wallnöfer 
> Autobuild-Date: Thu Oct 21 07:52:44 UTC 2010 on sn-devel-104

> diff --git a/source4/lib/ldb/common/ldb_modules.c 
> b/source4/lib/ldb/common/ldb_modules.c
> index ec71c8d..b8f155d 100644
> --- a/source4/lib/ldb/common/ldb_modules.c
> +++ b/source4/lib/ldb/common/ldb_modules.c
> @@ -320,6 +320,7 @@ static void *ldb_dso_load_symbol(struct ldb_context *ldb, 
> const char *name,
>  
>   sym = dlsym(handle, symbol);
>   if (sym == NULL) {
> + dlclose(handle);
>   ldb_debug(ldb, LDB_DEBUG_ERROR, "no symbol `%s' found in %s: 
> %s", symbol, path, dlerror());
>   return NULL;

I think we should call dlclose() after ldb_debug() otherwise dlerror()
may not return
the desired result.

metze



signature.asc
Description: OpenPGP digital signature


ctdb_hash() => jenkins

2010-10-08 Thread Stefan (metze) Metzmacher
Hi Ronnie,

> @@ -99,14 +99,7 @@ bool ctdb_same_address(struct ctdb_address *a1, struct 
> ctdb_address *a2)
>  */
>  uint32_t ctdb_hash(const TDB_DATA *key)
>  {
> - uint32_t value; /* Used to compute the hash value.  */
> - uint32_t i; /* Used to cycle through random values. */
> -
> - /* Set the initial value from the key size. */
> - for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++)
> - value = (value + (key->dptr[i] << (i*5 % 24)));
> -
> - return (1103515243 * value + 12345);  
> + return tdb_jenkins_hash(discard_const(key));
>  }

Don't we need to change the protocol version for this change?

See
http://gitweb.samba.org/?p=metze/ctdb/wip.git;a=shortlog;h=refs/heads/master-tdb

Here're also a few other ctdb/tdb related changes...

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-10-07 Thread Stefan (metze) Metzmacher
Hi Volker,

> - Log -
> commit 342c79e26544ee5345a9d54f68f774d7ce07e530
> Author: Volker Lendecke 
> Date:   Wed Oct 6 15:05:59 2010 +0200
> 
> s3: Make the write end of the echo responder pipe non-blocking
> 
> Without this, we can get a writable pipe end, but the writev call on the 
> pipe
> will block.

Don't we need to add some EAGAIN logic to writev_handler() ?
Currently it only handles EINTR.

metze




signature.asc
Description: OpenPGP digital signature


Re: How this update has slipped in my batch was Re: [SCM] Samba Shared Repository - branch master updated

2010-10-05 Thread Stefan (metze) Metzmacher
Hi Matthieu,

> On 05/10/2010 00:24, Matthieu Patou wrote:
>> The branch, master has been updated
>> via  d09cfc0 unittests: add a test to avoid regression on
>> previous fix
>> via  19f835d unittests: makes the unit tests for ldb.python
>> back in order
>> via  9dcad79 pyldb: test return code before trying to
>> talloc_steal
>> via  b53fbc7 s4:ldap_server: rewrite to socket layer to use
>> tstream
> I'm wondering how this has arrived in the tree given the fact that on my
> private repo git rebase -i master gives me:
>   1 pick ed2f6aa pyldb: test return code before trying to talloc_steal
>   2 pick dd6c604 unittests: makes the unit tests for ldb.python back in
> order
>   3 pick 6f95fec unittests: add a test to avoid regression on previous fix
> 
> Should the latest patch be removed ?

gensec_tls only work with some gnutls version (others have bugs),
that means TLS/SSL support is broken, but we still offer it.

We should add configure checks to only allow TLS/SSL support if the
used gnutls version don't has the handshake bug.
See https://bugzilla.samba.org/show_bug.cgi?id=7218

metze



signature.asc
Description: OpenPGP digital signature


Re: Disabling test for ktpass

2010-08-01 Thread Stefan (metze) Metzmacher
Hi Matthieu,

>> commit 0b4247ef7a60e7fe419681919daa3b31cae7bc48
>> Author: Stefan Metzmacher
>> Date:   Sat Jul 31 11:31:43 2010 +0200
>>
>>  s4:selftest: skip samba4.blackbox.ktpass for now as it's not
>> portable
>>
>>  ktutil might not be installed or from MIT.
>>  We should build a samba4ktutil and use that instead,
>>  until then we need to skip this test.
>>
>>  metze
>>
> Would it be acceptable if the tests checks if ktutil  (and any other
> programs that ktpass depends on ) is present ?
> Matthieu

I'd prefer to build a samba4ktutil as we do for samba4kinit,
this would be useful on its own. As heimdal ktutil is much more useful
than the MIT ktutil, which is installed on most systems.
And they don't have the same user interface.

I'll try to look at this next week.

And we could run the test on all system then.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-07-04 Thread Stefan (metze) Metzmacher
Hi Volker,

Am 04.07.2010 14:59, schrieb Volker Lendecke:
> The branch, master has been updated
>via  ba57d23... s3: ALWAYS run make test before checkin 
>   from  34558ae... s3: Slight reshaping of server_exists_parse
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -
> commit ba57d23c1ce5ef3b6c4b2e5e100a0457b8abdcbf
> Author: Volker Lendecke 
> Date:   Sun Jul 4 14:59:23 2010 +0200
> 
> s3: ALWAYS run make test before checkin 
> 
> ---
> 
> Summary of changes:
>  source3/lib/serverid.c |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
> index e9c7296..dc4834b 100644
> --- a/source3/lib/serverid.c
> +++ b/source3/lib/serverid.c
> @@ -187,8 +187,8 @@ static int server_exists_parse(TDB_DATA key, TDB_DATA 
> data, void *priv)
>* Use memcmp, not direct compare. data.dptr might not be
>* aligned.
>*/
> - state->exists =
> - (memcmp(&unique_id, data.dptr, sizeof(unique_id)) == 0);
> + state->exists = (memcmp(&state->id->unique_id, data.dptr,
> +     sizeof(unique_id)) == 0);
>   return 0;

isn't the "unique_id" variable unused, if we use
sizeof(state->id->unique_id)?

metze



signature.asc
Description: OpenPGP digital signature


s4: rid pool and other provision fixes

2010-06-25 Thread Stefan (metze) Metzmacher
Hi Tridge,

> The local dc account get the value of nextRid and the intial
> rIDAvailablePool starts
> with nextRid + x + 100. x was 0 in my dcpromo with a local rid counter
> of 50.
> I'll test more combinations...
> 
> I'm wondering why x is 1 in some cases and the rIDAvailablePool starts
> at 1101 when nextRid was 1000,
> instead of starting with 1100. Maybe it depends on the functional level.

I've done some testing with a w2k8r2 server and commpared dcpromo with
function levels (forest/domain) 4/4, 3/3, 2/2 and 0/0.

And x is always 0, but I found that we need to create the RID Set for the
local dc in provision, instead of runtime (when the first account is
created).

dcpromo sets the rIDNextRID to lowest value of rIDPreviousAllocationPool.

And as rIDNextRID is not the rid of the next user, but the rid of the
last user,
the first user gets rIDNextRID + 1, which is 1101 in most cases.

I also noticed that rIDUsedPool is never updated on a w2k8r2 server (at
least if it's
the rid master itself).

The changes can be found here:
http://gitweb.samba.org/?p=metze/samba/wip.git;a=shortlog;h=refs/heads/master4-s3upgrade-review

If they're no objections I've planed to push this changes tomorrow if
make test doesn't show
any additional errors.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-06-24 Thread Stefan (metze) Metzmacher
Am 24.06.2010 10:05, schrieb Matthias Dieter Wallnöfer:
> The branch, master has been updated
>via  41cdcd5... s4:provision.ldif - fix the number of available RIDs
>via  fec489b... s4:provision.ldif - this Win2003 revision level seems 
> always to be "9" on Windows Server 2008 machines
>via  64e19ef... s4:provision_users.ldif - change a group description 
> to be correct
>via  560620a... s4:upgradeprovision - fix include order for "ldb"
>via  e228b67... s4/ldb: ldb_msg_el_map_remote() should rename the 
> remote attribute names into local names as defined in simple_ldap_map.c.
>via  e88f37d... s4:setup/provision.reg - raise version to Windows 
> Server 2008 R2
>via  b172b7f... s4:libnet_join.c - always use LDB constants
>   from  f34db12... Add parse_setjob_command() to make setting job state 
> easier for users.
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -
> commit 41cdcd54b7b7e3fb70fdb220e74a1daf30e1891a
> Author: Matthias Dieter Wallnöfer 
> Date:   Thu Jun 24 09:35:58 2010 +0200
> 
> s4:provision.ldif - fix the number of available RIDs
> 
> There should be 4611686014132422209 and not 4611686014132422109.
>
> --- a/source4/setup/provision.ldif
> +++ b/source4/setup/provision.ldif
> @@ -809,7 +809,7 @@ dn: CN=RID Manager$,CN=System,${DOMAINDN}
>  objectClass: top
>  objectClass: rIDManager
>  systemFlags: -1946157056
> -rIDAvailablePool: 1001-1073741823
> +rIDAvailablePool: 1601-1073741823
>  isCriticalSystemObject: TRUE

I don't think that's correct.

me...@sernox:~/devel/samba/ctdb/ctdb$ i 4611686014132422209
4611686014132422209 0x3FFF0641 0374003101
0b1101100101
me...@sernox:~/devel/samba/ctdb/ctdb$ i 0x641
1601 0x641 03101 0b1100101
me...@sernox:~/devel/samba/ctdb/ctdb$ i 4611686014132422109
4611686014132422109 0x3FFF05DD 0374002735
0b11010111011101
me...@sernox:~/devel/samba/ctdb/ctdb$ i 0x5DD
1501 0x5DD 02735 0b10111011101

changing it from 1501 to 1601 on a running system (the first dc already
allocated its own rid pool with 500 entries)
means changing the lower value by 100 and not by 600.

The available pool also depends on the nextRid counter of the local sam,
before the dcpromo.
(which is copied into the 'nextRid' field on the domain object.

The local dc account get the value of nextRid and the intial
rIDAvailablePool starts
with nextRid + x + 100. x was 0 in my dcpromo with a local rid counter
of 50.
I'll test more combinations...

I'm wondering why x is 1 in some cases and the rIDAvailablePool starts
at 1101 when nextRid was 1000,
instead of starting with 1100. Maybe it depends on the functional level.

It also seems that the special dns accounts doesn't get hard coded rids,
they're getting rids from the
first pool the local dc allocates.

metze
metze



signature.asc
Description: OpenPGP digital signature


Re: lanman pwd hash (Re: [SCM] Samba Shared Repository - branch master updated)

2010-06-23 Thread Stefan (metze) Metzmacher
Am 23.06.2010 09:08, schrieb Matthias Dieter Wallnöfer:
> Hi metze,
> 
> I reject it when the lanman auth is deactivated. But otherwise it should
> be enabled (think at "dcesrv_samr_ChangeOemPassword2" which manipulates
> only the lanman hash - tested using the passwords torture test).
> Therefore it should also be valid to have only a "dBCSPwd" attribute in
> the DB (I read also the MS-SAMR documentation and this seems possible).
> But this patch prevents a change which would delete all password
> attributes - which is fatal.

I just noticed this:

-   if (!lp_lanman_auth(lp_ctx)) {
-   ldb_asprintf_errstring(ldb,
-   "check_password_restrictions: "
-   "The password change through the
LM hash is deactivated!");
-   return LDB_ERR_UNWILLING_TO_PERFORM;
-   }

and didn't realized that this check was implicitly readded by this:

+   /* refuse the change if someone tries to set/change the password by
+* the lanman hash alone and we've deactivated that mechanism. This
+* would end in an account without any password! */
+   if ((!io->n.cleartext_utf8) && (!io->n.cleartext_utf16)
+   && (!io->n.nt_hash) && (!io->n.lm_hash)) {
+   ldb_asprintf_errstring(ldb,
+   "setup_io: "
+   "The password change/set operations performed
using the LAN Manager hash alone are deactivated!");
+   return LDB_ERR_UNWILLING_TO_PERFORM;
+   }
+

metze



signature.asc
Description: OpenPGP digital signature


lanman pwd hash (Re: [SCM] Samba Shared Repository - branch master updated)

2010-06-22 Thread Stefan (metze) Metzmacher
Hi Matthias,

> commit 0e637be43b584aef9f5101d15ae5bdc1172c5502
> Author: Matthias Dieter Wallnöfer 
> Date:   Mon Jun 21 19:40:50 2010 +0200
> 
> s4:password_hash LDB module - fix another problem regarding the lanman 
> hash
> 
> When a user only provides only the lanman hash (and nothing else) and the
> lanman authentication is deactivated then we end in an account with no
> password attribute at all! Lock this down.

I think the correct behavior is to reject the password change in that case.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-06-10 Thread Stefan (metze) Metzmacher
Hi Björn,

> - Log -
> commit ec94efb79d4516b09c7d1d93a4ff8ce0f7046f41
> Author: Björn Jacke 
> Date:   Thu Jun 10 17:19:16 2010 +0200
> 
> s3: fix build on HP-UX
> 
> this struct member h_errno is not used in the HP-UX code paths, it was 
> just
> there because Solaris has it, too. As h_errno is a function call macro on 
> HP-UX
> when thread support is enabled we run into trouble here. Just commenting 
> it out
> should be okay as we don't use it anyway.
> 
> ---
> 
> Summary of changes:
>  nsswitch/winbind_nss_hpux.h |7 ++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/nsswitch/winbind_nss_hpux.h b/nsswitch/winbind_nss_hpux.h
> index 40a352d..393c0a3 100644
> --- a/nsswitch/winbind_nss_hpux.h
> +++ b/nsswitch/winbind_nss_hpux.h
> @@ -130,7 +130,12 @@ typedef struct nss_XbyY_args {
>  
>   void *returnval;
>   int erange;
> - int h_errno;
> + /*
> + *  h_errno is defined as function call macro for multithreaded 
> applications
> + *  in HP-UX. *this* h_errno is not used in the HP-UX codepath of our nss
> + *  modules, so let's simply comment it out here:
> + * int h_errno;
> + */
>   nss_status_t status;
>  } nss_XbyY_args_t;

Aren't this structures of fixed predefined size?
Don't we use this to cast a given buffer into something we use?

If so args->status is wrong now and we better keep an 'int _not_used'.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-05-31 Thread Stefan (metze) Metzmacher
Am 31.05.2010 19:23, schrieb Jelmer Vernooij:
> The branch, master has been updated
>via  7f75ee0... ldb: Install ldb_handlers.h header.
>via  fe8302b... ldb: Remove Samba-specific symbols.
>via  1bc53f0... ldb: Move utility functions to separate file.
>via  82d56b9... ldb: Fix dependencies when building with system ldb.
>   from  471ed70... s3:smbd map_username() doesn't need sconn anymore
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -
> commit 7f75ee025ff9c02763fb9201d94af4b2739c8e03
> Author: Jelmer Vernooij 
> Date:   Mon May 31 18:29:11 2010 +0200
> 
> ldb: Install ldb_handlers.h header.
> 
> commit fe8302b235197e359a20ba0489eb72b54793963e
> Author: Jelmer Vernooij 
> Date:   Mon May 31 18:28:09 2010 +0200
> 
> ldb: Remove Samba-specific symbols.
> 
> commit 1bc53f0213b04e30ebf2ac60695c84c5781e4e72
> Author: Jelmer Vernooij 
> Date:   Mon May 31 18:12:05 2010 +0200
> 
> ldb: Move utility functions to separate file.
> 
> commit 82d56b937445585b9e60451daf660aee5ace0523
> Author: Jelmer Vernooij 
> Date:   Mon May 31 16:05:41 2010 +0200
> 
> ldb: Fix dependencies when building with system ldb.

I'm getting this again:

[1862/1965] abi_check: source4/bin/default/source4/lib/ldb/libldb-samba4.so
libldb-samba4.so: symbol ldb_wrap_connect has been added - please mark
it _PRIVATE_ or update minor version
signature: struct ldb_context *(TALLOC_CTX *, struct
tevent_context *, struct loadparm_context *, const char *, struct
auth_session_info *, struct cli_credentials *, unsigned int)
libldb-samba4.so: symbol ldb_register_samba_handlers has been added -
please mark it _PRIVATE_ or update minor version
signature: int (struct ldb_context *)
libldb-samba4.so: symbol ldb_wrap_fork_hook has been added - please mark
it _PRIVATE_ or update minor version
signature: void (void)
libldb-samba4.so: symbol ldb_samba_syntax_by_lDAPDisplayName has been
added - please mark it _PRIVATE_ or update minor version
signature: const struct ldb_schema_syntax *(struct ldb_context
*, const char *)
libldb-samba4.so: symbol ldb_samba_syntax_by_name has been added -
please mark it _PRIVATE_ or update minor version
    signature: const struct ldb_schema_syntax *(struct ldb_context
*, const char *)
Waf: Leaving directory `/home/metze/master4/source4/bin'
Build failed: ABI for libldb-samba4.so has changed - please fix library
version then build with --abi-update
See http://wiki.samba.org/index.php/Waf#ABI_Checking for more information
make: *** [all] Fehler 1

metze
> ---
> 
> Summary of changes:
>  source4/auth/wscript_build |2 +-
>  source4/dsdb/wscript_build |2 +-
>  source4/lib/ldb/ABI/ldb-samba4-0.9.11.sigs |5 --
>  source4/lib/ldb/pyldb_util.c   |   81 
> 
>  source4/lib/ldb/tools/cmdline.c|   10 ++--
>  source4/lib/ldb/tools/ldbedit.c|7 +++
>  source4/lib/ldb/tools/ldbsearch.c  |6 ++
>  source4/lib/ldb/tools/ldbtest.c|5 ++
>  source4/lib/ldb/wscript|   25 ++---
>  source4/scripting/python/wscript_build |2 +-
>  10 files changed, 124 insertions(+), 21 deletions(-)
>  create mode 100644 source4/lib/ldb/pyldb_util.c
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/source4/auth/wscript_build b/source4/auth/wscript_build
> index 349171e..db8fdf8 100644
> --- a/source4/auth/wscript_build
> +++ b/source4/auth/wscript_build
> @@ -12,7 +12,7 @@ bld.SAMBA_SUBSYSTEM('auth_session',
>   public_deps='CREDENTIALS',
>   public_headers='session.h',
>  header_path='samba',
> - deps='SAMDB'
> + deps='SAMDB auth_sam'
>   )
>  
>  
> diff --git a/source4/dsdb/wscript_build b/source4/dsdb/wscript_build
> index 1bf8413..0a1ea1c 100644
> --- a/source4/dsdb/wscript_build
> +++ b/source4/dsdb/wscript_build
> @@ -51,6 +51,6 @@ bld.SAMBA_MODULE('DNS_UPDATE_SRV',
>  
>  bld.SAMBA_PYTHON('python_dsdb',
>   source='pydsdb.c',
> - deps='SAMDB pyldb',
> + deps='SAMDB pyldb_util',
>   realname='samba/dsdb.so'
>   )
> diff --git a/source4/lib/ldb/ABI/ldb-samba4-0.9.11.sigs 
> b/source4/lib/ldb/ABI/ldb-samba4-0.9.11.sigs
> index 4639220..2206e79 100644
> --- a/source4/lib/ldb/ABI/ldb-samba4-0.9.11.sigs
> +++ b/source4/lib/ldb/ABI/ldb-samba4-0.9.11.sigs
&

Re: [SCM] Samba Shared Repository - branch master updated

2010-05-31 Thread Stefan (metze) Metzmacher
Hi Jelmer,

> - Log -
> commit 8c017022dbb78966589fa98e03dea01d91d003b0
> Author: Jelmer Vernooij 
> Date:   Mon May 31 13:55:17 2010 +0200
> 
> talloc: Don't set is_bundled for standalone build.
> 
> commit 151e239bcf2860411527a953d627b2d724c0a57e
> Author: Jelmer Vernooij 
> Date:   Mon May 31 13:51:49 2010 +0200
> 
> ldb/waf: Fix build with system and bundled ldb.

Please test your changes without system libraries,
and make sure it still works.

Currently make bin/smbtorture4 in the merged build gets this:
http://pastie.org/985637

(I assume the s4 build will have the same problem)

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-05-31 Thread Stefan (metze) Metzmacher
Hi Jelmer,

> diff --git a/lib/talloc/wscript b/lib/talloc/wscript
> index 3a87506..61930f6 100644
> --- a/lib/talloc/wscript
> +++ b/lib/talloc/wscript
> @@ -60,14 +60,14 @@ def build(bld):
>abi_file='ABI/talloc-%s.sigs' % VERSION,
>abi_match='talloc* _talloc*',
>hide_symbols=True,
> -  vnum=VERSION)
> +  vnum=VERSION, is_bundled=True)
>  
>  # should we also install the symlink to libtalloc1.so here?
>  bld.SAMBA_LIBRARY('talloc-compat1',
>'compat/talloc_compat1.c',
>deps='talloc',
>enabled = bld.env.TALLOC_COMPAT1,
> -  vnum=VERSION)
> +  vnum=VERSION, is_bundled=True)
>

shouldn't we use 'not bld.env.standalone_talloc' instead of 'True'
here too?

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-05-24 Thread Stefan (metze) Metzmacher
Hi Björn,


> -dnl Check if the C compiler understands -Werror
> +dnl Check if the C compiler understands -Werror (GNU)
>  AC_CACHE_CHECK([that the C compiler understands 
> -Werror],samba_cv_HAVE_Werror, [
>   AC_TRY_RUN_STRICT([
>int main(void)
> @@ -286,7 +286,7 @@ AC_CACHE_CHECK([that the C compiler understands 
> -w2],samba_cv_HAVE_w2, [
>  if test x"$samba_cv_HAVE_w2" = x"yes"; then
> Werror_FLAGS="-w2"
>  else
> -dnl Check if the C compiler understands -errwarn
> +dnl Check if the C compiler understands -errwarn (Sun)
>  AC_CACHE_CHECK([that the C compiler understands 
> -errwarn],samba_cv_HAVE_errwarn, [
>AC_TRY_RUN_STRICT([
> int main(void)
> @@ -297,6 +297,18 @@ AC_CACHE_CHECK([that the C compiler understands 
> -errwarn],samba_cv_HAVE_errwarn,
>  if test x"$samba_cv_HAVE_errwarn" = x"yes"; then
> Werror_FLAGS="-errwarn=%all"
>  fi
> +else
> +dnl Check if the C compiler understands -qhalt (IBM)
> +AC_CACHE_CHECK([that the C compiler understands 
> -qhalt],samba_cv_HAVE_errwarn, [
> +  AC_TRY_RUN_STRICT([
> +   int main(void)
> +   {
> + return 0;
> +   }],[$CFLAGS -qhalt=w],[$CPPFLAGS],[$LDFLAGS],
> +   
> samba_cv_HAVE_qhalt=yes,samba_cv_HAVE_qhalt=no,samba_cv_HAVE_qhalt=cross)])
> +if test x"$samba_cv_HAVE_qhalt" = x"yes"; then
> +   Werror_FLAGS="-qhalt=w"
> +fi

I think we also need -qhalt=e here, to match -Werror.

I'm wondering if --errwarn is the correct thing for the sun case...

metze




signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-05-21 Thread Stefan (metze) Metzmacher
Am 21.05.2010 21:09, schrieb Jeremy Allison:
> The branch, master has been updated
>via  efb2922... Make krb5 over SMB2 identical to the way we handle it 
> in SMB1.
>   from  f576cc5... Doh! If you're going to give advice in "useage", make 
> sure it's correct.
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -
> commit efb29227fa46e2c9420b3158ef7422aea4f5846e
> Author: Jeremy Allison 
> Date:   Fri May 21 12:08:18 2010 -0700
> 
> Make krb5 over SMB2 identical to the way we handle it in SMB1.
> 
> Jeremy.

I guess we still need the chunked message support, it's less likely
to happen with the smb2 buffer sizes and a really large krb5 PAC
should not cause problems in production environments later...

metze



Re: [SCM] Samba Shared Repository - branch master updated

2010-04-27 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> - Log -
> commit a94a4b788c3056068d0c8e42c55e990f418db666
> Author: Jeremy Allison 
> Date:   Mon Apr 26 20:11:59 2010 -0700
> 
> Plumb in get_nt_acl into SMB2.
> 
> Jeremy.

>   /* the levels directly map to the passthru levels */
>   file_info_level = in_file_info_class + 1000;
> @@ -392,7 +408,59 @@ static struct tevent_req 
> *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
>   break;
>   }
>  
> + case 0x03:/* SMB2_GETINFO_SEC */
> + {
> + uint8_t *p_marshalled_sd = NULL;
> + size_t sd_size = 0;

I think we should check in_file_info_class for the correct value here
and maybe return an error instead of ignoring it.

> + status = smbd_do_query_security_desc(conn,
> + state,
> + fsp,
> + /* Security info wanted. */
> + in_additional_information,
> + in_output_buffer_length,
> + &p_marshalled_sd,
> + &sd_size);
> +
> + if (NT_STATUS_EQUAL(status, NT_STATUS_BUFFER_TOO_SMALL)) {
> + /* Return needed size. */
> + state->out_output_buffer = data_blob_talloc(state,
> + NULL,
> + 4);
> + if (tevent_req_nomem(state->out_output_buffer.data, 
> req)) {
> + return tevent_req_post(req, ev);
> + }
> + 
> SIVAL(state->out_output_buffer.data,0,(uint32_t)sd_size);
> + state->status = NT_STATUS_BUFFER_TOO_SMALL;
> + break;

don't we need to make sure that in_output_buffer_length is at least 4?

> + }
> + if (!NT_STATUS_IS_OK(status)) {
> + DEBUG(10,("smbd_smb2_getinfo_send: "
> +  "smbd_do_query_security_desc of %s failed "
> +  "(%s)\n", fsp_str_dbg(fsp),
> +  nt_errstr(status)));
> + tevent_req_nterror(req, status);
> + return tevent_req_post(req, ev);
> + }
> +
> + if (sd_size > 0) {
> + state->out_output_buffer = data_blob_talloc(state,
> + 
> p_marshalled_sd,
> + sd_size);
> +     if (tevent_req_nomem(state->out_output_buffer.data, 
> req)) {
> + return tevent_req_post(req, ev);
> + }
> + }

can't we use talloc_move here and avoid a memdup?

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-04-27 Thread Stefan (metze) Metzmacher
Hi Tridge,

> commit c375b90f5d1b1cbef2896f9a9d5964126ce82022
> Author: Andrew Tridgell 
> Date:   Mon Apr 26 21:49:37 2010 +1000
> 
> s4-getncchanges: honor DRSUAPI_DRS_REF_GCSPN
> 
> this is an alternative way of establishing repsTo
> 

I think we should use that when we act as client...

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-04-27 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> - Log -
> commit 6beba782f1bf951236813e0b46115b8102212c03
> Author: Jeremy Allison 
> Date:   Mon Apr 26 10:54:33 2010 -0700
> 
> Fix crash when rescheduling oplock open.

> + /*
> +  * This is subtle. We must null out the callback
> +  * before resheduling, else the first call to
> +  * tevent_req_nterror() causes the _receive()
> +  * function to be called, this causing tevent_req_post()
> +  * to crash.
> +  */
> + tevent_req_set_callback(smb2req->subreq, NULL, NULL);
> +
>   im = tevent_create_immediate(smb2req);
>   if (!im) {
>   smbd_server_connection_terminate(smb2req->sconn,

I'm not sure this is correct.

I haven't looked in detail, but this looks like just hiding the real
problem.

The real problem is likely that we're abusing the tevent_req guidelines.

I think 8f67f873ace91964da066c421986e260aceba75b is maybe ok, for
getting stuff working, but I'd like to see the design changed.

smb2_deferred_open_timer() should not call smbd_smb2_request_dispatch().

The re-entrant should happen inside the smbd_smb2_create_* code,
the place were it decides to go async, instead of two layers above.

I think the smbd_smb2_create_* should setup a
smb2req->retry_callback(struct tevent_req *) function pointer.
smb2_deferred_open_timer() would then just call it should just call it.

I'd like to have something similar for smb1 (I know it would be a lot of
work), but the layer violation is really confusing.

The top level smb1/2 server code should not see any of this retry logic,
it should just do a foo_send() call set it's callback
on the returned tevent_req and get the final result with foo_recv().
All magic should be in one spot in the lower level.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-04-24 Thread Stefan (metze) Metzmacher
Hi Volker,

> - Log -
> commit dbb7db6c2532bb18674c6acea27688f22c41efb8
> Author: Volker Lendecke 
> Date:   Sat Apr 24 11:11:45 2010 +0200
> 
> s3: sendto_domain() is lo longer used

That's great and simplifies winbind a lot, thanks for the good work!

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-04-19 Thread Stefan (metze) Metzmacher
Matthias Dieter Wallnöfer schrieb:
> Sorry Jelmer,
> 
> this wasn't clear (to prevent the use of "TALLOC_FREE"). But a real
> issue is the fact that we have already approximately 150-200 occourences
> of it under "source4" (checked with "cscope"). And we merge more and
> more with the s3 codebase so we get more and more occourences. Therefore
> I would simply propose to allow it for s4 as well.

I think it's fine to use it also in source4.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2010-04-14 Thread Stefan (metze) Metzmacher
tri...@samba.org schrieb:
>  > Author: Andrew Tridgell 
>  > Date:   Wed Apr 14 23:38:05 2010 +1000
>  > 
>  > Merge branch 'master' of ssh://git.samba.org/data/git/samba
> 
> sorry, I forgot a --rebase on a git pull

git config --help tells you how to make that the default for a branch...:-)

metze



signature.asc
Description: OpenPGP digital signature


SMB2 oplocks

2010-04-07 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> - Log -
> commit 3413cf7a6bd992fa722cc9674176beb15446502b
> Author: Jeremy Allison 
> Date:   Wed Apr 7 19:00:44 2010 -0700
> 
> Start to plumb smb2 into the oplock system. Calls dummy functions for now.

Do you noticed that smbd_smb2_send_oplock_break() already exists and you
just have to call it from send_smb2_break_message()?

metze




signature.asc
Description: OpenPGP digital signature


Make smbd_lock_socket/smbd_unlock_socket recursive with a ref_count.

2010-04-01 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> - Log -
> commit 6800fdbb81130b79c2e077e9a7fcbe2d5e0813cb
> Author: Jeremy Allison 
> Date:   Wed Mar 31 17:40:30 2010 -0700
> 
> Make smbd_lock_socket/smbd_unlock_socket recursive with a ref_count.
> 
> As these always call exit_server, make that part of the function.
> Use _internal functions for the echo client.
> 
> Metze please check !

The changes look ok...

> Summary of changes:
>  source3/smbd/globals.h |   10 -
>  source3/smbd/process.c |   78 +--
>  source3/smbd/reply.c   |   17 ++---
>  source3/smbd/smb2_read.c   |8 
>  source3/smbd/smb2_server.c |2 +-
>  source3/smbd/smb2_write.c  |9 +
>  6 files changed, 68 insertions(+), 56 deletions(-)

But please make use of 'git add -i', 'git diff --cached', 'git commit'
to select only the related changes into the commit
and then use 'git show' to see what's in the commit.

metze



signature.asc
Description: OpenPGP digital signature


getting rid of utf8string2

2010-03-24 Thread Stefan (metze) Metzmacher
Hi Simo,


> diff --git a/librpc/idl/idl_types.h b/librpc/idl/idl_types.h
> index e8b3da5..d763a8b 100644
> --- a/librpc/idl/idl_types.h
> +++ b/librpc/idl/idl_types.h
> @@ -48,9 +48,10 @@
>  #define utf8string   [flag(STR_UTF8|STR_NULLTERM)] string
>  
>  /*
> -  an utf8 string prefixed with [size], 32 bits
> +  an utf8 string prefixed with [length], 32 bits

This should be [size] when you use STR_SIZE4...

> +  not null terminated
>  */
> -#define utf8string2  [flag(STR_UTF8|STR_SIZE4)] string
> +#define utf8string2  [flag(STR_SIZE4|STR_UTF8|STR_NOTERM)] string

I'd like to get rid of this as you can express the same with valid NDR.

Something like:

[value(strlen(dns_name))] uint32 dns_name_size;
[charset(UTF8)] uint8 dns_name[dns_name_size];

should do the same.

Can you send me a file I can pass to ndrdump to test it?

metze

PS: It would be nice if you wouldn't introduce leading whitespaces in
the idl file...:-)



signature.asc
Description: OpenPGP digital signature


tdb recovery fixes

2010-02-24 Thread Stefan (metze) Metzmacher
Hi Rusty,

does it make sense to create a new tdb version,
or do you have some more changes pending?

metze

> The branch, master has been updated
>via  ec96ea6... tdb: handle processes dying during transaction commit.
>via  1bf482b... patch tdb-refactor-tdb_lock-and-tdb_lock_nonblock.patch
>via  ececeff... tdb: add -k option to tdbtorture
>via  8c3fda4... tdb: don't truncate tdb on recovery
>via  9f295ee... tdb: remove lock ops
>via  a84222b... tdb: rename tdb_release_extra_locks() to 
> tdb_release_transaction_locks()
>via  dd1b508... tdb: cleanup: remove ltype argument from 
> _tdb_transaction_cancel.
>via  fca1621... tdb: 
> tdb_allrecord_lock/tdb_allrecord_unlock/tdb_allrecord_upgrade
>via  caaf5c6... tdb: suppress record write locks when allrecord lock 
> is taken.
>via  9341f23... tdb: cleanup: always grab allrecord lock to infinity.
>via  1ab8776... tdb: remove num_locks
>via  d48c3e4... tdb: use tdb_nest_lock() for seqnum lock.
>via  4738d47... tdb: use tdb_nest_lock() for active lock.
>via  9136818... tdb: use tdb_nest_lock() for open lock.
>via  e8fa70a... tdb: use tdb_nest_lock() for transaction lock.
>via  ce41411... tdb: cleanup: find_nestlock() helper.
>via  db27073... tdb: cleanup: tdb_release_extra_locks() helper
>via  fba42f1... tdb: cleanup: tdb_have_extra_locks() helper
>via  b754f61... tdb: don't suppress the transaction lock because of 
> the allrecord lock.
>via  5d9de60... tdb: cleanup: tdb_nest_lock/tdb_nest_unlock
>via  e9114a7... tdb: cleanup: rename global_lock to allrecord_lock.
>via  7ab422d... tdb: cleanup: rename GLOBAL_LOCK to OPEN_LOCK.
>via  a6e0ef8... tdb: make _tdb_transaction_cancel static.
>via  452b4a5... tdb: cleanup: split brlock and brunlock methods.
>   from  fffdce6... s4/schema: Move msDS-IntId implementation to samldb.c 
> module




signature.asc
Description: OpenPGP digital signature


tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD

2010-02-18 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> - Log -
> commit 936828de71023d90aaec6c1dba84052246bbad11
> Author: Jeremy Allison 
> Date:   Wed Feb 17 09:24:34 2010 -0800
> 
> Fix commit d07cd37b993d3c9beded20323174633b806196b5
> 
> Which was:
> 
> tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD
> 
> Metze, this has to have been wrong - you are throwing away the 
> talloc_realloc
> pointer returned. Also no error checking. Please review.
> 
> Thank goodness for gcc warnings :-).

talloc_realloc would only shrink the size and can't fail, but it's good
to remove the warnings (you were faster with your commit because I had
no internet link...)

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2009-12-06 Thread Stefan (metze) Metzmacher
Tim Prouty schrieb:
> 
> On Dec 4, 2009, at 2:47 AM, Stefan (metze) Metzmacher wrote:
> 
>> Hi Tim,
>>
>> > diff --git a/source4/selftest/knownfail b/source4/selftest/knownfail
>> > index e2ae2cf..37c9f6a 100644
>> > --- a/source4/selftest/knownfail
>> > +++ b/source4/selftest/knownfail
>> > @@ -10,9 +10,7 @@ base.delete.*.deltest20a
>> >  base.delete.*.deltest20b
>> >  raw.rename.*.osxrename
>> >  raw.rename.*.directory rename
>> > +raw.sfileinfo.*.END_OF_FILE
>> >  rpc.winreg.*security
>> >  samba4.local.registry.(dir|ldb).check hive security
>> >  samba4.local.registry.local.security
>> >
>> > Unfortunately, I'm still seeing failures in source4 'make test'.  Am I
>> > missing
>> > something simple?
>>
>> yes, it's END-OF-FILE not END_OF_FILE:-)
>>
> 
> Thanks for the followup.  This should be fixed now as of:
> 5c857768d1415c4e70a9b7a96b8a9de1ec8efdee

Yes, thanks!

metze




signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2009-12-04 Thread Stefan (metze) Metzmacher
Hi Tim,

> diff --git a/source4/selftest/knownfail b/source4/selftest/knownfail
> index e2ae2cf..37c9f6a 100644
> --- a/source4/selftest/knownfail
> +++ b/source4/selftest/knownfail
> @@ -10,9 +10,7 @@ base.delete.*.deltest20a
>  base.delete.*.deltest20b
>  raw.rename.*.osxrename
>  raw.rename.*.directory rename
> +raw.sfileinfo.*.END_OF_FILE
>  rpc.winreg.*security
>  samba4.local.registry.(dir|ldb).check hive security
>  samba4.local.registry.local.security
> 
> Unfortunately, I'm still seeing failures in source4 'make test'.  Am I
> missing
> something simple?

yes, it's END-OF-FILE not END_OF_FILE:-)

metze



s4-drs: cope with bogus empty attributes from w2k8-r2 (Re: [SCM] Samba Shared Repository - branch master updated)

2009-11-28 Thread Stefan (metze) Metzmacher
Hi Tridge,

> The branch, master has been updated
>via  1287c1d... s4-drs: cope with bogus empty attributes from w2k8-r2
>   from  db41a0a... s4: fix SD update and password change in upgrade script
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -
> commit 1287c1d115fb7e8f3954bc05ff65007968403a9c
> Author: Andrew Tridgell 
> Date:   Sat Nov 28 13:27:06 2009 +1100
> 
> s4-drs: cope with bogus empty attributes from w2k8-r2
> 
> w2k8-r2 sometimes sends empty attributes with completely bogus attrid
> values in a DRS replication response. This allows us to continue with
> the vampire operation despite these broken elements.
> 
> ---
> 
> Summary of changes:
>  source4/dsdb/repl/replicated_objects.c |   17 +
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/source4/dsdb/repl/replicated_objects.c 
> b/source4/dsdb/repl/replicated_objects.c
> index 020d5f1..a8a93e4 100644
> --- a/source4/dsdb/repl/replicated_objects.c
> +++ b/source4/dsdb/repl/replicated_objects.c
> @@ -129,6 +129,15 @@ static WERROR dsdb_convert_object_ex(struct ldb_context 
> *ldb,
>   }
>  
>   status = dsdb_attribute_drsuapi_to_ldb(ldb, schema, a, 
> msg->elements, e);
> + if (!NT_STATUS_IS_OK(status) && a->value_ctr.num_values == 0) {
> + /* w2k8-r2 occasionally sends bogus empty
> +attributes with rubbish attribute IDs. The
> +only think we can do is discard these */
> + DEBUG(0,(__location__ ": Discarding bogus empty 
> DsReplicaAttribute with attid 0x%x\n",
> +  a->attid));
> + ZERO_STRUCTP(e);
> + continue;
> + }
>   W_ERROR_NOT_OK_RETURN(status);
>  
>   m->attid= a->attid;
> @@ -149,6 +158,14 @@ static WERROR dsdb_convert_object_ex(struct ldb_context 
> *ldb,
>   }
>   }
>  
> + /* delete any empty elements */
> + for (i=0; i < msg->num_elements; i++) {
> + if (msg->elements[i].name == NULL) {
> + ldb_msg_remove_element(msg, &msg->elements[i]);
> + i--;
> +     }
> + }
> +

We need to be careful about this, an empty element means
we should remove existing values.
If remove the empty ones here, we need to let the repl_meta_data module
remove them based on the received meta_data array.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated

2009-11-26 Thread Stefan (metze) Metzmacher
Hi Tim,

>> The branch, master has been updated
>>   via  17caf63... s3 selftest: Add RAW-SFILEINFO-END-OF-FILE to
>> selftest
>>   via  af610a6... s3 setfileinfo: Open with FILE_WRITE_DATA when
>> setting the file size
>>   via  b6f9722... s4 torture: Change RAW-OPLOCK to use the
>> documented version of SET_END_OF_FILE_INFO
>>   via  98f5950... s4 torture: Allow onefs to be checked like
>> samba3 and samba4
>>   via  6074a05... s4 torture: Add two new setfileinfo tests
>>   via  ce9ac3a... s4 torture: Split up the torture suite setup for
>> RAW-SFILEINFO
>>  from  56eca75... The start of a WHATSNEW for Samba4 alpha9
>>
>> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
>>
>>
>> commit ce9ac3a685e2a23b30952bf20dbe3f9bf24dfaaa
>> Author: Tim Prouty 
>> Date:   Tue Nov 24 16:25:02 2009 -0800
>>
>>s4 torture: Split up the torture suite setup for RAW-SFILEINFO
>>
>>A side effect of this change is that RAW-SFILEINFO now runs the whole
>>suite instead of just the first test.  I changed the name of the first
>>test to RAW-SFILEINFO-BASE and changed all of the selftest scripts
>>that call it.
> 
> I would like to solicit some help from a selftest/samba 4 expert on how
> to get selftest working with this recent commit.
> 
> RAW-SFILEINFO was explcitly defined in raw.c along with subtests such as
> RAW-SFILEINFO-BUG.  I modified RAW-SFILEINFO to reference the suite of
> tests which now includes subtests such as RAW-SFILEINFO-BUG.  Since it
> is no longer possible to have a specific test called RAW-SFILEINFO, I
> modified it to be called RAW-SFILEINFO-BASE.
> 
> I changed all of the samba3 make test references from RAW-SFILEINFO to
> RAW-SFILEINFO-BASE, but I'm having trouble doing the same in samba4.  I
> tried changing source4/selftest/quick to include a line
> "raw.sfileinfo.base" rather than "raw.sfileinfo", but it doesn't seem to
> parse correctly and just skips the test.  I could just remove it from
> quicktest, but that seems like a last resort.  Additionally, the full
> 'make test' far samba4 needs a similar adjustment.
> 
> I've been looking at this now for a few hours and need some guidance
> from someone who knows how this all fits together a little better than
> me :).

The reason is that we use smbtorture --list in source4/selftest/tests.sh
and --list only outputs the first 2 levels of torture suites nesting.

So we just pass RAW-SFILEINFO to smbtorture, which means it runs all
subtests.

me...@sam[sernet]:~/master4/source4 > bin/smbtorture --list |grep SFIL
RAW-SFILEINFO
me...@sam[sernet]:~/master4/source4 > bin/smbtorture //127.0.0.45/bla
RAW-SFILEINFO
Using seed 1259237626
test: BASE
Failed to open connection - NT_STATUS_CONNECTION_REFUSED
error: BASE [
Unknown error/failure
]
test: RENAME
Failed to open connection - NT_STATUS_CONNECTION_REFUSED
error: RENAME [
Unknown error/failure
]
test: BUG
Failed to open connection - NT_STATUS_CONNECTION_REFUSED
error: BUG [
Unknown error/failure
]
test: END-OF-FILE
Failed to open connection - NT_STATUS_CONNECTION_REFUSED
error: END-OF-FILE [
Unknown error/failure
]
test: END-OF-FILE-ACCESS
Failed to open connection - NT_STATUS_CONNECTION_REFUSED
error: END-OF-FILE-ACCESS [
Unknown error/failure
]
me...@sam[sernet]:~/master4/source4 > bin/smbtorture //127.0.0.45/bla
RAW-SFILEINFO-BUG
Using seed 1259237640
test: BUG
Failed to open connection - NT_STATUS_CONNECTION_REFUSED
error: BUG [
Unknown error/failure
]


As we're getting this in make test now:

UNEXPECTED(failure): samba4.raw.sfileinfo (dc).END-OF-FILE
command: ./bin/smbtorture --configfile=$SMB_CONF_PATH
--maximum-runtime=1200 --target=samba4
--basedir=/home/metze/tmp/st-master4/s4client
--option=torture:progress=no --format=subunit //$SERVER/tmp
-U$USERNAME%$PASSWORD --option=torture:sharedelay=1
--option=torture:oplocktimeout=3
--option=torture:writetimeupdatedelay=5 RAW-SFILEINFO
ERROR: Testsuite[samba4.raw.sfileinfo (dc)]
REASON: Exit code was 1


we should add something like "raw.sfileinfo.*.END-OF-FILE" to
source4/selftest/knownfail

metze



signature.asc
Description: OpenPGP digital signature


LIBREPLACE_LIBS in s3 (Re: [SCM] Samba Shared Repository - branch master updated)

2009-11-01 Thread Stefan (metze) Metzmacher
Hi Björn.

> - Log -
> commit a80a0b7728de21e992f8f0b3e31b600441a6535d
> Author: Björn Jacke 
> Date:   Sat Oct 31 10:37:44 2009 +0100
> 
> s3:Makefile: add LIBREPLACE_LIBS for talloc, tdb and wbclient

I think talloc and tdb should not get LIBREPLACE_NETWORK_LIBS
linked in... they don't include "system/network.h" from libreplace.
And the standalone builds also doesn't use LIBREPLACE_NETWORK at all.

I think it's a bit confusing to have LIBREPLACE_LIBS as the same
as LIBREPLACE_NETWORK_LIBS.




signature.asc
Description: OpenPGP digital signature


Linking Shared Libraries and Modules (Re: [SCM] Samba Shared Repository - branch master updated)

2009-10-20 Thread Stefan (metze) Metzmacher
Hi Björn,

> - Log -
> commit 4243e6e3a904d2f3deb72a6ba456c49233d9af51
> Author: Björn Jacke 
> Date:   Tue Oct 20 08:01:52 2009 +0200
> 
> s3:configure: add support for Solaris' ld -z ignore
> 
> try linker flags for ignoring unused libs in this order:
> -Wl,--as-needed (gcc like + binutils)
> -Wl,-z,ignore (gcc like + Solaris linker)
> -z ignore (old Sun C)

> -# Linker command to link a RPC, VFS, AUTH, CHARSET or PASSDB module.
> +# Linker command to link our shared libraries:
>  SHLD_MODULE = $(SHLD) $(LDSHFLAGS) $(MODULE_EXPORTS) \
> -o $@ @sonamef...@`basename $...@`
> +# Linker command to link samba internal plugin modules:
> +SHLD_PLUGIN = $(SHLD) $(LDPLUGINFLAGS) $(MODULE_EXPORTS) \
> + -o $@ @sonamef...@`basename $...@`
>  

Instead of using SHLD_PLUGIN for modules, we should keep
SHLD_MODULE, but use a new SHLD_LIBRARY for shared libraries.

It would also be nice to use

AC_LIBREPLACE_SHLD
AC_LIBREPLACE_SHLD_FLAGS

and

AC_LIBREPLACE_MDLD
AC_LIBREPLACE_MDLD_FLAGS

from libreplace. There we could also add the sun specifc flags genericly
for source3 and source4.

metze



signature.asc
Description: OpenPGP digital signature


root_fid changes...

2009-10-15 Thread Stefan (metze) Metzmacher
Hi Tridge,

> diff --git a/source4/smb_server/smb/nttrans.c 
> b/source4/smb_server/smb/nttrans.c
> index 23eb04b..316305a 100644
> --- a/source4/smb_server/smb/nttrans.c
> +++ b/source4/smb_server/smb/nttrans.c
> @@ -119,7 +119,8 @@ static NTSTATUS nttrans_create(struct smbsrv_request *req,
>   params = trans->in.params.data;
>  
>   io->ntcreatex.in.flags= IVAL(params,  0);
> - io->ntcreatex.in.root_fid.ntvfs   = smbsrv_pull_fnum(req, req->in.vwv, 
> 4);
> + io->ntcreatex.in.root_fid.fnum= IVAL(params,  4);
> + io->ntcreatex.in.root_fid.ntvfs   = smbsrv_pull_fnum(req, params, 4);

root_fid is a union, you can't set two union arms at the same time.

It's really confusing to read this code...

metze


Re: AW: changes to wbclient.h (Re: [SCM] Samba Shared Repository - branch master updated)

2009-10-09 Thread Stefan (metze) Metzmacher
Hi Matthias,

> yeah I know that my change is problematic. But I got a request from Günther 
> to adapt the values as they're specified in "samr.idl" to allow further error 
> case additions in winbind.
> 
> In particular consider the value 0: previous it was an "other" error but a 
> lookup in the MS-SAMR documentation pointed out that it should mean no error 
> at all.
> 
> So I'd strongly prefer to keep the patch in this form to have it right - from 
> now on . I know it is cumbersome to break the API and external code has to be 
> adapted - but personally I don't see a better solution.

I think we just need this, then it's fine:

#define WBC_PWD_CHANGE_REJECT_OTHER \
WBC_PWD_CHANGE_NO_ERROR
#define WBC_PWD_CHANGE_REJECT_TOO_SHORT \
WBC_PWD_CHANGE_PASSWORD_TOO_SHORT
#define WBC_PWD_CHANGE_REJECT_IN_HISTORY \
WBC_PWD_CHANGE_PWD_IN_HISTORY
#define WBC_PWD_CHANGE_REJECT_COMPLEXITY \
WBC_PWD_CHANGE_NOT_COMPLEX

metze


changes to wbclient.h (Re: [SCM] Samba Shared Repository - branch master updated)

2009-10-09 Thread Stefan (metze) Metzmacher
Hi Matthias,
> diff --git a/nsswitch/libwbclient/wbclient.h b/nsswitch/libwbclient/wbclient.h
> index 4dc6d23..ced82d8 100644
> --- a/nsswitch/libwbclient/wbclient.h
> +++ b/nsswitch/libwbclient/wbclient.h
> @@ -427,10 +427,15 @@ struct wbcUserPasswordPolicyInfo {
>   **/
>  
>  enum wbcPasswordChangeRejectReason {
> - WBC_PWD_CHANGE_REJECT_OTHER=0,
> - WBC_PWD_CHANGE_REJECT_TOO_SHORT=1,
> - WBC_PWD_CHANGE_REJECT_IN_HISTORY=2,
> - WBC_PWD_CHANGE_REJECT_COMPLEXITY=5
> + WBC_PWD_CHANGE_NO_ERROR=0,
> + WBC_PWD_CHANGE_PASSWORD_TOO_SHORT=1,
> + WBC_PWD_CHANGE_PWD_IN_HISTORY=2,
> + WBC_PWD_CHANGE_USERNAME_IN_PASSWORD=3,
> + WBC_PWD_CHANGE_FULLNAME_IN_PASSWORD=4,
> + WBC_PWD_CHANGE_NOT_COMPLEX=5,
> + WBC_PWD_CHANGE_MACHINE_NOT_DEFAULT=6,
> + WBC_PWD_CHANGE_FAILED_BY_FILTER=7,
> + WBC_PWD_CHANGE_PASSWORD_TOO_LONG=8
>  };

wbclient.h is a public interface, where we can't change existing code!

At least we need to add the old enum values as defines to the new ones.

metze


Re: [SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-156-g7669bc3

2009-09-11 Thread Stefan (metze) Metzmacher
Hi Matthias,

> - Log -
> commit 7669bc3c89898c585a65547b246981ddcd0f49dc
> Author: Matthias Dieter Wallnöfer 
> Date:   Thu Sep 10 07:17:40 2009 +0200
> 
> util_strlist: Add some more "const"s
> 

Why this changes?

I think they're wrong, functions which allocate memory should not
return const pointers, otherwise we'll get warnings when calling
talloc_free() on them.

metze




signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-136-ga08d173

2009-09-09 Thread Stefan (metze) Metzmacher
Hi Tridge,

> - Log -
> commit a08d17342d0affa3769875ad87dadbb1f4161a06
> Author: Andrew Tridgell 
> Date:   Thu Sep 10 14:27:47 2009 +1000
> 
> s4/drs: changed the UpdateRefs server to use the dn instead of the GUID
> 
> Our vampire code sends a zero GUID in the updaterefs calls. Windows
> seems to ignore the GUID and use the DN in the naming context instead,
> so I have changed our UpdateRefs server implementation to do the same.
> 
> With this change we can now vampire from s4<->s4 successfully! Now to
> see if all the attributes came across correctly.

I think we need to use the GUID if it's valid and fallback to SID and
finality to the dn, if the sid is also zero.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-1414-g43c766a

2009-09-06 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> - Log -
> commit 43c766a14a5eeed80e57bae9fde21eb2b542c209
> Author: Jeremy Allison 
> Date:   Sun Sep 6 21:38:50 2009 -0700
> 
> Fix bug 6673 - smbpasswd does not work with "unix password sync = yes".
> Revert change from 3.3 -> 3.4 with read_socket_with_timeout changed
> from sys_read() to sys_recv(). read_socket_with_timeout() is called
> with non-fd's (with a pty in chgpasswd.c and with a disk file in
> lib/dbwrap_file.c via read_data()). recv works for the disk file,
> but not the pty. Change the name of read_socket_with_timeout() to
> read_fd_with_timeout() to make this clear (and add comments).
> Jeremy.

I think we should have 2 functions then.
We need to use sys_recv() on sockets, otherwise our socket_wrapper pcap
support doesn't work.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-1167-g436d8b6

2009-08-25 Thread Stefan (metze) Metzmacher
Andrew Bartlett schrieb:
> On Tue, 2009-08-25 at 08:46 +0200, Stefan (metze) Metzmacher wrote:
>> Hi Andrew,
>>
>>>  static int show_deleted_search(struct ldb_module *module, struct 
>>> ldb_request *req)
>>>  {
>>> struct ldb_context *ldb;
>>> struct ldb_control *control;
>>> struct ldb_control **saved_controls;
>>> -   struct show_deleted_search_request *ar;
>>> struct ldb_request *down_req;
>>> -   char *old_filter;
>>> -   char *new_filter;
>>> +   struct ldb_parse_tree *nodeleted_tree;
>>> +   struct ldb_parse_tree *new_tree = req->op.search.tree;
>>> int ret;
>>>  
>>> ldb = ldb_module_get_ctx(module);
>>>  
>>> -   ar = talloc_zero(req, struct show_deleted_search_request);
>>> -   if (ar == NULL) {
>>> -   return LDB_ERR_OPERATIONS_ERROR;
>>> -   }
>>> -   ar->module = module;
>>> -   ar->req = req;
>>> -
>>> /* check if there's a show deleted control */
>>> control = ldb_request_get_control(req, LDB_CONTROL_SHOW_DELETED_OID);
>>>  
>>> -   if ( ! control) {
>>> -   old_filter = ldb_filter_from_tree(ar, req->op.search.tree);
>>> -   new_filter = talloc_asprintf(ar, "(&(!(isDeleted=TRUE))%s)",
>>> -old_filter);
>>> -
>>> -   ret = ldb_build_search_req(&down_req, ldb, ar,
>>> -  req->op.search.base,
>>> -  req->op.search.scope,
>>> -  new_filter,
>>> -  req->op.search.attrs,
>>> -  req->controls,
>>> -  ar, show_deleted_search_callback,
>>> -  req);
>>> -
>>> -   } else {
>>> -   ret = ldb_build_search_req_ex(&down_req, ldb, ar,
>>> - req->op.search.base,
>>> - req->op.search.scope,
>>> - req->op.search.tree,
>>> - req->op.search.attrs,
>>> - req->controls,
>>> - ar, show_deleted_search_callback,
>>> - req);
>>> +   if (! control) {
>>> +   nodeleted_tree = 
>>> talloc_get_type(ldb_module_get_private(module), 
>>> +struct ldb_parse_tree);
>>> +   if (nodeleted_tree) {
>>> +   new_tree = talloc(req, struct ldb_parse_tree);
>>> +   if (!new_tree) {
>>> +   ldb_oom(ldb);
>>> +   return LDB_ERR_OPERATIONS_ERROR;
>>> +   }
>>> +   *new_tree = *nodeleted_tree;
>>> +   /* Replace dummy part of 'and' with the old, tree,
>>> +  without a parse step */
>>> +   new_tree->u.list.elements[0] = req->op.search.tree;
>>> +   }
>>> }
>>> +   
>>> +   ret = ldb_build_search_req_ex(&down_req, ldb, req,
>>> + req->op.search.base,
>>> + req->op.search.scope,
>>> + new_tree,
>>> + req->op.search.attrs,
>>> + req->controls,
>>> + req->context, req->callback,
>>> + req);
>>> if (ret != LDB_SUCCESS) {
>>> return ret;
>>> }
>>> @@ -138,10 +93,20 @@ static int show_deleted_search(struct ldb_module 
>>> *module, struct ldb_request *re
>>>  static int show_deleted_init(struct ldb_module *module)
>>>  {
>>> struct ldb_context *ldb;
>>> +   struct ldb_parse_tree *nodeleted_tree;
>>> int ret;
>>>  
>>> ldb = ldb_module_get_ctx(module);
>>>  
>>> +   nodeleted_tree = ldb_parse_tree(module, 
>>> "(&(replace=me)(!(isDeleted=TRUE)))");
>>> +   if (!nodeleted_tree) {
>>> +   ldb_debug(ldb, LDB_DEBUG_ERROR,
>>> +   "show_deleted: Unable to parse isDeleted master 
>>> expression!\n");
>>> +   return LDB_ERR_OPERATIONS_ERROR;
>>> +   }
>>> +
>>> +   ldb_module_set_private(module, nodeleted_tree);
>> Why do we need to keep that as a "global" variable?
>> That doesn't play nicely together with multiple async searches.
>> I'd prefer to let each search request build its own parse tree.
> 
> We use structure assignment to create a local copy of this that we then
> insert the original tree into.  I'll see about using a deep copy of the
> template if that would make you happier. 

Ah, sorry I haven't noticed that, I think it's fine then.

metze




signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-1167-g436d8b6

2009-08-24 Thread Stefan (metze) Metzmacher
Hi Andrew,

>  static int show_deleted_search(struct ldb_module *module, struct ldb_request 
> *req)
>  {
>   struct ldb_context *ldb;
>   struct ldb_control *control;
>   struct ldb_control **saved_controls;
> - struct show_deleted_search_request *ar;
>   struct ldb_request *down_req;
> - char *old_filter;
> - char *new_filter;
> + struct ldb_parse_tree *nodeleted_tree;
> + struct ldb_parse_tree *new_tree = req->op.search.tree;
>   int ret;
>  
>   ldb = ldb_module_get_ctx(module);
>  
> - ar = talloc_zero(req, struct show_deleted_search_request);
> - if (ar == NULL) {
> - return LDB_ERR_OPERATIONS_ERROR;
> - }
> - ar->module = module;
> - ar->req = req;
> -
>   /* check if there's a show deleted control */
>   control = ldb_request_get_control(req, LDB_CONTROL_SHOW_DELETED_OID);
>  
> - if ( ! control) {
> - old_filter = ldb_filter_from_tree(ar, req->op.search.tree);
> - new_filter = talloc_asprintf(ar, "(&(!(isDeleted=TRUE))%s)",
> -  old_filter);
> -
> - ret = ldb_build_search_req(&down_req, ldb, ar,
> -req->op.search.base,
> -req->op.search.scope,
> -new_filter,
> -req->op.search.attrs,
> -req->controls,
> -ar, show_deleted_search_callback,
> -req);
> -
> - } else {
> - ret = ldb_build_search_req_ex(&down_req, ldb, ar,
> -   req->op.search.base,
> -   req->op.search.scope,
> -   req->op.search.tree,
> -   req->op.search.attrs,
> -   req->controls,
> -   ar, show_deleted_search_callback,
> -   req);
> + if (! control) {
> + nodeleted_tree = 
> talloc_get_type(ldb_module_get_private(module), 
> +  struct ldb_parse_tree);
> + if (nodeleted_tree) {
> + new_tree = talloc(req, struct ldb_parse_tree);
> + if (!new_tree) {
> + ldb_oom(ldb);
> + return LDB_ERR_OPERATIONS_ERROR;
> + }
> + *new_tree = *nodeleted_tree;
> + /* Replace dummy part of 'and' with the old, tree,
> +without a parse step */
> + new_tree->u.list.elements[0] = req->op.search.tree;
> + }
>   }
> + 
> + ret = ldb_build_search_req_ex(&down_req, ldb, req,
> +   req->op.search.base,
> +   req->op.search.scope,
> +   new_tree,
> +   req->op.search.attrs,
> +   req->controls,
> +   req->context, req->callback,
> +   req);
>   if (ret != LDB_SUCCESS) {
>   return ret;
>   }
> @@ -138,10 +93,20 @@ static int show_deleted_search(struct ldb_module 
> *module, struct ldb_request *re
>  static int show_deleted_init(struct ldb_module *module)
>  {
>   struct ldb_context *ldb;
> + struct ldb_parse_tree *nodeleted_tree;
>   int ret;
>  
>   ldb = ldb_module_get_ctx(module);
>  
> + nodeleted_tree = ldb_parse_tree(module, 
> "(&(replace=me)(!(isDeleted=TRUE)))");
> + if (!nodeleted_tree) {
> + ldb_debug(ldb, LDB_DEBUG_ERROR,
> + "show_deleted: Unable to parse isDeleted master 
> expression!\n");
> + return LDB_ERR_OPERATIONS_ERROR;
> + }
> +
> + ldb_module_set_private(module, nodeleted_tree);

Why do we need to keep that as a "global" variable?
That doesn't play nicely together with multiple async searches.
I'd prefer to let each search request build its own parse tree.

metze




signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-970-gd6270df

2009-08-13 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> - Log -
> commit d6270df748dcfd8d5a02c328518c2332da8fbed5
> Author: Jeremy Allison 
> Date:   Wed Aug 12 13:00:54 2009 -0700
> 
> Add "store create time" parameter (docs to follow)
> that stores the create time in the user.DosTimestamps EA.
> Jeremy.

Can we please use an idl based union to store this information?

Also user.DosTimestamps is misleading when it only stores the create time.

It would be nice if we could use a single EA to store all timestamps
and maybe all other info like the current xattr_DosAttrib struct used by
samba4.

But I think we should rename xattr_DosAttrib into
xattr_DosInforation or xattr_DosMetaData.

As *XATTR_DOSATTRIB_NAME = "user.DosAttrib";
and #define SAMBA_XATTR_DOS_ATTRIB "user.DOSATTRIB" are different.

metze
> ---
> 
> Summary of changes:
>  source3/include/proto.h  |   12 -
>  source3/include/smb.h|2 +
>  source3/modules/vfs_default.c|9 
>  source3/param/loadparm.c |   12 +
>  source3/script/tests/selftest.sh |1 +
>  source3/smbd/dosmode.c   |   91 
> --
>  source3/smbd/nttrans.c   |8 ++--
>  source3/smbd/open.c  |9 
>  source3/smbd/reply.c |2 +-
>  source3/smbd/trans2.c|9 ++--
>  10 files changed, 140 insertions(+), 15 deletions(-)
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/source3/include/proto.h b/source3/include/proto.h
> index 8b3e029..963e6df 100644
> --- a/source3/include/proto.h
> +++ b/source3/include/proto.h
> @@ -4187,6 +4187,7 @@ bool lp_administrative_share(int );
>  bool lp_print_ok(int );
>  bool lp_map_hidden(int );
>  bool lp_map_archive(int );
> +bool lp_store_create_time(int );
>  bool lp_store_dos_attributes(int );
>  bool lp_dmapi_support(int );
>  bool lp_locking(const struct share_params *p );
> @@ -6266,10 +6267,17 @@ bool set_sticky_write_time_fsp(struct files_struct 
> *fsp,
>  struct timespec mtime);
>  bool update_write_time(struct files_struct *fsp);
>  
> -struct timespec get_create_timespec(struct files_struct *fsp,
> +NTSTATUS set_create_timespec_ea(connection_struct *conn,
> + struct files_struct *fsp,
> + const struct smb_filename *smb_fname,
> + struct timespec create_time);
> +
> +struct timespec get_create_timespec(connection_struct *conn,
> + struct files_struct *fsp,
>   const struct smb_filename *smb_fname);
>  
> -struct timespec get_change_timespec(struct files_struct *fsp,
> +struct timespec get_change_timespec(connection_struct *conn,
> + struct files_struct *fsp,
>   const struct smb_filename *smb_fname);
>  
>  /* The following definitions come from smbd/error.c  */
> diff --git a/source3/include/smb.h b/source3/include/smb.h
> index fb01a92..28bd60a 100644
> --- a/source3/include/smb.h
> +++ b/source3/include/smb.h
> @@ -1859,6 +1859,8 @@ struct ea_list {
>  #define SAMBA_XATTR_DOS_ATTRIB "user.DOSATTRIB"
>  /* Prefix for DosStreams in the vfs_streams_xattr module */
>  #define SAMBA_XATTR_DOSSTREAM_PREFIX "user.DosStream."
> +/* Prefix for DOS timestamps. */
> +#define SAMBA_XATTR_DOSTIMESTAMPS "user.DosTimestamps"
>  
>  #define UUID_SIZE 16
>  
> diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
> index 2ee2fd1..a793b33 100644
> --- a/source3/modules/vfs_default.c
> +++ b/source3/modules/vfs_default.c
> @@ -817,6 +817,15 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
>   errno = ENOSYS;
>   result = -1;
>  #endif
> +
> + if (!null_timespec(ft->create_time) &&
> + lp_store_create_time(SNUM(handle->conn))) {
> + set_create_timespec_ea(handle->conn,
> + NULL,
> + smb_fname,
> + ft->create_time);
> + }
> +
>   out:
>   END_PROFILE(syscall_ntimes);
>   return result;
> diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
> index dbbd6e3..3598471 100644
> --- a/source3/param/loadparm.c
> +++ b/source3/param/loadparm.c
> @@ -446,6 +446,7 @@ struct service {
>   bool bMap_system;
>   bool bMap_hidden;
>   bool bMap_archive;
> + bool bStoreCreateTime;
>   bool bStoreDosAttribut

Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-494-geba2eb4

2009-07-20 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> Move the initialization of smbd_server_conn from smbd/process,
> after the accept and fork, to smbd_init_globals(), so it's
> done immediately on server startup. This is needed as some
> messages are sent to all active smbd processes (including
> the master listening daemon). If it gets a message that
> forces it to scan it's current connections (ie. conn_find())
> then it discovers that sconn->smb1.tcons.Connections dereferences
> null (as sconn == NULL in the parent) and crashes. Yes,
> I could fix all cases where sconn is used and explicitly
> check for NULL but this fix is easier. It means that
> the smbd_event_context() is initialized in the master
> daemon and then re-initialized after fork, but that
> should be being done correctly in every fork call anyway.
> Without this change the previous fix 
> 6a9e0039100b57f9626e87defec6720c476b9789
> still panics in the reproducible test case for bug
> 6564, as this is one case where such a message
> (MSG_SMB_CONF_UPDATED) is sent to the parent. Metze
> please check. This change passes valgrind.
> Jeremy.

I think it is thte wrong approach, smbd_server_connection represents
the state of a connected client/a smbd child process.
I added it so that we strictly separate code that runs in the parent
from code that runs in the child.

I'd really like to understand what the problem is.
From reading the code I can't find where we hit any panic.
Can you send me the backtrace please?

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79

2009-07-15 Thread Stefan (metze) Metzmacher
Steven Danneman schrieb:
>> Yes, please make sure you use torture_comment() instead of printf() and
>> all torture_assert* functions instead of just returning false in a
>> test. Then make test reports them as failures instead of errors and
>> it's easy to mark them as known failures. This makes sure that the
>> server doesn't crash when the test runs against it.
>>
>> metze
> 
> Excellent, thanks Metze.  Do we have any kind of document that describes best 
> practices for writing torture tests?  If not I can start a wiki page.

That would be great.

> Thus, far I have mostly copied style from other tests, but obviously there is 
> a mix of several different approaches added over the years.

Yes, there's a lot of old stuff there: I started to clean it up for some
tests... see 4ab243bcabefdcc044c6d517bb4d0e628227d5ac.

In the end I'd like to have a #define printf __donnot_use_printf__ in
lib/torture/torture.h, but he have a long way to go...

metze





signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79

2009-07-15 Thread Stefan (metze) Metzmacher
Hey Steven,

>> No one at Isilon is working on SMB2 server side implementation currently, 
>> but we are front loading a lot of test work so there will be a reasonable 
>> set of correctness tests already available when new code is written.
>>
>> Right now we're working on porting most of the RAW SMB tests to SMB2, 
>> including open, streams, share modes, acls, brl, and change notify.  All of 
>> our testing has been against a W2K8 server, though I'll include a W2K8R2 
>> server as well.
>>
>> Sorry, I made some last minute changes before pushing this patch and didn't 
>> re-run them.  I'll be more careful next time.  Though, several of the tests 
>> will fail against current HEAD because the features aren't implemented yet.  
>> Is it acceptable for the "make test TESTS=smb2" to fail for a bit?
> 
> Not without corresponding notations in the
> source{3,4}/selftest/knownfail files.

Yes, please make sure you use torture_comment() instead of printf()
and all torture_assert* functions instead of just returning false in a
test. Then make test reports them as failures instead of errors
and it's easy to mark them as known failures. This makes sure that the
server doesn't crash when the test runs against it.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-349-g5334b79

2009-07-15 Thread Stefan (metze) Metzmacher
Hi Steven,

> The branch, master has been updated
>via  5334b79142e32c39c56cea2e9c0d5b08e2f217ca (commit)
>   from  4b6401ab2cce8319abe0f8176bb460d51bd4a390 (commit)
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -
> commit 5334b79142e32c39c56cea2e9c0d5b08e2f217ca
> Author: Aravind 
> Date:   Tue Jul 7 07:11:56 2009 -0700
> 
> torture/smb2: Adding SMB2 Directory enumeration torture tests.

Could you please do runtime tests before you push such patches?
See 8cb44830e0356804e21d9973382e0070f20b15be and
f49129e59225f6ea84add8e845ffaeb03dc6c8da for the reasons.

It would be also nice to run 'make test' or 'make test TESTS=smb2'
in s4.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-349-g5334b79

2009-07-15 Thread Stefan (metze) Metzmacher
Hi Steven,

> - Log -
> commit 5334b79142e32c39c56cea2e9c0d5b08e2f217ca
> Author: Aravind 
> Date:   Tue Jul 7 07:11:56 2009 -0700
> 
> torture/smb2: Adding SMB2 Directory enumeration torture tests.

Is there anyone working on the server side of this?

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-261-g431e63c

2009-07-07 Thread Stefan (metze) Metzmacher
Hi Tim,

> commit 18a27a8df223ba8eb0faf6a64384acce174f3ace
> Author: Tim Prouty 
> Date:   Thu Jul 2 10:27:01 2009 -0700
> 
> s3 sticky write time: Removed unused args and tighten up a function by 
> making an arg const

I don't think it makes sense to apply a const in non-pointers
parameters, the function always gets a copy of the callers variable.

Also you missed a const in the proto.h for set_sticky_write_time_path()
which is present in the function.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-172-gacfb01a

2009-07-02 Thread Stefan (metze) Metzmacher
Hi Tridge,

> change talloc to 2.0.0
> 
> This is needed to prevent samba3 and samba4 from using an ABI
> incompatible system version of talloc
> 
> See ongoing discussion on the samba-technical mailing list

I think we should also change TALLOC_MAGIC to make 100% sure we abort,
when libtalloc.so.1 and libtalloc.so.2 are loaded into the same process.

Like this:
http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=c534a8af46e1efbfad8cd953dadb3a68b29b9919

--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -57,7 +57,9 @@


 #define MAX_TALLOC_SIZE 0x1000
-#define TALLOC_MAGIC 0xe814ec70
+#define TALLOC_MAGIC_V1 0xe814ec70
+#define TALLOC_MAGIC_V2 0xe814ec80
+#define TALLOC_MAGICTALLOC_MAGIC_V2
 #define TALLOC_FLAG_FREE 0x01
 #define TALLOC_FLAG_LOOP 0x02
 #define TALLOC_FLAG_POOL 0x04  /* This is a talloc pool */
@@ -154,6 +156,11 @@ static void talloc_abort(const char *reason)
talloc_abort_fn(reason);
 }

+static void talloc_abort_magic_v1(void)
+{
+   talloc_abort("Bad talloc magic value - old magic v1 used");
+}
+
 static void talloc_abort_double_free(void)
 {
talloc_abort("Bad talloc magic value - double free");
@@ -170,6 +177,10 @@ static inline struct talloc_chunk
*talloc_chunk_from_ptr(const void *ptr)
const char *pp = (const char *)ptr;
struct talloc_chunk *tc = discard_const_p(struct talloc_chunk, pp -
TC_HDR_SIZE);
if (unlikely((tc->flags & (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) {
+   if ((tc->flags & (~0xF)) == TALLOC_MAGIC_V1)) {
+   talloc_abort_magic_v1();
+   }
+
if (tc->flags & TALLOC_FLAG_FREE) {
    talloc_abort_double_free();
} else {

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1792-g6ef6538

2009-05-25 Thread Stefan (metze) Metzmacher
Hi Andrew,

> Add support for sendmsg() in socket_wrapper
> 
> This is required because the deferred connect code skips the connect()
> until sending the packet, but unless we catch this call, the connect()
> never happens.

Nice catch! Could you also add recvmsg() to make it symmetric?

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1501-ge86a534

2009-05-08 Thread Stefan (metze) Metzmacher
Hi Michael,

> diff --git a/source3/smbd/process.c b/source3/smbd/process.c
> index 7605ad7..0f3e560 100644
> --- a/source3/smbd/process.c
> +++ b/source3/smbd/process.c
> @@ -1887,8 +1887,15 @@ received when we should release a specific IP
>  static void release_ip(const char *ip, void *priv)
>  {
>   char addr[INET6_ADDRSTRLEN];
> + char *p;
this should be p = addr or p = NULL;

> - if (strcmp(client_socket_addr(get_client_fd(),addr,sizeof(addr)), ip) 
> == 0) {
> + client_socket_addr(get_client_fd(),addr,sizeof(addr));
> +
> + if (strncmp(":::", addr, 7) == 0) {
> + p = addr + 7;
> + }
>
> + if ((strcmp(p, ip) == 0) || (strcmp(addr, ip) == 0)) {

if p could be NULL based on the decision above we need to check this
before passing p to strcmp().

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1463-g512879a

2009-05-07 Thread Stefan (metze) Metzmacher
Hi Jeremy,

> +struct cli_setattrE_state {
> + int dummy;
> +};
> +
> +struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
> + struct event_context *ev,
> + struct cli_state *cli,
> + uint16_t fnum,
> + time_t change_time,
> + time_t access_time,
> + time_t write_time)
>  {
> - char *p;
> + struct tevent_req *req = NULL, *subreq = NULL;
> + struct cli_setattrE_state *state = NULL;
> + uint8_t additional_flags = 0;
> + uint16_t vwv[7];

vwv needs to be in the state structure. Wouldn't valgrind catch such
things?

Your following commit has the same problem.

> + subreq = cli_smb_send(state, ev, cli, SMBsetattrE, additional_flags,
> +   7, vwv, 0, NULL);

In general all non scalar input parameters to a _send() function need to
be arround until the _recv function is called.

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1429-ge46a88c

2009-05-04 Thread Stefan (metze) Metzmacher
Hi Jeremy,

>   if (ent->vuid == vuid) {
>   ent->vuid = UID_FIELD_INVALID;
> - /* Ensure we're not freeing an active pointer. */
> + /*
> +  * We need to keep conn->server_info around
> +  * if it's equal to ent->server_info as a SMBulogoff
> +  * is often followed by a SMBtdis (with an invalid
> +  * vuid). The debug code (or regular code in

Do you have a capture of this for me?

I wonder we should create a anonymous server_info for the SMBTdis,
if it uses an invalid vuid?

A torture test for this would also be very useful.

metze

metze



signature.asc
Description: OpenPGP digital signature


Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-834-g621d403

2009-04-02 Thread Stefan (metze) Metzmacher
Günther Deschner schrieb:
> The branch, master has been updated
>via  621d40332aad9d99b14c45155308a394c31b98b5 (commit)
>   from  31ab1d6a6487fb442ccd5b2cd093b4a2b7b80291 (commit)
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> 
> 
> - Log -
> commit 621d40332aad9d99b14c45155308a394c31b98b5
> Author: Günther Deschner 
> Date:   Fri Apr 3 00:30:13 2009 +0200
> 
> s3-build: fix the build after tsocket changes.
> 
> Metze, please check.

Thanks!

> ---
> 
> Summary of changes:
>  source3/Makefile.in |2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> 
> Changeset truncated at 500 lines:
> 
> diff --git a/source3/Makefile.in b/source3/Makefile.in
> index 9a97d8d..1578abf 100644
> --- a/source3/Makefile.in
> +++ b/source3/Makefile.in
> @@ -466,8 +466,6 @@ LIBCLI_LDAP_NDR_OBJ = ../libcli/ldap/ldap_ndr.o
>  LIBTSOCKET_OBJ = ../lib/tsocket/tsocket.o \
>   ../lib/tsocket/tsocket_helpers.o \
>   ../lib/tsocket/tsocket_bsd.o \
> - ../lib/tsocket/tsocket_recvfrom.o \
> - ../lib/tsocket/tsocket_sendto.o \
>   ../lib/tsocket/tsocket_connect.o \
>   ../lib/tsocket/tsocket_writev.o \
>   ../lib/tsocket/tsocket_readv.o
> 
> 




signature.asc
Description: OpenPGP digital signature


Re: TDB signed vs. unsigned char (was Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-554-gf942cb6)

2009-04-01 Thread Stefan (metze) Metzmacher
Jeremy Allison schrieb:
> On Wed, Apr 01, 2009 at 12:39:28PM +0200, Stefan (metze) Metzmacher wrote:
>> Hi Jeremy,
>>
>>> commit f942cb616e981e5370fab122969127de0910b58b
>>> Author: Jeremy Allison 
>>> Date:   Wed Mar 18 15:44:13 2009 -0700
>>>
>>> Fix bug #6195 - Migrating from 3.0.x to 3.3.x can fail to update 
>>> passdb.tdb correctly.
>>> This is a really nasty one to fix as in order to successfully update the
>>> passdb.tdb we must do the equivalent of a tdbbackup to move to the new 
>>> hash
>>> values before we do the upgrade.
>>> Jeremy.
>> Sorry, that I "introducted" the change that triggers with problems...
> 
> No problem, everyone makes mistakes (as we have seen today :-).

:-)

>> But it shows once again that we really need to use 'uint8_t *' instead
>> of 'char *' to represent raw bytes! As the same problem is there,
>> if we copy passdb.tdb from a machine where char is signed to a machine
>> were char is unsigned, while using exactly the same source on both machines.
>>
>> So we should really try to get rid of all 'char *buf' pointers we have,
> 
> Yeah, we should start cleaning up the code here (much of which
> is extremely old of course :-).
> 
>> but as the above example shows we need to be extremly careful and add
>> explicit cast in the right spots in order to avoid upgrade problems.
> 
> It's too late for that cast now, there were existing databases out there.
> (I did think about doing that, but we couldn't get away with it).

I mean for future code changes.

metze



signature.asc
Description: OpenPGP digital signature


  1   2   3   4   5   6   7   8   9   10   >