VUIIS / dax

Distributed Automation for XNAT
MIT License
25 stars 24 forks source link

XnatCheckLogin gives poor error when .netrc has wrong permissions #392

Closed duettwe closed 4 months ago

duettwe commented 2 years ago

When running XnatCheckLogin, we can get something like this:

$ XnatCheckLogin
================================================================
Checking your settings for XNAT
No host specified, using XNAT_HOST environment variable.
Checking login for host=http://129.59.135.143:8080/xnat
ERROR:login not found, set in ~/.netrc
================================================================

The issue in this situation is that the .netrc file was GLOBAL readable, which was fixed with

chmod go-r .netrc

I guess my real question; Is it possible to have a more refined error message?

baxpr commented 2 years ago

We got a sensible error message from the netrc library with Xnatinfo. Maybe use the netrc library in XnatCheckLogin as well? Or use it in similar way?

baxpr commented 2 years ago

Or don't trap the exception - that might be why we didn't see the same error message

baxpr commented 4 months ago

duplicate #439