-
Notifications
You must be signed in to change notification settings - Fork 95
standardise user name interface #7240
Description
In the Cylc scheduler, we use pwd.getpwnam().pw_name to determine the user name.
Whereas in the GUI and Tui, we use the newer getpass.getuser() interface for the same purpose.
We've had a user report of a system where different interfaces return different user names.
The symptoms described suggest that these two Python interfaces are returning different results, resulting in the scheduler reporting a different owner UIS/Tui user, causing workflows to be filtered out, or refuse connection. Note, these failures will be due to a simple string mismatch, not a security failure (that's handled by the curve authentication, pub/pri key pair).
Both interfaces should return the same username, the cause of this may be an OS or configuration issue, however, we can reduce the impact of this by standardising on a single interface.
Because this is the first bug report of its kind, I think we can take that as evidence that changing from pwd.getpwnam().pw_name to getpass.getuser() wouldn't cause problems with existing setups (as any mismatch would cause this very issue), so this should be low-risk. Conveniently, the getpass.getuser() provides a preferable answer in the reported example.