dirkjanm / ldapdomaindump

Active Directory information dumper via LDAP
MIT License
1.19k stars 190 forks source link

Bad operation type #27

Closed frenyman closed 4 years ago

frenyman commented 4 years ago

] Connecting as anonymous user, dumping will probably fail. Consider specifying a username/password to login with [] Connecting to host... [] Binding to host [+] Bind OK [] Starting domain dump Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/opt/scripts/ldapdomaindump/ldapdomaindump/main.py", line 3, in ldapdomaindump.main() File "ldapdomaindump/init.py", line 944, in main dd.domainDump() File "ldapdomaindump/init.py", line 425, in domainDump rw.generatePolicyReport(self) File "ldapdomaindump/init.py", line 827, in generatePolicyReport html = self.generateHtmlTable(dd.policy, self.policyattributes, 'Domain policy') File "ldapdomaindump/init.py", line 519, in generateHtmlTable of.append('%s' % self.formatAttribute(li[att], liIsGroup)) File "ldapdomaindump/init.py", line 635, in formatAttribute return '%.1f minutes' % self.nsToMinutes(att.value) File "ldapdomaindump/init.py", line 468, in nsToMinutes return abs(length) * .0000001 / 60 TypeError: bad operand type for abs(): 'unicode'

b4cktr4ck2 commented 4 years ago

Getting the same issue... my version of ldap3 is 2.5.1.

b4cktr4ck2 commented 4 years ago

Running it with python3 gives me: [] Connecting as anonymous user, dumping will probably fail. Consider specifying a username/password to login with [] Connecting to host... [] Binding to host [+] Bind OK [] Starting domain dump Traceback (most recent call last): File "/usr/bin/ldapdomaindump", line 3, in ldapdomaindump.main() File "/usr/local/lib/python3.7/dist-packages/ldapdomaindump/init.py", line 922, in main dd.domainDump() File "/usr/local/lib/python3.7/dist-packages/ldapdomaindump/init.py", line 417, in domainDump rw.generatePolicyReport(self) File "/usr/local/lib/python3.7/dist-packages/ldapdomaindump/init.py", line 805, in generatePolicyReport html = self.generateHtmlTable(dd.policy, self.policyattributes, 'Domain policy') File "/usr/local/lib/python3.7/dist-packages/ldapdomaindump/init.py", line 503, in generateHtmlTable of.append('%s' % self.formatAttribute(li[att], liIsGroup)) File "/usr/local/lib/python3.7/dist-packages/ldapdomaindump/init.py", line 616, in formatAttribute return '%.1f minutes' % self.nsToMinutes(att.value) File "/usr/local/lib/python3.7/dist-packages/ldapdomaindump/init.py", line 452, in nsToMinutes return abs(length) * .0000001 / 60 TypeError: bad operand type for abs(): 'str'

GanbaruTobi commented 4 years ago

Traceback (most recent call last): File "/bin/ldapdomaindump", line 3, in ldapdomaindump.main() File "/usr/lib/python3.8/site-packages/ldapdomaindump/init.py", line 944, in main dd.domainDump() File "/usr/lib/python3.8/site-packages/ldapdomaindump/init.py", line 425, in domainDump rw.generatePolicyReport(self) File "/usr/lib/python3.8/site-packages/ldapdomaindump/init.py", line 827, in generatePolicyReport html = self.generateHtmlTable(dd.policy, self.policyattributes, 'Domain policy') File "/usr/lib/python3.8/site-packages/ldapdomaindump/init.py", line 519, in generateHtmlTable of.append('%s' % self.formatAttribute(li[att], liIsGroup)) File "/usr/lib/python3.8/site-packages/ldapdomaindump/init.py", line 635, in formatAttribute return '%.1f minutes' % self.nsToMinutes(att.value) File "/usr/lib/python3.8/site-packages/ldapdomaindump/init.py", line 468, in nsToMinutes return abs(length) * .0000001 / 60 TypeError: bad operand type for abs(): 'str'

LuisFelipe-RR commented 4 years ago

I'm getting the same error. ValueError: invalid literal for int() with base 10: '0:30:00'

Traceback (most recent call last): File "/usr/local/bin/ldapdomaindump", line 4, in import('pkg_resources').run_script('ldapdomaindump==0.9.3', 'ldapdomaindump') File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 666, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1462, in run_script exec(code, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/ldapdomaindump-0.9.3-py2.7.egg/EGG-INFO/scripts/ldapdomaindump", line 3, in ldapdomaindump.main() File "/usr/local/lib/python2.7/dist-packages/ldapdomaindump-0.9.3-py2.7.egg/ldapdomaindump/init.py", line 944, in main dd.domainDump() File "/usr/local/lib/python2.7/dist-packages/ldapdomaindump-0.9.3-py2.7.egg/ldapdomaindump/init.py", line 425, in domainDump rw.generatePolicyReport(self) File "/usr/local/lib/python2.7/dist-packages/ldapdomaindump-0.9.3-py2.7.egg/ldapdomaindump/init.py", line 833, in generatePolicyReport grepout = self.generateGrepList(dd.policy, self.policyattributes) File "/usr/local/lib/python2.7/dist-packages/ldapdomaindump-0.9.3-py2.7.egg/ldapdomaindump/init.py", line 732, in generateGrepList eo.append(self.formatGrepAttribute(entry[attr]) or '') File "/usr/local/lib/python2.7/dist-packages/ldapdomaindump-0.9.3-py2.7.egg/ldapdomaindump/init.py", line 721, in formatGrepAttribute return '%.1f minutes' % self.nsToMinutes(att.value) File "/usr/local/lib/python2.7/dist-packages/ldapdomaindump-0.9.3-py2.7.egg/ldapdomaindump/init.py", line 468, in nsToMinutes return abs(int(length)) * .0000001 / 60 ValueError: invalid literal for int() with base 10: '0:30:00'

dirkjanm commented 4 years ago

This is fixed in the latest version. As far as I could see it was only occurring on python 2.x