OXIESEC PANEL
- Current Dir:
/
/
usr
/
sbin
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/26/2021 03:27:18 AM
rwxr-xr-x
📄
a2disconf
15.89 KB
02/23/2021 04:35:16 PM
rwxr-xr-x
📄
a2dismod
15.89 KB
02/23/2021 04:35:16 PM
rwxr-xr-x
📄
a2dissite
15.89 KB
02/23/2021 04:35:16 PM
rwxr-xr-x
📄
a2enconf
15.89 KB
02/23/2021 04:35:16 PM
rwxr-xr-x
📄
a2enmod
15.89 KB
02/23/2021 04:35:16 PM
rwxr-xr-x
📄
a2ensite
15.89 KB
02/23/2021 04:35:16 PM
rwxr-xr-x
📄
a2query
9.64 KB
06/23/2022 12:51:37 PM
rwxr-xr-x
📄
aa-remove-unknown
2.85 KB
09/27/2018 06:20:54 PM
rwxr-xr-x
📄
aa-status
8.41 KB
09/27/2018 06:20:54 PM
rwxr-xr-x
📄
aad_certhandler
253.48 KB
07/14/2023 12:01:46 AM
rwxr-xr-x
📄
aaduseradd
64.54 KB
07/14/2023 12:01:46 AM
rwxr-xr-x
📄
aaduserdel
55.16 KB
07/14/2023 12:01:46 AM
rwxr-xr-x
📄
accessdb
10.23 KB
08/04/2018 07:16:12 PM
rwxr-xr-x
📄
acpid
50.84 KB
04/28/2017 04:28:10 AM
rwxr-xr-x
📄
add-shell
860 bytes
12/30/2017 06:15:02 PM
rwxr-xr-x
📄
addgnupghome
3.01 KB
07/04/2022 04:20:59 PM
rwxr-xr-x
📄
addgroup
36.45 KB
12/05/2017 04:57:20 PM
rwxr-xr-x
📄
adduser
36.45 KB
12/05/2017 04:57:20 PM
rwxr-xr-x
📄
apache2
659.69 KB
06/23/2022 12:51:37 PM
rwxr-xr-x
📄
apache2ctl
7.06 KB
03/04/2022 10:48:50 AM
rwxr-xr-x
📄
apachectl
7.06 KB
03/04/2022 10:48:50 AM
rwxr-xr-x
📄
apparmor_status
8.41 KB
09/27/2018 06:20:54 PM
rwxr-xr-x
📄
applygnupgdefaults
2.17 KB
07/04/2022 04:20:59 PM
rwxr-xr-x
📄
arp
61.3 KB
01/10/2017 04:25:08 AM
rwxr-xr-x
📄
arpd
54.03 KB
07/15/2020 03:16:31 PM
rwxr-xr-x
📄
atd
26.01 KB
02/20/2018 06:59:43 AM
rwxr-xr-x
📄
bcache-super-show
13.99 KB
08/05/2020 08:44:05 PM
rwxr-xr-x
📄
biosdecode
18.87 KB
01/27/2020 06:09:10 PM
rwxr-xr-x
📄
bpftool
1.58 KB
11/01/2022 04:52:05 PM
rwxr-xr-x
📄
check_forensic
952 bytes
04/26/2011 03:10:00 PM
rwxr-xr-x
📄
chgpasswd
57.83 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
chmem
42.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
chpasswd
53.86 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
chroot
38.18 KB
01/18/2018 09:43:49 AM
rwxr-xr-x
📄
cifs.idmap
14.07 KB
06/01/2022 04:19:46 PM
rwxr-xr-x
📄
cifs.upcall
34.28 KB
06/01/2022 04:19:46 PM
rwxr-xr-x
📄
cpgr
55.96 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
cppw
55.96 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
cron
46.3 KB
05/10/2022 08:59:19 PM
rwxr-xr-x
📄
cryptdisks_start
1.11 KB
08/23/2018 02:36:42 PM
rwxr-xr-x
📄
cryptdisks_stop
1.16 KB
08/23/2018 02:36:42 PM
rwxr-xr-x
📄
delgroup
16.11 KB
12/05/2017 04:57:20 PM
rwxr-xr-x
📄
deluser
16.11 KB
12/05/2017 04:57:20 PM
rwxr-xr-x
📄
dmidecode
106.54 KB
01/27/2020 06:09:10 PM
rwxr-xr-x
📄
dnsmasq
379.6 KB
04/18/2022 03:41:06 PM
rwxr-xr-x
📄
dpkg-preconfigure
3.58 KB
05/06/2019 04:30:30 PM
rwxr-xr-x
📄
dpkg-reconfigure
4.34 KB
05/06/2019 04:30:30 PM
rwxr-xr-x
📄
e2freefrag
14.07 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
e4crypt
22.07 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
e4defrag
25.99 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
ephemeral-disk-warning
982 bytes
05/23/2019 09:15:53 PM
rwxr-xr-x
📄
fdformat
30.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
filefrag
14.02 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
genl
58.05 KB
07/15/2020 03:16:31 PM
rwxr-xr-x
📄
groupadd
61.92 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
groupdel
70.37 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
groupmems
57.87 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
groupmod
68.18 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
grpck
53.8 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
grpconv
49.68 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
grpunconv
49.68 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
grub-install
1003.51 KB
02/24/2021 07:47:47 PM
rwxr-xr-x
📄
grub-macbless
780.84 KB
02/24/2021 07:47:47 PM
rwxr-xr-x
📄
grub-mkconfig
8.03 KB
02/24/2021 07:47:47 PM
rwxr-xr-x
📄
grub-mkdevicemap
207.62 KB
02/24/2021 07:47:47 PM
rwxr-xr-x
📄
grub-probe
793.09 KB
02/24/2021 07:47:47 PM
rwxr-xr-x
📄
grub-reboot
4.73 KB
02/24/2021 07:47:47 PM
rwxr-xr-x
📄
grub-set-default
3.47 KB
02/24/2021 07:47:47 PM
rwxr-xr-x
📄
httxt2dbm
9.99 KB
06/23/2022 12:51:37 PM
rwxr-xr-x
📄
hv_fcopy_daemon
1.58 KB
11/01/2022 04:52:05 PM
rwxr-xr-x
📄
hv_get_dhcp_info
1.39 KB
11/01/2022 04:52:05 PM
rwxr-xr-x
📄
hv_get_dns_info
622 bytes
11/01/2022 04:52:05 PM
rwxr-xr-x
📄
hv_kvp_daemon
1.58 KB
11/01/2022 04:52:05 PM
rwxr-xr-x
📄
hv_set_ifconfig
7.72 KB
11/01/2022 04:52:05 PM
rwxr-xr-x
📄
hv_vss_daemon
1.58 KB
11/01/2022 04:52:05 PM
rwxr-xr-x
📄
iconvconfig
30.25 KB
01/24/2022 12:53:44 PM
rwxr-xr-x
📄
init.lxc
38.5 KB
11/23/2018 04:49:34 AM
rwxr-xr-x
📄
init.lxc.static
1001.56 KB
11/23/2018 04:49:34 AM
rwxr-xr-x
📄
invoke-rc.d
15.66 KB
10/25/2017 03:38:42 PM
rwxr-xr-x
📄
ip6tables-apply
6.85 KB
11/12/2017 02:52:05 AM
rwxr-xr-x
📄
iptables-apply
6.85 KB
11/12/2017 02:52:05 AM
rwxr-xr-x
📄
irqbalance
62.68 KB
01/09/2019 10:38:44 AM
rwxr-xr-x
📄
irqbalance-ui
34.06 KB
01/09/2019 10:38:44 AM
rwxr-xr-x
📄
iscsi-iname
9.99 KB
05/11/2020 01:27:31 AM
rwxr-xr-x
📄
iscsi_discovery
5.16 KB
09/29/2016 06:33:24 PM
rwxr-xr-x
📄
iscsid
398.15 KB
05/11/2020 01:27:31 AM
rwxr-xr-x
📄
iscsistart
358.13 KB
05/11/2020 01:27:31 AM
rwxr-xr-x
📄
ldattach
30.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
locale-gen
4.3 KB
12/07/2020 04:38:09 PM
rwxr-xr-x
📄
logrotate
74.09 KB
08/21/2017 11:01:27 PM
rwxr-xr-x
📄
lsvmbus
1.58 KB
11/01/2022 04:52:05 PM
rwxr-xr-x
📄
luksformat
3.32 KB
08/23/2018 02:36:42 PM
rwxr-xr-x
📄
make-bcache
18.07 KB
08/05/2020 08:44:05 PM
rwxr-xr-x
📄
make-ssl-cert
3.78 KB
04/28/2017 07:58:22 PM
rwxr-xr-x
📄
mkinitramfs
10.79 KB
08/12/2020 08:12:11 PM
rwxr-xr-x
📄
mklost+found
9.99 KB
06/02/2022 02:37:00 PM
rwxr-xr-x
📄
mysqld
23.15 MB
10/19/2022 12:58:42 PM
rwxr-xr-x
📄
netplan
798 bytes
05/28/2020 09:09:51 PM
rwxr-xr-x
📄
newusers
82.39 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
nfnl_osf
13.99 KB
11/12/2017 02:52:05 AM
rwxr-xr-x
📄
nologin
5.99 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
overlayroot-chroot
2.45 KB
09/20/2018 01:29:41 PM
rwxr-xr-x
📄
ownership
10.13 KB
01/27/2020 06:09:10 PM
rwxr-xr-x
📄
pam-auth-update
19.38 KB
07/21/2020 11:40:59 PM
rwxr-xr-x
📄
pam_getenv
2.82 KB
08/23/2018 11:37:53 PM
rwxr-xr-x
📄
pam_timestamp_check
9.99 KB
07/21/2020 11:40:59 PM
rwxr-xr-x
📄
phpdismod
7.11 KB
01/17/2018 11:50:00 PM
rwxr-xr-x
📄
phpenmod
7.11 KB
01/17/2018 11:50:00 PM
rwxr-xr-x
📄
phpquery
6.24 KB
01/17/2018 11:50:00 PM
rwxr-xr-x
📄
popcon-largest-unused
543 bytes
02/22/2018 05:15:22 AM
rwxr-xr-x
📄
popularity-contest
4.92 KB
02/22/2018 05:15:22 AM
rwxr-xr-x
📄
pwck
49.8 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
pwconv
45.7 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
pwunconv
45.68 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
readprofile
18.11 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
remove-shell
904 bytes
12/30/2017 06:15:02 PM
rwxr-xr-x
📄
rmt
58.39 KB
03/15/2022 12:58:06 PM
rwxr-xr-x
📄
rmt-tar
58.39 KB
03/15/2022 12:58:06 PM
rwxr-xr-x
📄
rsyslogd
668.54 KB
05/03/2022 09:20:37 AM
rwxr-xr-x
📄
rtcwake
42.08 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
samba_kcc
11.76 KB
01/25/2022 03:20:03 PM
rwxr-xr-x
📄
service
9.04 KB
10/25/2017 03:38:42 PM
rwxr-xr-x
📄
setvesablank
14.07 KB
01/22/2018 01:49:48 PM
rwxr-xr-x
📄
split-logfile
2.36 KB
06/23/2022 12:51:37 PM
rwxr-xr-x
📄
sshd
772.41 KB
08/11/2021 06:02:09 PM
rwxr-xr-x
📄
tarcat
936 bytes
03/15/2022 12:58:06 PM
rwxr-xr-x
📄
tcpdump
999.6 KB
04/07/2022 03:43:23 PM
rwxr-xr-x
📄
tzconfig
106 bytes
10/12/2022 07:07:15 PM
rwxr-xr-x
📄
ufw
4.82 KB
03/25/2019 09:14:25 PM
rwxr-xr-x
📄
update-ca-certificates
5.27 KB
06/02/2022 02:19:50 PM
rwxr-xr-x
📄
update-grub
64 bytes
02/23/2021 04:23:39 PM
rwxr-xr-x
📄
update-grub2
64 bytes
02/23/2021 04:23:39 PM
rwxr-xr-x
📄
update-info-dir
1.66 KB
02/05/2018 02:48:18 PM
rwxr-xr-x
📄
update-initramfs
8.04 KB
08/12/2020 08:12:11 PM
rwxr-xr-x
📄
update-locale
2.99 KB
12/07/2020 04:38:09 PM
rwxr-xr-x
📄
update-mime
8.84 KB
07/15/2016 12:06:12 PM
rwxr-xr-x
📄
update-passwd
30.41 KB
09/12/2017 09:48:16 PM
rwxr-xr-x
📄
update-pciids
2.84 KB
02/10/2019 06:25:12 PM
rwxr-xr-x
📄
update-rc.d
16.12 KB
10/25/2017 03:38:42 PM
rwxr-xr-x
📄
update-secureboot-policy
7.43 KB
08/27/2020 11:32:46 AM
rwxr-xr-x
📄
update-usbids
1.05 KB
04/21/2017 08:59:17 PM
rwxr-xr-x
📄
useradd
123.28 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
userdel
82.48 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
usermod
123.06 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
uuidd
34.16 KB
09/16/2020 06:43:15 PM
rwxr-xr-x
📄
validlocale
1.73 KB
12/07/2020 04:38:09 PM
rwxr-xr-x
📄
vcstime
9.99 KB
01/22/2018 01:49:48 PM
rwxr-xr-x
📄
vigr
60.18 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
vipw
60.18 KB
11/29/2022 12:25:19 PM
rwxr-xr-x
📄
visudo
208.8 KB
01/19/2021 02:36:00 PM
rwxr-xr-x
📄
vpddecode
14.27 KB
01/27/2020 06:09:10 PM
rwxr-xr-x
📄
waagent
1.48 KB
01/14/2020 04:44:47 PM
rwxr-xr-x
📄
waagent2.0
246.41 KB
01/14/2020 04:44:47 PM
rwxr-xr-x
📄
xfs_admin
1.35 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_bmap
638 bytes
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_copy
394.31 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_db
667.63 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_estimate
10.01 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_freeze
767 bytes
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_fsr
30.02 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_growfs
382.27 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_info
472 bytes
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_io
130.93 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_logprint
414.27 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_mdrestore
370.28 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_metadump
747 bytes
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_mkfile
1007 bytes
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_ncheck
650 bytes
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_quota
86.01 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
xfs_rtcp
13.99 KB
04/18/2018 06:44:31 AM
rwxr-xr-x
📄
zerofree
9.99 KB
11/14/2016 02:44:00 PM
rwxr-xr-x
📄
zic
54.14 KB
01/24/2022 12:53:44 PM
rwxr-xr-x
Editing: samba_kcc
Close
#!/usr/bin/python2.7 # # Compute our KCC topology # # Copyright (C) Dave Craft 2011 # Copyright (C) Andrew Bartlett 2015 # # Andrew Bartlett's alleged work performed by his underlings Douglas # Bagnall and Garming Sam. # # 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 import random # ensure we get messages out immediately, so they get in the samba logs, # and don't get swallowed by a timeout os.environ['PYTHONUNBUFFERED'] = '1' # forcing GMT avoids a problem in some timezones with kerberos. Both MIT # heimdal can get mutual authentication errors due to the 24 second difference # between UTC and GMT when using some zone files (eg. the PDT zone from # the US) os.environ["TZ"] = "GMT" # Find right directory when running from source tree import optparse import time from samba import getopt as options from samba.kcc.graph_utils import verify_and_dot, list_verify_tests from samba.kcc.graph_utils import GraphError import logging from samba.kcc.debug import logger, DEBUG, DEBUG_FN from samba.kcc import KCC # If DEFAULT_RNG_SEED is None, /dev/urandom or system time is used. DEFAULT_RNG_SEED = None def test_all_reps_from(kcc, dburl, lp, creds, unix_now, rng_seed=None, ldif_file=None): """Run the KCC from all DSAs in read-only mode The behaviour depends on the global opts variable which contains command line variables. Usually you will want to run it with opt.dot_file_dir set (via --dot-file-dir) to see the graphs that would be created from each DC. :param lp: a loadparm object. :param creds: a Credentials object. :param unix_now: the unix epoch time as an integer :param rng_seed: a seed for the random number generator :return None: """ # This implies readonly and attempt_live_connections dsas = kcc.list_dsas() samdb = kcc.samdb needed_parts = {} current_parts = {} guid_to_dnstr = {} for site in kcc.site_table.values(): guid_to_dnstr.update((str(dsa.dsa_guid), dnstr) for dnstr, dsa in site.dsa_table.items()) dot_edges = [] dot_vertices = [] colours = [] vertex_colours = [] for dsa_dn in dsas: if rng_seed is not None: random.seed(rng_seed) kcc = KCC(unix_now, readonly=True, verify=opts.verify, debug=opts.debug, dot_file_dir=opts.dot_file_dir) if ldif_file is not None: try: # The dburl in this case is a temporary database. # Its non-existence is ensured at the script startup. # If it exists, it is from a previous iteration of # this loop -- unless we're in an unfortunate race. # Because this database is temporary, it lacks some # detail and needs to be re-created anew to set the # local dsa. os.unlink(dburl) except OSError: pass kcc.import_ldif(dburl, lp, ldif_file, dsa_dn) else: kcc.samdb = samdb kcc.run(dburl, lp, creds, forced_local_dsa=dsa_dn, forget_local_links=opts.forget_local_links, forget_intersite_links=opts.forget_intersite_links, attempt_live_connections=opts.attempt_live_connections) current, needed = kcc.my_dsa.get_rep_tables() for dsa in kcc.my_site.dsa_table.values(): if dsa is kcc.my_dsa: continue kcc.translate_ntdsconn(dsa) c, n = dsa.get_rep_tables() current.update(c) needed.update(n) for name, rep_table, rep_parts in ( ('needed', needed, needed_parts), ('current', current, current_parts)): for part, nc_rep in rep_table.items(): edges = rep_parts.setdefault(part, []) for reps_from in nc_rep.rep_repsFrom: source = guid_to_dnstr[str(reps_from.source_dsa_obj_guid)] dest = guid_to_dnstr[str(nc_rep.rep_dsa_guid)] edges.append((source, dest)) for site in kcc.site_table.values(): for dsa in site.dsa_table.values(): if dsa.is_ro(): vertex_colours.append('#cc0000') else: vertex_colours.append('#0000cc') dot_vertices.append(dsa.dsa_dnstr) if dsa.connect_table: DEBUG_FN("DSA %s %s connections:\n%s" % (dsa.dsa_dnstr, len(dsa.connect_table), [x.from_dnstr for x in dsa.connect_table.values()])) for con in dsa.connect_table.values(): if con.is_rodc_topology(): colours.append('red') else: colours.append('blue') dot_edges.append((con.from_dnstr, dsa.dsa_dnstr)) verify_and_dot('all-dsa-connections', dot_edges, vertices=dot_vertices, label="all dsa NTDSConnections", properties=(), debug=DEBUG, verify=opts.verify, dot_file_dir=opts.dot_file_dir, directed=True, edge_colors=colours, vertex_colors=vertex_colours) for name, rep_parts in (('needed', needed_parts), ('current', current_parts)): for part, edges in rep_parts.items(): verify_and_dot('all-repsFrom_%s__%s' % (name, part), edges, directed=True, label=part, properties=(), debug=DEBUG, verify=opts.verify, dot_file_dir=opts.dot_file_dir) ################################################## # samba_kcc entry point ################################################## parser = optparse.OptionParser("samba_kcc [options]") sambaopts = options.SambaOptions(parser) credopts = options.CredentialsOptions(parser) parser.add_option_group(sambaopts) parser.add_option_group(credopts) parser.add_option_group(options.VersionOptions(parser)) parser.add_option("--readonly", default=False, help="compute topology but do not update database", action="store_true") parser.add_option("--debug", help="debug output", action="store_true") parser.add_option("--verify", help="verify that assorted invariants are kept", action="store_true") parser.add_option("--list-verify-tests", help=("list what verification actions are available " "and do nothing else"), action="store_true") parser.add_option("--dot-file-dir", default=None, help="Write Graphviz .dot files to this directory") parser.add_option("--seed", help="random number seed", type=int, default=DEFAULT_RNG_SEED) parser.add_option("--importldif", help="import topology ldif file", type=str, metavar="<file>") parser.add_option("--exportldif", help="export topology ldif file", type=str, metavar="<file>") parser.add_option("-H", "--URL", help="LDB URL for database or target server", type=str, metavar="<URL>", dest="dburl") parser.add_option("--tmpdb", help="schemaless database file to create for ldif import", type=str, metavar="<file>") parser.add_option("--now", help=("assume current time is this ('YYYYmmddHHMMSS[tz]'," " default: system time)"), type=str, metavar="<date>") parser.add_option("--forced-local-dsa", help="run calculations assuming the DSA is this DN", type=str, metavar="<DSA>") parser.add_option("--attempt-live-connections", default=False, help="Attempt to connect to other DSAs to test links", action="store_true") parser.add_option("--list-valid-dsas", default=False, help=("Print a list of DSA dnstrs that could be" " used in --forced-local-dsa"), action="store_true") parser.add_option("--test-all-reps-from", default=False, help="Create and verify a graph of reps-from for every DSA", action="store_true") parser.add_option("--forget-local-links", default=False, help="pretend not to know the existing local topology", action="store_true") parser.add_option("--forget-intersite-links", default=False, help="pretend not to know the existing intersite topology", action="store_true") opts, args = parser.parse_args() if opts.list_verify_tests: list_verify_tests() sys.exit(0) if opts.test_all_reps_from: opts.readonly = True if opts.debug: logger.setLevel(logging.DEBUG) elif opts.readonly: logger.setLevel(logging.INFO) else: logger.setLevel(logging.WARNING) random.seed(opts.seed) if opts.now: for timeformat in ("%Y%m%d%H%M%S%Z", "%Y%m%d%H%M%S"): try: now_tuple = time.strptime(opts.now, timeformat) break except ValueError: pass else: # else happens if break doesn't --> no match print >> sys.stderr, "could not parse time '%s'" % opts.now sys.exit(1) unix_now = int(time.mktime(now_tuple)) else: unix_now = int(time.time()) lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp, fallback_machine=True) if opts.dburl is None: if opts.importldif: opts.dburl = opts.tmpdb else: opts.dburl = lp.samdb_url() elif opts.importldif: logger.error("Don't use -H/--URL with --importldif, use --tmpdb instead") sys.exit(1) # Instantiate Knowledge Consistency Checker and perform run kcc = KCC(unix_now, readonly=opts.readonly, verify=opts.verify, debug=opts.debug, dot_file_dir=opts.dot_file_dir) if opts.exportldif: rc = kcc.export_ldif(opts.dburl, lp, creds, opts.exportldif) sys.exit(rc) if opts.importldif: if opts.tmpdb is None or opts.tmpdb.startswith('ldap'): logger.error("Specify a target temp database file with --tmpdb option") sys.exit(1) if os.path.exists(opts.tmpdb): logger.error("The temp database file (%s) specified with --tmpdb " "already exists. We refuse to clobber it." % opts.tmpdb) sys.exit(1) rc = kcc.import_ldif(opts.tmpdb, lp, opts.importldif, forced_local_dsa=opts.forced_local_dsa) if rc != 0: sys.exit(rc) kcc.load_samdb(opts.dburl, lp, creds, force=False) if opts.test_all_reps_from: test_all_reps_from(kcc, opts.dburl, lp, creds, unix_now, rng_seed=opts.seed, ldif_file=opts.importldif) sys.exit() if opts.list_valid_dsas: print '\n'.join(kcc.list_dsas()) sys.exit() try: rc = kcc.run(opts.dburl, lp, creds, opts.forced_local_dsa, opts.forget_local_links, opts.forget_intersite_links, attempt_live_connections=opts.attempt_live_connections) sys.exit(rc) except GraphError, e: print e sys.exit(1)