[PATCH] samba-tool: Fix traceback in samba-tool ntacl subcommands
Amit Kumar
amitkuma at redhat.com
Thu Jul 18 06:51:21 UTC 2019
# samba-tool ntacl sysvolcheck
ERROR(runtime): uncaught exception - samdb_domain_sid failed
File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py",
line 177, in _run
return self.run(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/samba/netcmd/ntacl.py", line
265, in run
domain_sid = security.dom_sid(samdb.domain_sid)
File "/usr/lib64/python2.7/site-packages/samba/samdb.py", line 583, in
get_domain_sid
return dsdb._samdb_get_domain_sid(self)
# samba-tool ntacl sysvolreset
ERROR(runtime): uncaught exception - samdb_domain_sid failed
File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py",
line 177, in _run
return self.run(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/samba/netcmd/ntacl.py", line
210, in run
domain_sid = security.dom_sid(samdb.domain_sid)
File "/usr/lib64/python2.7/site-packages/samba/samdb.py", line 583, in
get_domain_sid
return dsdb._samdb_get_domain_sid(self)
Signed-off-by: Amit Kumar <amitkuma at redhat.com>
---
python/samba/netcmd/ntacl.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/python/samba/netcmd/ntacl.py b/python/samba/netcmd/ntacl.py
index 4cc7737ae77..dfcc8bd4d8f 100644
--- a/python/samba/netcmd/ntacl.py
+++ b/python/samba/netcmd/ntacl.py
@@ -393,7 +393,11 @@ class cmd_ntacl_sysvolreset(Command):
elif use_s3fs:
use_ntvfs = False
- domain_sid = security.dom_sid(samdb.domain_sid)
+ try:
+ domain_sid = security.dom_sid(samdb.domain_sid)
+ except Exception as e:
+ print("domain_sid not returned,",e)
+ return
s3conf = s3param.get_context()
s3conf.load(lp.configfile)
@@ -448,7 +452,11 @@ class cmd_ntacl_sysvolcheck(Command):
except Exception as e:
raise CommandError("Unable to open samdb:", e)
- domain_sid = security.dom_sid(samdb.domain_sid)
+ try:
+ domain_sid = security.dom_sid(samdb.domain_sid)
+ except Exception as e:
+ print("domain_sid not returned,",e)
+ return
provision.checksysvolacl(samdb, netlogon, sysvol,
domain_sid,
--
2.17.1
Opened MR: https://gitlab.com/samba-team/samba/merge_requests/650
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-samba-tool-Fix-traceback-in-samba-tool-ntacl-subcomm.patch
Type: text/x-patch
Size: 2461 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190718/f4f61159/0001-samba-tool-Fix-traceback-in-samba-tool-ntacl-subcomm.bin>
More information about the samba-technical
mailing list