[SCM] Samba Shared Repository - branch master updated

2013-11-08 Thread Jeremy Allison
The branch, master has been updated
   via  374b2cf xattr: fix listing EAs on *BSD for non-root users
   via  12a2230 s4-smb_server: Fix a use after free.
   via  29f12e7 s3-vfs: Fix stream_depot vfs module on btrfs.
   via  c7aab6e vfstest: fix uninitialised variable usage in open
  from  15b0c39 net: remove net idmap secret

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


- Log -
commit 374b2cfde74e0c61f4b2da724b30d0e430596092
Author: Björn Jacke b...@sernet.de
Date:   Wed Nov 6 12:37:07 2013 +0100

xattr: fix listing EAs on *BSD for non-root users

Thanks to Stefan Rompf for reporting.

This fixes bug #10247

Signed-off-by: Bjoern Jacke b...@sernet.de
Reviewed-by: Jeremy Allison j...@samba.org

Autobuild-User(master): Jeremy Allison j...@samba.org
Autobuild-Date(master): Fri Nov  8 20:43:30 CET 2013 on sn-devel-104

commit 12a2230581b3ff5c7a29819532652d7ddfe61521
Author: Andreas Schneider a...@samba.org
Date:   Fri Nov 8 16:14:35 2013 +0100

s4-smb_server: Fix a use after free.

If we haven't allocated the smbsrv_session then we should not free it.

Signed-off-by: Andreas Schneider a...@samba.org
Reviewed-by: Jeremy Allison j...@samba.org

commit 29f12e7d5960906935e3af1405e9759a07d64750
Author: Andreas Schneider a...@samba.org
Date:   Fri Nov 8 15:10:03 2013 +0100

s3-vfs: Fix stream_depot vfs module on btrfs.

Checking if the directory is empty using 'nlink == 2' only checks if
there are no subdirectories. It doesn't indicate if there are files in
the directory. However checking link count for no subdirectories is
wrong and applications shouldn't rely on it, see:

https://lkml.org/lkml/2012/2/1/756

Signed-off-by: Andreas Schneider a...@samba.org
Reviewed-by: Jeremy Allison j...@samba.org

commit c7aab6e5205b78f00f84492cc1a0fd4b67ef917a
Author: David Disseldorp dd...@samba.org
Date:   Fri Nov 8 13:56:23 2013 +0100

vfstest: fix uninitialised variable usage in open

The vfstest open command currently fails intermittently due to a read of
a potentially uninitialised status variable.

Signed-off-by: David Disseldorp dd...@samba.org
Reviewed-by: Jeremy Allison j...@samba.org

---

Summary of changes:
 lib/replace/xattr.c |4 
 source3/modules/vfs_streams_depot.c |   16 
 source3/torture/cmd_vfs.c   |5 +++--
 source4/smb_server/smb/sesssetup.c  |6 +-
 4 files changed, 20 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/xattr.c b/lib/replace/xattr.c
index a26ff67..459b7f3 100644
--- a/lib/replace/xattr.c
+++ b/lib/replace/xattr.c
@@ -194,6 +194,10 @@ static ssize_t bsd_attr_list (int type, extattr_arg arg, 
char *list, size_t size
char *buf;
/* Iterate through extattr(2) namespaces */
for(t = 0; t  ARRAY_SIZE(extattr); t++) {
+   if (t != EXTATTR_NAMESPACE_USER  geteuid() != 0) {
+   /* ignore all but user namespace when we are not root, 
see bug 10247 */
+   continue;
+   }
switch(type) {
 #if defined(HAVE_EXTATTR_LIST_FILE)
case 0:
diff --git a/source3/modules/vfs_streams_depot.c 
b/source3/modules/vfs_streams_depot.c
index 3ada92e..f33d998 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -665,6 +665,7 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
 static int streams_depot_rmdir(vfs_handle_struct *handle, const char *path)
 {
struct smb_filename *smb_fname_base = NULL;
+   char *dirname;
int ret = -1;
 
DEBUG(10, (streams_depot_rmdir called for %s\n, path));
@@ -690,15 +691,14 @@ static int streams_depot_rmdir(vfs_handle_struct *handle, 
const char *path)
return -1;
}
 
-   if (smb_fname_base-st.st_ex_nlink == 2) {
-   char *dirname = stream_dir(handle, smb_fname_base,
-  smb_fname_base-st, false);
-
-   if (dirname != NULL) {
-   SMB_VFS_NEXT_RMDIR(handle, dirname);
-   }
-   TALLOC_FREE(dirname);
+   dirname = stream_dir(handle,
+smb_fname_base,
+smb_fname_base-st,
+false);
+   if (dirname != NULL) {
+   SMB_VFS_NEXT_RMDIR(handle, dirname);
}
+   TALLOC_FREE(dirname);
 
ret = SMB_VFS_NEXT_RMDIR(handle, path);
 
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 1b20208..f923ed5 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -347,6 +347,7 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, 

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

2013-11-08 Thread Stefan (metze) Metzmacher
 commit 12a2230581b3ff5c7a29819532652d7ddfe61521
 Author: Andreas Schneider a...@samba.org
 Date:   Fri Nov 8 16:14:35 2013 +0100
 
 s4-smb_server: Fix a use after free.
 
 If we haven't allocated the smbsrv_session then we should not free it.
 
 Signed-off-by: Andreas Schneider a...@samba.org
 Reviewed-by: Jeremy Allison j...@samba.org

 diff --git a/source4/smb_server/smb/sesssetup.c 
 b/source4/smb_server/smb/sesssetup.c
 index b26c128..4ebc0c4 100644
 --- a/source4/smb_server/smb/sesssetup.c
 +++ b/source4/smb_server/smb/sesssetup.c
 @@ -415,6 +415,7 @@ static void sesssetup_spnego(struct smbsrv_request *req, 
 union smb_sesssetup *se
  {
   NTSTATUS status;
   struct smbsrv_session *smb_sess = NULL;
 + bool is_smb_sess_new = false;
   struct sesssetup_spnego_state *s = NULL;
   uint16_t vuid;
   struct tevent_req *subreq;
 @@ -465,6 +466,7 @@ static void sesssetup_spnego(struct smbsrv_request *req, 
 union smb_sesssetup *se
   status = NT_STATUS_INSUFFICIENT_RESOURCES;
   goto failed;
   }
 + is_smb_sess_new = true;
   } else {
   smb_sess = smbsrv_session_find_sesssetup(req-smb_conn, vuid);
   }
 @@ -510,7 +512,9 @@ static void sesssetup_spnego(struct smbsrv_request *req, 
 union smb_sesssetup *se
  nomem:
   status = NT_STATUS_NO_MEMORY;
  failed:
 - talloc_free(smb_sess);
 + if (is_smb_sess_new) {
 + talloc_free(smb_sess);
 + }
   status = nt_status_squash(status);
   smbsrv_sesssetup_backend_send(req, sess, status);

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

metze