OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python2.7
/
dist-packages
/
samba
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/15/2022 06:13:39 AM
rwxr-xr-x
📄
__init__.py
12.92 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
__init__.pyc
13.1 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
_glue.x86_64-linux-gnu.so
14.3 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
_ldb.x86_64-linux-gnu.so
45.16 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
auth.x86_64-linux-gnu.so
40.55 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
common.py
3.61 KB
02/07/2018 08:37:51 AM
rw-r--r--
📄
common.pyc
3.61 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
compat.py
834 bytes
07/04/2017 10:05:25 AM
rw-r--r--
📄
compat.pyc
284 bytes
02/03/2022 06:37:40 AM
rw-r--r--
📄
credentials.x86_64-linux-gnu.so
32.02 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
crypto.x86_64-linux-gnu.so
45.93 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
dbchecker.py
114.77 KB
02/07/2018 08:37:51 AM
rw-r--r--
📄
dbchecker.pyc
74.47 KB
02/03/2022 06:37:40 AM
rw-r--r--
📁
dcerpc
-
02/03/2022 06:37:40 AM
rwxr-xr-x
📄
descriptor.py
26.63 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
descriptor.pyc
23.43 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
dnsserver.py
5.98 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
dnsserver.pyc
6.65 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
drs_utils.py
13.17 KB
09/17/2017 07:15:34 PM
rw-r--r--
📄
drs_utils.pyc
11.17 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
dsdb.x86_64-linux-gnu.so
42.9 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
dsdb_dns.x86_64-linux-gnu.so
14.02 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
gensec.x86_64-linux-gnu.so
26.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
getopt.py
10.87 KB
09/17/2017 07:15:34 PM
rw-r--r--
📄
getopt.pyc
11.77 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
hostconfig.py
2.29 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
hostconfig.pyc
3.26 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
idmap.py
3.18 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
idmap.pyc
3.07 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
join.py
67.78 KB
09/17/2017 07:15:34 PM
rw-r--r--
📄
join.pyc
47 KB
02/03/2022 06:37:40 AM
rw-r--r--
📁
kcc
-
02/03/2022 06:37:40 AM
rwxr-xr-x
📄
messaging.x86_64-linux-gnu.so
18.65 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
ms_display_specifiers.py
4.58 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
ms_display_specifiers.pyc
3.61 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
ms_schema.py
8.1 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
ms_schema.pyc
6.97 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
ndr.py
4.76 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
ndr.pyc
4.65 KB
02/03/2022 06:37:40 AM
rw-r--r--
📄
net.x86_64-linux-gnu.so
26.62 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
netbios.x86_64-linux-gnu.so
14.46 KB
01/25/2022 03:20:03 PM
rw-r--r--
📁
netcmd
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
ntacls.py
10.4 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
ntacls.pyc
6.91 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
ntstatus.x86_64-linux-gnu.so
117.69 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
param.x86_64-linux-gnu.so
23.52 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
policy.x86_64-linux-gnu.so
9.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
posix_eadb.x86_64-linux-gnu.so
9.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
📁
provision
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
registry.x86_64-linux-gnu.so
19.62 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
remove_dc.py
17.3 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
remove_dc.pyc
11.45 KB
02/03/2022 06:37:41 AM
rw-r--r--
📁
samba3
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
samdb.py
36.89 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
samdb.pyc
34.62 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
schema.py
8.16 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
schema.pyc
6.84 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
sd_utils.py
3.24 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
sd_utils.pyc
3.12 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
security.x86_64-linux-gnu.so
9.93 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
sites.py
3.94 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
sites.pyc
4.24 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
smb.x86_64-linux-gnu.so
22.63 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
subnets.py
6.76 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
subnets.pyc
5.95 KB
02/03/2022 06:37:41 AM
rw-r--r--
📁
subunit
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
tdb_util.py
1.46 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
tdb_util.pyc
989 bytes
02/03/2022 06:37:41 AM
rw-r--r--
📁
tests
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📁
third_party
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
upgrade.py
33.68 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
upgrade.pyc
24.59 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
upgradehelpers.py
31.83 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
upgradehelpers.pyc
26.92 KB
02/03/2022 06:37:41 AM
rw-r--r--
📁
web_server
-
02/03/2022 06:37:41 AM
rwxr-xr-x
📄
werror.x86_64-linux-gnu.so
153.69 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
xattr.py
2.22 KB
07/04/2017 10:05:25 AM
rw-r--r--
📄
xattr.pyc
1.57 KB
02/03/2022 06:37:41 AM
rw-r--r--
📄
xattr_native.x86_64-linux-gnu.so
9.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
📄
xattr_tdb.x86_64-linux-gnu.so
9.99 KB
01/25/2022 03:20:03 PM
rw-r--r--
Editing: idmap.py
Close
# Unix SMB/CIFS implementation. # Copyright (C) 2008 Kai Blin <kai@samba.org> # # # 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/>. # """Convenience functions for using the idmap database.""" __docformat__ = "restructuredText" import ldb import samba class IDmapDB(samba.Ldb): """The IDmap database.""" # Mappings for ID_TYPE_UID, ID_TYPE_GID and ID_TYPE_BOTH TYPE_UID = 1 TYPE_GID = 2 TYPE_BOTH = 3 def __init__(self, url=None, lp=None, modules_dir=None, session_info=None, credentials=None, flags=0, options=None): """Opens the IDMap Database. For parameter meanings see the super class (samba.Ldb) """ self.lp = lp if url is None: url = lp.private_path("idmap.ldb") super(IDmapDB, self).__init__(url=url, lp=lp, modules_dir=modules_dir, session_info=session_info, credentials=credentials, flags=flags, options=options) def connect(self, url=None, flags=0, options=None): super(IDmapDB, self).connect(url=self.lp.private_path(url), flags=flags, options=options) def increment_xid(self): """Increment xidNumber, if not present it create and assign it to the lowerBound :return xid can that be used for SID/unixid mapping """ res = self.search(expression="distinguishedName=CN=CONFIG", base="", scope=ldb.SCOPE_SUBTREE) id = res[0].get("xidNumber") flag = ldb.FLAG_MOD_REPLACE if id is None: id = res[0].get("lowerBound") flag = ldb.FLAG_MOD_ADD newid = int(str(id)) + 1 msg = ldb.Message() msg.dn = ldb.Dn(self, "CN=CONFIG") msg["xidNumber"] = ldb.MessageElement(str(newid), flag, "xidNumber") self.modify(msg) return id def setup_name_mapping(self, sid, type, unixid=None): """Setup a mapping between a sam name and a unix name. :param sid: SID of the NT-side of the mapping. :param unixname: Unix id to map to, if none supplied the next one will be selected """ if unixid is None: unixid = self.increment_xid() type_string = "" if type == self.TYPE_UID: type_string = "ID_TYPE_UID" elif type == self.TYPE_GID: type_string = "ID_TYPE_GID" elif type == self.TYPE_BOTH: type_string = "ID_TYPE_BOTH" else: return mod = """ dn: CN=%s xidNumber: %s objectSid: %s objectClass: sidMap type: %s cn: %s """ % (sid, unixid, sid, type_string, sid) self.add(self.parse_ldif(mod).next()[1])