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

[SambaHook] Can not extract domain from the username #15773

Closed
edwinkong opened this issue May 11, 2021 · 3 comments
Closed

[SambaHook] Can not extract domain from the username #15773

edwinkong opened this issue May 11, 2021 · 3 comments
Labels
kind:bug This is a clearly a bug

Comments

@edwinkong
Copy link

Apache Airflow version:
2.0.1

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment: docker-compose + custom built docker image

What happened:

The airflow.providers.samba.hooks.samba.SambaHook does not accept the domain argument and is automatically defaults to the server ip address by upstream pysmbclient.
If the DOMAIN/USERNAME format was supplied, it would fail with NT_STATUS_BAD_NETWORK_NAME error. If only the USERNAME was supplied, then the login would fail with NT_STATUS_LOGON_FAILURE error.

What you expected to happen:
The domain should be extracted from the username if the user supplied the SambaHook.conn.login in the DOMAIN/USERNAME format.

How to reproduce it:
Just connect to a samba drive with domain authentication with SambaHook

@edwinkong edwinkong added the kind:bug This is a clearly a bug label May 11, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented May 11, 2021

Thanks for opening your first issue here! Be sure to follow the issue template!

@edwinkong
Copy link
Author

I am sorry for not checking the upstream before opening an issue here. The upstream project pysmbclient was last updated at 9 years ago so the project is very likely to be obsolete. The NT_STATUS_BAD_NETWORK_NAME error was raised due to the faulty subprocess call

smbclient [SHARE] -I [IP] -A [AUTH_FILE] -c ls "[PATH]"

the double quote doesn't include the ls so it fails.

I would create my samba hook myself. Moreover, the SambaHook can not even list the directory, so probably some deprecation warning should be displayed when installing the package.

@eladkal
Copy link
Contributor

eladkal commented May 11, 2021

We have open task to move to a maintained library #14054 handled by @marcosmarxm

@eladkal eladkal closed this as completed May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

2 participants