[SCM] Samba Shared Repository - branch master updated

2012-02-25 Thread Volker Lendecke
The branch, master has been updated
   via  341bd82 s3: Fix a typo
   via  71a6d33 s3: Fix bug 8777, sys_statvfs() wrapper support for 
OpenBSD/FreeBSD/DragonFly
  from  0fbefbc s3-auth rename vuid_serverinfo to session_info

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


- Log -
commit 341bd82fbf1f9209aae94bdbc6461805f826e39e
Author: Volker Lendecke v...@samba.org
Date:   Sat Feb 25 09:40:16 2012 +0100

s3: Fix a typo

Autobuild-User: Volker Lendecke v...@samba.org
Autobuild-Date: Sat Feb 25 11:16:41 CET 2012 on sn-devel-104

commit 71a6d334321d42fd0f02646d1649405ccf197c00
Author: Brad Smith b...@comstyle.com
Date:   Sat Feb 25 09:28:43 2012 +0100

s3: Fix bug 8777, sys_statvfs() wrapper support for 
OpenBSD/FreeBSD/DragonFly

---

Summary of changes:
 source3/configure.in  |   10 -
 source3/modules/vfs_default.c |2 +-
 source3/smbd/statvfs.c|   45 +---
 3 files changed, 51 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index 7b90c8f..dc47f13 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -6838,13 +6838,21 @@ CFLAGS=$CFLAGS_SAVE
 # Start
 AC_CHECK_FUNC(getmntent)
 
-AC_CHECK_HEADERS(sys/statfs.h)
+AC_CHECK_HEADERS(sys/param.h sys/statfs.h sys/mount.h)
 
 AC_MSG_CHECKING([vfs_fileid: checking for statfs() and struct statfs.f_fsid)])
 AC_CACHE_VAL(vfsfileid_cv_statfs,[
 AC_TRY_RUN([
#include sys/types.h
+   #ifdef HAVE_SYS_PARAM_H
+   #include sys/param.h
+   #endif
+   #ifdef HAVE_SYS_MOUNT_H
+   #include sys/mount.h
+   #endif
+   #ifdef HAVE_SYS_STATFS_H
#include sys/statfs.h
+   #endif
int main(void)
{
struct statfs fsd;
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index f556f1c..d81adad 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -111,7 +111,7 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
NTSTATUS status;
int ret = -1;
 
-#if defined(DARWINOS)
+#if defined(DARWINOS) || (defined(BSD)  defined(MNT_RDONLY))
struct vfs_statvfs_struct statbuf;
ZERO_STRUCT(statbuf);
sys_statvfs(conn-connectpath, statbuf);
diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c
index 2de015a..e6e1572 100644
--- a/source3/smbd/statvfs.c
+++ b/source3/smbd/statvfs.c
@@ -49,9 +49,7 @@ static int linux_statvfs(const char *path, vfs_statvfs_struct 
*statbuf)
}
return result;
 }
-#endif
-
-#if defined(DARWINOS)
+#elif defined(DARWINOS)
 
 #include sys/attr.h
 
@@ -125,13 +123,50 @@ static int darwin_statvfs(const char *path, 
vfs_statvfs_struct *statbuf)
 
return 0;
 }
+#elif defined(BSD)  defined(MNT_RDONLY)
+static int bsd_statvfs(const char *path, vfs_statvfs_struct *statbuf)
+{
+   struct statfs statfs_buf;
+   int result;
+
+   result = statfs(path, statfs_buf);
+   if (result != 0) {
+   return result;
+   }
+
+   statbuf-OptimalTransferSize = statfs_buf.f_iosize;
+   statbuf-BlockSize = statfs_buf.f_bsize;
+   statbuf-TotalBlocks = statfs_buf.f_blocks;
+   statbuf-BlocksAvail = statfs_buf.f_bfree;
+   statbuf-UserBlocksAvail = statfs_buf.f_bavail;
+   statbuf-TotalFileNodes = statfs_buf.f_files;
+   statbuf-FreeFileNodes = statfs_buf.f_ffree;
+   statbuf-FsIdentifier =
+   (((uint64_t) statfs_buf.f_fsid.val[0]  32)  
0xLL) |
+   (uint64_t) statfs_buf.f_fsid.val[1];
+   /* Try to extrapolate some of the fs flags into the
+* capabilities
+*/
+   statbuf-FsCapabilities =
+   FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+#ifdef MNT_ACLS
+   if (statfs_buf.f_flags  MNT_ACLS)
+   statbuf-FsCapabilities |= FILE_PERSISTENT_ACLS;
+#endif
+   if (statfs_buf.f_flags  MNT_QUOTA)
+   statbuf-FsCapabilities |= FILE_VOLUME_QUOTAS;
+   if (statfs_buf.f_flags  MNT_RDONLY)
+   statbuf-FsCapabilities |= FILE_READ_ONLY_VOLUME;
+
+   return 0;
+}
 #endif
 
 /* 
  sys_statvfs() is an abstraction layer over system-dependent statvfs()/statfs()
  for particular POSIX systems. Due to controversy of what is considered more 
important
  between LSB and FreeBSD/POSIX.1 (IEEE Std 1003.1-2001) we need to abstract 
the interface
- so that particular OS would use its preffered interface.
+ so that particular OS would use its prefered interface.
 */
 int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 {
@@ -139,6 +174,8 @@ int sys_statvfs(const char *path, 

[SCM] Samba Shared Repository - branch master updated

2012-02-25 Thread Jelmer Vernooij
The branch, master has been updated
   via  66f13ea Partially revert 1f0298dd1b1a939cb215e7b474178b217f8347f4
   via  f5d706b provision: Remove unused imports.
  from  341bd82 s3: Fix a typo

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


- Log -
commit 66f13ea1e9ad8d66f6dec7e6a4716bcdb1dfbfa0
Author: Jelmer Vernooij jel...@samba.org
Date:   Sat Feb 25 15:56:25 2012 +0100

Partially revert 1f0298dd1b1a939cb215e7b474178b217f8347f4

It's fine to catch keyboard interrupts and other kinds of errors when it's 
done just for resource management, where the error is reraised later.

Autobuild-User: Jelmer Vernooij jel...@samba.org
Autobuild-Date: Sat Feb 25 17:29:34 CET 2012 on sn-devel-104

commit f5d706b0ee8486f94853db8e38538c3a74b2e0bb
Author: Jelmer Vernooij jel...@samba.org
Date:   Sat Feb 25 15:15:51 2012 +0100

provision: Remove unused imports.

---

Summary of changes:
 source4/scripting/python/samba/join.py |4 +-
 source4/scripting/python/samba/netcmd/dbcheck.py   |2 +-
 .../scripting/python/samba/provision/__init__.py   |   49 ++--
 source4/scripting/python/samba/provision/common.py |2 +-
 .../scripting/python/samba/provision/sambadns.py   |4 +-
 source4/scripting/python/samba/samdb.py|   14 +++---
 source4/scripting/python/samba/schema.py   |2 +-
 7 files changed, 38 insertions(+), 39 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/join.py 
b/source4/scripting/python/samba/join.py
index b695277..10f8ad7 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -701,7 +701,7 @@ class dc_join(object):
 ctx.destination_dsa_guid = destination_dsa_guid
 
 print Committing SAM database
-except Exception:
+except:
 ctx.local_samdb.transaction_cancel()
 raise
 else:
@@ -877,7 +877,7 @@ class dc_join(object):
 ctx.join_provision_own_domain()
 ctx.join_setup_trusts()
 ctx.join_finalise()
-except Exception:
+except:
 print Join failed - cleaning up
 ctx.cleanup_old_join()
 raise
diff --git a/source4/scripting/python/samba/netcmd/dbcheck.py 
b/source4/scripting/python/samba/netcmd/dbcheck.py
index 72b2f91..db02c6a 100644
--- a/source4/scripting/python/samba/netcmd/dbcheck.py
+++ b/source4/scripting/python/samba/netcmd/dbcheck.py
@@ -117,7 +117,7 @@ class cmd_dbcheck(Command):
 else:
 error_count = chk.check_database(DN=DN, scope=search_scope,
 controls=controls, attrs=attrs)
-except Exception:
+except:
 if started_transaction:
 samdb.transaction_cancel()
 raise
diff --git a/source4/scripting/python/samba/provision/__init__.py 
b/source4/scripting/python/samba/provision/__init__.py
index 25a4551..aa8736b 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -37,7 +37,6 @@ import time
 import uuid
 import socket
 import urllib
-import shutil
 import string
 
 import ldb
@@ -81,7 +80,6 @@ from samba.provision.common import (
 setup_path,
 setup_add_ldif,
 setup_modify_ldif,
-setup_ldb
 )
 from samba.provision.sambadns import (
 setup_ad_dns,
@@ -243,6 +241,7 @@ def find_provision_key_parameters(samdb, secretsdb, 
idmapdb, paths, smbconf, lp)
 raise ProvisioningError(Unable to find uid/gid for Domain Admins rid)
 return names
 
+
 def update_provision_usn(samdb, low, high, id, replace=False):
 Update the field provisionUSN in sam.ldb
 
@@ -653,7 +652,6 @@ def make_smbconf(smbconf, hostname, domain, realm, 
serverrole,
 f.close()
 
 
-
 def setup_name_mappings(idmap, sid, root_uid, nobody_uid,
 users_gid, wheel_gid):
 setup reasonable name mappings for sam names to unix names.
@@ -720,7 +718,7 @@ def setup_samdb_partitions(samdb_path, logger, lp, 
session_info,
 
 logger.info(Setting up sam.ldb rootDSE)
 setup_samdb_rootdse(samdb, names)
-except Exception:
+except:
 samdb.transaction_cancel()
 raise
 else:
@@ -839,12 +837,10 @@ def setup_secretsdb(paths, session_info, 
backend_credentials, lp):
 
 path = paths.secrets
 
-secrets_ldb = Ldb(path, session_info=session_info,
-  lp=lp)
+secrets_ldb = Ldb(path, session_info=session_info, lp=lp)
 secrets_ldb.erase()
 secrets_ldb.load_ldif_file_add(setup_path(secrets_init.ldif))
-secrets_ldb = Ldb(path, session_info=session_info,
-  lp=lp)
+secrets_ldb = Ldb(path, session_info=session_info, lp=lp)
 

[SCM] Samba Website Repository - branch master updated

2012-02-25 Thread Lars Müller
The branch, master has been updated
   via  1f5ccc7 Rewritten credits section on request of RIM
  from  97ffa8e Update latest bodies and headlines regarding CVE-2012-0870

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


- Log -
commit 1f5ccc7cc290ba217a415466878b68721e12f4b9
Author: Lars Müller l...@samba.org
Date:   Sat Feb 25 17:32:45 2012 +0100

Rewritten credits section on request of RIM

---

Summary of changes:
 security/CVE-2012-0870.html |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/security/CVE-2012-0870.html b/security/CVE-2012-0870.html
index 1bc834b..e9c3d7b 100644
--- a/security/CVE-2012-0870.html
+++ b/security/CVE-2012-0870.html
@@ -57,9 +57,10 @@ community, users, and vendors.
 Credits
 ===
 
-The vulnerability was discovered by Andy Davis of NGS Secure¹ and reported by
-Greg Kinasewitz of Research In Motion².  Patches were written by Volker
-Lendecke of the Samba Team.
+The vulnerability was discovered by Andy Davis of NGS Secure¹ and reported to
+Research In Motion².
+
+The patches were written by Volker Lendecke of the Samba Team.
 
 ==
 References


-- 
Samba Website Repository


[SCM] Samba Shared Repository - branch master updated

2012-02-25 Thread Jelmer Vernooij
The branch, master has been updated
   via  fe3274d provision: Start splitting out provision result reporting 
from actual provisioning.
   via  2fd1046 provision: Properly close ldb transactions.
   via  9ecc68a 'samba-tool gpo': Properly close transaction.
   via  08a3d6d ntacl: There is no 'secrets database' configuration option.
   via  d06eeb7 Factor out sanitize_server_role.
  from  66f13ea Partially revert 1f0298dd1b1a939cb215e7b474178b217f8347f4

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


- Log -
commit fe3274d9cb576f82366070a25a4a7eef4bd43708
Author: Jelmer Vernooij jel...@samba.org
Date:   Sat Feb 25 20:04:57 2012 +0100

provision: Start splitting out provision result reporting from actual 
provisioning.

Autobuild-User: Jelmer Vernooij jel...@samba.org
Autobuild-Date: Sat Feb 25 22:13:10 CET 2012 on sn-devel-104

commit 2fd10469c1ad55234d5350b10373b52f0bfd2cd0
Author: Jelmer Vernooij jel...@samba.org
Date:   Sat Feb 25 17:55:52 2012 +0100

provision: Properly close ldb transactions.

commit 9ecc68abe707506b7dc10ce580c7c2ef6b95a785
Author: Jelmer Vernooij jel...@samba.org
Date:   Sat Feb 25 17:50:14 2012 +0100

'samba-tool gpo': Properly close transaction.

commit 08a3d6d6ad2db15ddeec5cc9e57392ea01d881ad
Author: Jelmer Vernooij jel...@samba.org
Date:   Sat Feb 25 17:36:54 2012 +0100

ntacl: There is no 'secrets database' configuration option.

commit d06eeb7949d6c4dd20c46de94e92f3144fa73b15
Author: Jelmer Vernooij jel...@samba.org
Date:   Sat Feb 25 17:35:41 2012 +0100

Factor out sanitize_server_role.

---

Summary of changes:
 source4/scripting/python/samba/netcmd/gpo.py   |8 +-
 source4/scripting/python/samba/netcmd/ntacl.py |2 +-
 .../scripting/python/samba/provision/__init__.py   |  139 
 source4/scripting/python/samba/tests/provision.py  |   54 +++-
 4 files changed, 143 insertions(+), 60 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/netcmd/gpo.py 
b/source4/scripting/python/samba/netcmd/gpo.py
index bd3480e..94c70c6 100644
--- a/source4/scripting/python/samba/netcmd/gpo.py
+++ b/source4/scripting/python/samba/netcmd/gpo.py
@@ -916,11 +916,11 @@ class cmd_create(Command):
 
 # Set ACL
 conn.set_acl(sharepath, fs_sd)
-
-self.samdb.transaction_commit()
-except Exception, e:
+except:
 self.samdb.transaction_cancel()
-raise RuntimeError(Error adding GPO to AD, e)
+raise
+else:
+self.samdb.transaction_commit()
 
 self.outf.write(GPO '%s' created as %s\n % (displayname, gpo))
 
diff --git a/source4/scripting/python/samba/netcmd/ntacl.py 
b/source4/scripting/python/samba/netcmd/ntacl.py
index 96d4c97..349c006 100644
--- a/source4/scripting/python/samba/netcmd/ntacl.py
+++ b/source4/scripting/python/samba/netcmd/ntacl.py
@@ -61,7 +61,7 @@ class cmd_ntacl_set(Command):
 def run(self, acl, file, quiet=False,xattr_backend=None,eadb_file=None,
 credopts=None, sambaopts=None, versionopts=None):
 lp = sambaopts.get_loadparm()
-path = os.path.join(lp.get(private dir), lp.get(secrets database) 
or secrets.ldb)
+path = lp.private_path(secrets.ldb)
 creds = credopts.get_credentials(lp)
 creds.set_kerberos_state(DONT_USE_KERBEROS)
 try:
diff --git a/source4/scripting/python/samba/provision/__init__.py 
b/source4/scripting/python/samba/provision/__init__.py
index aa8736b..6f7adc1 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -2,7 +2,7 @@
 # Unix SMB/CIFS implementation.
 # backend code for provisioning a Samba4 server
 
-# Copyright (C) Jelmer Vernooij jel...@samba.org 2007-2010
+# Copyright (C) Jelmer Vernooij jel...@samba.org 2007-2012
 # Copyright (C) Andrew Bartlett abart...@samba.org 2008-2009
 # Copyright (C) Oliver Liebel oli...@itc.li 2008-2009
 #
@@ -360,14 +360,30 @@ def get_last_provision_usn(sam):
 
 
 class ProvisionResult(object):
+Result of a provision.
+
+:ivar server_role: The server role
+:ivar paths: ProvisionPaths instance
+:ivar domaindn: The domain dn, as string
+
 
 def __init__(self):
+self.server_role = None
 self.paths = None
 self.domaindn = None
 self.lp = None
 self.samdb = None
 self.idmap = None
 self.names = None
+self.domainsid = None
+
+def report_logger(self, logger):
+Report this provision result to a logger.
+logger.info(Server Role:   %s % self.server_role)
+logger.info(Hostname:  %s % self.names.hostname)
+logger.info(NetBIOS Domain:%s % self.names.domain)
+

[SCM] Samba Shared Repository - branch master updated

2012-02-25 Thread Volker Lendecke
The branch, master has been updated
   via  263c7c2 s3: Use the correct enum values
   via  a5c0446 nsswitch: Remove a pointless if-clause
   via  bd6ff4d libcli: Remove a pointless check
  from  fe3274d provision: Start splitting out provision result reporting 
from actual provisioning.

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


- Log -
commit 263c7c28e3cc28a91577631cc6e8f1a96426868c
Author: Volker Lendecke v...@samba.org
Date:   Sat Feb 25 21:27:28 2012 +0100

s3: Use the correct enum values

wbcIdType and id_type have the same values, but different names

Autobuild-User: Volker Lendecke v...@samba.org
Autobuild-Date: Sat Feb 25 23:46:36 CET 2012 on sn-devel-104

commit a5c044644f7387cb0859f823f91d735e94594b7a
Author: Volker Lendecke v...@samba.org
Date:   Sat Feb 25 21:20:21 2012 +0100

nsswitch: Remove a pointless if-clause

gr-num_gr_mem is a uint32, so it can never be  0

commit bd6ff4dbab68b34b7903ebbde470b970e45dcdb7
Author: Volker Lendecke v...@samba.org
Date:   Sat Feb 25 21:17:40 2012 +0100

libcli: Remove a pointless check

n is size_t, so it is always =0.

---

Summary of changes:
 libcli/auth/msrpc_parse.c|4 +---
 nsswitch/winbind_nss_linux.c |2 +-
 source3/winbindd/winbindd_sids_to_xids.c |6 +++---
 3 files changed, 5 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/auth/msrpc_parse.c b/libcli/auth/msrpc_parse.c
index 8b64e98..d499d9e 100644
--- a/libcli/auth/msrpc_parse.c
+++ b/libcli/auth/msrpc_parse.c
@@ -177,9 +177,7 @@ NTSTATUS msrpc_gen(TALLOC_CTX *mem_ctx,
 
n = pointers[i].length;
SSVAL(blob-data, data_ofs, n); data_ofs += 2;
-   if (n = 0) {
-   memcpy(blob-data+data_ofs, pointers[i].data, 
n);
-   }
+   memcpy(blob-data+data_ofs, pointers[i].data, n);
data_ofs += n;
break;
case 'd':
diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c
index 7b16752..8d66a74 100644
--- a/nsswitch/winbind_nss_linux.c
+++ b/nsswitch/winbind_nss_linux.c
@@ -322,7 +322,7 @@ static NSS_STATUS fill_grent(struct group *result, struct 
winbindd_gr *gr,
 
/* Group membership */
 
-   if ((gr-num_gr_mem  0) || !gr_mem) {
+   if (!gr_mem) {
gr-num_gr_mem = 0;
}
 
diff --git a/source3/winbindd/winbindd_sids_to_xids.c 
b/source3/winbindd/winbindd_sids_to_xids.c
index b416e3a..0ed6c89 100644
--- a/source3/winbindd/winbindd_sids_to_xids.c
+++ b/source3/winbindd/winbindd_sids_to_xids.c
@@ -189,15 +189,15 @@ static void winbindd_sids_to_xids_lookupsids_done(struct 
tevent_req *subreq)
switch (n-sid_type) {
case SID_NAME_USER:
case SID_NAME_COMPUTER:
-   t-type = WBC_ID_TYPE_UID;
+   t-type = ID_TYPE_UID;
break;
case SID_NAME_DOM_GRP:
case SID_NAME_ALIAS:
case SID_NAME_WKN_GRP:
-   t-type = WBC_ID_TYPE_GID;
+   t-type = ID_TYPE_GID;
break;
default:
-   t-type = WBC_ID_TYPE_NOT_SPECIFIED;
+   t-type = ID_TYPE_NOT_SPECIFIED;
break;
};
t-domain_index = n-sid_index;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2012-02-25 Thread Volker Lendecke
The branch, master has been updated
   via  558ef5e s3-configure: Add CFLAGS_APPEND variable
  from  263c7c2 s3: Use the correct enum values

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


- Log -
commit 558ef5e26eaff1e1731ce2abd97a5aa486b0a32d
Author: Volker Lendecke v...@samba.org
Date:   Sat Feb 25 23:42:52 2012 +0100

s3-configure: Add CFLAGS_APPEND variable

This makes it possible to add some CFLAGS to the end of the CFLAGS list. I 
use
it for adding -Wno-unused-value when compiling with clang.

Autobuild-User: Volker Lendecke v...@samba.org
Autobuild-Date: Sun Feb 26 01:21:49 CET 2012 on sn-devel-104

---

Summary of changes:
 source3/configure.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index dc47f13..6c7c3b0 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -7183,7 +7183,7 @@ AC_TRY_RUN([#include ${srcdir-.}/../tests/summary.c],
 dnl Merge in developer cflags from now on
 AC_SUBST(DEVELOPER_CFLAGS)
 if test x$krb5_developer = xyes -o x$developer = xyes -o 
x$picky_developer = xyes; then
-CFLAGS=${CFLAGS} \$(DEVELOPER_CFLAGS)
+CFLAGS=${CFLAGS} \$(DEVELOPER_CFLAGS) ${CFLAGS_APPEND}
 fi
 
 # Stuff the smbd-only libraries at the end of the smbd link


-- 
Samba Shared Repository