diff options
| author | David Mulder <dmulder@suse.com> | 2022-05-27 10:56:25 -0600 |
|---|---|---|
| committer | Jeremy Allison <jra@samba.org> | 2022-05-31 20:15:45 +0000 |
| commit | 56f5ea683001d573e9ddeb30e68aae8ba2d742ed (patch) | |
| tree | d7ab419dc8f4cfb9b60a871adb896c66e310cf59 /python | |
| parent | 5aa6b85cd90a14d66c966e2eb1b878bdcbf937c5 (diff) | |
| download | samba-56f5ea683001d573e9ddeb30e68aae8ba2d742ed.tar.gz samba-56f5ea683001d573e9ddeb30e68aae8ba2d742ed.tar.bz2 samba-56f5ea683001d573e9ddeb30e68aae8ba2d742ed.zip | |
gpo: Move Group Policy code below gp directory
Moves the Group Policy extensions and supporting
code within the existing python/samba/gp directory.
Meant to clean up the clutter that's accumulating
in python/samba.
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 31 20:15:45 UTC 2022 on sn-devel-184
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/gp/gp_centrify_crontab_ext.py (renamed from python/samba/gp_centrify_crontab_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_centrify_sudoers_ext.py (renamed from python/samba/gp_centrify_sudoers_ext.py) | 4 | ||||
| -rw-r--r-- | python/samba/gp/gp_cert_auto_enroll_ext.py (renamed from python/samba/gp_cert_auto_enroll_ext.py) | 4 | ||||
| -rw-r--r-- | python/samba/gp/gp_chromium_ext.py (renamed from python/samba/gp_chromium_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_ext_loader.py (renamed from python/samba/gp_ext_loader.py) | 4 | ||||
| -rw-r--r-- | python/samba/gp/gp_firefox_ext.py (renamed from python/samba/gp_firefox_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_firewalld_ext.py (renamed from python/samba/gp_firewalld_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_gnome_settings_ext.py (renamed from python/samba/gp_gnome_settings_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_msgs_ext.py (renamed from python/samba/gp_msgs_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_scripts_ext.py (renamed from python/samba/gp_scripts_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_sec_ext.py (renamed from python/samba/gp_sec_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_smb_conf_ext.py (renamed from python/samba/gp_smb_conf_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gp_sudoers_ext.py (renamed from python/samba/gp_sudoers_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/gpclass.py (renamed from python/samba/gpclass.py) | 0 | ||||
| -rw-r--r-- | python/samba/gp/vgp_access_ext.py (renamed from python/samba/vgp_access_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/vgp_files_ext.py (renamed from python/samba/vgp_files_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/vgp_issue_ext.py (renamed from python/samba/vgp_issue_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/vgp_motd_ext.py (renamed from python/samba/vgp_motd_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/vgp_openssh_ext.py (renamed from python/samba/vgp_openssh_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/vgp_startup_scripts_ext.py (renamed from python/samba/vgp_startup_scripts_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/gp/vgp_sudoers_ext.py (renamed from python/samba/vgp_sudoers_ext.py) | 4 | ||||
| -rw-r--r-- | python/samba/gp/vgp_symlink_ext.py (renamed from python/samba/vgp_symlink_ext.py) | 2 | ||||
| -rw-r--r-- | python/samba/netcmd/gpo.py | 2 | ||||
| -rw-r--r-- | python/samba/tests/gpo.py | 54 | ||||
| -rw-r--r-- | python/samba/tests/gpo_member.py | 4 |
25 files changed, 55 insertions, 55 deletions
diff --git a/python/samba/gp_centrify_crontab_ext.py b/python/samba/gp/gp_centrify_crontab_ext.py index eace6a973cd..220feb776a5 100644 --- a/python/samba/gp_centrify_crontab_ext.py +++ b/python/samba/gp/gp_centrify_crontab_ext.py @@ -16,7 +16,7 @@ import os, re from subprocess import Popen, PIPE -from samba.gpclass import gp_pol_ext, drop_privileges +from samba.gp.gpclass import gp_pol_ext, drop_privileges from hashlib import blake2b from tempfile import NamedTemporaryFile diff --git a/python/samba/gp_centrify_sudoers_ext.py b/python/samba/gp/gp_centrify_sudoers_ext.py index 4af51406050..2d03a4871a4 100644 --- a/python/samba/gp_centrify_sudoers_ext.py +++ b/python/samba/gp/gp_centrify_sudoers_ext.py @@ -15,11 +15,11 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext from base64 import b64encode from tempfile import NamedTemporaryFile from subprocess import Popen, PIPE -from samba.gp_sudoers_ext import visudo, intro +from samba.gp.gp_sudoers_ext import visudo, intro from samba.gp.util.logging import log def ext_enabled(entries): diff --git a/python/samba/gp_cert_auto_enroll_ext.py b/python/samba/gp/gp_cert_auto_enroll_ext.py index fe86d7f3428..f1dcf6bbafb 100644 --- a/python/samba/gp_cert_auto_enroll_ext.py +++ b/python/samba/gp/gp_cert_auto_enroll_ext.py @@ -17,11 +17,11 @@ import os import operator import requests -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext from samba import Ldb from ldb import SCOPE_SUBTREE, SCOPE_BASE from samba.auth import system_session -from samba.gpclass import get_dc_hostname +from samba.gp.gpclass import get_dc_hostname import base64 from shutil import which from subprocess import Popen, PIPE diff --git a/python/samba/gp_chromium_ext.py b/python/samba/gp/gp_chromium_ext.py index befce47085d..ae4bc8a7a80 100644 --- a/python/samba/gp_chromium_ext.py +++ b/python/samba/gp/gp_chromium_ext.py @@ -16,7 +16,7 @@ import os import json -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext from samba.dcerpc import misc from samba.common import get_string from samba.gp.util.logging import log diff --git a/python/samba/gp_ext_loader.py b/python/samba/gp/gp_ext_loader.py index 3db8442ea3f..bd702de55a5 100644 --- a/python/samba/gp_ext_loader.py +++ b/python/samba/gp/gp_ext_loader.py @@ -14,8 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -from samba.gpclass import list_gp_extensions -from samba.gpclass import gp_ext +from samba.gp.gpclass import list_gp_extensions +from samba.gp.gpclass import gp_ext from samba.gp.util.logging import log try: diff --git a/python/samba/gp_firefox_ext.py b/python/samba/gp/gp_firefox_ext.py index 6dbded0cae7..06ae31d7afb 100644 --- a/python/samba/gp_firefox_ext.py +++ b/python/samba/gp/gp_firefox_ext.py @@ -16,7 +16,7 @@ import os import json -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext from samba.dcerpc import misc from samba.common import get_string from samba.gp.util.logging import log diff --git a/python/samba/gp_firewalld_ext.py b/python/samba/gp/gp_firewalld_ext.py index 3b60cf44ad3..7947961a9ee 100644 --- a/python/samba/gp_firewalld_ext.py +++ b/python/samba/gp/gp_firewalld_ext.py @@ -19,7 +19,7 @@ from subprocess import Popen, PIPE from hashlib import blake2b from shutil import which import json -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext from samba.gp.util.logging import log def firewall_cmd(*args): diff --git a/python/samba/gp_gnome_settings_ext.py b/python/samba/gp/gp_gnome_settings_ext.py index 1a5e73bea0a..cbf01a14ade 100644 --- a/python/samba/gp_gnome_settings_ext.py +++ b/python/samba/gp/gp_gnome_settings_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os, re -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext from tempfile import NamedTemporaryFile import shutil from configparser import ConfigParser diff --git a/python/samba/gp_msgs_ext.py b/python/samba/gp/gp_msgs_ext.py index 9366cd82685..267c7456ad1 100644 --- a/python/samba/gp_msgs_ext.py +++ b/python/samba/gp/gp_msgs_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext class gp_msgs_ext(gp_pol_ext): def __str__(self): diff --git a/python/samba/gp_scripts_ext.py b/python/samba/gp/gp_scripts_ext.py index 33049ff6dc0..3ff650996bb 100644 --- a/python/samba/gp_scripts_ext.py +++ b/python/samba/gp/gp_scripts_ext.py @@ -16,7 +16,7 @@ import os, re from subprocess import Popen, PIPE -from samba.gpclass import gp_pol_ext, drop_privileges +from samba.gp.gpclass import gp_pol_ext, drop_privileges from base64 import b64encode from hashlib import blake2b from tempfile import NamedTemporaryFile diff --git a/python/samba/gp_sec_ext.py b/python/samba/gp/gp_sec_ext.py index df18a3ac7da..667bc4cd48b 100644 --- a/python/samba/gp_sec_ext.py +++ b/python/samba/gp/gp_sec_ext.py @@ -16,7 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os.path -from samba.gpclass import gp_inf_ext +from samba.gp.gpclass import gp_inf_ext from samba.auth import system_session from samba.common import get_string try: diff --git a/python/samba/gp_smb_conf_ext.py b/python/samba/gp/gp_smb_conf_ext.py index 61ac2ff198c..598d0ac9b2e 100644 --- a/python/samba/gp_smb_conf_ext.py +++ b/python/samba/gp/gp_smb_conf_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os, re, numbers -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext from tempfile import NamedTemporaryFile from samba.gp.util.logging import log diff --git a/python/samba/gp_sudoers_ext.py b/python/samba/gp/gp_sudoers_ext.py index 47e8778d68d..b3a37efb61a 100644 --- a/python/samba/gp_sudoers_ext.py +++ b/python/samba/gp/gp_sudoers_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_pol_ext +from samba.gp.gpclass import gp_pol_ext from base64 import b64encode from tempfile import NamedTemporaryFile from subprocess import Popen, PIPE diff --git a/python/samba/gpclass.py b/python/samba/gp/gpclass.py index 0c95cdb66c0..0c95cdb66c0 100644 --- a/python/samba/gpclass.py +++ b/python/samba/gp/gpclass.py diff --git a/python/samba/vgp_access_ext.py b/python/samba/gp/vgp_access_ext.py index cdbda991c05..efd91ef93fb 100644 --- a/python/samba/vgp_access_ext.py +++ b/python/samba/gp/vgp_access_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os, re -from samba.gpclass import gp_xml_ext +from samba.gp.gpclass import gp_xml_ext from hashlib import blake2b from tempfile import NamedTemporaryFile from samba.common import get_bytes diff --git a/python/samba/vgp_files_ext.py b/python/samba/gp/vgp_files_ext.py index 0c1dcae479f..bd26212793e 100644 --- a/python/samba/vgp_files_ext.py +++ b/python/samba/gp/vgp_files_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os, pwd, grp -from samba.gpclass import gp_xml_ext, check_safe_path +from samba.gp.gpclass import gp_xml_ext, check_safe_path from tempfile import NamedTemporaryFile from shutil import copyfile, move from hashlib import blake2b diff --git a/python/samba/vgp_issue_ext.py b/python/samba/gp/vgp_issue_ext.py index b4b08901149..c622fa094b6 100644 --- a/python/samba/vgp_issue_ext.py +++ b/python/samba/gp/vgp_issue_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_xml_ext +from samba.gp.gpclass import gp_xml_ext class vgp_issue_ext(gp_xml_ext): def __str__(self): diff --git a/python/samba/vgp_motd_ext.py b/python/samba/gp/vgp_motd_ext.py index 1ac152c29e9..8a5f8a6458b 100644 --- a/python/samba/vgp_motd_ext.py +++ b/python/samba/gp/vgp_motd_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_xml_ext +from samba.gp.gpclass import gp_xml_ext class vgp_motd_ext(gp_xml_ext): def __str__(self): diff --git a/python/samba/vgp_openssh_ext.py b/python/samba/gp/vgp_openssh_ext.py index 44cde4c8627..e8b888ffbaa 100644 --- a/python/samba/vgp_openssh_ext.py +++ b/python/samba/gp/vgp_openssh_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_xml_ext +from samba.gp.gpclass import gp_xml_ext from base64 import b64encode from tempfile import NamedTemporaryFile from samba.common import get_bytes, get_string diff --git a/python/samba/vgp_startup_scripts_ext.py b/python/samba/gp/vgp_startup_scripts_ext.py index cc5c8682019..71be4c0e32c 100644 --- a/python/samba/vgp_startup_scripts_ext.py +++ b/python/samba/gp/vgp_startup_scripts_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_xml_ext, check_safe_path +from samba.gp.gpclass import gp_xml_ext, check_safe_path from tempfile import NamedTemporaryFile from samba.common import get_bytes from subprocess import Popen, PIPE diff --git a/python/samba/vgp_sudoers_ext.py b/python/samba/gp/vgp_sudoers_ext.py index 8d2255beae8..c0137d5f49e 100644 --- a/python/samba/vgp_sudoers_ext.py +++ b/python/samba/gp/vgp_sudoers_ext.py @@ -15,11 +15,11 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_xml_ext +from samba.gp.gpclass import gp_xml_ext from base64 import b64encode from tempfile import NamedTemporaryFile from subprocess import Popen, PIPE -from samba.gp_sudoers_ext import visudo, intro +from samba.gp.gp_sudoers_ext import visudo, intro from samba.gp.util.logging import log class vgp_sudoers_ext(gp_xml_ext): diff --git a/python/samba/vgp_symlink_ext.py b/python/samba/gp/vgp_symlink_ext.py index 0bca7572d02..3dd6241fede 100644 --- a/python/samba/vgp_symlink_ext.py +++ b/python/samba/gp/vgp_symlink_ext.py @@ -15,7 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os -from samba.gpclass import gp_xml_ext +from samba.gp.gpclass import gp_xml_ext from tempfile import NamedTemporaryFile from subprocess import Popen, PIPE from samba.gp.util.logging import log diff --git a/python/samba/netcmd/gpo.py b/python/samba/netcmd/gpo.py index 784c1676467..3b21dc6128c 100644 --- a/python/samba/netcmd/gpo.py +++ b/python/samba/netcmd/gpo.py @@ -67,7 +67,7 @@ from samba.netcmd.common import attr_default from samba.common import get_bytes, get_string from configparser import ConfigParser from io import StringIO, BytesIO -from samba.vgp_files_ext import calc_mode, stat_from_mode +from samba.gp.vgp_files_ext import calc_mode, stat_from_mode import hashlib diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py index e1f81e8a50d..48f794b490c 100644 --- a/python/samba/tests/gpo.py +++ b/python/samba/tests/gpo.py @@ -17,39 +17,39 @@ import os, grp, pwd import errno from samba import gpo, tests -from samba.gpclass import register_gp_extension, list_gp_extensions, \ +from samba.gp.gpclass import register_gp_extension, list_gp_extensions, \ unregister_gp_extension, GPOStorage from samba.param import LoadParm -from samba.gpclass import check_refresh_gpo_list, check_safe_path, \ +from samba.gp.gpclass import check_refresh_gpo_list, check_safe_path, \ check_guid, parse_gpext_conf, atomic_write_conf, get_deleted_gpos_list from subprocess import Popen, PIPE from tempfile import NamedTemporaryFile, TemporaryDirectory -from samba import gpclass +from samba.gp import gpclass # Disable privilege dropping for testing gpclass.drop_privileges = lambda _, func, *args : func(*args) -from samba.gp_sec_ext import gp_krb_ext, gp_access_ext -from samba.gp_scripts_ext import gp_scripts_ext, gp_user_scripts_ext -from samba.gp_sudoers_ext import gp_sudoers_ext -from samba.vgp_sudoers_ext import vgp_sudoers_ext -from samba.vgp_symlink_ext import vgp_symlink_ext -from samba.gpclass import gp_inf_ext -from samba.gp_smb_conf_ext import gp_smb_conf_ext -from samba.vgp_files_ext import vgp_files_ext -from samba.vgp_openssh_ext import vgp_openssh_ext -from samba.vgp_startup_scripts_ext import vgp_startup_scripts_ext -from samba.vgp_motd_ext import vgp_motd_ext -from samba.vgp_issue_ext import vgp_issue_ext -from samba.vgp_access_ext import vgp_access_ext -from samba.gp_gnome_settings_ext import gp_gnome_settings_ext -from samba import gp_cert_auto_enroll_ext as cae -from samba.gp_firefox_ext import gp_firefox_ext -from samba.gp_chromium_ext import gp_chromium_ext -from samba.gp_firewalld_ext import gp_firewalld_ext +from samba.gp.gp_sec_ext import gp_krb_ext, gp_access_ext +from samba.gp.gp_scripts_ext import gp_scripts_ext, gp_user_scripts_ext +from samba.gp.gp_sudoers_ext import gp_sudoers_ext +from samba.gp.vgp_sudoers_ext import vgp_sudoers_ext +from samba.gp.vgp_symlink_ext import vgp_symlink_ext +from samba.gp.gpclass import gp_inf_ext +from samba.gp.gp_smb_conf_ext import gp_smb_conf_ext +from samba.gp.vgp_files_ext import vgp_files_ext +from samba.gp.vgp_openssh_ext import vgp_openssh_ext +from samba.gp.vgp_startup_scripts_ext import vgp_startup_scripts_ext +from samba.gp.vgp_motd_ext import vgp_motd_ext +from samba.gp.vgp_issue_ext import vgp_issue_ext +from samba.gp.vgp_access_ext import vgp_access_ext +from samba.gp.gp_gnome_settings_ext import gp_gnome_settings_ext +from samba.gp import gp_cert_auto_enroll_ext as cae +from samba.gp.gp_firefox_ext import gp_firefox_ext +from samba.gp.gp_chromium_ext import gp_chromium_ext +from samba.gp.gp_firewalld_ext import gp_firewalld_ext from samba.credentials import Credentials -from samba.gp_msgs_ext import gp_msgs_ext -from samba.gp_centrify_sudoers_ext import gp_centrify_sudoers_ext -from samba.gp_centrify_crontab_ext import gp_centrify_crontab_ext, \ - gp_user_centrify_crontab_ext +from samba.gp.gp_msgs_ext import gp_msgs_ext +from samba.gp.gp_centrify_sudoers_ext import gp_centrify_sudoers_ext +from samba.gp.gp_centrify_crontab_ext import gp_centrify_crontab_ext, \ + gp_user_centrify_crontab_ext from samba.common import get_bytes from samba.dcerpc import preg from samba.ndr import ndr_pack @@ -60,7 +60,7 @@ import hashlib from samba.gp_parse.gp_pol import GPPolParser from glob import glob from configparser import ConfigParser -from samba.gpclass import get_dc_hostname +from samba.gp.gpclass import get_dc_hostname from samba import Ldb import ldb as _ldb from samba.auth import system_session @@ -7221,7 +7221,7 @@ class GPOTests(tests.TestCase): def test_gpt_ext_register(self): this_path = os.path.dirname(os.path.realpath(__file__)) samba_path = os.path.realpath(os.path.join(this_path, '../../../')) - ext_path = os.path.join(samba_path, 'python/samba/gp_sec_ext.py') + ext_path = os.path.join(samba_path, 'python/samba/gp/gp_sec_ext.py') ext_guid = '{827D319E-6EAC-11D2-A4EA-00C04F79F83A}' ret = register_gp_extension(ext_guid, 'gp_access_ext', ext_path, smb_conf=self.lp.configfile, diff --git a/python/samba/tests/gpo_member.py b/python/samba/tests/gpo_member.py index 605d4f33cce..642eb13a639 100644 --- a/python/samba/tests/gpo_member.py +++ b/python/samba/tests/gpo_member.py @@ -16,10 +16,10 @@ import os from samba import gpo, tests -from samba.gpclass import GPOStorage +from samba.gp.gpclass import GPOStorage from samba.param import LoadParm from samba.credentials import Credentials -from samba.gp_sec_ext import gp_access_ext +from samba.gp.gp_sec_ext import gp_access_ext import logging class GPOTests(tests.TestCase): |
