Re: [Samba] Receiving async directory change notifications from a Windows Server host on a Linux client

2012-04-02 Thread Volker Lendecke
On Mon, Mar 26, 2012 at 02:03:12PM +0200, Tin Tvrtković wrote:
 I'll take a look, thanks!

You should use at least hash 831a97c147c6, otherwise you
will see NT_STATUS_IO_TIMEOUT where you should not.

Volker

 
 On Thu, Mar 22, 2012 at 11:10 PM, Jeremy Allison j...@samba.org wrote:
 
  On Mon, Mar 19, 2012 at 11:30:34AM +0100, Tin Tvrtković wrote:
   Hello everyone,
  
   I need a way to programatically monitor a remote SMB share (hosted on a
   Windows server) for new files, in an asynchronous (inotify-like) way
  from a
   Linux machine. The directory I'd be monitoring might have a large number
  of
   files, so I'd like to avoid constant polling. I'm open to just about
   anything, from parsing smbclient stdout, to writing my own little C
  wrapper
   around libsmbclient or a JCIFS Java application.
  
   I'd like to know if this kind of async monitoring is even possible, and
   what would be a good way to go about implementing it?
 
  If you're willing to work out of git-master, Volker just added a
  notify command to smbclient
 
  Jeremy.
 
 -- 
 To unsubscribe from this list go to the following URL and read the
 instructions:  https://lists.samba.org/mailman/options/samba

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-37-0, fax: +49-551-37-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kont...@sernet.de
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Re: [Samba] Users

2012-04-02 Thread Aaron E.
Make sure you can look up users with wbinfo if not fillow the samba4 
winbind wiki..


On 03/30/2012 06:23 PM, sandy.napo...@eccmg.cupet.cu wrote:

Hello list, Look at it

chown pepe Temp
chown: invalid user: `pepe'

Where pepe es a users tha was create in active directory, it problem is in
samba4 as BDC, i follow the step in how to samba4






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


[Samba] Chown

2012-04-02 Thread sandy . napoles
Hello list, i did try to assign permission to folder for some users in
samba4 as BDC, for example
chown sandy Temp/
chown: invalid user: `sandy'

when sandy is a users create in active directory, why sayme that sandy is
invalid users


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


Re: [Samba] Chown

2012-04-02 Thread John Drescher
 Hello list, i did try to assign permission to folder for some users in
 samba4 as BDC, for example
 chown sandy Temp/
 chown: invalid user: `sandy'

 when sandy is a users create in active directory, why sayme that sandy is
 invalid users


It sounds like you do not have your nsswitch setup to use winbind.

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


[Samba] Connected client unaffected by group/user/share change

2012-04-02 Thread Steve Tice
On Fri, Mar 30, 2012 at 5:25 PM, Chris Weisswrote:

 the quick and dirty hack is to use smbstatus to get the clients PID and kill 
it.

Yes, that's the sort of active revokation I'm looking for. Thanks for the 
suggestion. More difficult is the art of detecting that a connection should be 
torn down (because the connected user should no longer have access). For each 
existing connection, perhaps I'd need to see if a new connection with all the 
same parameters can currently be established. In a perfect world, I could test 
authorization and validity of the new connection without requiring the user's 
password. In other words, it would be helpful to test authorization without 
first having to authenticate. Is such a test possible?
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Connected client unaffected by group/user/share change

2012-04-02 Thread Chris Weiss
On Mon, Apr 2, 2012 at 10:39 AM, Steve Tice stic6...@yahoo.com wrote:
In a perfect world, ...

well, in a perfect world, the authentication source would be able tell
all systems that have logins to it that something's changed.  I'm note
really sure this is possible though since I don't think a connection
to the DC is maintained from member servers just because a client
auth'd.

I'm not sure what authorization tests you would do, if you make a
change, kill it.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] Samba4 how to get a reverse dlz zone

2012-04-02 Thread steve

Hi
I have s4 with bind9 working fine. I see that it sets up a forward zone 
without using zone files (is that the dlz bit?)


Is it possible to get it to produce a reverse zone?

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


Re: [Samba] Samba LDAP Failover

2012-04-02 Thread Stephan

Am 02.04.2012 07:43, schrieb Massimiliano Perantoni:

Hi,


the distribution is a Debian 6 but I compiled samba myself against a self
compiled openldap 2.4.26.


Actually the only difference is the openldap client libraries version,
I do use 2.3 instead of 2.4, but using getent, as I stated before,
works...

If I do getent passwd I get, with the failure, the immediate list of
local users and, after a timeout, I get the users list from the
secondary LDAP.
I guess that nscd is working or, at least, the service is up and
running: never understood how does the system decide to use it or
not...
For what I know if I disable the service nothing changes, so that I do
not know if nscd is working or not...
If I stop the LDAP I get the failover with getent, but I have to wait
for the timeout set in ldap.conf.


I honestly don't know what's going on there. I just wanted to make sure 
that at getent is really working and doesn't just look that way because 
nscd masks the problem.


I guess your secondary 389 server doesn't show a connection attempt in 
the log when you simulate the failure of your first server ? You wrote 
that you don't use ssl - is this also true in ldap.conf ?



The passdb backend line doesn't look different
than yours (except the server names of course ;-)). You are not running nscd
by chance ? If so does getent passwd work with a simulated ldap1 failure
(via iptables) and nscd shut down ?


I get a timeout seconds (actualy 5 secs) delay... Then the answer,
while samba waits for the timeout set in smb.conf then fails.

Ciao a grazie!




Am 01.04.2012 23:47, schrieb Massimiliano Perantoni:


Hi,
could you send me the setup?
Which lines did you add?
Whici distro do you run?

Thanks!

Il 31 marzo 2012 22:11, Stephansteff...@gmx.deha scritto:


Am 31.03.2012 20:56, schrieb Steve Thompson:


On Sat, 31 Mar 2012, Massimiliano Perantoni wrote:


Well, did not try, but guess it happens the same.
Just for completeness, which version of samba did you use for ldap
failover?




I was using 3.0.33 at the time, on CentOS 5 x86_64. Not sure which
revision of CentOS; it was a while ago.

Steve




My samba 3.5.9 DCs are pointed at a bunch of LDAP servers as well. I just
tried (shut down the first LDAP server in the list) and it works as
expected.

Regards
Stephan

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







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






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


Re: [Samba] Chown

2012-04-02 Thread steve

El 02/04/12 16:52, sandy.napo...@eccmg.cupet.cu escribió:

Hello list, i did try to assign permission to folder for some users in
samba4 as BDC, for example
chown sandy Temp/
chown: invalid user: `sandy'

when sandy is a users create in active directory, why sayme that sandy is
invalid users



Is sandy defined in AD with Unix attributes? e.g. what is his uid/gid?
Cheers,
Steve
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 how to get a reverse dlz zone

2012-04-02 Thread steve

El 02/04/12 18:12, fe...@epepm.cupet.cu escribió:

Hi
I have s4 with bind9 working fine. I see that it sets up a forward zone
without using zone files (is that the dlz bit?)

Is it possible to get it to produce a reverse zone?



Well, it's possible.
I have done it using the DNS mmc console from Windows.

Best regards,
Felix.

Hi
I'm not very good with windows. Is there a equivalent for Linux?
Cheers,
Steve
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] samba4 DNS error when joining domain

2012-04-02 Thread steve

El 02/04/12 07:11, Matthieu Patou escribió:

Steve,
On 04/01/2012 09:14 AM, steve wrote:



Then, after:
net ads keytab create
everyone can work fine.


The title seems to indicate samba4 when the body seems to indicate samba 3.
Am I guessing right that you have this problem with a samba 3.x with
samba 4 acting as a AD DC.

If so with which version of samba3 do you have this problem, samba 3.5.x
branch and early 3.6 have this problem even with MS AD, fix are present
in the master git tree to fix this problem.

Matthieu.


Hi
 I installed the samba-client rpm (openSUSE 12.1) simply to get the net 
command as an easy way to make a keytab fr the client. My Linux users 
have their posix attributes stored in s4 ldap and need the machine key 
for nfs.


As I say, everything works but I was concerned about the error message.
Cheers,
Steve
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] Samba4 how to get a reverse dlz zone

2012-04-02 Thread steve

El 02/04/12 18:22, fe...@epepm.cupet.cu escribió:

El 02/04/12 18:12, fe...@epepm.cupet.cu escribió:

Hi
I have s4 with bind9 working fine. I see that it sets up a forward zone
without using zone files (is that the dlz bit?)

Is it possible to get it to produce a reverse zone?



Well, it's possible.
I have done it using the DNS mmc console from Windows.

Best regards,
Felix.

Hi
I'm not very good with windows. Is there a equivalent for Linux?
Cheers,
Steve


I don't know. It might be possible with samba-tool.

Cheers,
Felix


OK, thanks.
Anyone?
Steve
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] Chown

2012-04-02 Thread sandy . napoles
Hello list, I solved my problem.



1- run as root in samba4 server
ln -s /usr/local/samba/lib/libnss_winbind.so.2 /lib/libnss_winbind.so
ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2

2- Edit nsswitch.con y put only the follow line
passwd:  files winbind
group:   files winbind
shadow:  files

3- run this command /usr/local/samba/bin/wbinfo -p
you can watch
Ping to winbindd succeeded

when i run chown pepe Trabajo/ everything is ok, where pepe is a users in
the active directory

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


Re: [Samba] Samba4 how to get a reverse dlz zone

2012-04-02 Thread Amitay Isaacs
On Tue, Apr 3, 2012 at 3:27 AM, steve st...@steve-ss.com wrote:
 El 02/04/12 18:22, fe...@epepm.cupet.cu escribió:

 El 02/04/12 18:12, fe...@epepm.cupet.cu escribió:

 Hi
 I have s4 with bind9 working fine. I see that it sets up a forward zone
 without using zone files (is that the dlz bit?)

 Is it possible to get it to produce a reverse zone?


 Well, it's possible.
 I have done it using the DNS mmc console from Windows.

 Best regards,
 Felix.

 Hi
 I'm not very good with windows. Is there a equivalent for Linux?
 Cheers,
 Steve


 I don't know. It might be possible with samba-tool.

 Cheers,
 Felix


 OK, thanks.
 Anyone?

 Steve

You can use samba-tool dns commands to create a reverse zone.

To create a reverse zone for 192.168.1.0/24 subnet,

$ samba-tool dns zonecreate server 1.168.192.in-addr.arpa

And then you can add record (e.g. test1.my.domain - 192.168.1.1)

$ samba-tool dns add server 1.168.192.in-addr.arpa 1 PTR test1.my.domain

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


Re: [Samba] Samba4 how to get a reverse dlz zone

2012-04-02 Thread steve

El 03/04/12 02:10, Amitay Isaacs escribió:

On Tue, Apr 3, 2012 at 3:27 AM, stevest...@steve-ss.com  wrote:

El 02/04/12 18:22, fe...@epepm.cupet.cu escribió:


El 02/04/12 18:12, fe...@epepm.cupet.cu escribió:






OK, thanks.
Anyone?

Steve


You can use samba-tool dns commands to create a reverse zone.

To create a reverse zone for 192.168.1.0/24 subnet,

$ samba-tool dns zonecreateserver  1.168.192.in-addr.arpa

And then you can add record (e.g. test1.my.domain -  192.168.1.1)

$ samba-tool dns addserver  1.168.192.in-addr.arpa 1 PTR test1.my.domain

Amitay.



Thanks. That's good news. But for that to work, I would need to have a 
fixed IP for each client no?


The s4 provision produces a bind include for the forward zone and a tsig 
keytab for ddns on it. Is it possible to do the same for the reverse zone?


BTW, I only need this for Linux clients using Kerberized nfs. Win7 
clients don't seem to need it for anything.

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


Re: [Samba] Chown

2012-04-02 Thread steve

El 02/04/12 21:27, sandy.napo...@eccmg.cupet.cu escribió:

Hello list, I solved my problem.



1- run as root in samba4 server
ln -s /usr/local/samba/lib/libnss_winbind.so.2 /lib/libnss_winbind.so
ln -s /lib/libnss_winbind.so /lib/libnss_winbind.so.2

2- Edit nsswitch.con y put only the follow line
passwd:  files winbind
group:   files winbind
shadow:  files

3- run this command /usr/local/samba/bin/wbinfo -p
you can watch
Ping to winbindd succeeded

when i run chown pepe Trabajo/ everything is ok, where pepe is a users in
the active directory


Hi

That's interesting. Can pepe also log into a Linux account? Does winbind 
allocate him a gid/uid?


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


Re: [Samba] samba authenticating users via kerberos failure

2012-04-02 Thread Christopher Chan

On Monday, April 02, 2012 12:45 PM, Christopher Chan wrote:
On Friday, March 30, 2012 05:40 PM, Christopher Chan wrote: What does 
this mean? A configuration problem?


Yep. thanks to Andrew Barlett, the problem was identified as kerberos 
method = system tab.


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


autobuild: intermittent test failure detected

2012-04-02 Thread 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/2012-04-02-1027/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2012-04-02-1027/samba3.stderr
   http://git.samba.org/autobuild.flakey/2012-04-02-1027/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2012-04-02-1027/samba4.stderr
   http://git.samba.org/autobuild.flakey/2012-04-02-1027/samba4.stdout
  
The top commit at the time of the failure was:

commit 2c322ca95a7dc4fb8396b475d115f31837316267
Author: Richard Sharpe realrichardsha...@gmail.com
Date:   Sun Apr 1 13:14:49 2012 -0700

Fix some of the issues that Jelmer identified in my first patch. This might 
be
changed again, especially when I figure out how to return the file as an
object.

Autobuild-User: Richard Sharpe sha...@samba.org
Autobuild-Date: Mon Apr  2 01:43:44 CEST 2012 on sn-devel-104


[SCM] Samba Shared Repository - branch master updated

2012-04-02 Thread Amitay Isaacs
The branch, master has been updated
   via  13a4b72 s4-upgradedns: Fix the fqdn for forest dns zone
  from  2c322ca Fix some of the issues that Jelmer identified in my first 
patch. This might be changed again, especially when I figure out how to return 
the file as an object.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 13a4b7284753e7e52bad7dd19aa50327b886d845
Author: Amitay Isaacs ami...@gmail.com
Date:   Mon Apr 2 17:15:09 2012 +1000

s4-upgradedns: Fix the fqdn for forest dns zone

Autobuild-User: Amitay Isaacs ami...@samba.org
Autobuild-Date: Mon Apr  2 10:56:10 CEST 2012 on sn-devel-104

---

Summary of changes:
 source4/scripting/bin/samba_upgradedns |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/bin/samba_upgradedns 
b/source4/scripting/bin/samba_upgradedns
index 86172a7..5a335a9 100755
--- a/source4/scripting/bin/samba_upgradedns
+++ b/source4/scripting/bin/samba_upgradedns
@@ -345,7 +345,7 @@ if __name__ == '__main__':
 # Create DNS partitions if missing and fill DNS information
 try:
 expression = 
'(|(dnsRoot=DomainDnsZones.%s)(dnsRoot=ForestDnsZones.%s))' % \
- (dnsdomain, dnsdomain)
+ (dnsdomain, dnsforest)
 msg = ldbs.sam.search(base=names.configdn, scope=ldb.SCOPE_DEFAULT,
   expression=expression, attrs=['nCName'])
 ncname = msg[0]['nCName'][0]


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2012-04-02 Thread Volker Lendecke
The branch, master has been updated
   via  831a97c s3: Notifies should never time out
  from  13a4b72 s4-upgradedns: Fix the fqdn for forest dns zone

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 831a97c147c6231397c51500bd44c1c3d3f83f19
Author: Volker Lendecke v...@samba.org
Date:   Mon Apr 2 10:50:33 2012 +0200

s3: Notifies should never time out

Autobuild-User: Volker Lendecke v...@samba.org
Autobuild-Date: Mon Apr  2 12:31:17 CEST 2012 on sn-devel-104

---

Summary of changes:
 source3/libsmb/clifile.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 48a0636..1a67bcd 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -4945,6 +4945,7 @@ struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
 {
struct tevent_req *req, *subreq;
struct cli_notify_state *state;
+   unsigned old_timeout;
 
req = tevent_req_create(mem_ctx, state, struct cli_notify_state);
if (req == NULL) {
@@ -4955,6 +4956,11 @@ struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
SSVAL(state-setup, 4, fnum);
SSVAL(state-setup, 6, recursive);
 
+   /*
+* Notifies should not time out
+*/
+   old_timeout = cli_set_timeout(cli, 0);
+
subreq = cli_trans_send(
state,  /* mem ctx. */
ev, /* event ctx. */
@@ -4974,6 +4980,8 @@ struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
0,  /* num data. */
0); /* max returned data. */
 
+   cli_set_timeout(cli, old_timeout);
+
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}


-- 
Samba Shared Repository


Re: wild use of strlcpy() broke ipv6 support

2012-04-02 Thread Jeremy Allison
On Sun, Apr 01, 2012 at 01:07:01AM -0700, Matthieu Patou wrote:

 I'll just tested your patch it's working for local-link ipv6, was
 too busy today between homedepot and fry's and enjoying this
 beautifull bay area weather :-)
 And please can you recheck that you didn't introduced other regression.

I did a quick scan and didn't see any other issues.

 I'm thinking of having one instance of samba in make test with
 interface + bind interface only combo set so that we can catch this
 problem in the future.

That would be great - thanks !


[SCM] Samba Shared Repository - branch master updated

2012-04-02 Thread Stefan Metzmacher
The branch, master has been updated
   via  c7a3b8a s4:smb_server/smb2: add missing 'return;' statements in 
smb2srv_chain_reply()
   via  d72641e s4:smb_server/smb2: after smbsrv_terminate_connection() we 
have to return
   via  e01d6f4 s4:smb_server/smb2: fix memory leak in smb2srv_chain_reply()
   via  dca4e6e s4:smb_server/smb2: use helper variable 
smb2srv_chain_reply()
   via  6865241 s4:smb_server/smb: remove a request from the list before 
adding the next one in a chain.
  from  831a97c s3: Notifies should never time out

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit c7a3b8ae21523f6af2c3e3fea1a0d3fcf9706d4c
Author: Stefan Metzmacher me...@samba.org
Date:   Mon Mar 26 13:50:44 2012 +0200

s4:smb_server/smb2: add missing 'return;' statements in 
smb2srv_chain_reply()

metze

Autobuild-User: Stefan Metzmacher me...@samba.org
Autobuild-Date: Mon Apr  2 23:02:53 CEST 2012 on sn-devel-104

commit d72641ef769da6cba8fd8422586121c79ad3af42
Author: Stefan Metzmacher me...@samba.org
Date:   Mon Mar 26 13:49:36 2012 +0200

s4:smb_server/smb2: after smbsrv_terminate_connection() we have to return

req is a talloc child of the connection...

metze

commit e01d6f4af02160199a014b9ea3e05a56c47f9f1f
Author: Stefan Metzmacher me...@samba.org
Date:   Mon Mar 26 13:48:51 2012 +0200

s4:smb_server/smb2: fix memory leak in smb2srv_chain_reply()

metze

commit dca4e6eb6e199e35b50a36ea3861a5d3429f6804
Author: Stefan Metzmacher me...@samba.org
Date:   Mon Mar 26 13:47:39 2012 +0200

s4:smb_server/smb2: use helper variable smb2srv_chain_reply()

metze

commit 6865241fdde71c5f7bbe85b3b88cb57ca14578b2
Author: Stefan Metzmacher me...@samba.org
Date:   Mon Mar 19 23:52:25 2012 +0100

s4:smb_server/smb: remove a request from the list before adding the next 
one in a chain.

metze

---

Summary of changes:
 source4/smb_server/smb/receive.c  |1 +
 source4/smb_server/smb2/receive.c |   19 ---
 2 files changed, 13 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/smb_server/smb/receive.c b/source4/smb_server/smb/receive.c
index 8e3bab8..b100757 100644
--- a/source4/smb_server/smb/receive.c
+++ b/source4/smb_server/smb/receive.c
@@ -633,6 +633,7 @@ void smbsrv_chain_reply(struct smbsrv_request *req)
SSVAL(req-out.vwv, VWV(1), req-out.size - NBT_HDR_SIZE);
 
/* cleanup somestuff for the next request */
+   DLIST_REMOVE(req-smb_conn-requests, req);
talloc_free(req-ntvfs);
req-ntvfs = NULL;
talloc_free(req-io_ptr);
diff --git a/source4/smb_server/smb2/receive.c 
b/source4/smb_server/smb2/receive.c
index 141fdd8..3b54c97 100644
--- a/source4/smb_server/smb2/receive.c
+++ b/source4/smb_server/smb2/receive.c
@@ -155,6 +155,7 @@ static NTSTATUS smb2srv_reply(struct smb2srv_request *req);
 static void smb2srv_chain_reply(struct smb2srv_request *p_req)
 {
NTSTATUS status;
+   struct smbsrv_connection *smb_conn = p_req-smb_conn;
struct smb2srv_request *req;
uint32_t chain_offset;
uint32_t protocol_version;
@@ -163,6 +164,8 @@ static void smb2srv_chain_reply(struct smb2srv_request 
*p_req)
uint32_t flags;
uint32_t last_hdr_offset;
 
+   talloc_steal(req, p_req);
+
last_hdr_offset = p_req-in.hdr - p_req-in.buffer;
 
chain_offset = p_req-chain_offset;
@@ -171,7 +174,7 @@ static void smb2srv_chain_reply(struct smb2srv_request 
*p_req)
if (p_req-in.size  (last_hdr_offset + chain_offset + 
SMB2_MIN_SIZE_NO_BODY)) {
DEBUG(2,(Invalid SMB2 chained packet at offset 0x%X from last 
hdr 0x%X\n,
chain_offset, last_hdr_offset));
-   smbsrv_terminate_connection(p_req-smb_conn, Invalid SMB2 
chained packet);
+   smbsrv_terminate_connection(smb_conn, Invalid SMB2 chained 
packet);
return;
}
 
@@ -179,13 +182,13 @@ static void smb2srv_chain_reply(struct smb2srv_request 
*p_req)
if (protocol_version != SMB2_MAGIC) {
DEBUG(2,(Invalid SMB chained packet: protocol prefix: 
0x%08X\n,
 protocol_version));
-   smbsrv_terminate_connection(p_req-smb_conn, NON-SMB2 chained 
packet);
+   smbsrv_terminate_connection(smb_conn, NON-SMB2 chained 
packet);
return;
}
 
-   req = smb2srv_init_request(p_req-smb_conn);
+   req = smb2srv_init_request(smb_conn);
if (!req) {
-   smbsrv_terminate_connection(p_req-smb_conn, SMB2 chained 
packet - no memory);
+   smbsrv_terminate_connection(smb_conn, SMB2 chained packet - no 
memory);
return;
}
 
@@ -206,9 +209,11 @@ static void smb2srv_chain_reply(struct 

[SCM] CTDB repository - branch 1.13 updated - ctdb-1.13-70-g0489d75

2012-04-02 Thread Ronnie Sahlberg
The branch, 1.13 has been updated
   via  0489d75a27b63f3f2e69f18400498e667995738a (commit)
   via  2899dd5d400bbfcaddc2b8a0e9a405dca979f6d0 (commit)
  from  aaec46211b72f7d6886832301eee169d4b6a5f80 (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=1.13


- Log -
commit 0489d75a27b63f3f2e69f18400498e667995738a
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Tue Apr 3 13:45:22 2012 +1000

New version 1.41

commit 2899dd5d400bbfcaddc2b8a0e9a405dca979f6d0
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Tue Apr 3 13:43:21 2012 +1000

CTDB: add back the rebalanceip command

---

Summary of changes:
 packaging/RPM/ctdb.spec.in |2 +
 tools/ctdb.c   |   75 
 2 files changed, 77 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index f9a5cef..8db59d2 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -145,6 +145,8 @@ development libraries for ctdb
 %{_libdir}/libctdb.a
 
 %changelog
+* Tue Apr 3 2012 : Version 1.41
+ - add back the rebalanceip command
 * Thu Mar 1 2012 : Version 1.13
  - This is the new stable branch for modern features for ctdb.
Main new features are performance/scaling improvements for
diff --git a/tools/ctdb.c b/tools/ctdb.c
index d482eab..a56d579 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1619,6 +1619,80 @@ static int control_rebalancenode(struct ctdb_context 
*ctdb, int argc, const char
 }
 
 
+static int rebalance_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr)
+{
+   struct ctdb_public_ip ip;
+   int ret;
+   uint32_t *nodes;
+   uint32_t disable_time;
+   TDB_DATA data;
+   struct ctdb_node_map *nodemap=NULL;
+   TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
+
+   disable_time = 30;
+   data.dptr  = (uint8_t*)disable_time;
+   data.dsize = sizeof(disable_time);
+   ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, 
CTDB_SRVID_DISABLE_IP_CHECK, data);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR,(Failed to send message to disable 
ipcheck\n));
+   return -1;
+   }
+
+   ip.pnn  = -1;
+   ip.addr = *addr;
+
+   data.dptr  = (uint8_t *)ip;
+   data.dsize = sizeof(ip);
+
+   ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), options.pnn, tmp_ctx, 
nodemap);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR, (Unable to get nodemap from node %u\n, 
options.pnn));
+   talloc_free(tmp_ctx);
+   return ret;
+   }
+
+   nodes = list_of_active_nodes(ctdb, nodemap, tmp_ctx, true);
+   ret = ctdb_client_async_control(ctdb, CTDB_CONTROL_RELEASE_IP,
+   nodes, 0,
+   LONGTIMELIMIT(),
+   false, data,
+   NULL, NULL,
+   NULL);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR,(Failed to release IP on nodes\n));
+   talloc_free(tmp_ctx);
+   return -1;
+   }
+
+   talloc_free(tmp_ctx);
+   return 0;
+}
+
+/*
+  release an ip form all nodes and have it re-assigned by recd
+ */
+static int control_rebalanceip(struct ctdb_context *ctdb, int argc, const char 
**argv)
+{
+   ctdb_sock_addr addr;
+
+   if (argc  1) {
+   usage();
+   return -1;
+   }
+
+   if (parse_ip(argv[0], NULL, 0, addr) == 0) {
+   DEBUG(DEBUG_ERR,(Wrongly formed ip address '%s'\n, argv[0]));
+   return -1;
+   }
+
+   if (rebalance_ip(ctdb, addr) != 0) {
+   DEBUG(DEBUG_ERR,(Error when trying to reassign ip\n));
+   return -1;
+   }
+
+   return 0;
+}
+
 static int getips_store_callback(void *param, void *data)
 {
struct ctdb_public_ip *node_ip = (struct ctdb_public_ip *)data;
@@ -5582,6 +5656,7 @@ static const struct {
{ listnodes,   control_listnodes, false,  true, list all 
nodes in the cluster},
{ reloadnodes, control_reload_nodes_file, false,  false, reload 
the nodes file and restart the transport on all nodes},
{ moveip,  control_moveip,false,  false, 
move/failover an ip address to another node, ip node},
+   { rebalanceip, control_rebalanceip,   false,  false, release 
an ip from the node and let recd rebalance it, ip},
{ addip,   control_addip, true,   false, add a 
ip address to a node, ip/mask iface},
{ delip,   control_delip, false,  false, delete 
an ip address from a node, ip},
{ eventscript, control_eventscript,   true,   false, run the 
eventscript with 

[SCM] CTDB repository - branch master updated - ctdb-1.13-61-g83aea64

2012-04-02 Thread Ronnie Sahlberg
The branch, master has been updated
   via  83aea6488002aa75dd25752fa0d164afb8b4f300 (commit)
   via  a2ba2c4ec153c8844cf7f5b0de03b2269ec892f3 (commit)
   via  98ac99c4a79fe2ee024890bb27c3ca68dc02d434 (commit)
   via  10ab88a5c822ac403a70a9cd1a6c81020eb91d08 (commit)
   via  2ade83de4e1f318c91489ec9a7f90d1b26f77e1b (commit)
   via  94f1e02406c353c3a0235685acdd107ee5a7f285 (commit)
   via  0cbe7a4f92795203f022252a50a240b8bd4238c3 (commit)
   via  36e690faab3d76919780c8550fe6d49fb6bbfba5 (commit)
   via  45773dab630ee44b39df0dd4b50f43fb1e7bb0ba (commit)
   via  a9e9444a7a78f5ef0e929a8dbd8ca0c68b40acd4 (commit)
  from  00cd75595685dae829758abf1a4cb644af7ed50e (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master


- Log -
commit 83aea6488002aa75dd25752fa0d164afb8b4f300
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Tue Apr 3 13:43:21 2012 +1000

CTDB: add back the rebalanceip command

commit a2ba2c4ec153c8844cf7f5b0de03b2269ec892f3
Author: Amitay Isaacs ami...@gmail.com
Date:   Fri Mar 30 12:06:05 2012 +1100

build: Substitute POPT macros once and reuse variables

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 98ac99c4a79fe2ee024890bb27c3ca68dc02d434
Author: Amitay Isaacs ami...@gmail.com
Date:   Tue Mar 27 10:53:25 2012 +1100

recovery: Add prototypes for tdb internal functions

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 10ab88a5c822ac403a70a9cd1a6c81020eb91d08
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 21 14:45:56 2012 +1100

build: Use system tdb library if available

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 2ade83de4e1f318c91489ec9a7f90d1b26f77e1b
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 21 15:56:45 2012 +1100

build: Use system tevent library if available

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 94f1e02406c353c3a0235685acdd107ee5a7f285
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 21 13:18:10 2012 +1100

build: Use system talloc library if available

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 0cbe7a4f92795203f022252a50a240b8bd4238c3
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 21 16:08:57 2012 +1100

build: Display correct LIB_FLAGS while building

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 36e690faab3d76919780c8550fe6d49fb6bbfba5
Author: Amitay Isaacs ami...@gmail.com
Date:   Tue Mar 20 09:22:54 2012 +1100

build: Remove re-definition of same variable

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 45773dab630ee44b39df0dd4b50f43fb1e7bb0ba
Author: Amitay Isaacs ami...@gmail.com
Date:   Mon Feb 6 16:45:50 2012 +1100

packaging: Setup directories for rpmbuild

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit a9e9444a7a78f5ef0e929a8dbd8ca0c68b40acd4
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Jan 11 19:04:39 2012 +1100

build: Add rules to create ctags/etags

Signed-off-by: Amitay Isaacs ami...@gmail.com

---

Summary of changes:
 Makefile.in |   44 ++---
 lib/talloc/libtalloc.m4 |   63 +---
 lib/tdb/libtdb.m4   |   66 +
 lib/tevent/libtevent.m4 |   66 --
 packaging/RPM/makerpms.sh   |8 
 server/ctdb_recover.c   |7 
 server/ctdb_update_record.c |8 ++--
 tools/ctdb.c|   75 +++
 8 files changed, 256 insertions(+), 81 deletions(-)


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index 90d7b08..1794be5 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -29,6 +29,18 @@ POPT_LIBS = @POPT_LIBS@
 POPT_CFLAGS = @POPT_CFLAGS@
 POPT_OBJ = @POPT_OBJ@
 
+TALLOC_LIBS = @TALLOC_LIBS@
+TALLOC_CFLAGS = @TALLOC_CFLAGS@
+TALLOC_OBJ = @TALLOC_OBJ@
+
+TEVENT_LIBS = @TEVENT_LIBS@
+TEVENT_CFLAGS = @TEVENT_CFLAGS@
+TEVENT_OBJ = @TEVENT_OBJ@
+
+TDB_LIBS = @TDB_LIBS@
+TDB_CFLAGS = @TDB_CFLAGS@
+TDB_OBJ = @TDB_OBJ@
+
 SOCKET_WRAPPER_OBJ = @SOCKET_WRAPPER_OBJS@
 
 PMDA_LIBS = -lpcp -lpcp_pmda
@@ -36,7 +48,7 @@ PMDA_INSTALL = @CTDB_PMDA_INSTALL@
 PMDA_DEST_DIR = /var/lib/pcp/pmdas
 
 CFLAGS=@CPPFLAGS@ -g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util 
-I$(srcdir) \
-   -I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
+   $(TALLOC_CFLAGS) $(TEVENT_CFLAGS) $(TDB_CFLAGS) -I@libreplacedir@ \
-DVARDIR=\$(localstatedir)\ -DETCDIR=\$(etcdir)\ \
-DLOGDIR=\$(logdir)\ \
-DUSE_MMAP=1 -DTEVENT_DEPRECATED_QUIET=1 @CFLAGS@ 
-Wno-format-zero-length $(POPT_CFLAGS) \
@@ -46,7 +58,8 @@ LDSHFLAGS=-fPIC -shared
 #LDSHFLAGS=-fPIC -shared -Wl,-Bsymbolic -Wl,-z,relo -Wl,-Bsymbolic-funtions 
-Wl,--as-needed -Wl,-z,defs
 SHLD=${CC}