[SCM] Samba Shared Repository - branch master updated
Björn Baumbach
bbaumbach at samba.org
Wed Dec 18 11:38:02 UTC 2019
The branch, master has been updated
via 5fd65edc91b samba_kcc: avoid ValueError when local connections are less than 2
via f8f3b33ea58 lib/replace: prefer <sys/xattr.h> over <attr/xattr.h>
from ad9a81c6a93 librpc: Move winstation.idl to the top level and exclude from fuzzing
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 5fd65edc91b0f56e044428a32676b079aec9377d
Author: Björn Baumbach <bb at sernet.de>
Date: Tue Aug 13 13:15:58 2019 +0200
samba_kcc: avoid ValueError when local connections are less than 2
Signed-off-by: Björn Baumbach <bb at sernet.de>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Autobuild-User(master): Björn Baumbach <bb at sernet.de>
Autobuild-Date(master): Wed Dec 18 11:37:53 UTC 2019 on sn-devel-184
commit f8f3b33ea58a03dc3c17b03256530b6990ce9191
Author: Ralph Boehme <slow at samba.org>
Date: Sat Dec 14 18:35:51 2019 +0100
lib/replace: prefer <sys/xattr.h> over <attr/xattr.h>
This prevents the following compile error that may happens if "system/filesys.h"
is included before "system/capability.h" on Ubuntu 16.04:
[1802/4407] Compiling source3/lib/system.c
In file included from ../../lib/replace/system/filesys.h:112:0,
from ../../source3/include/vfs.h:29,
from ../../source3/include/smb.h:150,
from ../../source3/include/includes.h:284,
from ../../source3/lib/system.c:23:
/usr/include/x86_64-linux-gnu/sys/xattr.h:32:3: error: expected identifier before numeric constant
XATTR_CREATE = 1, /* set value, fail if attr already exists. */
^
The above error is from compiling a source tree which includes a change that
adds an include "system/filesys.h" to the top of "source3/include/vfs.h".
"source3/lib/system.c" has the following includes:
#include "includes.h"
#include "system/syslog.h"
#include "system/capability.h"
#include "system/passwd.h"
#include "system/filesys.h"
#include "../lib/util/setid.h"
The first include of "includes.h" pulls in "vfs.h" which will pull in
"system/filesys.h" with the mentioned change. "system/filesys.h" pulls in
<attr/xattr.h> which has this define
#define XATTR_CREATE 0x1
Later in "source3/lib/system.c" "system/capability.h" is included which includes
<sys/xattr.h> on Ubuntu 16.04 (not in later versions of glibc). This defines the
XATTR_* values as an enum:
enum {
XATTR_CREATE = 1, /* set value, fail if attr already exists. */
XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */
};
The previous define of XATTR_CREATE as 1 makes this
enum {
1 = 1, /* set value, fail if attr already exists. */
2 = 2 /* set value, fail if attr does not exist. */
};
which is invalid C. The compiler error diagnostic is a bit confusing, as it
prints the original enum from the include file.
See also:
<https://bugs.freedesktop.org/show_bug.cgi?id=78741>
<https://bugs.launchpad.net/ubuntu/+source/attr/+bug/1288091>
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756097>
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Björn Baumbach <bb at samba.org>
-----------------------------------------------------------------------
Summary of changes:
lib/replace/system/filesys.h | 6 +++---
python/samba/kcc/__init__.py | 5 +++++
2 files changed, 8 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
index afde4eacb39..976b2aeec5e 100644
--- a/lib/replace/system/filesys.h
+++ b/lib/replace/system/filesys.h
@@ -108,10 +108,10 @@
#endif
/* mutually exclusive (SuSE 8.2) */
-#if defined(HAVE_ATTR_XATTR_H)
-#include <attr/xattr.h>
-#elif defined(HAVE_SYS_XATTR_H)
+#if defined(HAVE_SYS_XATTR_H)
#include <sys/xattr.h>
+#elif defined(HAVE_ATTR_XATTR_H)
+#include <attr/xattr.h>
#elif defined(HAVE_SYS_ATTRIBUTES_H)
#include <sys/attributes.h>
#elif defined(HAVE_ATTR_ATTRIBUTES_H)
diff --git a/python/samba/kcc/__init__.py b/python/samba/kcc/__init__.py
index 6c6c202fa2c..734c7641883 100644
--- a/python/samba/kcc/__init__.py
+++ b/python/samba/kcc/__init__.py
@@ -499,6 +499,11 @@ class KCC(object):
local_connections.append((cn_conn, s_dnstr,
packed_guid, removable))
+ # Avoid "ValueError: r cannot be bigger than the iterable" in
+ # for a, b in itertools.permutations(local_connections, 2):
+ if (len(local_connections) < 2):
+ return
+
for a, b in itertools.permutations(local_connections, 2):
cn_conn, s_dnstr, packed_guid, removable = a
cn_conn2, s_dnstr2, packed_guid2, removable2 = b
--
Samba Shared Repository
More information about the samba-cvs
mailing list