[SCM] Samba Shared Repository - branch v4-4-stable updated
Karolin Seeger
kseeger at samba.org
Tue Jun 7 10:13:35 UTC 2016
The branch, v4-4-stable has been updated
via ad4db24 VERSION: Disable git snapshots for the 4.4.4 release.
via fa67ef92 WHATSNEW: Add release notes for Samba 4.4.4.
via da9b7ba samba-too: Allow 'samba-tool fsmo' to cope with empty or missing fsmo roles
via 445e678 smbd: dfree - ignore quota if not enforced
via b0f7275 selftest: add disk-free quota tests
via 76abfe7 vfs_fake_dfq: add more mocking options
via 8f142c8 s3:selftest add a test for rpcclient --pw-nt-hash option
via 2f579c7 s3:rpcclient make --pw-nt-hash option work
via 3454590 s3-smbd: Support systemd 230
via 0242e2a s3-smbspool: Log to stderr
via 37fa8a6 Fix memory leak in share mode locking.
via 98b9ea2 s3-quotas: fix sysquotas_4B quota fetching for BSD
via c4c8606 notifyd: prevent NULL deref segfault in notifyd_peer_destructor
via 730ec25 s3-net: Convert the key_name to UTF8 during migration
via abe1808 packaging: Set default limit for core file size in service files
via 2bf48c3 packaging: Set default limit for core file size in init scripts
via e1b7363 packaging: Remove ulimit usage for setting core file size limit
via 211938f s3: auth: Move the declaration of struct dom_sid tmp_sid to function level scope.
via 6a10012 s3:rpcclient: make use of SMB_SIGNING_IPC_DEFAULT
via 8ac105e smbd:close: only remove kernel share modes if they had been taken at open
via 68249a7 s3:vfs: add 'kernel_share_modes_taken' to files_struct
via 290541a s3:client:smbspool_krb5_wrapper: fix the non clearenv build.
via 5a2464b Provide fallback code for non-portable clearenv(3)
via bc3751b smbd: Fix an assert
via da98554 s3:ntlm_auth: make ntlm_auth_generate_session_info() more complete
via 90dd993 s3:smbd: fix anonymous authentication if signing is mandatory
via 8b3fbe1 libcli/auth: let msrpc_parse() return talloc'ed empty strings
via cc19ba3 s3:libsmb/clifile use correct value for MaxParameterCount for setting EAs
via 9f86419 pdb: Fix segfault in pdb_ldap for missing gecos
via bbfe6f4 s3-kerberos: avoid entering a password change dialogue also when using MIT.
via 9799c30 s3:libnet:libnet_join: add netbios aliases as SPNs
via 15a5069 init: set core file size to unlimited by default
via 79cbf02 source3: Honor the core soft limit of the OS.
via 6823ef7 heimdal: encode/decode kvno as signed integer
via 37da5c2 torture:smb2: Add test replay6 to verify Error Codes for DurableHandleReqV2 replay
via 97e96c1 lib/torture: add torture_assert_u64_not_equal_goto macro
via 470569a torture:smb2: add test for checking sequence number wrap around.
via 8240ef3 libcli:smb:smbXcli_base: add smb2cli_session_current_channel_sequence() call.
via 15700e9 smbd:smb2: add some asserts before decrementing the counters
via 6dec722 smbd:smb2: update outstanding request counters before sending a reply
via c8624df smbd:smb2: implement channel sequence checks and request counters in dispatch
via a962dec smbd:smb2: add request_counters_updated to the smbd_smb2_request struct
via 7894513 smbd:smb2: add a modify flag to dispatch table
via 6266902 s3:smbXsrv.idl: add 8 byte channel_sequence number and request counters to IDL.
via 5fcfb62 ldb-samba/ldb_matching_rules: Fix CID 1349424 - Uninitialized pointer read
via be1c27e dbwrap_ctdb: Fix ENOENT->NT_STATUS_NOT_FOUND
via 41f3e50 vfs_fruit: add an option that allows disabling POSIX rename behaviour
via ae7e3d1 s3:smbd/filename remove smelly code
via cb3d4b1 s3:smbd/service apply some code formatting
via 9892c48 s3:smbd/service disable case-sensitivity for SMB2/3 connections
via 6a6f678 Correctly set cli->raw_status for libsmbclient in SMB2 code
via ddd90dc VERSION: Bump version up to 4.4.4...
from f67230d VERSION: Disable git snapshots for the 4.4.3 release.
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-4-stable
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
VERSION | 2 +-
WHATSNEW.txt | 117 ++++-
docs-xml/manpages/vfs_fruit.8.xml | 11 +
lib/ldb-samba/ldb_matching_rules.c | 2 +-
lib/torture/torture.h | 12 +
lib/util/become_daemon.c | 10 +-
libcli/auth/msrpc_parse.c | 24 +-
libcli/smb/smbXcli_base.c | 5 +
libcli/smb/smbXcli_base.h | 1 +
packaging/RHEL-CTDB/setup/smb.init | 2 +
packaging/RHEL-CTDB/setup/winbind.init | 2 +
packaging/RHEL/setup/smb.init | 2 +
packaging/RHEL/setup/winbind.init | 2 +
packaging/systemd/nmb.service | 1 +
packaging/systemd/smb.service | 1 +
packaging/systemd/winbind.service | 1 +
python/samba/netcmd/fsmo.py | 233 +++++-----
python/samba/tests/{auth.py => samba_tool/fsmo.py} | 22 +-
selftest/knownfail | 1 +
source3/auth/token_util.c | 2 +-
source3/client/smbspool.c | 2 +-
source3/client/smbspool_krb5_wrapper.c | 10 +
source3/include/vfs.h | 2 +
source3/lib/dbwrap/dbwrap_ctdb.c | 10 +
source3/lib/dumpcore.c | 15 -
source3/lib/sysquotas_4B.c | 6 +
source3/libads/kerberos.c | 59 +--
source3/libnet/libnet_join.c | 60 +++
source3/librpc/idl/smbXsrv.idl | 3 +
source3/libsmb/cli_smb2_fnum.c | 16 +-
source3/libsmb/clifile.c | 2 +-
source3/locking/share_mode_lock.c | 5 +
source3/modules/vfs_fake_dfq.c | 15 +-
source3/modules/vfs_fruit.c | 6 +-
source3/passdb/pdb_ldap.c | 6 +-
source3/rpcclient/rpcclient.c | 16 +-
source3/script/tests/test_dfree_quota.sh | 12 +
source3/script/tests/test_rpcclient_pw_nt_hash.sh | 27 ++
source3/selftest/tests.py | 5 +
source3/smbd/close.c | 17 +-
source3/smbd/filename.c | 28 --
source3/smbd/globals.h | 7 +
source3/smbd/notifyd/notifyd.c | 5 +-
source3/smbd/open.c | 2 +
source3/smbd/oplock.c | 1 +
source3/smbd/quotas.c | 32 +-
source3/smbd/service.c | 50 ++-
source3/smbd/sesssetup.c | 8 +-
source3/smbd/smb2_server.c | 163 +++++++
source3/utils/net_printing.c | 90 +++-
source3/utils/ntlm_auth.c | 51 ++-
source3/wscript | 2 +-
source4/heimdal/kdc/misc.c | 2 +-
source4/heimdal/lib/asn1/krb5.asn1 | 2 +-
source4/selftest/tests.py | 4 +
source4/torture/rpc/lsa.c | 2 +-
source4/torture/smb2/replay.c | 477 ++++++++++++++++++++-
wscript_configure_system_mitkrb5 | 1 +
58 files changed, 1425 insertions(+), 249 deletions(-)
copy python/samba/tests/{auth.py => samba_tool/fsmo.py} (59%)
create mode 100755 source3/script/tests/test_rpcclient_pw_nt_hash.sh
Changeset truncated at 500 lines:
diff --git a/VERSION b/VERSION
index ba47aab..667e0e5 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
########################################################
SAMBA_VERSION_MAJOR=4
SAMBA_VERSION_MINOR=4
-SAMBA_VERSION_RELEASE=3
+SAMBA_VERSION_RELEASE=4
########################################################
# If a official release has a serious bug #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index ac373fd..ca3c325 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,117 @@
=============================
+ Release Notes for Samba 4.4.4
+ June 7, 2016
+ =============================
+
+
+This is the latest stable release of Samba 4.4.
+
+
+Changes since 4.4.3:
+--------------------
+
+o Michael Adam <obnox at samba.org>
+ * BUG 11809: SMB3 multichannel: Add implementation of missing channel sequence
+ number verification.
+ * BUG 11919: smbd:close: Only remove kernel share modes if they had been
+ taken at open.
+ * BUG 11930: notifyd: Prevent NULL deref segfault in notifyd_peer_destructor.
+
+o Jeremy Allison <jra at samba.org>
+ * BUG 10618: s3: auth: Move the declaration of struct dom_sid tmp_sid to
+ function level scope.
+
+o Christian Ambach <ambi at samba.org>
+ * BUG 10796: s3:rpcclient: Make '--pw-nt-hash' option work.
+ * BUG 11354: s3:libsmb/clifile: Use correct value for MaxParameterCount for
+ setting EAs.
+ * BUG 11438: Fix case sensitivity issues over SMB2 or above.
+
+o Ralph Boehme <slow at samba.org>
+ * BUG 1703: s3:libnet:libnet_join: Add netbios aliases as SPNs.
+ * BUG 11721: vfs_fruit: Add an option that allows disabling POSIX rename
+ behaviour.
+
+o Alexander Bokovoy <ab at samba.org>
+ * BUG 11936: s3-smbd: Support systemd 230.
+
+o Ira Cooper <ira at samba.org>
+ * BUG 11907: source3: Honor the core soft limit of the OS.
+
+o Günther Deschner <gd at samba.org>
+ * BUG 11809: SMB3 multichannel: Add implementation of missing channel sequence
+ number verification.
+ * BUG 11864: s3:client:smbspool_krb5_wrapper: Fix the non clearenv build.
+ * BUG 11906: s3-kerberos: Avoid entering a password change dialogue also when
+ using MIT.
+
+o Robin Hack <hack.robin at gmail.com>
+ * BUG 11890: ldb-samba/ldb_matching_rules: Fix CID 1349424 - Uninitialized
+ pointer read.
+
+o Volker Lendecke <vl at samba.org>
+ * BUG 11844: dbwrap_ctdb: Fix ENOENT->NT_STATUS_NOT_FOUND.
+
+o Robin McCorkell <robin at mccorkell.me.uk>
+ * BUG 11276: Correctly set cli->raw_status for libsmbclient in SMB2 code.
+
+o Stefan Metzmacher <metze at samba.org>
+ * BUG 11910: s3:smbd: Fix anonymous authentication if signing is mandatory.
+ * BUG 11912: libcli/auth: Let msrpc_parse() return talloc'ed empty strings.
+ * BUG 11914: Fix NTLM Authentication issue with squid.
+ * BUG 11927: s3:rpcclient: make use of SMB_SIGNING_IPC_DEFAULT.
+
+o Luca Olivetti <luca at wetron.es>
+ * BUG 11530: pdb: Fix segfault in pdb_ldap for missing gecos.
+
+o Rowland Penny <rpenny at samba.org>
+ * BUG 11613: Allow 'samba-tool fsmo' to cope with empty or missing fsmo
+ roles.
+
+o Anoop C S <anoopcs at redhat.com>
+ * BUG 11907: packaging: Set default limit for core file size in service
+ files.
+
+o Andreas Schneider <asn at samba.org>
+ * BUG 11922: s3-net: Convert the key_name to UTF8 during migration.
+ * BUG 11935: s3-smbspool: Log to stderr.
+
+o Uri Simchoni <uri at samba.org>
+ * BUG 11900: heimdal: Encode/decode kvno as signed integer.
+ * BUG 11931: s3-quotas: Fix sysquotas_4B quota fetching for BSD.
+ * BUG 11937: smbd: dfree: Ignore quota if not enforced.
+
+o Raghavendra Talur <rtalur at redhat.com>
+ * BUG 11907: init: Set core file size to unlimited by default.
+
+o Hemanth Thummala <hemanth.thummala at nutanix.com>
+ * BUG 11934: Fix memory leak in share mode locking.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored. All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
+ =============================
Release Notes for Samba 4.4.3
May 2, 2016
=============================
@@ -92,8 +205,8 @@ database (https://bugzilla.samba.org/).
======================================================================
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
=============================
Release Notes for Samba 4.4.2
diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml
index 2ac5db7..a275344 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -226,6 +226,17 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>fruit:posix_rename = yes | no</term>
+ <listitem>
+ <para>Whether to enable POSIX directory rename behaviour
+ for OS X clients. Without this, directories can't be
+ renamed if any client has any file inside it
+ (recursive!) open.</para>
+ <para>The default is <emphasis>yes</emphasis>.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect1>
diff --git a/lib/ldb-samba/ldb_matching_rules.c b/lib/ldb-samba/ldb_matching_rules.c
index 1692a73..637858f 100644
--- a/lib/ldb-samba/ldb_matching_rules.c
+++ b/lib/ldb-samba/ldb_matching_rules.c
@@ -206,7 +206,7 @@ static int ldb_eval_transitive_filter(TALLOC_CTX *mem_ctx,
struct dsdb_dn *dn_to_match;
const char *dn_oid;
unsigned int count;
- struct dsdb_dn **visited;
+ struct dsdb_dn **visited = NULL;
schema = dsdb_get_schema(ldb, mem_ctx);
if (schema == NULL) {
diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index 356922a..e710873 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -479,6 +479,18 @@ void torture_result(struct torture_context *test,
} \
} while(0)
+#define torture_assert_u64_not_equal_goto(torture_ctx,got,not_expected,ret,label,cmt)\
+ do { uint64_t __got = (got), __not_expected = (not_expected); \
+ if (__got == __not_expected) { \
+ torture_result(torture_ctx, TORTURE_FAIL, \
+ __location__": "#got" was %llu (0x%llX), expected a different number: %s", \
+ (unsigned long long)__got, (unsigned long long)__got, \
+ cmt); \
+ ret = false; \
+ goto label; \
+ } \
+ } while(0)
+
#define torture_assert_errno_equal(torture_ctx,expected,cmt)\
do { int __expected = (expected); \
if (errno != __expected) { \
diff --git a/lib/util/become_daemon.c b/lib/util/become_daemon.c
index 4622971..9979fad 100644
--- a/lib/util/become_daemon.c
+++ b/lib/util/become_daemon.c
@@ -24,7 +24,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "system/locale.h"
-#if HAVE_LIBSYSTEMD_DAEMON
+#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
#include <systemd/sd-daemon.h>
#endif
#include "lib/util/close_low_fd.h"
@@ -69,7 +69,7 @@ _PUBLIC_ void become_daemon(bool do_fork, bool no_process_group, bool log_stdout
if (do_fork) {
newpid = fork();
if (newpid) {
-#if HAVE_LIBSYSTEMD_DAEMON
+#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
sd_notifyf(0, "READY=0\nSTATUS=Starting process...\nMAINPID=%lu", (unsigned long) newpid);
#endif /* HAVE_LIBSYSTEMD_DAEMON */
_exit(0);
@@ -98,7 +98,7 @@ _PUBLIC_ void become_daemon(bool do_fork, bool no_process_group, bool log_stdout
_PUBLIC_ void exit_daemon(const char *msg, int error)
{
-#ifdef HAVE_LIBSYSTEMD_DAEMON
+#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
if (msg == NULL) {
msg = strerror(error);
}
@@ -117,7 +117,7 @@ _PUBLIC_ void daemon_ready(const char *name)
if (name == NULL) {
name = "Samba";
}
-#ifdef HAVE_LIBSYSTEMD_DAEMON
+#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
sd_notifyf(0, "READY=1\nSTATUS=%s: ready to serve connections...", name);
#endif
DEBUG(0, ("STATUS=daemon '%s' finished starting up and ready to serve "
@@ -129,7 +129,7 @@ _PUBLIC_ void daemon_status(const char *name, const char *msg)
if (name == NULL) {
name = "Samba";
}
-#ifdef HAVE_LIBSYSTEMD_DAEMON
+#if defined(HAVE_LIBSYSTEMD_DAEMON) || defined(HAVE_LIBSYSTEMD)
sd_notifyf(0, "\nSTATUS=%s: %s", name, msg);
#endif
DEBUG(0, ("STATUS=daemon '%s' : %s", name, msg));
diff --git a/libcli/auth/msrpc_parse.c b/libcli/auth/msrpc_parse.c
index d499d9e..74a7bcc 100644
--- a/libcli/auth/msrpc_parse.c
+++ b/libcli/auth/msrpc_parse.c
@@ -262,7 +262,11 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx,
ps = va_arg(ap, char **);
if (len1 == 0 && len2 == 0) {
- *ps = (char *)discard_const("");
+ *ps = talloc_strdup(mem_ctx, "");
+ if (*ps == NULL) {
+ ret = false;
+ goto cleanup;
+ }
} else {
/* make sure its in the right format - be strict */
if ((len1 != len2) || (ptr + len1 < ptr) || (ptr + len1 < len1) || (ptr + len1 > blob->length)) {
@@ -289,7 +293,11 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx,
goto cleanup;
}
} else {
- (*ps) = (char *)discard_const("");
+ *ps = talloc_strdup(mem_ctx, "");
+ if (*ps == NULL) {
+ ret = false;
+ goto cleanup;
+ }
}
}
break;
@@ -302,7 +310,11 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx,
ps = (char **)va_arg(ap, char **);
/* make sure its in the right format - be strict */
if (len1 == 0 && len2 == 0) {
- *ps = (char *)discard_const("");
+ *ps = talloc_strdup(mem_ctx, "");
+ if (*ps == NULL) {
+ ret = false;
+ goto cleanup;
+ }
} else {
if ((len1 != len2) || (ptr + len1 < ptr) || (ptr + len1 < len1) || (ptr + len1 > blob->length)) {
ret = false;
@@ -325,7 +337,11 @@ bool msrpc_parse(TALLOC_CTX *mem_ctx,
goto cleanup;
}
} else {
- (*ps) = (char *)discard_const("");
+ *ps = talloc_strdup(mem_ctx, "");
+ if (*ps == NULL) {
+ ret = false;
+ goto cleanup;
+ }
}
}
break;
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index faf74ca..4332374 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -5522,6 +5522,11 @@ uint16_t smb2cli_session_reset_channel_sequence(struct smbXcli_session *session,
return prev_cs;
}
+uint16_t smb2cli_session_current_channel_sequence(struct smbXcli_session *session)
+{
+ return session->smb2->channel_sequence;
+}
+
void smb2cli_session_start_replay(struct smbXcli_session *session)
{
session->smb2->replay_active = true;
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index 8b9851b..16c8848 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -413,6 +413,7 @@ void smb2cli_session_set_id_and_flags(struct smbXcli_session *session,
void smb2cli_session_increment_channel_sequence(struct smbXcli_session *session);
uint16_t smb2cli_session_reset_channel_sequence(struct smbXcli_session *session,
uint16_t channel_sequence);
+uint16_t smb2cli_session_current_channel_sequence(struct smbXcli_session *session);
void smb2cli_session_start_replay(struct smbXcli_session *session);
void smb2cli_session_stop_replay(struct smbXcli_session *session);
NTSTATUS smb2cli_session_update_preauth(struct smbXcli_session *session,
diff --git a/packaging/RHEL-CTDB/setup/smb.init b/packaging/RHEL-CTDB/setup/smb.init
index 4dd5b23..39bf0a8 100644
--- a/packaging/RHEL-CTDB/setup/smb.init
+++ b/packaging/RHEL-CTDB/setup/smb.init
@@ -18,6 +18,8 @@ else
exit 0
fi
+DAEMON_COREFILE_LIMIT='unlimited'
+
# Avoid using root's TMPDIR
unset TMPDIR
diff --git a/packaging/RHEL-CTDB/setup/winbind.init b/packaging/RHEL-CTDB/setup/winbind.init
index a99038f..2a9dd82 100644
--- a/packaging/RHEL-CTDB/setup/winbind.init
+++ b/packaging/RHEL-CTDB/setup/winbind.init
@@ -16,6 +16,8 @@ else
exit 0
fi
+DAEMON_COREFILE_LIMIT='unlimited'
+
# Avoid using root's TMPDIR
unset TMPDIR
diff --git a/packaging/RHEL/setup/smb.init b/packaging/RHEL/setup/smb.init
index af85b2c..96fb74a 100644
--- a/packaging/RHEL/setup/smb.init
+++ b/packaging/RHEL/setup/smb.init
@@ -18,6 +18,8 @@ else
exit 0
fi
+DAEMON_COREFILE_LIMIT='unlimited'
+
# Avoid using root's TMPDIR
unset TMPDIR
diff --git a/packaging/RHEL/setup/winbind.init b/packaging/RHEL/setup/winbind.init
index a99038f..2a9dd82 100644
--- a/packaging/RHEL/setup/winbind.init
+++ b/packaging/RHEL/setup/winbind.init
@@ -16,6 +16,8 @@ else
exit 0
fi
+DAEMON_COREFILE_LIMIT='unlimited'
+
# Avoid using root's TMPDIR
unset TMPDIR
diff --git a/packaging/systemd/nmb.service b/packaging/systemd/nmb.service
index 3d71a7d..992c0cd 100644
--- a/packaging/systemd/nmb.service
+++ b/packaging/systemd/nmb.service
@@ -9,6 +9,7 @@ PIDFile=/run/nmbd.pid
EnvironmentFile=-/etc/sysconfig/samba
ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
ExecReload=/usr/bin/kill -HUP $MAINPID
+LimitCORE=infinity
[Install]
WantedBy=multi-user.target
diff --git a/packaging/systemd/smb.service b/packaging/systemd/smb.service
index 9810891..6053a5c 100644
--- a/packaging/systemd/smb.service
+++ b/packaging/systemd/smb.service
@@ -10,6 +10,7 @@ LimitNOFILE=16384
EnvironmentFile=-/etc/sysconfig/samba
ExecStart=/usr/sbin/smbd $SMBDOPTIONS
ExecReload=/usr/bin/kill -HUP $MAINPID
+LimitCORE=infinity
[Install]
WantedBy=multi-user.target
diff --git a/packaging/systemd/winbind.service b/packaging/systemd/winbind.service
index f711a17..c511488 100644
--- a/packaging/systemd/winbind.service
+++ b/packaging/systemd/winbind.service
@@ -9,6 +9,7 @@ PIDFile=/run/winbindd.pid
EnvironmentFile=-/etc/sysconfig/samba
ExecStart=/usr/sbin/winbindd "$WINBINDOPTIONS"
ExecReload=/usr/bin/kill -HUP $MAINPID
+LimitCORE=infinity
[Install]
WantedBy=multi-user.target
diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py
index 3904bcb..3d14939 100644
--- a/python/samba/netcmd/fsmo.py
+++ b/python/samba/netcmd/fsmo.py
@@ -31,17 +31,26 @@ from samba.netcmd import (
)
from samba.samdb import SamDB
-def get_fsmo_roleowner(samdb, roledn):
+def get_fsmo_roleowner(samdb, roledn, role):
"""Gets the owner of an FSMO role
:param roledn: The DN of the FSMO role
+ :param role: The FSMO role
"""
- res = samdb.search(roledn,
- scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"])
- if len(res) == 0:
- raise CommandError('"%s" does not have a FSMO roleowner' % roledn)
- master_owner = res[0]["fSMORoleOwner"][0]
- return master_owner
+ try:
+ res = samdb.search(roledn,
+ scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"])
+ except LdbError, (num, msg):
+ if num == ldb.ERR_NO_SUCH_OBJECT:
+ return "* The '%s' role is not present in this domain" % role
+ raise
+
+ if 'fSMORoleOwner' in res[0]:
+ master_owner = res[0]["fSMORoleOwner"][0]
+ return master_owner
+ else:
+ master_owner = "* The '%s' role does not have an FSMO roleowner" % role
+ return master_owner
def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
@@ -54,23 +63,23 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
forest_dn = samba.dn_from_dns_name(samdb.forest_dns_name())
role_object = "CN=Infrastructure,DC=ForestDnsZones," + forest_dn
- try:
- res = samdb.search(role_object,
- attrs=["fSMORoleOwner"],
- scope=ldb.SCOPE_BASE,
- controls=["extended_dn:1:1"])
+ res = samdb.search(role_object,
+ attrs=["fSMORoleOwner"],
+ scope=ldb.SCOPE_BASE,
+ controls=["extended_dn:1:1"])
- if 'fSMORoleOwner' in res[0]:
- try:
- master_guid = str(misc.GUID(ldb.Dn(samdb,
- res[0]['fSMORoleOwner'][0])
- .get_extended_component('GUID')))
- master_owner = str(ldb.Dn(samdb, res[0]['fSMORoleOwner'][0]))
- except LdbError, (num, msg):
- raise CommandError("GUID not found in partition naming master DN %s : %s \n" %
- (res[0]['fSMORoleOwner'][0], msg))
- except LdbError, (num, msg):
- raise CommandError("DNS partion %s not found : %s" % (role, msg))
+ if 'fSMORoleOwner' in res[0]:
+ try:
+ master_guid = str(misc.GUID(ldb.Dn(samdb,
+ res[0]['fSMORoleOwner'][0])
+ .get_extended_component('GUID')))
+ master_owner = str(ldb.Dn(samdb, res[0]['fSMORoleOwner'][0]))
+ except LdbError, (num, msg):
+ raise CommandError("No GUID found in naming master DN %s : %s \n" %
+ (res[0]['fSMORoleOwner'][0], msg))
+ else:
+ outf.write("* The '%s' role does not have an FSMO roleowner\n" % role)
+ return False
--
Samba Shared Repository
More information about the samba-cvs
mailing list