Skip to content

Commit

Permalink
pam: fix cache id
Browse files Browse the repository at this point in the history
Something went wrong in the cherry-picking for
3fc9c41. Bus is not stored correctly in the
cache. Because authentication calls `pam_acquire_bus_connection` twice, and the
first created bus is used after the second one is created, `pam_set_data`
disconnects the first one. This results in the following error:

```
Failed to acquire home for user test-user: Transport endpoint is not connected
```
  • Loading branch information
valentindavid committed Aug 8, 2023
1 parent 641103a commit fcb1fe2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/pam-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int pam_acquire_bus_connection(pam_handle_t *handle, const char *module_name, sd
return PAM_SERVICE_ERR;
}

r = pam_set_data(handle, "systemd-system-bus", bus, cleanup_system_bus);
r = pam_set_data(handle, cache_id, bus, cleanup_system_bus);
if (r != PAM_SUCCESS) {
pam_syslog(handle, LOG_ERR, "Failed to set PAM bus data: %s", pam_strerror(handle, r));
return r;
Expand Down

0 comments on commit fcb1fe2

Please sign in to comment.