Re: [Samba] Net rpc strange results

2011-04-29 Thread Volker Lendecke
On Thu, Apr 28, 2011 at 08:37:38PM +0200, Alejandro Escanero Blanco wrote:
 I have a ldap based domain and different machines with different
 version of samba triing to get the user list from the PDC.
 The Server is samba 3.5.6
 
 With version 3.4.7 I do:
 net rpc user -S myserver and get 1024 users
 same as wbinfo -u
 
 Whi version 3.0 I do
 net rpc user -S myserver and get 2875 users
 same as wbinfo -u
 
 Any clue?

Can you please send network traces of both commands?
Information on how to create useful network traces can be
found under

https://wiki.samba.org/index.php/Capture_Packets

With best regards,

Volker Lendecke

-- 
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
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] Cannot set ACL for Authenticated Users

2011-04-29 Thread Arnaud Lesauvage

Hi list !

I have found someone having a similar problem back in 2007 
(http://lists.samba.org/archive/samba/2007-April/131574.html), but as I 
understand it, this problem is fixed for a long time now.


So basically, I am trying to give Authenticated Users some permissions 
on a folder in a samba share, but when I wheck back either with my 
windows GUI or via getfacl, the permission has just been dismissed and 
nothing ahas changed.


The serveur is running samba version 3.2.7 on OpenSuse 11.

Here is the result of testparm :
[global]
 workgroup = dom
 realm = dom.ext
 server string = Samba Server
 security = ADS
 password server = pdc1.dom.ext pdc2.dom.ext
 idmap uid = 1200-2
 idmap gid = 1200-2
 winbind separator = +
 winbind enum users = Yes
 winbind enum groups = Yes
 winbind use default domain = Yes
 winbind expand groups = 3

And for the share where the folder is stored :
[data]
comment = data
path = /srv/samba/data
valid users = @LOCAL+Domain Users
admin users = @LOCAL+Domain Admins
read only = no
browseable = no
map acl inherit = yes
inherit acls = yes
create mask = 0600
directory mask = 0700
store dos attributes = yes
csc policy = disable

What should I change to be able to attribute permissions to the 
Authenticated Users group ?



Thanks a lot for your help !

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


Re: [Samba] Cannot set ACL for Authenticated Users

2011-04-29 Thread Aaron E.
Does the file system your working with support ACL? IS it set to use 
acls in the /etc/fstab?


On 04/29/2011 06:24 AM, Arnaud Lesauvage wrote:

Hi list !

I have found someone having a similar problem back in 2007
(http://lists.samba.org/archive/samba/2007-April/131574.html), but as I
understand it, this problem is fixed for a long time now.

So basically, I am trying to give Authenticated Users some permissions
on a folder in a samba share, but when I wheck back either with my
windows GUI or via getfacl, the permission has just been dismissed and
nothing ahas changed.

The serveur is running samba version 3.2.7 on OpenSuse 11.

Here is the result of testparm :
[global]
workgroup = dom
realm = dom.ext
server string = Samba Server
security = ADS
password server = pdc1.dom.ext pdc2.dom.ext
idmap uid = 1200-2
idmap gid = 1200-2
winbind separator = +
winbind enum users = Yes
winbind enum groups = Yes
winbind use default domain = Yes
winbind expand groups = 3

And for the share where the folder is stored :
[data]
comment = data
path = /srv/samba/data
valid users = @LOCAL+Domain Users
admin users = @LOCAL+Domain Admins
read only = no
browseable = no
map acl inherit = yes
inherit acls = yes
create mask = 0600
directory mask = 0700
store dos attributes = yes
csc policy = disable

What should I change to be able to attribute permissions to the
Authenticated Users group ?


Thanks a lot for your help !

Arnaud


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


Re: [Samba] Cannot set ACL for Authenticated Users

2011-04-29 Thread Arnaud Lesauvage

Le 29/04/2011 14:45, Aaron E. a écrit :

Does the file system your working with support ACL? IS it set to use
acls in the /etc/fstab?


Hi Aaron, thanks for your answer.
Yes, it is set to use ACL and usr_xattr. Both work well.
But Authenticated Users seem to be not mappable to a gid.





On 04/29/2011 06:24 AM, Arnaud Lesauvage wrote:

 Hi list !

 I have found someone having a similar problem back in 2007
 (http://lists.samba.org/archive/samba/2007-April/131574.html), but as I
 understand it, this problem is fixed for a long time now.

 So basically, I am trying to give Authenticated Users some permissions
 on a folder in a samba share, but when I wheck back either with my
 windows GUI or via getfacl, the permission has just been dismissed and
 nothing ahas changed.

 The serveur is running samba version 3.2.7 on OpenSuse 11.

 Here is the result of testparm :
 [global]
 workgroup = dom
 realm = dom.ext
 server string = Samba Server
 security = ADS
 password server = pdc1.dom.ext pdc2.dom.ext
 idmap uid = 1200-2
 idmap gid = 1200-2
 winbind separator = +
 winbind enum users = Yes
 winbind enum groups = Yes
 winbind use default domain = Yes
 winbind expand groups = 3

 And for the share where the folder is stored :
 [data]
 comment = data
 path = /srv/samba/data
 valid users = @LOCAL+Domain Users
 admin users = @LOCAL+Domain Admins
 read only = no
 browseable = no
 map acl inherit = yes
 inherit acls = yes
 create mask = 0600
 directory mask = 0700
 store dos attributes = yes
 csc policy = disable

 What should I change to be able to attribute permissions to the
 Authenticated Users group ?


 Thanks a lot for your help !

 Arnaud




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


Re: [Samba] Cannot set ACL for Authenticated Users

2011-04-29 Thread Aaron E.

Windows PDC?

Does wbinfo -u return a list of domain users?

On 04/29/2011 09:44 AM, Arnaud Lesauvage wrote:

Le 29/04/2011 14:45, Aaron E. a écrit :

Does the file system your working with support ACL? IS it set to use
acls in the /etc/fstab?


Hi Aaron, thanks for your answer.
Yes, it is set to use ACL and usr_xattr. Both work well.
But Authenticated Users seem to be not mappable to a gid.





On 04/29/2011 06:24 AM, Arnaud Lesauvage wrote:

Hi list !

I have found someone having a similar problem back in 2007
(http://lists.samba.org/archive/samba/2007-April/131574.html), but as I
understand it, this problem is fixed for a long time now.

So basically, I am trying to give Authenticated Users some permissions
on a folder in a samba share, but when I wheck back either with my
windows GUI or via getfacl, the permission has just been dismissed and
nothing ahas changed.

The serveur is running samba version 3.2.7 on OpenSuse 11.

Here is the result of testparm :
[global]
workgroup = dom
realm = dom.ext
server string = Samba Server
security = ADS
password server = pdc1.dom.ext pdc2.dom.ext
idmap uid = 1200-2
idmap gid = 1200-2
winbind separator = +
winbind enum users = Yes
winbind enum groups = Yes
winbind use default domain = Yes
winbind expand groups = 3

And for the share where the folder is stored :
[data]
comment = data
path = /srv/samba/data
valid users = @LOCAL+Domain Users
admin users = @LOCAL+Domain Admins
read only = no
browseable = no
map acl inherit = yes
inherit acls = yes
create mask = 0600
directory mask = 0700
store dos attributes = yes
csc policy = disable

What should I change to be able to attribute permissions to the
Authenticated Users group ?


Thanks a lot for your help !

Arnaud






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


Re: [Samba] Cannot set ACL for Authenticated Users

2011-04-29 Thread Arnaud Lesauvage

Yes, windows PDC running Windows 2003 R2 (NO unix extensions).
wbinfo -u works fine.

But wbinfo -Y S-1-5-11 returns Could not convert sid S-1-5-11 to gid
And that is exactly what happened to the OP of the discussion I quoted 
in my original message.



Le 29/04/2011 16:00, Aaron E. a écrit :

Windows PDC?

Does wbinfo -u return a list of domain users?

On 04/29/2011 09:44 AM, Arnaud Lesauvage wrote:

 Le 29/04/2011 14:45, Aaron E. a écrit :

 Does the file system your working with support ACL? IS it set to use
 acls in the /etc/fstab?


 Hi Aaron, thanks for your answer.
 Yes, it is set to use ACL and usr_xattr. Both work well.
 But Authenticated Users seem to be not mappable to a gid.





 On 04/29/2011 06:24 AM, Arnaud Lesauvage wrote:

 Hi list !

 I have found someone having a similar problem back in 2007
 (http://lists.samba.org/archive/samba/2007-April/131574.html), but as I
 understand it, this problem is fixed for a long time now.

 So basically, I am trying to give Authenticated Users some permissions
 on a folder in a samba share, but when I wheck back either with my
 windows GUI or via getfacl, the permission has just been dismissed and
 nothing ahas changed.

 The serveur is running samba version 3.2.7 on OpenSuse 11.

 Here is the result of testparm :
 [global]
 workgroup = dom
 realm = dom.ext
 server string = Samba Server
 security = ADS
 password server = pdc1.dom.ext pdc2.dom.ext
 idmap uid = 1200-2
 idmap gid = 1200-2
 winbind separator = +
 winbind enum users = Yes
 winbind enum groups = Yes
 winbind use default domain = Yes
 winbind expand groups = 3

 And for the share where the folder is stored :
 [data]
 comment = data
 path = /srv/samba/data
 valid users = @LOCAL+Domain Users
 admin users = @LOCAL+Domain Admins
 read only = no
 browseable = no
 map acl inherit = yes
 inherit acls = yes
 create mask = 0600
 directory mask = 0700
 store dos attributes = yes
 csc policy = disable

 What should I change to be able to attribute permissions to the
 Authenticated Users group ?


 Thanks a lot for your help !

 Arnaud








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


Re: [Samba] Cannot set ACL for Authenticated Users

2011-04-29 Thread Jeremy Allison
On Fri, Apr 29, 2011 at 04:11:34PM +0200, Arnaud Lesauvage wrote:
 Yes, windows PDC running Windows 2003 R2 (NO unix extensions).
 wbinfo -u works fine.
 
 But wbinfo -Y S-1-5-11 returns Could not convert sid S-1-5-11 to gid
 And that is exactly what happened to the OP of the discussion I
 quoted in my original message.

Try force unknown acl user = yes
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] Time sync in Samba4

2011-04-29 Thread felix

Hello.

How can I have my windows clients synchronized with my Samba4 domain
controller without using startup scripts??

I've played with Group Policies the same way they are configured when a
w2k3 server is used and I couldn't make it this way.

I also tried installing ntpd.
I'm using Samba4 alpha 15 in a Debian Lenny Box.

Any suggestions??

Thanks in advance.
Regards,
Felix.

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


[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Stefan Metzmacher
The branch, master has been updated
   via  e050677 Revert s4:selftest: skip s3member tests for now
  from  ffb2dcf s4:libcli/smb_composite: move 
smb2_composite_setpathinfo_setinfo_done()

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


- Log -
commit e050677c7f9986cbc6c15319482079014167f9b4
Author: Stefan Metzmacher me...@samba.org
Date:   Fri Apr 29 07:16:35 2011 +0200

Revert s4:selftest: skip s3member tests for now

This reverts commit c5034ac3155958c0d3e2a1cfbfc669bc2e869f29.

This doesn't seem to help and isn't needed if the filesystem
has posix acl support.

metze

Autobuild-User: Stefan Metzmacher me...@samba.org
Autobuild-Date: Fri Apr 29 08:23:01 CEST 2011 on sn-devel-104

---

Summary of changes:
 source4/selftest/skip |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/selftest/skip b/source4/selftest/skip
index fed59ed..671269a 100644
--- a/source4/selftest/skip
+++ b/source4/selftest/skip
@@ -84,4 +84,3 @@ smb2.acls # new test which doesn't pass yet
 # ktutil might not be installed or from mit...
 # we should build a samba4ktutil and use that instead
 samba4.blackbox.ktpass # this test isn't portable ...
-s3member # this tests sometimes fail to start the environment


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Andrew Bartlett
The branch, master has been updated
   via  f967931 build: put doserr.c into it's own subsystem, so it's no 
longer a duplicate
   via  3542bd3 selftest: Restore the s3member environment by avoiding 
smbcacls
   via  bc31e9c s4-param Rename lp_destructor() - lpcfg_destructor() for 
consistency
   via  96136ad s4-param Rename unused lp_ functions to match param.h
   via  7730ab0 s4-param Rename volume_label() - lpcfg_volume_label()
   via  93ace5c lib/util Re-merge the string_sub() and all_string_sub() 
from source3
   via  9a9124b lib/util/charset Move strstr_m() to the top level
   via  67905b4 s4-param Rename private_path() - lpcfg_private_path()
   via  dbbc6e9 s4-param Remove config_path() - lpcfg_config_path()
   via  209d47c s4-param Rename lock_path() - lpcfg_lock_path()
   via  6021af4 libcli/smb Move attrib_string in common
   via  724915f s3-client Add TALLOC_CTX argument to attrib_string().
   via  0520da2 s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
   via  0eca33b s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR
   via  08c90d6 s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID
   via  0a3c84b s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM
   via  317e19a s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN
   via  7f66ebd s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY
   via  9f75b7c libcli/smb Move FILE_ATTRIBUTE defines to the top level
   via  5cc7a3a s3-libads Move variables into if (socket_wrapper_dir()) 
where they are used.
   via  bb520dc build: Fix kerberos build issues in top level build
   via  a3ec605 s3-ldap Move ldap prototypes to inside #ifdef HAVE_LDAP_H
  from  e050677 Revert s4:selftest: skip s3member tests for now

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


- Log -
commit f96793142d0b5a6e0bdb0bcf4811178f3274949c
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 16:57:41 2011 +1000

build: put doserr.c into it's own subsystem, so it's no longer a duplicate

Autobuild-User: Andrew Bartlett abart...@samba.org
Autobuild-Date: Fri Apr 29 10:00:32 CEST 2011 on sn-devel-104

commit 3542bd324ecea130292909fd052f71ab0790b7d3
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 15:54:20 2011 +1000

selftest: Restore the s3member environment by avoiding smbcacls

This removes the need for acls on the filesystem for simple domain
member tests.  ACL tests should be written at some point...

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell tri...@samba.org

commit bc31e9c7d2a030dc0f63322f5c42d2fe22bbf7ff
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 14:02:16 2011 +1000

s4-param Rename lp_destructor() - lpcfg_destructor() for consistency

commit 96136ad6567fc1793bf0669c4fd65f680d521dae
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 13:58:26 2011 +1000

s4-param Rename unused lp_ functions to match param.h

commit 7730ab00b5c0c8c8bf7b239c65cf769108874dae
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 13:30:18 2011 +1000

s4-param Rename volume_label() - lpcfg_volume_label()

commit 93ace5cc2484b53fc33d4689ccc286defbe2b728
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 13:20:51 2011 +1000

lib/util Re-merge the string_sub() and all_string_sub() from source3

Andrew Bartlett

commit 9a9124b08760a6235059f517b9a138337754cd02
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 13:19:41 2011 +1000

lib/util/charset Move strstr_m() to the top level

commit 67905b41a97fb7c0a7f4c7070e837f1fcb8bfbb4
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 12:47:11 2011 +1000

s4-param Rename private_path() - lpcfg_private_path()

This is consistent with lock_path()

Andrew Bartlett

commit dbbc6e9ddac30de869d67410869dba90b4bd4a19
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 12:46:10 2011 +1000

s4-param Remove config_path() - lpcfg_config_path()

This is consistent with lock_path()

Andrew Bartlett

commit 209d47c100bf59f15519c4c82089285210041c2e
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 12:41:45 2011 +1000

s4-param Rename lock_path() - lpcfg_lock_path()

This avoids a conflict with the source3/ lock_path()

commit 6021af4fd38d2a712dca42a3cacf8537007fd160
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 12:41:27 2011 +1000

libcli/smb Move attrib_string in common

commit 724915f721819705c7cf5c850a24b32f815c07e3
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 12:05:07 2011 +1000

s3-client Add TALLOC_CTX argument to attrib_string().

This ensures the caller knows where the memory was allocated.

Andrew Bartlett

commit 0520da2bbe246c45d89bfdec0d399862ecb867ba
Author: Andrew Bartlett abart...@samba.org

[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Andrew Bartlett
The branch, master has been updated
   via  4d41a5e s3-ldap Only prototype ldap_init_fd() when we have found it 
in the libraries
  from  f967931 build: put doserr.c into it's own subsystem, so it's no 
longer a duplicate

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


- Log -
commit 4d41a5effdc9a13921367be3412b53a39f75d73a
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 18:43:30 2011 +1000

s3-ldap Only prototype ldap_init_fd() when we have found it in the libraries

Autobuild-User: Andrew Bartlett abart...@samba.org
Autobuild-Date: Fri Apr 29 11:47:07 CEST 2011 on sn-devel-104

---

Summary of changes:
 source3/include/smb_ldap.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h
index 613f6dc..389a734 100644
--- a/source3/include/smb_ldap.h
+++ b/source3/include/smb_ldap.h
@@ -26,7 +26,10 @@ typedef int ber_int_t;
 #ifdef HAVE_LDAP_PVT_H
 #include ldap_pvt.h
 #endif /* HAVE_LDAP_PVT_H */
+
+#ifdef HAVE_LDAP_INIT_FD
 int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp);
+#endif
 
 /* function declarations not included in proto.h */
 LDAP *ldap_open_with_timeout(const char *server,


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Günther Deschner
The branch, master has been updated
   via  50883cf s3-tevent: only include ../lib/util/tevent wrappers where 
needed.
   via  1247622 s3-tsocket: only include ../lib/tsocket/tsocket.h where 
needed.
   via  bc6f24e s3-build: remove some unused headers.
  from  4d41a5e s3-ldap Only prototype ldap_init_fd() when we have found it 
in the libraries

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


- Log -
commit 50883cfeb4eed3d538f71443060745f8747044c9
Author: Günther Deschner g...@samba.org
Date:   Thu Apr 28 17:38:09 2011 +0200

s3-tevent: only include ../lib/util/tevent wrappers where needed.

Guenther

Autobuild-User: Günther Deschner g...@samba.org
Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104

commit 12476223c6aa7473c55bcf529639eefce8450680
Author: Günther Deschner g...@samba.org
Date:   Thu Apr 28 17:26:40 2011 +0200

s3-tsocket: only include ../lib/tsocket/tsocket.h where needed.

Guenther

commit bc6f24e89f2dd6204209fc9bacc7bfa9c22d0a57
Author: Günther Deschner g...@samba.org
Date:   Thu Apr 28 16:37:05 2011 +0200

s3-build: remove some unused headers.

Guenther

---

Summary of changes:
 source3/include/includes.h |3 ---
 source3/include/proto.h|1 +
 source3/lib/addrchange.c   |1 +
 source3/lib/fncall.c   |1 +
 source3/lib/tldap.c|2 ++
 source3/lib/util_sock.c|2 ++
 source3/lib/util_tsock.c   |2 ++
 source3/librpc/rpc/rpc_common.c|1 -
 source3/libsmb/async_smb.c |2 ++
 source3/libsmb/cli_np_tstream.c|1 +
 source3/libsmb/cliconnect.c|1 +
 source3/libsmb/clidgram.c  |1 +
 source3/libsmb/clientgen.c |1 +
 source3/libsmb/clifile.c   |1 +
 source3/libsmb/clifsinfo.c |1 +
 source3/libsmb/clilist.c   |1 +
 source3/libsmb/climessage.c|1 +
 source3/libsmb/clioplock.c |1 +
 source3/libsmb/clirap.c|1 +
 source3/libsmb/clireadwrite.c  |1 +
 source3/libsmb/clitrans.c  |1 +
 source3/libsmb/namequery.c |1 +
 source3/libsmb/smbsock_connect.c   |1 +
 source3/libsmb/unexpected.c|1 +
 source3/rpc_client/cli_pipe.c  |1 +
 source3/rpc_client/rpc_transport_np.c  |1 +
 source3/rpc_client/rpc_transport_sock.c|1 +
 source3/rpc_client/rpc_transport_tstream.c |1 +
 source3/rpc_server/rpc_ncacn_np.c  |2 ++
 source3/rpc_server/srv_pipe_hnd.c  |2 ++
 source3/smbd/aio.c |1 +
 source3/smbd/lanman.c  |3 ---
 source3/smbd/msg_idmap.c   |2 --
 source3/smbd/process.c |1 +
 source3/smbd/server.c  |1 -
 source3/smbd/service.c |1 +
 source3/smbd/sesssetup.c   |1 +
 source3/smbd/smb2_break.c  |1 +
 source3/smbd/smb2_create.c |1 +
 source3/smbd/smb2_find.c   |1 +
 source3/smbd/smb2_flush.c  |1 +
 source3/smbd/smb2_getinfo.c|1 +
 source3/smbd/smb2_ioctl.c  |1 +
 source3/smbd/smb2_lock.c   |1 +
 source3/smbd/smb2_notify.c |1 +
 source3/smbd/smb2_read.c   |1 +
 source3/smbd/smb2_server.c |1 +
 source3/smbd/smb2_setinfo.c|1 +
 source3/smbd/smb2_write.c  |1 +
 source3/torture/nbench.c   |1 +
 source3/torture/torture.c  |1 +
 source3/winbindd/winbindd.h|2 ++
 source3/winbindd/winbindd_dual.c   |1 +
 53 files changed, 55 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/includes.h b/source3/include/includes.h
index 014d1d4..f4cac1a 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -520,9 +520,6 @@ typedef char fstring[FSTRING_LEN];
 #include talloc.h
 
 #include event.h
-#include ../lib/util/tevent_unix.h
-#include ../lib/util/tevent_ntstatus.h
-#include ../lib/tsocket/tsocket.h
 
 #include ../lib/util/data_blob.h
 #include ../lib/util/time.h
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c9552d7..b4a9109 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -925,6 +925,7 @@ struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
 int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res);
 int 

autobuild: intermittent test failure detected

2011-04-29 Thread 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/2011-04-29-1442/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-29-1442/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-04-29-1442/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-29-1442/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-04-29-1442/samba4.stdout
  
The top commit at the time of the failure was:

commit 4d41a5effdc9a13921367be3412b53a39f75d73a
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 18:43:30 2011 +1000

s3-ldap Only prototype ldap_init_fd() when we have found it in the libraries

Autobuild-User: Andrew Bartlett abart...@samba.org
Autobuild-Date: Fri Apr 29 11:47:07 CEST 2011 on sn-devel-104


[SCM] Samba Shared Repository - branch v3-6-test updated

2011-04-29 Thread Günther Deschner
The branch, v3-6-test has been updated
   via  c3b2d25 s3-tevent: only include ../lib/util/tevent wrappers where 
needed.
   via  0afb13f s3-tsocket: only include ../lib/tsocket/tsocket.h where 
needed.
   via  7ca8ea5 s3-build: remove some unused headers.
  from  284c00d s3: Close the winbind client fds after forking

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit c3b2d2579e1d7310724a2f9576f6d2af7843d457
Author: Günther Deschner g...@samba.org
Date:   Thu Apr 28 17:38:09 2011 +0200

s3-tevent: only include ../lib/util/tevent wrappers where needed.

Guenther

Autobuild-User: Günther Deschner g...@samba.org
Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
(cherry picked from commit 50883cfeb4eed3d538f71443060745f8747044c9)

commit 0afb13fed8d62fd147d59d14f3028a069203b224
Author: Günther Deschner g...@samba.org
Date:   Thu Apr 28 17:26:40 2011 +0200

s3-tsocket: only include ../lib/tsocket/tsocket.h where needed.

Guenther
(cherry picked from commit 12476223c6aa7473c55bcf529639eefce8450680)

commit 7ca8ea51f8fc5ca77a27211106007f323857341a
Author: Günther Deschner g...@samba.org
Date:   Thu Apr 28 16:37:05 2011 +0200

s3-build: remove some unused headers.

Guenther
(cherry picked from commit bc6f24e89f2dd6204209fc9bacc7bfa9c22d0a57)

---

Summary of changes:
 source3/include/includes.h |3 ---
 source3/include/proto.h|1 +
 source3/lib/addrchange.c   |1 +
 source3/lib/fncall.c   |1 +
 source3/lib/tldap.c|2 ++
 source3/lib/util_sock.c|2 ++
 source3/lib/util_tsock.c   |2 ++
 source3/librpc/rpc/rpc_common.c|1 -
 source3/libsmb/async_smb.c |2 ++
 source3/libsmb/cli_np_tstream.c|1 +
 source3/libsmb/cliconnect.c|1 +
 source3/libsmb/clidgram.c  |1 +
 source3/libsmb/clientgen.c |1 +
 source3/libsmb/clifile.c   |1 +
 source3/libsmb/clifsinfo.c |1 +
 source3/libsmb/clilist.c   |1 +
 source3/libsmb/climessage.c|1 +
 source3/libsmb/clioplock.c |1 +
 source3/libsmb/clirap.c|1 +
 source3/libsmb/clireadwrite.c  |1 +
 source3/libsmb/clitrans.c  |1 +
 source3/libsmb/namequery.c |1 +
 source3/libsmb/smbsock_connect.c   |1 +
 source3/libsmb/unexpected.c|1 +
 source3/rpc_client/cli_pipe.c  |1 +
 source3/rpc_client/rpc_transport_np.c  |1 +
 source3/rpc_client/rpc_transport_sock.c|1 +
 source3/rpc_client/rpc_transport_tstream.c |1 +
 source3/rpc_server/rpc_ncacn_np.c  |2 ++
 source3/rpc_server/srv_pipe_hnd.c  |2 ++
 source3/smbd/aio.c |1 +
 source3/smbd/lanman.c  |3 ---
 source3/smbd/msg_idmap.c   |2 --
 source3/smbd/process.c |1 +
 source3/smbd/server.c  |1 -
 source3/smbd/service.c |1 +
 source3/smbd/sesssetup.c   |1 +
 source3/smbd/smb2_break.c  |1 +
 source3/smbd/smb2_create.c |1 +
 source3/smbd/smb2_find.c   |1 +
 source3/smbd/smb2_flush.c  |1 +
 source3/smbd/smb2_getinfo.c|1 +
 source3/smbd/smb2_ioctl.c  |1 +
 source3/smbd/smb2_lock.c   |1 +
 source3/smbd/smb2_notify.c |1 +
 source3/smbd/smb2_read.c   |1 +
 source3/smbd/smb2_server.c |1 +
 source3/smbd/smb2_setinfo.c|1 +
 source3/smbd/smb2_write.c  |1 +
 source3/torture/nbench.c   |1 +
 source3/torture/torture.c  |1 +
 source3/winbindd/winbindd.h|2 ++
 source3/winbindd/winbindd_dual.c   |1 +
 53 files changed, 55 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/includes.h b/source3/include/includes.h
index 6d0b15c..c5ce10a 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -520,9 +520,6 @@ typedef char fstring[FSTRING_LEN];
 #include talloc.h
 
 #include event.h
-#include ../lib/util/tevent_unix.h
-#include ../lib/util/tevent_ntstatus.h
-#include ../lib/tsocket/tsocket.h
 
 #include ../lib/util/data_blob.h
 #include ../lib/util/time.h
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 7d73906..d44dfb6 100644
--- a/source3/include/proto.h

[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Volker Lendecke
The branch, master has been updated
   via  df099e6 s3: Avoid a potential 100% CPU loop in winbindd
   via  aa5abca s3: Make winbindd_reinit_after_fork return NTSTATUS
   via  0757688 s3: In winbind, close parent/child sockets
  from  50883cf s3-tevent: only include ../lib/util/tevent wrappers where 
needed.

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


- Log -
commit df099e66240c7670c9f7b7dcccb1c38216bac3ec
Author: Volker Lendecke v...@samba.org
Date:   Fri Apr 29 13:00:14 2011 +0200

s3: Avoid a potential 100% CPU loop in winbindd

In the clustering case if ctdb is unhappy, winbindd_reinit_after_fork fails.
This can lead to an endless loop depending on the scheduling of the parent 
vs
child. Parent forks, child is immediately scheduled and exits. Parent gets
SIGCHLD, parent is then scheduled before it sends the request out to the 
child.
Parent tries to fork again immediately.

The code before this patch did not really take into account that
reinit_after_fork can fail. The code now sends the result of
winbindd_reinit_after_fork to the parent and the parent only considers the
child alive when it got NT_STATUS_OK.

This was seen in 3.4 winbind. winbind has changed significantly since then, 
so
it might be possible that this does not happen anymore in exactly this way. 
But
passing up the status of reinit_after_fork and only consider the child alive
when that's ok is the correct thing to do anyway.

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Fri Apr 29 17:58:19 CEST 2011 on sn-devel-104

commit aa5abcaf7e2844e3bd3d8e8fe26488673ad3c00e
Author: Volker Lendecke v...@samba.org
Date:   Fri Apr 29 12:53:13 2011 +0200

s3: Make winbindd_reinit_after_fork return NTSTATUS

commit 0757688eb34ec1a22bf8c28f72416d6684756647
Author: Volker Lendecke v...@samba.org
Date:   Thu Apr 28 13:26:57 2011 +0200

s3: In winbind, close parent/child sockets

This should further reduce fd load in winbind children

---

Summary of changes:
 source3/winbindd/winbindd.c   |6 +++-
 source3/winbindd/winbindd_cm.c|6 +++-
 source3/winbindd/winbindd_dual.c  |   53 -
 source3/winbindd/winbindd_proto.h |3 +-
 4 files changed, 58 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 033c436..071b3cc 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -378,6 +378,7 @@ static void winbind_msg_validate_cache(struct 
messaging_context *msg_ctx,
 {
uint8 ret;
pid_t child_pid;
+   NTSTATUS status;
 
DEBUG(10, (winbindd_msg_validate_cache: got validate-cache 
   message.\n));
@@ -404,7 +405,10 @@ static void winbind_msg_validate_cache(struct 
messaging_context *msg_ctx,
 
/* child */
 
-   if (!winbindd_reinit_after_fork(NULL)) {
+   status = winbindd_reinit_after_fork(NULL, NULL);
+   if (!NT_STATUS_IS_OK(status)) {
+   DEBUG(1, (winbindd_reinit_after_fork failed: %s\n,
+ nt_errstr(status)));
_exit(0);
}
 
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 06d954f..d9fca5f 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -189,6 +189,7 @@ static bool fork_child_dc_connect(struct winbindd_domain 
*domain)
TALLOC_CTX *mem_ctx = NULL;
pid_t parent_pid = sys_getpid();
char *lfile = NULL;
+   NTSTATUS status;
 
if (domain-dc_probe_pid != (pid_t)-1) {
/*
@@ -233,7 +234,10 @@ static bool fork_child_dc_connect(struct winbindd_domain 
*domain)
}
}
 
-   if (!winbindd_reinit_after_fork(lfile)) {
+   status = winbindd_reinit_after_fork(NULL, lfile);
+   if (!NT_STATUS_IS_OK(status)) {
+   DEBUG(1, (winbindd_reinit_after_fork failed: %s\n,
+ nt_errstr(status)));
messaging_send_buf(winbind_messaging_context(),
   pid_to_procid(parent_pid),
   MSG_WINBIND_FAILED_TO_GO_ONLINE,
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 04ef3d8..ebafe8f 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1167,7 +1167,8 @@ static void child_msg_dump_event_list(struct 
messaging_context *msg,
dump_event_list(winbind_event_context());
 }
 
-bool winbindd_reinit_after_fork(const char *logfilename)
+NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
+   const char *logfilename)
 {
struct winbindd_domain 

autobuild: intermittent test failure detected

2011-04-29 Thread 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/2011-04-29-1843/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-29-1843/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-04-29-1843/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-29-1843/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-04-29-1843/samba4.stdout
  
The top commit at the time of the failure was:

commit df099e66240c7670c9f7b7dcccb1c38216bac3ec
Author: Volker Lendecke v...@samba.org
Date:   Fri Apr 29 13:00:14 2011 +0200

s3: Avoid a potential 100% CPU loop in winbindd

In the clustering case if ctdb is unhappy, winbindd_reinit_after_fork fails.
This can lead to an endless loop depending on the scheduling of the parent 
vs
child. Parent forks, child is immediately scheduled and exits. Parent gets
SIGCHLD, parent is then scheduled before it sends the request out to the 
child.
Parent tries to fork again immediately.

The code before this patch did not really take into account that
reinit_after_fork can fail. The code now sends the result of
winbindd_reinit_after_fork to the parent and the parent only considers the
child alive when it got NT_STATUS_OK.

This was seen in 3.4 winbind. winbind has changed significantly since then, 
so
it might be possible that this does not happen anymore in exactly this way. 
But
passing up the status of reinit_after_fork and only consider the child alive
when that's ok is the correct thing to do anyway.

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Fri Apr 29 17:58:19 CEST 2011 on sn-devel-104


[SCM] Samba Shared Repository - branch v3-6-test updated

2011-04-29 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  a02d916 s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
   via  51023a0 s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR
   via  6b2730f s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID
   via  983e1ac s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM
   via  a0071e3 s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN
   via  163267b s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY
   via  2805f85 Add FILE_ATTRIBUTE_VOLUME.
  from  c3b2d25 s3-tevent: only include ../lib/util/tevent wrappers where 
needed.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit a02d91689858e0195f660e9b7f5d88004c06c8e0
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 12:00:57 2011 +1000

s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH

This means we use just one constant for this file attribute.

Andrew Bartlett
(cherry picked from commit 0520da2bbe246c45d89bfdec0d399862ecb867ba)

commit 51023a0d5a46334e6370b9dec9f9722ddb28c1d8
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 11:57:02 2011 +1000

s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR

This means we use just one constant for this file attribute.

Andrew Bartlett
(cherry picked from commit 0eca33bbf620678759bbe39efaa74f33f96efb74)

commit 6b2730f1c6a32c198fa948749e9aed496e99366c
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 11:52:48 2011 +1000

s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID

This means we use just one constant for this file attribute.

Andrew Bartlett
(cherry picked from commit 08c90d6f2df85499f43c5766a62839e80437290f)

commit 983e1ac9f0051e924890c64be99c9a4e35ee411a
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 13:23:14 2011 +1000

s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM

This means we use just one constant for this file attribute.

Andrew Bartlett
(cherry picked from commit 0a3c84b554f3862b3e558f62e67ceb8311b248ce)

commit a0071e39d67411d578e34a7d03dff9906ff5ea94
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 11:43:35 2011 +1000

s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN

This means we use just one constant for this file attribute.

Andrew Bartlett
(cherry picked from commit 317e19aeb3fbdb21573b6ef1bc8c2af646a7e61e)

commit 163267bb107368d5dd457cde5fbad40a6434752e
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Apr 29 11:36:14 2011 +1000

s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY

This means we use just one constant for this file attribute.

Andrew Bartlett
(cherry picked from commit 7f66ebde2e2975b079f6c135b131d064dab38624)

commit 2805f8596c42f2834db089c6f96a81651db6ad33
Author: Jeremy Allison j...@samba.org
Date:   Fri Apr 29 09:08:20 2011 -0700

Add FILE_ATTRIBUTE_VOLUME.

---

Summary of changes:
 source3/client/client.c   |   40 
 source3/client/clitar.c   |   22 ++--
 source3/include/smb.h |9 +--
 source3/include/smb_macros.h  |   10 +-
 source3/lib/util.c|   12 +-
 source3/libgpo/gpo_filesync.c |4 +-
 source3/libsmb/clifile.c  |6 +-
 source3/libsmb/libsmb_dir.c   |   18 ++--
 source3/locking/locking.c |2 +-
 source3/modules/onefs_acl.c   |2 +-
 source3/modules/onefs_open.c  |8 +-
 source3/smbd/dir.c|8 +-
 source3/smbd/dosmode.c|   90 
 source3/smbd/fileio.c |2 +-
 source3/smbd/nttrans.c|4 +-
 source3/smbd/open.c   |   10 +-
 source3/smbd/reply.c  |   40 
 source3/smbd/smb2_find.c  |2 +-
 source3/smbd/trans2.c |   18 ++--
 source3/torture/denytest.c|8 +-
 source3/torture/locktest.c|2 +-
 source3/torture/locktest2.c   |2 +-
 source3/torture/mangle_test.c |   10 +-
 source3/torture/masktest.c|   10 +-
 source3/torture/nbio.c|8 +-
 source3/torture/scanner.c |4 +-
 source3/torture/torture.c |  228 
 source3/torture/utable.c  |8 +-
 source3/utils/net_rpc.c   |4 +-
 source3/utils/smbcacls.c  |2 +-
 30 files changed, 293 insertions(+), 300 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index a12f8a2..4c90716 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -505,7 +505,7 @@ static bool do_this_one(struct file_info *finfo)
return false;
}
 
-   if (finfo-mode  aDIR) {
+   if (finfo-mode  FILE_ATTRIBUTE_DIRECTORY) {
return true;
}
 
@@ -520,7 +520,7 @@ static bool do_this_one(struct file_info *finfo)
return false;
 

[SCM] Samba Shared Repository - branch v3-6-test updated

2011-04-29 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  59d1c3a s3: Avoid a potential 100% CPU loop in winbindd
   via  31b9258 s3: Make winbindd_reinit_after_fork return NTSTATUS (cherry 
picked from commit aa5abcaf7e2844e3bd3d8e8fe26488673ad3c00e)
   via  114cc59 s3: In winbind, close parent/child sockets
  from  a02d916 s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit 59d1c3a296cede628b46edb74693e08e7f388c38
Author: Volker Lendecke v...@samba.org
Date:   Fri Apr 29 13:00:14 2011 +0200

s3: Avoid a potential 100% CPU loop in winbindd

In the clustering case if ctdb is unhappy, winbindd_reinit_after_fork fails.
This can lead to an endless loop depending on the scheduling of the parent 
vs
child. Parent forks, child is immediately scheduled and exits. Parent gets
SIGCHLD, parent is then scheduled before it sends the request out to the 
child.
Parent tries to fork again immediately.

The code before this patch did not really take into account that
reinit_after_fork can fail. The code now sends the result of
winbindd_reinit_after_fork to the parent and the parent only considers the
child alive when it got NT_STATUS_OK.

This was seen in 3.4 winbind. winbind has changed significantly since then, 
so
it might be possible that this does not happen anymore in exactly this way. 
But
passing up the status of reinit_after_fork and only consider the child alive
when that's ok is the correct thing to do anyway.

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Fri Apr 29 17:58:19 CEST 2011 on sn-devel-104
(cherry picked from commit df099e66240c7670c9f7b7dcccb1c38216bac3ec)

commit 31b9258c40365f97fdd707c9756764bc94392726
Author: Volker Lendecke v...@samba.org
Date:   Fri Apr 29 12:53:13 2011 +0200

s3: Make winbindd_reinit_after_fork return NTSTATUS
(cherry picked from commit aa5abcaf7e2844e3bd3d8e8fe26488673ad3c00e)

commit 114cc59409932f6afc2149fd758784a8556374e9
Author: Volker Lendecke v...@samba.org
Date:   Thu Apr 28 13:26:57 2011 +0200

s3: In winbind, close parent/child sockets

This should further reduce fd load in winbind children
(cherry picked from commit 0757688eb34ec1a22bf8c28f72416d6684756647)

---

Summary of changes:
 source3/winbindd/winbindd.c   |6 +++-
 source3/winbindd/winbindd_cm.c|6 +++-
 source3/winbindd/winbindd_dual.c  |   53 -
 source3/winbindd/winbindd_proto.h |3 +-
 4 files changed, 58 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index f6b3e8d..f9742f2 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -387,6 +387,7 @@ static void winbind_msg_validate_cache(struct 
messaging_context *msg_ctx,
 {
uint8 ret;
pid_t child_pid;
+   NTSTATUS status;
 
DEBUG(10, (winbindd_msg_validate_cache: got validate-cache 
   message.\n));
@@ -413,7 +414,10 @@ static void winbind_msg_validate_cache(struct 
messaging_context *msg_ctx,
 
/* child */
 
-   if (!winbindd_reinit_after_fork(NULL)) {
+   status = winbindd_reinit_after_fork(NULL, NULL);
+   if (!NT_STATUS_IS_OK(status)) {
+   DEBUG(1, (winbindd_reinit_after_fork failed: %s\n,
+ nt_errstr(status)));
_exit(0);
}
 
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 06d954f..d9fca5f 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -189,6 +189,7 @@ static bool fork_child_dc_connect(struct winbindd_domain 
*domain)
TALLOC_CTX *mem_ctx = NULL;
pid_t parent_pid = sys_getpid();
char *lfile = NULL;
+   NTSTATUS status;
 
if (domain-dc_probe_pid != (pid_t)-1) {
/*
@@ -233,7 +234,10 @@ static bool fork_child_dc_connect(struct winbindd_domain 
*domain)
}
}
 
-   if (!winbindd_reinit_after_fork(lfile)) {
+   status = winbindd_reinit_after_fork(NULL, lfile);
+   if (!NT_STATUS_IS_OK(status)) {
+   DEBUG(1, (winbindd_reinit_after_fork failed: %s\n,
+ nt_errstr(status)));
messaging_send_buf(winbind_messaging_context(),
   pid_to_procid(parent_pid),
   MSG_WINBIND_FAILED_TO_GO_ONLINE,
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 04ef3d8..ebafe8f 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1167,7 +1167,8 @@ static void child_msg_dump_event_list(struct 
messaging_context *msg,

[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Matthias Dieter Wallnöfer
The branch, master has been updated
   via  e64ffee ldb:tdb backend - cache - remove unused last_attribute 
structure member
   via  bbf2870 s4:ldb_connect calls - proof for != LDB_SUCCESS
   via  6611f0109 s4:torture/rpc/testjoin.c - use a LDB result constant
   via  aec1bc7 ldb:tools/cmdline.c + tools/ldbtest.c - make use of LDB 
result constants
   via  cc1cf31 s4:repl_meta_data LDB module - quiet a discard const ptr 
warning
   via  d4a06d5 ldb:ldb_controls.c - fix comment indentation
   via  3884fec s4:token_group.py python test - fix typos
  from  df099e6 s3: Avoid a potential 100% CPU loop in winbindd

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


- Log -
commit e64ffee1c212b6956a993ebb2032f664c0ac5802
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Apr 10 19:41:34 2011 +0200

ldb:tdb backend - cache - remove unused last_attribute structure member

Reviewed-by: abartlet

Autobuild-User: Matthias Dieter Wallnöfer m...@samba.org
Autobuild-Date: Fri Apr 29 20:07:27 CEST 2011 on sn-devel-104

commit bbf28703a47fc464a7d5dac25e6a4a6cf96fe3e9
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Apr 10 20:47:18 2011 +0200

s4:ldb_connect calls - proof for != LDB_SUCCESS

Reviewed-by: abartlet

commit 6611f0109b73d8c9ff5679e434aa8e354f28608a
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Apr 10 20:47:43 2011 +0200

s4:torture/rpc/testjoin.c - use a LDB result constant

Reviewed-by: abartlet

commit aec1bc7febfb8d3b18018e7b5b653210a0d94e93
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Apr 10 19:35:22 2011 +0200

ldb:tools/cmdline.c + tools/ldbtest.c - make use of LDB result constants

Reviewed-by: abartlet

commit cc1cf31e55b455f67d846ebe1fe60d305ae2ca11
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Wed Apr 13 09:14:44 2011 +0200

s4:repl_meta_data LDB module - quiet a discard const ptr warning

commit d4a06d5dac813951cff3f76704199ec5b6dc834c
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Apr 10 19:24:16 2011 +0200

ldb:ldb_controls.c - fix comment indentation

Reviewed-by: abartlet

commit 3884fec3d504af8c4bc9cff1e6c1a540d874ec8c
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Fri Apr 29 19:03:48 2011 +0200

s4:token_group.py python test - fix typos

---

Summary of changes:
 source4/dns_server/dlz_bind9.c  |2 +-
 source4/dsdb/samdb/ldb_modules/proxy.c  |2 +-
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |2 +-
 source4/dsdb/tests/python/token_group.py|4 ++--
 source4/lib/ldb/common/ldb_controls.c   |8 
 source4/lib/ldb/ldb_tdb/ldb_cache.c |3 ---
 source4/lib/ldb/ldb_tdb/ldb_tdb.h   |5 -
 source4/lib/ldb/tools/cmdline.c |2 +-
 source4/lib/ldb/tools/ldbtest.c |2 +-
 source4/torture/rpc/testjoin.c  |4 ++--
 10 files changed, 13 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 4399e1c..4873112 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -533,7 +533,7 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
}
 
ret = ldb_connect(state-samdb, options.url, 0, NULL);
-   if (ret == -1) {
+   if (ret != LDB_SUCCESS) {
state-log(ISC_LOG_ERROR, samba_dlz: Failed to connect to %s - 
%s,
   options.url, ldb_errstring(state-samdb));
result = ISC_R_FAILURE;
diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c 
b/source4/dsdb/samdb/ldb_modules/proxy.c
index 6fba24f..5f6e56f 100644
--- a/source4/dsdb/samdb/ldb_modules/proxy.c
+++ b/source4/dsdb/samdb/ldb_modules/proxy.c
@@ -138,7 +138,7 @@ static int load_proxy_info(struct ldb_module *module)
ldb_set_opaque(proxy-upstream, credentials, creds);
 
ret = ldb_connect(proxy-upstream, url, 0, NULL);
-   if (ret != 0) {
+   if (ret != LDB_SUCCESS) {
ldb_debug(ldb, LDB_DEBUG_FATAL, proxy failed to connect to 
%s\n, url);
goto failed;
}
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c 
b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 646abeb..90933c4 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -2488,7 +2488,7 @@ static int replmd_rename_callback(struct ldb_request 
*req, struct ldb_reply *are
if (ret == LDB_ERR_REFERRAL) {
struct ldb_dn *olddn = ac-req-op.rename.olddn;
struct loadparm_context *lp_ctx;
-   const char *referral;
+   char *referral;
 
   

autobuild: intermittent test failure detected

2011-04-29 Thread 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/2011-04-29-2042/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-29-2042/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-04-29-2042/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-29-2042/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-04-29-2042/samba4.stdout
  
The top commit at the time of the failure was:

commit df099e66240c7670c9f7b7dcccb1c38216bac3ec
Author: Volker Lendecke v...@samba.org
Date:   Fri Apr 29 13:00:14 2011 +0200

s3: Avoid a potential 100% CPU loop in winbindd

In the clustering case if ctdb is unhappy, winbindd_reinit_after_fork fails.
This can lead to an endless loop depending on the scheduling of the parent 
vs
child. Parent forks, child is immediately scheduled and exits. Parent gets
SIGCHLD, parent is then scheduled before it sends the request out to the 
child.
Parent tries to fork again immediately.

The code before this patch did not really take into account that
reinit_after_fork can fail. The code now sends the result of
winbindd_reinit_after_fork to the parent and the parent only considers the
child alive when it got NT_STATUS_OK.

This was seen in 3.4 winbind. winbind has changed significantly since then, 
so
it might be possible that this does not happen anymore in exactly this way. 
But
passing up the status of reinit_after_fork and only consider the child alive
when that's ok is the correct thing to do anyway.

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Fri Apr 29 17:58:19 CEST 2011 on sn-devel-104


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: autobuild: intermittent test failure detected

2011-04-29 Thread 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.

Cheers,

Jelmer




signature.asc
Description: This is a digitally signed message part


[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Günther Deschner
The branch, master has been updated
   via  bbacaec s3-proto: move more headers to rpc_server/rpc_ncacn_np.h 
where they origin from.
   via  bc781bf s3-proto: remove duplicate prototypes.
   via  487cb0c s3-rpc_server: remove some unneeded headers.
   via  c7d38f4 s3-proto: move rpc_server/rpc_handles.c protos to ntdomain.h
   via  faf1175 s3-proto: move more librpc prototypes to librpc/rpc/dcerpc.h
   via  d628964 s3-proto: remove remaining nss_info prototypes to nss_info.h
  from  e64ffee ldb:tdb backend - cache - remove unused last_attribute 
structure member

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


- Log -
commit bbacaec4e9365b128eb11467c95412de7473c1ec
Author: Günther Deschner g...@samba.org
Date:   Fri Apr 29 16:40:24 2011 +0200

s3-proto: move more headers to rpc_server/rpc_ncacn_np.h where they origin 
from.

Guenther

Autobuild-User: Günther Deschner g...@samba.org
Autobuild-Date: Fri Apr 29 22:05:07 CEST 2011 on sn-devel-104

commit bc781bf7d98baca57c8043bf7dc0a95f8ffd1345
Author: Günther Deschner g...@samba.org
Date:   Fri Apr 29 16:20:27 2011 +0200

s3-proto: remove duplicate prototypes.

Guenther

commit 487cb0c96ef8ca05fcef35d0d7c49bc067f6cff7
Author: Günther Deschner g...@samba.org
Date:   Fri Apr 29 16:19:54 2011 +0200

s3-rpc_server: remove some unneeded headers.

Guenther

commit c7d38f49c8bcf5899b186ebb495c31f4ade3c8d6
Author: Günther Deschner g...@samba.org
Date:   Fri Apr 29 15:22:29 2011 +0200

s3-proto: move rpc_server/rpc_handles.c protos to ntdomain.h

Guenther

commit faf11751255202274505d72848c54ee6e5dce7b6
Author: Günther Deschner g...@samba.org
Date:   Fri Apr 29 15:13:55 2011 +0200

s3-proto: move more librpc prototypes to librpc/rpc/dcerpc.h

Guenther

commit d6289641f5d421d188c37819f5fe8ceeb5a86aba
Author: Günther Deschner g...@samba.org
Date:   Fri Apr 29 15:02:49 2011 +0200

s3-proto: remove remaining nss_info prototypes to nss_info.h

Guenther

---

Summary of changes:
 source3/include/nss_info.h  |7 +++
 source3/include/ntdomain.h  |   28 +
 source3/include/proto.h |   77 +--
 source3/lib/netapi/netapi_private.h |2 +
 source3/librpc/rpc/dcerpc.h |8 
 source3/librpc/rpc/dcerpc_ep.c  |1 +
 source3/librpc/rpc/rpc_common.c |1 +
 source3/rpc_client/cli_winreg_int.h |1 +
 source3/rpc_server/rpc_handles.c|1 +
 source3/rpc_server/rpc_ncacn_np.h   |7 +++
 source3/rpc_server/rpc_server.c |1 +
 source3/rpc_server/srv_pipe_hnd.c   |4 --
 source3/smbd/conn.c |1 +
 source3/smbd/lanman.c   |1 +
 14 files changed, 61 insertions(+), 79 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/nss_info.h b/source3/include/nss_info.h
index bf66ef0..f92937e 100644
--- a/source3/include/nss_info.h
+++ b/source3/include/nss_info.h
@@ -95,5 +95,12 @@ NTSTATUS nss_map_from_alias( TALLOC_CTX *mem_ctx, const char 
*domain,
 
 NTSTATUS nss_close( const char *parameters );
 
+/* The following definitions come from winbindd/nss_info.c  */
+
+
+/* The following definitions come from winbindd/nss_info_template.c  */
+
+NTSTATUS nss_info_template_init( void );
+
 #endif /* _IDMAP_NSS_H_ */
 
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index 077924d..9cd00da 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -207,4 +207,32 @@ struct api_struct {
bool (*fn) (struct pipes_struct *);
 };
 
+/* The following definitions come from rpc_server/rpc_handles.c  */
+
+size_t num_pipe_handles(struct pipes_struct *p);
+bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id 
*syntax);
+bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd, void 
*data_ptr);
+bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle 
*hnd,
+   void **data_p);
+bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd);
+void close_policy_by_pipe(struct pipes_struct *p);
+bool pipe_access_check(struct pipes_struct *p);
+
+void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd,
+   uint32_t access_granted, size_t data_size,
+   const char *type, NTSTATUS *pstatus);
+#define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \
+   (_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), 
#_type, \
+  (_pstatus))
+
+void *_policy_handle_find(struct pipes_struct *p,
+ const struct policy_handle *hnd,
+ uint32_t access_required, uint32_t *paccess_granted,
+

autobuild: intermittent test failure detected

2011-04-29 Thread 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/2011-04-29-2243/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-29-2243/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-04-29-2243/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-29-2243/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-04-29-2243/samba4.stdout
  
The top commit at the time of the failure was:

commit e64ffee1c212b6956a993ebb2032f664c0ac5802
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Apr 10 19:41:34 2011 +0200

ldb:tdb backend - cache - remove unused last_attribute structure member

Reviewed-by: abartlet

Autobuild-User: Matthias Dieter Wallnöfer m...@samba.org
Autobuild-Date: Fri Apr 29 20:07:27 CEST 2011 on sn-devel-104


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


[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Jeremy Allison
The branch, master has been updated
   via  440d71f torture test for bug #8111 - CIFS VFS: unexpected error on 
SMB posix open.
   via  7673943 Fix bug 8111 - CIFS VFS: unexpected error on SMB posix open
  from  bbacaec s3-proto: move more headers to rpc_server/rpc_ncacn_np.h 
where they origin from.

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


- Log -
commit 440d71f6c76a4363f69eaf70cada69bdcb98c7bf
Author: Jeremy Allison j...@samba.org
Date:   Fri Apr 29 14:27:45 2011 -0700

torture test for bug #8111 - CIFS VFS: unexpected error on SMB posix open.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Sat Apr 30 00:33:40 CEST 2011 on sn-devel-104

commit 76739435fc8abf1f47193ec4db35a567b564c785
Author: Jeremy Allison j...@samba.org
Date:   Fri Apr 29 14:27:32 2011 -0700

Fix bug 8111 - CIFS VFS: unexpected error on SMB posix open

We are conflating the O_CREAT|O_EXCL with the O_TRUNC
processing, they need to be separate. We need to chose
using (O_CREAT|O_EXCL) first, then modify if O_TRUNC is
set. This needs two separate switch statements.

Jeremy

---

Summary of changes:
 source3/smbd/trans2.c |   61 -
 source3/torture/torture.c |   55 
 2 files changed, 104 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index abab387..028d318 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -7286,18 +7286,55 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
 
wire_open_mode = ~SMB_ACCMODE;
 
-   if((wire_open_mode  (SMB_O_CREAT | SMB_O_EXCL)) == (SMB_O_CREAT | 
SMB_O_EXCL)) {
-   create_disp = FILE_CREATE;
-   } else if((wire_open_mode  (SMB_O_CREAT | SMB_O_TRUNC)) == 
(SMB_O_CREAT | SMB_O_TRUNC)) {
-   create_disp = FILE_OVERWRITE_IF;
-   } else if((wire_open_mode  SMB_O_CREAT) == SMB_O_CREAT) {
-   create_disp = FILE_OPEN_IF;
-   } else if ((wire_open_mode  (SMB_O_CREAT | SMB_O_EXCL | SMB_O_TRUNC)) 
== 0) {
-   create_disp = FILE_OPEN;
-   } else {
-   DEBUG(5,(smb_posix_open: invalid create mode 0x%x\n,
-   (unsigned int)wire_open_mode ));
-   return NT_STATUS_INVALID_PARAMETER;
+   /* First take care of O_CREAT|O_EXCL interactions. */
+   switch (wire_open_mode  (SMB_O_CREAT | SMB_O_EXCL)) {
+   case (SMB_O_CREAT | SMB_O_EXCL):
+   /* File exists fail. File not exist create. */
+   create_disp = FILE_CREATE;
+   break;
+   case SMB_O_CREAT:
+   /* File exists open. File not exist create. */
+   create_disp = FILE_OPEN_IF;
+   break;
+   case 0:
+   /* File exists open. File not exist fail. */
+   create_disp = FILE_OPEN;
+   break;
+   case SMB_O_EXCL:
+   /* O_EXCL on its own without O_CREAT is undefined. */
+   default:
+   DEBUG(5,(smb_posix_open: invalid create mode 0x%x\n,
+   (unsigned int)wire_open_mode ));
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+
+   /* Next factor in the effects of O_TRUNC. */
+   wire_open_mode = ~(SMB_O_CREAT | SMB_O_EXCL);
+
+   if (wire_open_mode  SMB_O_TRUNC) {
+   switch (create_disp) {
+   case FILE_CREATE:
+   /* (SMB_O_CREAT | SMB_O_EXCL | O_TRUNC) */
+   /* Leave create_disp alone as
+  (O_CREAT|O_EXCL|O_TRUNC) == (O_CREAT|O_EXCL)
+   */
+   /* File exists fail. File not exist create. */
+   break;
+   case FILE_OPEN_IF:
+   /* SMB_O_CREAT | SMB_O_TRUNC */
+   /* File exists overwrite. File not exist 
create. */
+   create_disp = FILE_OVERWRITE_IF;
+   break;
+   case FILE_OPEN:
+   /* SMB_O_TRUNC */
+   /* File exists overwrite. File not exist fail. 
*/
+   create_disp = FILE_OVERWRITE;
+   break;
+   default:
+   /* Cannot get here. */
+   smb_panic(smb_posix_open: logic error);
+   return NT_STATUS_INVALID_PARAMETER;
+   }

[SCM] Samba Shared Repository - branch v3-6-test updated

2011-04-29 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  187cd18 torture test for bug #8111 - CIFS VFS: unexpected error on 
SMB posix open.
   via  c5182ce Fix bug 8111 - CIFS VFS: unexpected error on SMB posix open
  from  59d1c3a s3: Avoid a potential 100% CPU loop in winbindd

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit 187cd188635620ce66740dc0c86f55a211bfb9c7
Author: Jeremy Allison j...@samba.org
Date:   Fri Apr 29 14:27:45 2011 -0700

torture test for bug #8111 - CIFS VFS: unexpected error on SMB posix open.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Sat Apr 30 00:33:40 CEST 2011 on sn-devel-104
(cherry picked from commit 440d71f6c76a4363f69eaf70cada69bdcb98c7bf)

commit c5182ced05e4c259bd93fd6b8fdf84985ea123ad
Author: Jeremy Allison j...@samba.org
Date:   Fri Apr 29 14:27:32 2011 -0700

Fix bug 8111 - CIFS VFS: unexpected error on SMB posix open

We are conflating the O_CREAT|O_EXCL with the O_TRUNC
processing, they need to be separate. We need to chose
using (O_CREAT|O_EXCL) first, then modify if O_TRUNC is
set. This needs two separate switch statements.

Jeremy
(cherry picked from commit 76739435fc8abf1f47193ec4db35a567b564c785)

---

Summary of changes:
 source3/smbd/trans2.c |   61 -
 source3/torture/torture.c |   55 
 2 files changed, 104 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index abab387..028d318 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -7286,18 +7286,55 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
 
wire_open_mode = ~SMB_ACCMODE;
 
-   if((wire_open_mode  (SMB_O_CREAT | SMB_O_EXCL)) == (SMB_O_CREAT | 
SMB_O_EXCL)) {
-   create_disp = FILE_CREATE;
-   } else if((wire_open_mode  (SMB_O_CREAT | SMB_O_TRUNC)) == 
(SMB_O_CREAT | SMB_O_TRUNC)) {
-   create_disp = FILE_OVERWRITE_IF;
-   } else if((wire_open_mode  SMB_O_CREAT) == SMB_O_CREAT) {
-   create_disp = FILE_OPEN_IF;
-   } else if ((wire_open_mode  (SMB_O_CREAT | SMB_O_EXCL | SMB_O_TRUNC)) 
== 0) {
-   create_disp = FILE_OPEN;
-   } else {
-   DEBUG(5,(smb_posix_open: invalid create mode 0x%x\n,
-   (unsigned int)wire_open_mode ));
-   return NT_STATUS_INVALID_PARAMETER;
+   /* First take care of O_CREAT|O_EXCL interactions. */
+   switch (wire_open_mode  (SMB_O_CREAT | SMB_O_EXCL)) {
+   case (SMB_O_CREAT | SMB_O_EXCL):
+   /* File exists fail. File not exist create. */
+   create_disp = FILE_CREATE;
+   break;
+   case SMB_O_CREAT:
+   /* File exists open. File not exist create. */
+   create_disp = FILE_OPEN_IF;
+   break;
+   case 0:
+   /* File exists open. File not exist fail. */
+   create_disp = FILE_OPEN;
+   break;
+   case SMB_O_EXCL:
+   /* O_EXCL on its own without O_CREAT is undefined. */
+   default:
+   DEBUG(5,(smb_posix_open: invalid create mode 0x%x\n,
+   (unsigned int)wire_open_mode ));
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+
+   /* Next factor in the effects of O_TRUNC. */
+   wire_open_mode = ~(SMB_O_CREAT | SMB_O_EXCL);
+
+   if (wire_open_mode  SMB_O_TRUNC) {
+   switch (create_disp) {
+   case FILE_CREATE:
+   /* (SMB_O_CREAT | SMB_O_EXCL | O_TRUNC) */
+   /* Leave create_disp alone as
+  (O_CREAT|O_EXCL|O_TRUNC) == (O_CREAT|O_EXCL)
+   */
+   /* File exists fail. File not exist create. */
+   break;
+   case FILE_OPEN_IF:
+   /* SMB_O_CREAT | SMB_O_TRUNC */
+   /* File exists overwrite. File not exist 
create. */
+   create_disp = FILE_OVERWRITE_IF;
+   break;
+   case FILE_OPEN:
+   /* SMB_O_TRUNC */
+   /* File exists overwrite. File not exist fail. 
*/
+   create_disp = FILE_OVERWRITE;
+   break;
+   default:
+   /* Cannot get here. */
+   

[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Jeremy Allison
The branch, master has been updated
   via  de87f54 Add POSIX O_RDONLY test of a directory for bug #8112 - 
POSIX extension opens of a directory are denied with EISDIR.
   via  2cb53f0 Fix bug #8112 - POSIX extension opens of a directory are 
denied with EISDIR.
  from  440d71f torture test for bug #8111 - CIFS VFS: unexpected error on 
SMB posix open.

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


- Log -
commit de87f549b75d05a1198c490f6aa5c7e62c3fd4a5
Author: Jeremy Allison j...@samba.org
Date:   Fri Apr 29 16:18:14 2011 -0700

Add POSIX O_RDONLY test of a directory for bug #8112 - POSIX extension 
opens of a directory are denied with EISDIR.

Don't strip access bits from wire flags when opening a directory.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Sat Apr 30 02:21:24 CEST 2011 on sn-devel-104

commit 2cb53f066e0e42d923be89dd3a7e18ea7a1b7340
Author: Jeremy Allison j...@samba.org
Date:   Fri Apr 29 16:15:55 2011 -0700

Fix bug #8112 - POSIX extension opens of a directory are denied with EISDIR.

Ensure create_options are passed down to SMB_VFS_CREATE_FILE().
Correctly set create_options is SMB_O_DIRECTORY is set or pathname
is known to be a directory.

Jeremy.

---

Summary of changes:
 source3/libsmb/clifile.c  |2 --
 source3/smbd/trans2.c |   12 ++--
 source3/torture/torture.c |   12 ++--
 3 files changed, 20 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index cde2466..9c0db1e 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -4396,7 +4396,6 @@ static uint32_t open_flags_to_wire(int flags)
 #endif
 #if defined(O_DIRECTORY)
if (flags  O_DIRECTORY) {
-   ret = ~(SMB_O_RDONLY|SMB_O_RDWR|SMB_O_WRONLY);
ret |= SMB_O_DIRECTORY;
}
 #endif
@@ -4471,7 +4470,6 @@ static struct tevent_req 
*cli_posix_open_internal_send(TALLOC_CTX *mem_ctx,
 
/* Setup data words. */
if (is_dir) {
-   wire_flags = ~(SMB_O_RDONLY|SMB_O_RDWR|SMB_O_WRONLY);
wire_flags |= SMB_O_DIRECTORY;
}
 
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 028d318..46f2aa0 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -7240,7 +7240,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
uint32 mod_unixmode = 0;
uint32 create_disp = 0;
uint32 access_mask = 0;
-   uint32 create_options = 0;
+   uint32 create_options = FILE_NON_DIRECTORY_FILE;
NTSTATUS status = NT_STATUS_OK;
mode_t unixmode = (mode_t)0;
files_struct *fsp = NULL;
@@ -7354,6 +7354,14 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
if (wire_open_mode  SMB_O_SYNC) {
create_options |= FILE_WRITE_THROUGH;
}
+   if ((wire_open_mode  SMB_O_DIRECTORY) ||
+   VALID_STAT_OF_DIR(smb_fname-st)) {
+   if (access_mask != FILE_READ_DATA) {
+   return NT_STATUS_FILE_IS_A_DIRECTORY;
+   }
+   create_options = ~FILE_NON_DIRECTORY_FILE;
+   create_options |= FILE_DIRECTORY_FILE;
+   }
if (wire_open_mode  SMB_O_APPEND) {
access_mask |= FILE_APPEND_DATA;
}
@@ -7375,7 +7383,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
(FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
FILE_SHARE_DELETE),
create_disp,/* create_disposition*/
-   FILE_NON_DIRECTORY_FILE,/* create_options */
+   create_options, /* create_options */
mod_unixmode,   /* file_attributes */
oplock_request, /* oplock_request */
0,  /* allocation_size */
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 61af238..5dfcb7e 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -5073,8 +5073,16 @@ static bool run_simple_posix_open_test(int dummy)
goto out;
}
 
-   /* What happens when we try and POSIX open a directory ? */
-   if (NT_STATUS_IS_OK(cli_posix_open(cli1, dname, O_RDONLY, 0, fnum1))) {
+   if (!NT_STATUS_IS_OK(cli_posix_open(cli1, dname, O_RDONLY, 0, fnum1))) 
{
+   printf(POSIX open directory O_RDONLY of %s failed (%s)\n,
+   dname, cli_errstr(cli1));
+   goto out;
+   }
+
+   cli_close(cli1, fnum1);
+
+   /* What happens when we try and POSIX open a directory for write ? */
+   if 

[SCM] Samba Shared Repository - branch master updated

2011-04-29 Thread Andrew Bartlett
The branch, master has been updated
   via  1018dd1 s3-lib: Rely on uint64_t in conv_str_size()
   via  e1eae82 kerberos: Only include gssapi/gssapi_krb5.h when available
   via  b1f2547 s3-waf: Add dependency on popt to fix build on FreeBSD
  from  de87f54 Add POSIX O_RDONLY test of a directory for bug #8112 - 
POSIX extension opens of a directory are denied with EISDIR.

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


- Log -
commit 1018dd182686f5b3a6db3d08294c78305521e4f4
Author: Andrew Bartlett abart...@samba.org
Date:   Sat Apr 30 12:52:11 2011 +1000

s3-lib: Rely on uint64_t in conv_str_size()

Autobuild-User: Andrew Bartlett abart...@samba.org
Autobuild-Date: Sat Apr 30 05:58:35 CEST 2011 on sn-devel-104

commit e1eae822856c076f63874d8d3b07691b3154848d
Author: Andrew Bartlett abart...@samba.org
Date:   Sat Apr 30 12:05:25 2011 +1000

kerberos: Only include gssapi/gssapi_krb5.h when available

commit b1f2547699d335287d5f007d108a067eb7a0203d
Author: Andrew Bartlett abart...@samba.org
Date:   Sat Apr 30 10:50:50 2011 +1000

s3-waf: Add dependency on popt to fix build on FreeBSD

---

Summary of changes:
 lib/replace/system/kerberos.h   |2 +
 source3/configure.in|2 +-
 source3/include/proto.h |2 +-
 source3/lib/util_str.c  |   43 +-
 source3/wscript |2 +-
 source3/wscript_build   |2 +-
 source4/heimdal_build/wscript_configure |1 +
 7 files changed, 20 insertions(+), 34 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/system/kerberos.h b/lib/replace/system/kerberos.h
index 10d5f76..6d8c59f 100644
--- a/lib/replace/system/kerberos.h
+++ b/lib/replace/system/kerberos.h
@@ -45,7 +45,9 @@
 #include gssapi.h
 #endif
 
+#if HAVE_GSSAPI_GSSAPI_KRB5_H
 #include gssapi/gssapi_krb5.h
+#endif
 
 #endif
 #endif
diff --git a/source3/configure.in b/source3/configure.in
index 3624c25..8164a44 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -3791,7 +3791,7 @@ if test x$with_ads_support != xno; then
 
   # now check for gssapi headers.  This is also done here to allow for
   # different kerberos include paths
-  AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h 
gssapi/gssapi_ext.h com_err.h)
+  AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h 
gssapi/gssapi_ext.h gssapi/gssapi_krb5.h com_err.h)
 
   ##
   # we might need the k5crypto and com_err libraries on some systems
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 170b9ad..fe981f1 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1007,7 +1007,7 @@ char *ipstr_list_make(char **ipstr_list,
 int ipstr_list_parse(const char *ipstr_list, struct ip_service **ip_list);
 void ipstr_list_free(char* ipstr_list);
 uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
-SMB_OFF_T conv_str_size(const char * str);
+uint64_t conv_str_size(const char * str);
 bool add_string_to_array(TALLOC_CTX *mem_ctx,
 const char *str, const char ***strings,
 int *num);
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 07a0589..b15dd79 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1206,25 +1206,17 @@ uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const 
char **entptr)
  *
  *  Returns 0 if the string can't be converted.
  */
-SMB_OFF_T conv_str_size(const char * str)
+uint64_t conv_str_size(const char * str)
 {
-   SMB_OFF_T lval_orig;
-SMB_OFF_T lval;
+   uint64_t lval_orig;
+uint64_t lval;
char * end;
 
 if (str == NULL || *str == '\0') {
 return 0;
 }
 
-#ifdef HAVE_STRTOULL
-   if (sizeof(SMB_OFF_T) == 8) {
-   lval = strtoull(str, end, 10 /* base */);
-   } else {
-   lval = strtoul(str, end, 10 /* base */);
-   }
-#else
-   lval = strtoul(str, end, 10 /* base */);
-#endif
+   lval = strtoull(str, end, 10 /* base */);
 
 if (end == NULL || end == str) {
 return 0;
@@ -1237,32 +1229,23 @@ SMB_OFF_T conv_str_size(const char * str)
lval_orig = lval;
 
if (strwicmp(end, K) == 0) {
-   lval *= (SMB_OFF_T)1024;
+   lval *= 1024ULL;
} else if (strwicmp(end, M) == 0) {
-   lval *= ((SMB_OFF_T)1024 * (SMB_OFF_T)1024);
+   lval *= (1024ULL * 1024ULL);
} else if (strwicmp(end, G) == 0) {
-   lval *= ((SMB_OFF_T)1024 * (SMB_OFF_T)1024 *
-(SMB_OFF_T)1024);
+   lval *= (1024ULL * 1024ULL *
+1024ULL);
} else if