Re: [Samba] Samba4 errors

2013-06-11 Thread Andrew Bartlett
On Tue, 2013-06-11 at 19:03 +0200, Andreas Calvo wrote:
> A more detailed output:
> [root@sauron ~]# netstat -tnp|grep 445|grep "192.168.0.222"|grep 55257
> tcp   24  0 192.168.0.222:55257 192.168.0.222:445
> ESTABLISHED 17417/samba
> tcp0  0 192.168.0.222:445   192.168.0.222:55257
> ESTABLISHED 23713/smbd
> 
> Note that 192.168.0.222 is the IP address of the samba server.
> This occurs when the backup agent starts running.
> It seems that samba it's connecting to itself, and the socket remains open.

This has been fixed in master and in v4-0-test for the next 4.0.x
release with the attached patch. 

Andrew Bartlett
-- 
Andrew Bartletthttp://samba.org/~abartlet/
Authentication Developer, Samba Team   http://samba.org

>From 1d610ce1a14f5a97c9b5cacca839b245df4bae6a Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher 
Date: Fri, 31 May 2013 16:04:26 +0200
Subject: [PATCH] s4:winbind: don't leak libnet_context into the main event
 context (bug #9929)

This needs to be a talloc child of struct wbsrv_domain
otherwise the cleanup of a broken connection doesn't work.

The following command can trigger the leak on a domain controller.

root@dc:~/samba# ls -l /var/lib/samba/sysvol/samba.private/
total 16
drwxrwx---+ 5 root 300 4096 May 14 14:46 Policies
drwxrwx---+ 2 root 300 4096 May 14 11:45 scripts

gid 300 belongs to Builtin\Administrators.

The code triggers a ncacn_np: connection to the local smbd
and complains that domain BUILTIN is not available:

[2013/05/29 17:28:03,  2] ../source4/winbind/wb_init_domain.c:376(init_domain_recv_queryinfo)
  Expected domain name BUILTIN, DC dc.samba.private said SAMBA

In that case the connection was not closed, which is fixed by this commit.

Using ncalrpc: for all local SIDs and serving the BUILTIN domain is
a project for another day...

Signed-off-by: Stefan Metzmacher 

Reviewed-by: Andrew Bartlett 

Autobuild-User(master): Andrew Bartlett 
Autobuild-Date(master): Tue Jun  4 11:05:09 CEST 2013 on sn-devel-104
(cherry picked from commit 097a8c723925d3e35606215cb16be28a37b0112e)

Autobuild-User(v4-0-test): Karolin Seeger 
Autobuild-Date(v4-0-test): Wed Jun  5 13:57:16 CEST 2013 on sn-devel-104
---
 source4/winbind/wb_init_domain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/source4/winbind/wb_init_domain.c b/source4/winbind/wb_init_domain.c
index 5e2aa47..70dbaa9 100644
--- a/source4/winbind/wb_init_domain.c
+++ b/source4/winbind/wb_init_domain.c
@@ -144,6 +144,8 @@ struct composite_context *wb_init_domain_send(TALLOC_CTX *mem_ctx,
 
 	state->domain->libnet_ctx = libnet_context_init(service->task->event_ctx, 
 			service->task->lp_ctx);
+	if (state->domain->libnet_ctx == NULL) goto failed;
+	talloc_steal(state->domain, state->domain->libnet_ctx);
 
 	/* Create a credentials structure */
 	state->domain->libnet_ctx->cred = cli_credentials_init(state->domain);
-- 
1.7.11.7

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Re: [Samba] Samba4 errors

2013-06-11 Thread Andreas Calvo
A more detailed output:
[root@sauron ~]# netstat -tnp|grep 445|grep "192.168.0.222"|grep 55257
tcp   24  0 192.168.0.222:55257 192.168.0.222:445
ESTABLISHED 17417/samba
tcp0  0 192.168.0.222:445   192.168.0.222:55257
ESTABLISHED 23713/smbd

Note that 192.168.0.222 is the IP address of the samba server.
This occurs when the backup agent starts running.
It seems that samba it's connecting to itself, and the socket remains open.


On Tue, Jun 11, 2013 at 11:30 AM, Andreas Calvo  wrote:

> We found out that samba is performing connections on the RPC port (TCP
> 445) against itself, and it scales until the memory is gone completely and
> crashes.
>
> Any hint?
>
>
> On Mon, Jun 10, 2013 at 3:08 PM, Andreas Calvo wrote:
>
>> Hello,
>> We've been using samba v4 for a while, but recently we faced two problems
>> for which we cannot determine the source - nor the solution:
>> - every day samba4 stops authenticating new users and sharing folders.
>> While previous logged users can access resources and services, users that
>> weren't logged can't log in. It happens either from kerberos or directly
>> from LDAP.
>> - We are forwarding all DNS requests to the internal DNS server in samba.
>> When samba it's restarted, our main DNS server must be restarted too as it
>> cannot forward new queries to the samba server - howerver, both reply to
>> requests if queried individually.
>>
>> We have tried to update from 4.0.5 to 4.0.6, and to downgrade it as it
>> wasn't working either.
>>
>> Logs don't show anything that we can identify as an
>> error/misconfiguration - and samba main log file remains with extension %m,
>> it does not get expanded; while client's log file end with the IP/hostname
>> of the machine.
>>
>> What steps can we perform to identify the root of the problem?
>> Is there a particular string in the log files that can help?
>>
>> PS: if necessary, we can upload a log file sample and the samba
>> configuration.
>>
>> Thanks in advance.
>>
>
>
>
> --
> Atentamente,
> Andreas Calvo
>



-- 
Atentamente,
Andreas Calvo
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 errors

2013-06-11 Thread Andreas Calvo
We found out that samba is performing connections on the RPC port (TCP 445)
against itself, and it scales until the memory is gone completely and
crashes.

Any hint?


On Mon, Jun 10, 2013 at 3:08 PM, Andreas Calvo  wrote:

> Hello,
> We've been using samba v4 for a while, but recently we faced two problems
> for which we cannot determine the source - nor the solution:
> - every day samba4 stops authenticating new users and sharing folders.
> While previous logged users can access resources and services, users that
> weren't logged can't log in. It happens either from kerberos or directly
> from LDAP.
> - We are forwarding all DNS requests to the internal DNS server in samba.
> When samba it's restarted, our main DNS server must be restarted too as it
> cannot forward new queries to the samba server - howerver, both reply to
> requests if queried individually.
>
> We have tried to update from 4.0.5 to 4.0.6, and to downgrade it as it
> wasn't working either.
>
> Logs don't show anything that we can identify as an error/misconfiguration
> - and samba main log file remains with extension %m, it does not get
> expanded; while client's log file end with the IP/hostname of the machine.
>
> What steps can we perform to identify the root of the problem?
> Is there a particular string in the log files that can help?
>
> PS: if necessary, we can upload a log file sample and the samba
> configuration.
>
> Thanks in advance.
>



-- 
Atentamente,
Andreas Calvo
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] Samba4 errors

2013-06-10 Thread Andreas Calvo
Hello,
We've been using samba v4 for a while, but recently we faced two problems
for which we cannot determine the source - nor the solution:
- every day samba4 stops authenticating new users and sharing folders.
While previous logged users can access resources and services, users that
weren't logged can't log in. It happens either from kerberos or directly
from LDAP.
- We are forwarding all DNS requests to the internal DNS server in samba.
When samba it's restarted, our main DNS server must be restarted too as it
cannot forward new queries to the samba server - howerver, both reply to
requests if queried individually.

We have tried to update from 4.0.5 to 4.0.6, and to downgrade it as it
wasn't working either.

Logs don't show anything that we can identify as an error/misconfiguration
- and samba main log file remains with extension %m, it does not get
expanded; while client's log file end with the IP/hostname of the machine.

What steps can we perform to identify the root of the problem?
Is there a particular string in the log files that can help?

PS: if necessary, we can upload a log file sample and the samba
configuration.

Thanks in advance.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba