Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
1.7.1
-
None
-
None
Description
GetLoggedInUser() may fail when calling getpwuid_r():
Error calling getpwuid_r(): No such file or directory (error 2).
In which case, a newly created Proxy object may have an empty username in the user credentials. That leads to an error during negotiation when using plain text SASL. it seems more robust to fall back to some default user name when GetLoggedInUser() fails.
Not authorized: Client connection negotiation failed: client connection to 127.0.0.1:27000: SASL(-1): generic failure: All-whitespace username.
Relevant code below:
Proxy::Proxy(std::shared_ptr<Messenger> messenger, const Sockaddr& remote, string hostname, string service_name) : service_name_(std::move(service_name)), messenger_(std::move(messenger)), is_started_(false) { CHECK(messenger_ != nullptr); DCHECK(!service_name_.empty()) << "Proxy service name must not be blank"; // By default, we set the real user to the currently logged-in user. // Effective user and password remain blank. string real_user; <<----- "empty" Status s = GetLoggedInUser(&real_user); if (!s.ok()) { LOG(WARNING) << "Proxy for " << service_name_ << ": Unable to get logged-in user name: " << s.ToString() << " before connecting to remote: " << remote.ToString(); } UserCredentials creds; creds.set_real_user(std::move(real_user)); conn_id_ = ConnectionId(remote, std::move(hostname), std::move(creds)); }
Attachments
Issue Links
- is related to
-
IMPALA-7585 Always set user credentials after creating a KRPC proxy
- Resolved