Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on Windows machines which are members of a domain but not connected to a domain controller #73

Open
nfd opened this issue Nov 4, 2020 · 1 comment

Comments

@nfd
Copy link

nfd commented Nov 4, 2020

Describe the bug

Calling get_mode on a Windows machine which is a member of a domain but which is disconnected from its domain controller produces an exception from win32security.LookupAccountSid().

Your configuration

Windows 10 x64, Python 3.7, oschmod==0.3.9

Steps to reproduce

oschmod.get_mode(pathname)

What happened

Traceback (most recent call last)
File "...\oschmod\__init__.py", line 163, in get_mode
    return win_get_permissions(path)
File "...\oschmod\__init__.py", line 364, in win_get_permissions
    return _win_get_permissions(path, get_object_type(path))
File "...\oschmod\__init__.py", line 387, in _win_get_permissions
    win32security.LookupAccountSid(None, ace[2]) != \
pywintypes.error: (1789, 'LookupAccountSid', 'The trust relationship between this workstation and the primary domain controller failed.')

Additional context
I'm not an expert in windows security (traceback was retyped from a screenshot of a teamviewer session!) so am not sure if this is even resolvable or oschmod's problem. But apparently being part of a domain, but not connected to a domain controller, is a reasonable scenario for Windows devices.

@YakDriver
Copy link
Owner

Thanks for raising this issue! My apologies for not getting back to you. I'll definitely take a look at this. Perhaps there's some easy error handling that will allow this to work despite the exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants