sharpe/samba-autobuild/.git
8 years agobuildtools: Always reset the build environment
Petr Viktorin [Fri, 22 May 2015 11:06:48 +0000 (13:06 +0200)]
buildtools: Always reset the build environment

In install_library, the Build object's environment was not reset
after an early return, so the extrapython env would be used in
subsequent build steps.
Wrap everything in a try-finally block to make sure the env is reset.

(Almost all of the change is indentation, `git show -w` recommended.)

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
8 years agos3: libsmbclient: Use cache targetcli in SMBC_splice_ctx calls also.
Jeremy Allison [Mon, 8 Jun 2015 17:07:49 +0000 (10:07 -0700)]
s3: libsmbclient: Use cache targetcli in SMBC_splice_ctx calls also.

Bug 11295 - Excessive cli_resolve_path() usage can slow down transmission.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11295

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Jun 10 04:09:36 CEST 2015 on sn-devel-104

8 years agosmbd/trans2: add a useful diagnostic for files with bad encoding
Ralph Boehme [Wed, 3 Jun 2015 15:07:46 +0000 (17:07 +0200)]
smbd/trans2: add a useful diagnostic for files with bad encoding

Catch conversion error and log the path of the offending file.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun  9 21:00:02 CEST 2015 on sn-devel-104

8 years agolib/util/charset: fix conversion failure logging
Ralph Boehme [Wed, 3 Jun 2015 14:58:22 +0000 (16:58 +0200)]
lib/util/charset: fix conversion failure logging

Move catch-all debug statement with loglevel 0 from behind the switch
clause into the switch clause as default case. Fixes an issue that
resulted in the log being flooded with level 0 messages in case someone
put a file with an illegal UTF8 encoding (eg '\xA0test') on the server.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agovfs_fruit: add option veto_appledouble
Ralph Boehme [Sat, 9 May 2015 06:31:24 +0000 (08:31 +0200)]
vfs_fruit: add option veto_appledouble

vfs_fruit adds a wildcard path "._*" to the vetolist in order to prevent
client access to ._ AppleDouble files created internally by vfs_fruit
for storing the Mac resource fork stream.

Unfortunately there are legitimite use cases where an OS X client may
want to use such filenames, extracting ZIP archives (where the archive
contains ._ files) being one of them.

A possible simple solution to this problem would be to not veto ._ files
in the first place, even though that exposes internally created ._ files
which the client shouldn't be able to access.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11305

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jun  9 14:48:14 CEST 2015 on sn-devel-104

8 years agos3:param/loadparm fix testparm --show-all-parameters
Christian Ambach [Mon, 8 Jun 2015 21:48:54 +0000 (23:48 +0200)]
s3:param/loadparm fix testparm --show-all-parameters

it didn't know about the new types of config parameters

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11170

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jun  9 11:49:18 CEST 2015 on sn-devel-104

8 years agonsswitch: Simplify winbind_named_pipe_sock()
Volker Lendecke [Sun, 1 Mar 2015 11:43:01 +0000 (11:43 +0000)]
nsswitch: Simplify winbind_named_pipe_sock()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jun  8 19:48:18 CEST 2015 on sn-devel-104

8 years agoctdb-build: only use ctdb/packaging/mkversion.sh for the standalone build.
Stefan Metzmacher [Thu, 28 May 2015 14:17:15 +0000 (16:17 +0200)]
ctdb-build: only use ctdb/packaging/mkversion.sh for the standalone build.

This avoids rebuilding ctdb after each commit, instead we're using
SAMBA_VERSION_STRING, which may contain "4.3.0pre1-DEVELOPERBUILD",
instead of "4.3.0pre1.GIT.4ccdd39" for the non-install build.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jun  8 15:51:46 CEST 2015 on sn-devel-104

8 years agoctdb-build: fix version handling in standalone build
Michael Adam [Mon, 8 Jun 2015 10:47:34 +0000 (12:47 +0200)]
ctdb-build: fix version handling in standalone build

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
8 years agoselftest: Remove binary mappings from the build system.
Adrian Cochrane [Fri, 5 Jun 2015 00:22:45 +0000 (12:22 +1200)]
selftest: Remove binary mappings from the build system.

Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoselftest: Apply rename filepath arguments so binary mapping doesn't have to.
Adrian Cochrane [Fri, 5 Jun 2015 03:18:19 +0000 (15:18 +1200)]
selftest: Apply rename filepath arguments so binary mapping doesn't have to.

Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agos3:smb2_tcon: require a signed request when authentication is used for SMB >= 3.11
Stefan Metzmacher [Thu, 28 May 2015 13:35:25 +0000 (15:35 +0200)]
s3:smb2_tcon: require a signed request when authentication is used for SMB >= 3.11

Disconnect the client if the request is not signed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun  6 03:19:33 CEST 2015 on sn-devel-104

8 years agoctdb: Change use of 'which' to 'type' in scripts.
Jose A. Rivera [Fri, 5 Jun 2015 14:20:59 +0000 (09:20 -0500)]
ctdb: Change use of 'which' to 'type' in scripts.

While 'which' is a very common tool, on many distros it is not a requirement
that it be installed. 'type' is a shell built-in specified by the Open Group,
and is found in shells like bash, dash, and ksh across multiple OSes.

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun  5 20:39:47 CEST 2015 on sn-devel-104

8 years agomessaging: Move parsing of ctdb_req_message to ctdbd_conn.c
Volker Lendecke [Tue, 2 Jun 2015 20:30:06 +0000 (20:30 +0000)]
messaging: Move parsing of ctdb_req_message to ctdbd_conn.c

This way we can remove the ctdb-specific includes from messages_ctdbd.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agowinbind: Lookup groupmem via primaryGroupID
Volker Lendecke [Fri, 5 Jun 2015 11:02:10 +0000 (13:02 +0200)]
winbind: Lookup groupmem via primaryGroupID

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun  5 17:21:04 CEST 2015 on sn-devel-104

8 years agotsocket: Use common code in tsocket_bsd_common_prepare_fd
Volker Lendecke [Fri, 5 Jun 2015 09:02:45 +0000 (11:02 +0200)]
tsocket: Use common code in tsocket_bsd_common_prepare_fd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
8 years agolibcli/named_pipe_auth: call smb_set_close_on_exec() in tstream_npa_socketpair()
Stefan Metzmacher [Fri, 5 Jun 2015 07:40:19 +0000 (09:40 +0200)]
libcli/named_pipe_auth: call smb_set_close_on_exec() in tstream_npa_socketpair()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11312

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agodocs: Reference ldap ssl options in idmap_rfc2307 manpage
Christof Schmitt [Thu, 4 Jun 2015 20:28:55 +0000 (13:28 -0700)]
docs: Reference ldap ssl options in idmap_rfc2307 manpage

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun  5 14:18:01 CEST 2015 on sn-devel-104

8 years agos3: libsmbclient: Re-resolving targetcli on every read/write/lseek/ftruncate/close...
Jeremy Allison [Thu, 28 May 2015 18:07:41 +0000 (11:07 -0700)]
s3: libsmbclient: Re-resolving targetcli on every read/write/lseek/ftruncate/close is both incorrect and slow.

Cache targetcli on file open in the SMBCFILE struct.

Bug 11295 - Excessive cli_resolve_path() usage can slow down transmission.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11295

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoctdb-recovered: Drop unused variable
Amitay Isaacs [Fri, 5 Jun 2015 06:36:08 +0000 (16:36 +1000)]
ctdb-recovered: Drop unused variable

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoctdb-recoverd/vacuum: Remove vacuum_info structure
Amitay Isaacs [Fri, 5 Jun 2015 06:35:48 +0000 (16:35 +1000)]
ctdb-recoverd/vacuum: Remove vacuum_info structure

For all the records listed in VACUUM_FETCH, migration requests are sent
immediately without waiting.  This means there can only be a single
VACUUM_FETCH processing active at a time.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoctdb-recoverd/vacuum: move fetch loop back into fetch handler.
Michael Adam [Tue, 2 Jun 2015 20:17:03 +0000 (22:17 +0200)]
ctdb-recoverd/vacuum: move fetch loop back into fetch handler.

With the processing of one element factored out,
it is more natural to have the actual loop inside the
handler function. This also makes the talloc/free
bracked around the loop more obvious.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-recoverd/vacuum: slightly reorder the vacuum fetch loop
Michael Adam [Tue, 2 Jun 2015 20:16:17 +0000 (22:16 +0200)]
ctdb-recoverd/vacuum: slightly reorder the vacuum fetch loop

Reads more naturally this way, imho.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-recoverd/vacuum: add common exit point to vacuum_fetch_handler
Michael Adam [Tue, 2 Jun 2015 19:57:54 +0000 (21:57 +0200)]
ctdb-recoverd/vacuum: add common exit point to vacuum_fetch_handler

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-recoverd/vacuum: factor vacuum_fetch_process_one out of vacuum_fetch_loop
Michael Adam [Tue, 2 Jun 2015 19:39:00 +0000 (21:39 +0200)]
ctdb-recoverd/vacuum: factor vacuum_fetch_process_one out of vacuum_fetch_loop

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-recoverd/vacuum: move two variables into scope.
Michael Adam [Tue, 2 Jun 2015 19:27:16 +0000 (21:27 +0200)]
ctdb-recoverd/vacuum: move two variables into scope.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb-recoverd/vacuum: remove unneeded prototype.
Michael Adam [Wed, 27 May 2015 23:06:25 +0000 (01:06 +0200)]
ctdb-recoverd/vacuum: remove unneeded prototype.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agonsswitch: Extend idmap_rfc2307 testcase for reverse lookup
Christof Schmitt [Thu, 4 Jun 2015 17:39:14 +0000 (10:39 -0700)]
nsswitch: Extend idmap_rfc2307 testcase for reverse lookup

Also test the codepaths to map UID and GID back to SID and names. Use
different user and group to avoid returning results cached from the
previous lookups.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11313

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun  5 01:24:32 CEST 2015 on sn-devel-104

8 years agoidmap_rfc2307: Fix wbinfo --gid-to-sid query
Christof Schmitt [Thu, 4 Jun 2015 19:11:27 +0000 (12:11 -0700)]
idmap_rfc2307: Fix wbinfo --gid-to-sid query

Fix syntax error in LDAP query for gidNumber.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11313

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos3-rpc_server: Fix inteface typo.
Günther Deschner [Wed, 3 Jun 2015 11:33:00 +0000 (13:33 +0200)]
s3-rpc_server: Fix inteface typo.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun  4 03:51:29 CEST 2015 on sn-devel-104

8 years agotstream: Make socketpair nonblocking
Volker Lendecke [Wed, 3 Jun 2015 13:41:24 +0000 (13:41 +0000)]
tstream: Make socketpair nonblocking

When we have a large RPC reply, we can't block in the RPC server.

Test: Do rpcclient netshareenumall with a thousand shares defined

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agodebug: Fix default log levels
Volker Lendecke [Wed, 3 Jun 2015 14:34:31 +0000 (14:34 +0000)]
debug: Fix default log levels

According to man smb.conf, the log level with the "logging=" parameter is
separated by @, not :.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Thu Jun  4 01:01:35 CEST 2015 on sn-devel-104

8 years agoPrevent clashes between system and Samba SHA functions
Emmanuel Dreyfus [Sat, 30 May 2015 05:31:01 +0000 (07:31 +0200)]
Prevent clashes between system and Samba SHA functions

Samba provides its own set of SHA function, which would replace
libc-provided flavors. This is a problem because while the prototypes
are the same, the context structure are different. As a result,
when connecting to a LDAP/SSL directory, we go through
libldap/libssl/libcrypto and there libcrypto expects to call libc
SHA functions, not Samba's.

The fix is to check for SHA function presence and rename Samba's
version to avoid a clash.

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo <simo@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun  3 01:54:24 CEST 2015 on sn-devel-104

8 years agotevent: fix access after free in tevent_common_check_signal()
Stefan Metzmacher [Tue, 2 Jun 2015 10:18:22 +0000 (12:18 +0200)]
tevent: fix access after free in tevent_common_check_signal()

This was reported by Pavel Březina <pbrezina@redhat.com>:

    We found a crash in SSSD when a tevent signal is freed in its handler, tevent
    than crashes when it access siginfo.

    sig_info is freed in signal destructor:

    > #ifdef SA_SIGINFO
    >         if (se->sa_flags & SA_SIGINFO) {
    >             if (sig_state->sig_info[se->signum]) {
    >                 talloc_free(sig_state->sig_info[se->signum]);
    >                 sig_state->sig_info[se->signum] = NULL;
    >             }
    >         }
    > #endif

    (gdb) bt
    #0  0x00007f5d4d86cc74 in tevent_signal_destructor (se=0x7f5d5370f920) at
    ../tevent_signal.c:213
    #1  0x00007f5d4d65f233 in _talloc_free_internal () from /lib64/libtalloc.so.2
    #2  0x00007f5d4d6593a3 in _talloc_free () from /lib64/libtalloc.so.2
    #3  0x00007f5d4342f3d4 in proxy_child_init_done (subreq=0x7f5d5370f600) at
    src/providers/proxy/proxy_auth.c:436
    #4  0x00007f5d4d86b0c2 in _tevent_req_error (req=req@entry=0x7f5d5370f600,
    error=error@entry=5, location=location@entry=0x7f5d43433010
    "src/providers/proxy/proxy_auth.c:356")
        at ../tevent_req.c:167
    #5  0x00007f5d4342ef5e in pc_init_sig_handler (ev=<optimized out>,
    sige=<optimized out>, signum=<optimized out>, count=<optimized out>,
    __siginfo=<optimized out>, pvt=<optimized out>)
        at src/providers/proxy/proxy_auth.c:356
    #6  0x00007f5d4d86d48c in tevent_common_check_signal (ev=0x7f5d536de670) at
    ../tevent_signal.c:428
    #7  0x00007f5d4d86f28c in epoll_event_loop (tvalp=0x7fff7b568490,
    epoll_ev=0x7f5d536de8b0) at ../tevent_epoll.c:647
    #8  epoll_event_loop_once (ev=<optimized out>, location=<optimized out>) at
    ../tevent_epoll.c:926
    #9  0x00007f5d4d86d7d7 in std_event_loop_once (ev=0x7f5d536de670,
    location=0x7f5d50faedc3 "src/util/server.c:668") at ../tevent_standard.c:114
    #10 0x00007f5d4d869fbd in _tevent_loop_once (ev=ev@entry=0x7f5d536de670,
    location=location@entry=0x7f5d50faedc3 "src/util/server.c:668") at
    ../tevent.c:530
    #11 0x00007f5d4d86a15b in tevent_common_loop_wait (ev=0x7f5d536de670,
    location=0x7f5d50faedc3 "src/util/server.c:668") at ../tevent.c:634
    #12 0x00007f5d4d86d777 in std_event_loop_wait (ev=0x7f5d536de670,
    location=0x7f5d50faedc3 "src/util/server.c:668") at ../tevent_standard.c:140
    #13 0x00007f5d50f96863 in server_loop (main_ctx=0x7f5d536dfac0) at
    src/util/server.c:668
    #14 0x00007f5d5180aa42 in main (argc=8, argv=<optimized out>) at
    src/providers/data_provider_be.c:2909

    But then it is accessed again in tevent_common_check_signal:

    > #ifdef SA_SIGINFO
    >         if (clear_processed_siginfo) {
    >             uint32_t j;
    >             for (j=0;j<count;j++) {
    >                 uint32_t ofs = (counter.seen + j)
    >                     % TEVENT_SA_INFO_QUEUE_COUNT;
    >                 memset((void*)&sig_state->sig_info[i][ofs],
    >                     '\0',
    >                     sizeof(siginfo_t));
    >             }
    >         }
    > #endif

    (gdb) bt
    #0  0x00007fd7ba400505 in memset (__len=<optimized out>, __ch=<optimized out>,
    __dest=<optimized out>) at /usr/include/bits/string3.h:84
    #1  tevent_common_check_signal (ev=0x7fd7bfddf670) at ../tevent_signal.c:459
    #2  0x00007fd7ba40228c in epoll_event_loop (tvalp=0x7fff85536430,
    epoll_ev=0x7fd7bfddf8b0) at ../tevent_epoll.c:647
    #3  epoll_event_loop_once (ev=<optimized out>, location=<optimized out>) at
    ../tevent_epoll.c:926
    #4  0x00007fd7ba4007d7 in std_event_loop_once (ev=0x7fd7bfddf670,
    location=0x7fd7bdb417c3 "src/util/server.c:668") at ../tevent_standard.c:114
    #5  0x00007fd7ba3fcfbd in _tevent_loop_once (ev=ev@entry=0x7fd7bfddf670,
    location=location@entry=0x7fd7bdb417c3 "src/util/server.c:668") at
    ../tevent.c:530
    #6  0x00007fd7ba3fd15b in tevent_common_loop_wait (ev=0x7fd7bfddf670,
    location=0x7fd7bdb417c3 "src/util/server.c:668") at ../tevent.c:634
    #7  0x00007fd7ba400777 in std_event_loop_wait (ev=0x7fd7bfddf670,
    location=0x7fd7bdb417c3 "src/util/server.c:668") at ../tevent_standard.c:140
    #8  0x00007fd7bdb29343 in server_loop (main_ctx=0x7fd7bfde0ac0) at
    src/util/server.c:668
    #9  0x00007fd7be39ca42 in main (argc=8, argv=<optimized out>) at
    src/providers/data_provider_be.c:2909

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11308

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun  2 21:02:11 CEST 2015 on sn-devel-104

8 years agos4-torture: call clusapi_CreateResEnum for all cluster resources.
Günther Deschner [Thu, 23 Apr 2015 09:44:43 +0000 (11:44 +0200)]
s4-torture: call clusapi_CreateResEnum for all cluster resources.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun  2 05:16:00 CEST 2015 on sn-devel-104

8 years agoclusapi: add inline comment describing why we use so many "if 0" in this IDL.
Günther Deschner [Fri, 22 May 2015 08:59:03 +0000 (10:59 +0200)]
clusapi: add inline comment describing why we use so many "if 0" in this IDL.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agoKCC: improve docstring for KCC.load_samdb()
Douglas Bagnall [Wed, 29 Apr 2015 23:34:21 +0000 (11:34 +1200)]
KCC: improve docstring for KCC.load_samdb()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat May 30 23:55:22 CEST 2015 on sn-devel-104

8 years agoKCC: improve docstring for KCC.list_dsas()
Douglas Bagnall [Wed, 29 Apr 2015 23:33:59 +0000 (11:33 +1200)]
KCC: improve docstring for KCC.list_dsas()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: slightly improve docstring for KCC.create_connection()
Douglas Bagnall [Mon, 27 Apr 2015 23:32:27 +0000 (11:32 +1200)]
KCC: slightly improve docstring for KCC.create_connection()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.is_bridgehead_failed()
Douglas Bagnall [Mon, 27 Apr 2015 23:31:51 +0000 (11:31 +1200)]
KCC: improve docstring for KCC.is_bridgehead_failed()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Slightly improve docstring for KCC.get_all_bridgeheads()
Douglas Bagnall [Mon, 27 Apr 2015 23:30:30 +0000 (11:30 +1200)]
KCC: Slightly improve docstring for KCC.get_all_bridgeheads()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Slightly improve docstring for KCC.get_bridgehead()
Douglas Bagnall [Mon, 27 Apr 2015 23:29:47 +0000 (11:29 +1200)]
KCC: Slightly improve docstring for KCC.get_bridgehead()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.load_all_partitions()
Douglas Bagnall [Mon, 27 Apr 2015 23:22:40 +0000 (11:22 +1200)]
KCC: improve docstring for KCC.load_all_partitions()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.add_transports()
Douglas Bagnall [Mon, 27 Apr 2015 23:14:04 +0000 (11:14 +1200)]
KCC: improve docstring for KCC.add_transports()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.setup_graph()
Douglas Bagnall [Mon, 27 Apr 2015 23:13:23 +0000 (11:13 +1200)]
KCC: improve docstring for KCC.setup_graph()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.translate_ntdsconn()
Douglas Bagnall [Mon, 27 Apr 2015 23:11:43 +0000 (11:11 +1200)]
KCC: improve docstring for KCC.translate_ntdsconn()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.modify_repsFrom()
Douglas Bagnall [Mon, 27 Apr 2015 23:10:46 +0000 (11:10 +1200)]
KCC: improve docstring for KCC.modify_repsFrom()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.is_stale_link_connection()
Douglas Bagnall [Mon, 27 Apr 2015 23:06:58 +0000 (11:06 +1200)]
KCC: improve docstring for KCC.is_stale_link_connection()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.merge_failed_links()
Douglas Bagnall [Mon, 27 Apr 2015 23:05:06 +0000 (11:05 +1200)]
KCC: improve docstring for KCC.merge_failed_links()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring and comment for kcc.remove_unneeded_ntdsconn()
Douglas Bagnall [Mon, 27 Apr 2015 23:01:13 +0000 (11:01 +1200)]
KCC: improve docstring and comment for kcc.remove_unneeded_ntdsconn()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.load_my_dsa()
Douglas Bagnall [Fri, 24 Apr 2015 04:56:36 +0000 (16:56 +1200)]
KCC: improve docstring for KCC.load_my_dsa()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.load_my_site()
Douglas Bagnall [Fri, 24 Apr 2015 04:56:05 +0000 (16:56 +1200)]
KCC: improve docstring for KCC.load_my_site()

Separating :return: from :raise:

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.load_mysite()
Douglas Bagnall [Fri, 24 Apr 2015 04:54:35 +0000 (16:54 +1200)]
KCC: improve docstring for KCC.load_mysite()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring and comments for KCC.load_site()
Douglas Bagnall [Fri, 24 Apr 2015 04:53:35 +0000 (16:53 +1200)]
KCC: improve docstring and comments for KCC.load_site()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.load_all_sitelinks()
Douglas Bagnall [Fri, 24 Apr 2015 04:52:59 +0000 (16:52 +1200)]
KCC: improve docstring for KCC.load_all_sitelinks()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for KCC.load_all_transports()
Douglas Bagnall [Fri, 24 Apr 2015 04:52:33 +0000 (16:52 +1200)]
KCC: improve docstring for KCC.load_all_transports()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: docstring for the KCC class
Douglas Bagnall [Fri, 24 Apr 2015 04:51:33 +0000 (16:51 +1200)]
KCC: docstring for the KCC class

The params describe the __init__ method arguments.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve docstring for is_smtp_replication_available()
Douglas Bagnall [Fri, 24 Apr 2015 04:48:51 +0000 (16:48 +1200)]
KCC: improve docstring for is_smtp_replication_available()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: docstring for sort_dsa_by_gc_and_guid
Douglas Bagnall [Fri, 24 Apr 2015 04:48:08 +0000 (16:48 +1200)]
KCC: docstring for sort_dsa_by_gc_and_guid

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Docstring for sort_replica_by_dsa_guid
Douglas Bagnall [Fri, 24 Apr 2015 04:47:36 +0000 (16:47 +1200)]
KCC: Docstring for sort_replica_by_dsa_guid

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: tests/ldif_utils tests ldif import
Douglas Bagnall [Thu, 16 Apr 2015 05:26:51 +0000 (17:26 +1200)]
KCC: tests/ldif_utils tests ldif import

Thanks as usual to Andrew Bartlett for his help.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: ldif_utils: ldif_to_samdb doesn't need creds; begin selftest
Douglas Bagnall [Mon, 27 Apr 2015 23:38:51 +0000 (11:38 +1200)]
KCC: ldif_utils: ldif_to_samdb doesn't need creds; begin selftest

The tests are based on the testdata/ldif-utils-test-multisite.ldif
which describes a multisite windows network. It was constructed by
Garming Sam.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: add multisite ldif file for KCC tests
Douglas Bagnall [Mon, 27 Apr 2015 23:39:49 +0000 (11:39 +1200)]
KCC: add multisite ldif file for KCC tests

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agokcc: translate over other DSA for repsFrom graph
Garming Sam [Fri, 10 Apr 2015 04:17:28 +0000 (16:17 +1200)]
kcc: translate over other DSA for repsFrom graph

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agokcc: prevent non-determinism when running translation
Garming Sam [Fri, 10 Apr 2015 04:15:28 +0000 (16:15 +1200)]
kcc: prevent non-determinism when running translation

RODC connections could appear first some runs while not always. This would
mean that repsFrom could accidentally be deleted.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoctdb: remove various dead prototypes from the ctdb private header.
Günther Deschner [Wed, 27 May 2015 17:01:55 +0000 (19:01 +0200)]
ctdb: remove various dead prototypes from the ctdb private header.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat May 30 05:03:59 CEST 2015 on sn-devel-104

8 years agoctdb: remove various dead prototypes from the ctdb client header.
Günther Deschner [Wed, 27 May 2015 14:34:48 +0000 (16:34 +0200)]
ctdb: remove various dead prototypes from the ctdb client header.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
8 years agos3:smb2_server: In CCM and GCM mode we can't reuse nonces
Simo Sorce [Wed, 20 May 2015 12:01:44 +0000 (14:01 +0200)]
s3:smb2_server: In CCM and GCM mode we can't reuse nonces

Reuse of nonces with AES-CCM and AES-GCM leads to catastrophic failure,
so make sure the server drops the connection if that ever happens.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11300

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri May 29 22:38:50 CEST 2015 on sn-devel-104

8 years agolibcli/smb: In CCM and GCM mode we can't reuse nonces
Stefan Metzmacher [Thu, 28 May 2015 13:20:54 +0000 (15:20 +0200)]
libcli/smb: In CCM and GCM mode we can't reuse nonces

Reuse of nonces with AES-CCM and AES-GCM leads to catastrophic failure,
so make sure the server drops the connection if that ever happens.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11300

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
8 years agoctdbd_conn: Fix CID 1301580 Explicit null dereferenced
Volker Lendecke [Thu, 23 Apr 2015 16:06:17 +0000 (18:06 +0200)]
ctdbd_conn: Fix CID 1301580 Explicit null dereferenced

Coverity does not really tell me which code path it sees where we could leave
hdr==NULL, but this check does not hurt.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri May 29 19:49:30 CEST 2015 on sn-devel-104

8 years agoKCC: test suite for the graph_utils
Douglas Bagnall [Tue, 14 Apr 2015 02:46:12 +0000 (14:46 +1200)]
KCC: test suite for the graph_utils

This found a few bugs in the tests which were fixed.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri May 29 13:55:54 CEST 2015 on sn-devel-104

8 years agoKCC: rename 'repsFrom_%s_all' graphs --> 'all-repsFrom_%s' for better sort order
Douglas Bagnall [Tue, 14 Apr 2015 02:35:15 +0000 (14:35 +1200)]
KCC: rename 'repsFrom_%s_all' graphs --> 'all-repsFrom_%s' for better sort order

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: more debugging changes
Douglas Bagnall [Tue, 14 Apr 2015 02:31:05 +0000 (14:31 +1200)]
KCC: more debugging changes

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: (doc) explain intrasite max edge count a bit better
Douglas Bagnall [Mon, 13 Apr 2015 22:12:48 +0000 (10:12 +1200)]
KCC: (doc) explain intrasite max edge count a bit better

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: remove print statements from kcc_utils
Douglas Bagnall [Thu, 9 Apr 2015 03:04:44 +0000 (15:04 +1200)]
KCC: remove print statements from kcc_utils

debug noise should not go to stdout

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: pep8/flake8 fixes for samba_kcc
Douglas Bagnall [Thu, 9 Apr 2015 03:02:00 +0000 (15:02 +1200)]
KCC: pep8/flake8 fixes for samba_kcc

Also note a couple of unused variables. I am not removing them yet
in case their intended use turns up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: more pep8 for kcc_utils
Douglas Bagnall [Thu, 9 Apr 2015 03:00:55 +0000 (15:00 +1200)]
KCC: more pep8 for kcc_utils

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: pep8 pass over graph_utils.py
Douglas Bagnall [Thu, 9 Apr 2015 02:45:08 +0000 (14:45 +1200)]
KCC: pep8 pass over graph_utils.py

Using the `flake8` tool, which also spots e.g. unused imports.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: add graph tests of robustness against edge and vertex failure
Douglas Bagnall [Thu, 9 Apr 2015 02:31:17 +0000 (14:31 +1200)]
KCC: add graph tests of robustness against edge and vertex failure

These tests are themselves tested in a later patch.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: improve directed_double_ring graph check
Douglas Bagnall [Thu, 9 Apr 2015 01:55:40 +0000 (13:55 +1200)]
KCC: improve directed_double_ring graph check

The previous test assumed there would be only a double directed ring
but in fact there could be other edges.  In large graphs there are
certain to be more edges.

Now we want to be sure there is a complete ring apart from any other
connections. This is called the Hamiltonian path problem and takes
exponential time in general, so now our test is that it looks *quite*
a lot like a complete ring.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: --test-all-reps-from uses same random seed for all DSAs
Douglas Bagnall [Wed, 8 Apr 2015 01:40:53 +0000 (13:40 +1200)]
KCC: --test-all-reps-from uses same random seed for all DSAs

Otherwise some of the links end up different for each KCC run. That is
expected and proper, but it is confusing.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: RODCs are their own bridgeheads
Douglas Bagnall [Thu, 2 Apr 2015 02:50:40 +0000 (15:50 +1300)]
KCC: RODCs are their own bridgeheads

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: ignore non-IP transports more thoroughly
Douglas Bagnall [Thu, 2 Apr 2015 02:46:55 +0000 (15:46 +1300)]
KCC: ignore non-IP transports more thoroughly

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: don't create duplicate DSA objects
Douglas Bagnall [Thu, 2 Apr 2015 02:11:12 +0000 (15:11 +1300)]
KCC: don't create duplicate DSA objects

load_site() returns the canonical site even if it didn't make it

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Add more debugging and fix a comment
Douglas Bagnall [Wed, 1 Apr 2015 22:15:58 +0000 (11:15 +1300)]
KCC: Add more debugging and fix a comment

It seems I lost my train of thought in that comment.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: use 75% fewer lines to assign a Boolean to a variable
Douglas Bagnall [Wed, 1 Apr 2015 22:12:13 +0000 (11:12 +1300)]
KCC: use 75% fewer lines to assign a Boolean to a variable

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: A woeful warning comment about the state of our code
Douglas Bagnall [Wed, 1 Apr 2015 22:04:28 +0000 (11:04 +1300)]
KCC: A woeful warning comment about the state of our code

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Debugging changes -- including DEBUG_FN() function
Douglas Bagnall [Wed, 1 Apr 2015 22:03:42 +0000 (11:03 +1300)]
KCC: Debugging changes -- including DEBUG_FN() function

DEBUG_FN(msg) prefixes the msg with the function name and line no.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Fail earlier if there is no IP transport
Douglas Bagnall [Wed, 1 Apr 2015 04:46:43 +0000 (17:46 +1300)]
KCC: Fail earlier if there is no IP transport

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: graph the result of partial edge reversal
Douglas Bagnall [Wed, 20 May 2015 01:01:55 +0000 (13:01 +1200)]
KCC: graph the result of partial edge reversal

What it shows is we don't ever reverse an edge because we have no
partial replica in our test.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: merge copy_output_edges into get_spanning_tree_edges
Douglas Bagnall [Wed, 20 May 2015 00:59:31 +0000 (12:59 +1200)]
KCC: merge copy_output_edges into get_spanning_tree_edges

copy_output_edges() was rearranging the edges, not copying them, and
it wasn't used elsewhere.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: move get_spanning_tree_edges out of KCC object
Douglas Bagnall [Wed, 1 Apr 2015 03:33:10 +0000 (16:33 +1300)]
KCC: move get_spanning_tree_edges out of KCC object

It doesn't use the object parameters, and might be better in another
module (e.g. graph_utils) with the other graph stuff.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: slight rewrite for the sake of pep8
Douglas Bagnall [Wed, 1 Apr 2015 02:29:14 +0000 (15:29 +1300)]
KCC: slight rewrite for the sake of pep8

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: remove essentially dead code
Douglas Bagnall [Wed, 1 Apr 2015 02:28:26 +0000 (15:28 +1300)]
KCC: remove essentially dead code

As the removed comment noted, the logic goes:

    if partial:           # ~60 lines up
       if not partial:
           ...

and we have kept it there for this long because the spec implies it.

(As a matter of fact I can't see how this entire `if partial` loop does
anything of consequence, given the previous loop didn't exclude the
partial case).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: add a warning about repsFRom magic objects
Douglas Bagnall [Wed, 20 May 2015 00:29:17 +0000 (12:29 +1200)]
KCC: add a warning about repsFRom magic objects

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: more pep8, using temp variables in places
Douglas Bagnall [Wed, 20 May 2015 00:28:17 +0000 (12:28 +1200)]
KCC: more pep8, using temp variables in places

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: fix square bracket padding for pep8
Douglas Bagnall [Wed, 1 Apr 2015 01:05:04 +0000 (14:05 +1300)]
KCC: fix square bracket padding for pep8

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: deduplicate connection schedule creation
Douglas Bagnall [Wed, 1 Apr 2015 01:04:16 +0000 (14:04 +1300)]
KCC: deduplicate connection schedule creation

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: reformat kcc_util object __str__ for pep8
Douglas Bagnall [Wed, 1 Apr 2015 00:49:24 +0000 (13:49 +1300)]
KCC: reformat kcc_util object __str__ for pep8

Many lines were too long, which is to a large extent fixed by replacing
`text = text +` with `text +=`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: pep8 conformance
Douglas Bagnall [Wed, 1 Apr 2015 00:46:32 +0000 (13:46 +1300)]
KCC: pep8 conformance

I ran the files through the pep8 command-line tool.

Most changes are for line length, inline comment formatting, adjusting
numbers of blank lines, and the indentation of conditions on if
statements.

This is pretty useless work, but I thought I would have a go with the
pep8 tool, and it came up with a lot of complaints.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>