<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/python/samba/join.py, branch talloc-2.2.0</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>join: Throw CommandError instead of Exception for simple errors</title>
<updated>2019-01-16T21:11:04+00:00</updated>
<author>
<name>Tim Beale</name>
<email>timbeale@catalyst.net.nz</email>
</author>
<published>2019-01-16T02:37:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=9e4b08f4c384b8cae5ad853a7be7cf03e2749be5'/>
<id>9e4b08f4c384b8cae5ad853a7be7cf03e2749be5</id>
<content type='text'>
Throwing an exception here still dumps out the Python stack trace, which
can be a little disconcerting for users.

In this case, the stack trace isn't going to really help at all (the
problem is pretty obvious), and it obscures the useful message
explaining what went wrong.

Throw a CommandError instead, which samba-tool will catch and display
more nicely.

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

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Rowland Penny &lt;rpenny@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;rpenny@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Wed Jan 16 22:11:04 CET 2019 on sn-devel-144
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Throwing an exception here still dumps out the Python stack trace, which
can be a little disconcerting for users.

In this case, the stack trace isn't going to really help at all (the
problem is pretty obvious), and it obscures the useful message
explaining what went wrong.

Throw a CommandError instead, which samba-tool will catch and display
more nicely.

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

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Rowland Penny &lt;rpenny@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;rpenny@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Wed Jan 16 22:11:04 CET 2019 on sn-devel-144
</pre>
</div>
</content>
</entry>
<entry>
<title>join: Fix TypeError when handling exception</title>
<updated>2019-01-16T17:51:27+00:00</updated>
<author>
<name>Tim Beale</name>
<email>timbeale@catalyst.net.nz</email>
</author>
<published>2019-01-16T02:17:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=3bb7808984c163a7bba66fb983411d1281589722'/>
<id>3bb7808984c163a7bba66fb983411d1281589722</id>
<content type='text'>
When we can't resolve a domain name, we were inadvertently throwing a
TypeError whilst trying to output a helpful message. E.g.

ERROR(&lt;class 'TypeError'&gt;): uncaught exception - 'NTSTATUSError' object
does not support indexing

Instead of indexing the object, we want to index the Exception.args so
that we just display the string portion of the exception error.

The same problem is also present for the domain trust commands.

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

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Rowland Penny &lt;rpenny@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;rpenny@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we can't resolve a domain name, we were inadvertently throwing a
TypeError whilst trying to output a helpful message. E.g.

ERROR(&lt;class 'TypeError'&gt;): uncaught exception - 'NTSTATUSError' object
does not support indexing

Instead of indexing the object, we want to index the Exception.args so
that we just display the string portion of the exception error.

The same problem is also present for the domain trust commands.

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

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Rowland Penny &lt;rpenny@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;rpenny@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PY3: net.change_password &amp; net.set_password take string not bytes</title>
<updated>2018-12-10T09:38:21+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-11-28T14:06:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0d73a2b0a29c108c3a0efbbe0473142046302b71'/>
<id>0d73a2b0a29c108c3a0efbbe0473142046302b71</id>
<content type='text'>
Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/samba: PY3 Credential.set_password takes string</title>
<updated>2018-12-10T09:38:21+00:00</updated>
<author>
<name>Noel Power</name>
<email>noel.power@suse.com</email>
</author>
<published>2018-11-28T13:58:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d253e84a41b9f18243d57c41656d28fcd07e476a'/>
<id>d253e84a41b9f18243d57c41656d28fcd07e476a</id>
<content type='text'>
Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Noel Power &lt;noel.power@suse.com&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>join: Fix join large-DB timeout against Windows</title>
<updated>2018-11-06T02:39:11+00:00</updated>
<author>
<name>Tim Beale</name>
<email>timbeale@catalyst.net.nz</email>
</author>
<published>2018-11-05T01:30:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=02d41fea33e3ad521fbef2d4f00af2db35edd9d9'/>
<id>02d41fea33e3ad521fbef2d4f00af2db35edd9d9</id>
<content type='text'>
The LDAP connection can also timeout when trying to join a Windows DC
with a very large database. However, in this case Windows gives a
slightly different error message (NT_STATUS_CONNECTION_RESET instead of
NT_STATUS_CONNECTION_DISCONNECTED).

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

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The LDAP connection can also timeout when trying to join a Windows DC
with a very large database. However, in this case Windows gives a
slightly different error message (NT_STATUS_CONNECTION_RESET instead of
NT_STATUS_CONNECTION_DISCONNECTED).

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

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/join: remove unused imports and variables</title>
<updated>2018-11-01T04:08:15+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2018-10-11T00:06:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=eeb1e81e25ff8477fe00b36ba8c90a81e6241df9'/>
<id>eeb1e81e25ff8477fe00b36ba8c90a81e6241df9</id>
<content type='text'>
Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python join: use the sd_utils we imported</title>
<updated>2018-11-01T04:08:12+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2018-10-26T05:38:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=4be0bcb12bddb0a5d8dedb591f7c1af697fbacf8'/>
<id>4be0bcb12bddb0a5d8dedb591f7c1af697fbacf8</id>
<content type='text'>
Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Noel Power &lt;noel.power@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Noel Power &lt;noel.power@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netcmd: Add backend-store option to domain backup/rename cmds</title>
<updated>2018-10-30T23:30:16+00:00</updated>
<author>
<name>Tim Beale</name>
<email>timbeale@catalyst.net.nz</email>
</author>
<published>2018-10-24T20:03:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=5a57378d342e690c8736877fb481ef34b27d4ea4'/>
<id>5a57378d342e690c8736877fb481ef34b27d4ea4</id>
<content type='text'>
Currently the online/rename backup files always use the default backend
(TDB) and there is no way to change this.

This patch adds the backend-store option to the backup commands so that
you can create a backup with an MDB backend, if needed.

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the online/rename backup files always use the default backend
(TDB) and there is no way to change this.

This patch adds the backend-store option to the backup commands so that
you can create a backup with an MDB backend, if needed.

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>join: Sanity-check LDB connection before failed join cleanup</title>
<updated>2018-10-18T04:15:24+00:00</updated>
<author>
<name>Tim Beale</name>
<email>timbeale@catalyst.net.nz</email>
</author>
<published>2018-10-18T00:07:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=10a9cc44abd29f46f075823fce55b496e760c7bd'/>
<id>10a9cc44abd29f46f075823fce55b496e760c7bd</id>
<content type='text'>
Joining a large DB can take so long that the LDAP connection times out.
The previous patch fixed the 'happy case' where the join succeeds.
However, if the commit or replication fails (throwing an exception),
then the cleanup code can also fail when it tries to delete objects from
the remote DC. This then gives you an error pointing to
cleanup_old_accounts() rather than what actually went wrong.

This patch adds a sanity-check that if the join fails, that the LDB
connection to the remote DC is still alive, before we start deleting
objects.

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

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Joining a large DB can take so long that the LDAP connection times out.
The previous patch fixed the 'happy case' where the join succeeds.
However, if the commit or replication fails (throwing an exception),
then the cleanup code can also fail when it tries to delete objects from
the remote DC. This then gives you an error pointing to
cleanup_old_accounts() rather than what actually went wrong.

This patch adds a sanity-check that if the join fails, that the LDB
connection to the remote DC is still alive, before we start deleting
objects.

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

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>join: Avoid searching for more than strictly required during sanity check</title>
<updated>2018-10-18T04:15:24+00:00</updated>
<author>
<name>Andrew Bartlett</name>
<email>abartlet@samba.org</email>
</author>
<published>2018-10-18T03:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=30277feb839f7460638c777b048e45d557dfdea0'/>
<id>30277feb839f7460638c777b048e45d557dfdea0</id>
<content type='text'>
We check for the default base DN as this does require authentication, but
we do not need to search for more than just that (so use SCOPE_BASE) and
we need no attributes, so ask for none

Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We check for the default base DN as this does require authentication, but
we do not need to search for more than just that (so use SCOPE_BASE) and
we need no attributes, so ask for none

Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
</feed>
