<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/python/samba/tests/posixacl.py, branch talloc-2.3.3</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>tests/pysmbd: fill session unix info in ntacl tests</title>
<updated>2020-06-05T10:32:31+00:00</updated>
<author>
<name>Björn Baumbach</name>
<email>bb@sernet.de</email>
</author>
<published>2020-06-04T11:51:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=26fd73de7b25dfc191e5c164d3c375bae2b4c113'/>
<id>26fd73de7b25dfc191e5c164d3c375bae2b4c113</id>
<content type='text'>
Valid unix info is required.

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

Signed-off-by: Björn Baumbach &lt;bb@sernet.de&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Valid unix info is required.

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

Signed-off-by: Björn Baumbach &lt;bb@sernet.de&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pytests: heed assertEquals deprecation warning en-masse</title>
<updated>2020-02-07T10:37:37+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2020-02-06T22:02:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c247afbda00013bf4821e5a2d4f3166bf31814f0'/>
<id>c247afbda00013bf4821e5a2d4f3166bf31814f0</id>
<content type='text'>
TestCase.assertEquals() is an alias for TestCase.assertEqual() and
has been deprecated since Python 2.7.

When we run our tests with in python developer mode (`PYTHONDEVMODE=1
make test`) we get 580 DeprecationWarnings about this.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Noel Power &lt;npower@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TestCase.assertEquals() is an alias for TestCase.assertEqual() and
has been deprecated since Python 2.7.

When we run our tests with in python developer mode (`PYTHONDEVMODE=1
make test`) we get 580 DeprecationWarnings about this.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Noel Power &lt;npower@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pysmbd: add "session_info" arg to py_smbd_get_sys_acl()</title>
<updated>2019-12-20T11:41:42+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-12-17T13:56:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=5cef3a13b880ee058f633e68a9b35996365b5c29'/>
<id>5cef3a13b880ee058f633e68a9b35996365b5c29</id>
<content type='text'>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pysmbd: make "session_info" arg to py_smbd_get_nt_acl() mandatory</title>
<updated>2019-12-20T11:41:42+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-12-17T13:52:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=9b2c415d2c614c8980fc800fa1cf967d69eb7975'/>
<id>9b2c415d2c614c8980fc800fa1cf967d69eb7975</id>
<content type='text'>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pysmbd: make "session_info" arg to py_smbd_set_nt_acl() mandatory</title>
<updated>2019-12-20T11:41:42+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-12-17T13:49:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=437af4d07944f201c26cd0ebc4a5622e342d0f4c'/>
<id>437af4d07944f201c26cd0ebc4a5622e342d0f4c</id>
<content type='text'>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pysmbd: add "session_info" arg to py_smbd_unlink()</title>
<updated>2019-12-20T11:41:42+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-12-17T13:14:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a4f3860da31a42c3905cdd8f7ff7103bf901394d'/>
<id>a4f3860da31a42c3905cdd8f7ff7103bf901394d</id>
<content type='text'>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pysmbd: add "session_info" arg to py_smbd_chown()</title>
<updated>2019-12-20T11:41:42+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-12-17T13:14:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=da2a9857d0397d75ac45fc62440ad29bbd0388a1'/>
<id>da2a9857d0397d75ac45fc62440ad29bbd0388a1</id>
<content type='text'>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pysmbd: add "session_info" arg to py_smbd_set_simple_acl()</title>
<updated>2019-12-20T11:41:42+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-12-17T13:13:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=e6d40e6f9c022c5e571255cd4ff248d5a188b45f'/>
<id>e6d40e6f9c022c5e571255cd4ff248d5a188b45f</id>
<content type='text'>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/tests: use a system session_info in posixacl.py</title>
<updated>2019-12-20T11:41:42+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-12-17T14:32:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=9807d69ef4178d4a2c974fed5708ad2d487d0c19'/>
<id>9807d69ef4178d4a2c974fed5708ad2d487d0c19</id>
<content type='text'>
Previously posixacl.py passed None as session_info object from
get_session_info().

That meant that the if/else branch referring to session_info:

        if nwrap_winbind_active or session_info:
             self.assertEquals(posix_acl.acl[1].a_perm, 7)
         else:
             self.assertEquals(posix_acl.acl[1].a_perm, 6)

must be tweaked to take into account that session info is now either

* a system session_info in which case we must continue to use the if branch in
  the code, or

* a user session_info in which case we must continue to go through the else
  branch

Using

  is_user_session = not session_info.security_token.is_system()

in place of just "session_info" does the trick.

Cf the classes SessionedPosixAclMappingTests and
UnixSessionedPosixAclMappingTests in posixacl.py, those are the ones that
trigger test execution with a user session.

Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously posixacl.py passed None as session_info object from
get_session_info().

That meant that the if/else branch referring to session_info:

        if nwrap_winbind_active or session_info:
             self.assertEquals(posix_acl.acl[1].a_perm, 7)
         else:
             self.assertEquals(posix_acl.acl[1].a_perm, 6)

must be tweaked to take into account that session info is now either

* a system session_info in which case we must continue to use the if branch in
  the code, or

* a user session_info in which case we must continue to go through the else
  branch

Using

  is_user_session = not session_info.security_token.is_system()

in place of just "session_info" does the trick.

Cf the classes SessionedPosixAclMappingTests and
UnixSessionedPosixAclMappingTests in posixacl.py, those are the ones that
trigger test execution with a user session.

Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>posixacl.py: avoid inefficient string concatenations</title>
<updated>2019-09-24T12:22:44+00:00</updated>
<author>
<name>Björn Jacke</name>
<email>bj@sernet.de</email>
</author>
<published>2019-08-25T21:07:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=32d1c3f873fc8bd89a7dc985cb8258e990dc12cd'/>
<id>32d1c3f873fc8bd89a7dc985cb8258e990dc12cd</id>
<content type='text'>
Signed-off-by: Bjoern Jacke &lt;bjacke@samba.org&gt;
Reviewed-by: Matthias Dieter Wallnöfer &lt;mdw@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Bjoern Jacke &lt;bjacke@samba.org&gt;
Reviewed-by: Matthias Dieter Wallnöfer &lt;mdw@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
