summaryrefslogtreecommitdiff
path: root/python/samba/samba3
AgeCommit message (Collapse)AuthorFilesLines
2023-06-23python:samba:samba3: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-12-17libsmb_samba_internal: calculate the access_mask for {g,s}et_acl() based on ↵Stefan Metzmacher1-4/+73
the secinfo flags SEC_FLAG_MAXIMUM_ALLOWED will never result in SEC_FLAG_SYSTEM_SECURITY being granted. As SECINFO_SACL is part of the default secinfo value (SECINFO_DEFAULT_FLAGS), {g,s}et_acl() will always return NT_STATUS_ACCESS_DENIED by default. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-17libsmb_samba_internal: don't send SECINFO_[UN]PROTECTED_{S,D}ACL by defaultStefan Metzmacher1-5/+1
We want to get the default behavior. It's also pointless to set PROTECTED and UNPROTECTED at the same time. These are defined in MS-DTYP 2.4.7 SECURITY_INFORMATION with a brief description, but they aren't referenced in anywhere in MS-DTYP itself, nor in MS-FSA are any other document. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-11-16pylibsmb: Move set_acl() to pythonVolker Lendecke1-0/+14
The previous code was not available in threaded environments Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-11-16pylibsmb: Move get_acl() to pythonVolker Lendecke1-0/+26
The previous code was not available in threaded environments Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-11-16pylibsmb: Move deltree to python codeVolker Lendecke1-1/+7
This is much shorter. There's also another aspect: I'm working on improving cli_list() to not collect all files before starting to call the callback function. This means that the cli_list cb will be called from within tevent_loop_once(). In pylibsmb.c's deltree code this would create a nested event loop. By moving the deltree code into the python world this nested event loop is avoided. Now the python code will first collect everything and then start to delete, avoiding the nesting. A future development should make listing directories a generator or something like that. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-11-16pylibsmb: Add a compatible python-level wrapperVolker Lendecke1-0/+19
Right now this is empty, but it is the basis for moving complexity out or pylibsmb.c into python code. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-02python2 reduction: Merge remaining compat code into commonDavid Mulder1-1/+1
The remaining compat code (get_string, get_bytes, cmp) are useful helper routines which we should simply merge into common (especially since there is some duplication here). Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Fri Oct 2 14:49:36 UTC 2020 on sn-devel-184
2018-11-01python/samba3: import passdb in the manner it is usedDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <noel.power@suse.com>
2018-10-23python/samba/samba3: PY3 tdb.Tdb.get method expects bytes in PY3Noel Power1-15/+15
part of PY3 port samba4.blackbox.upgrade.samba3-upgrade* Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-24PEP8: fix E713: test for membership should be 'not in'Joe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E302: expected 2 blank lines, found 1Joe Guo1-0/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E261: at least two spaces before inline commentJoe Guo1-2/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E225: missing whitespace around operatorJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-05-12Fix spelling s/retrive/retrieve/Mathieu Parent1-1/+1
Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-04-13python: bulk port tdb iterkeys for py3Joe Guo1-4/+4
In py3, `dict.iterkeys()` is removed, we need to use `keys()` instead. This is compatible with py2 since `dict.keys()` exists for py2. tdb pretents to be a dict, however, not completely. It provides `iterkeys()` for py2 only, and `keys()` for py3 only, which means replace `iterkeys()` to `keys()` will break py2. In python, iter a dict will implicitly iter on keys. Use this feature to work around. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-05samba3: work around bytes formatting for Python 3.4Joe Guo1-4/+4
b'%s\x00' % key The above % formatting for bytes is only available since Python 3.5, however we need to support Python 3.4 so far. Work around this with `+`. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-05selftest python: get samba.tests.s3idmapdb to run with py3Noel Power1-15/+15
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-05python selftest: enabled samba.tests.s3registry to run with py3Noel Power1-7/+7
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-05python selftest: enable samba.tests.s3param to run with python3Noel Power1-3/+2
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2015-03-17python: Remove ntdb referencesVolker Lendecke1-6/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-12source4/scripting/python/samba/samba3: handle ntdb files.Rusty Russell1-47/+51
Upgrading old Samba 3 instances seems like a place where we don't have to read ntdb files, but Andrew Bartlett points out that you can run a Samba 4.0 and even a 4.1 'classic' domain and desire to migrate that to the AD DC. So make this upgrade code generic: if it finds an ntdb file, read that, otherwise read the tdb file. Cc: Jelmer Vernooij <jelmer@samba.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-02Move python modules from source4/scripting/python/ to python/.Jelmer Vernooij1-0/+408
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 2 03:57:34 CET 2013 on sn-devel-104