Skip to content

Fix broken cache_refresh behavior when groups are disabled.#181

Merged
google-oss-prow[bot] merged 4 commits intoGoogleCloudPlatform:masterfrom
anandadalton:master
Feb 27, 2026
Merged

Fix broken cache_refresh behavior when groups are disabled.#181
google-oss-prow[bot] merged 4 commits intoGoogleCloudPlatform:masterfrom
anandadalton:master

Conversation

@anandadalton
Copy link
Contributor

No description provided.

This change introduces a new binary cache format for storing OS Login passwd information. It includes:
-   `OsLoginPasswdCacheWriter`: A C++ class to build and write the cache file. It buffers user entries, sorts them, and writes them to a temporary file before atomically renaming it.
-   `oslogin_passwd_cache_reader`: A C implementation for reading from the cache file using mmap. It provides functions compatible with NSS modules for looking up entries by UID, name, and iterating through all entries.
-   `eytzinger_layout.h`: A template function to convert a sorted vector into an Eytzinger layout, used for the name index to improve cache locality during lookups.
-   `oslogin_index_structs.h`: Defines the structures used for the UID and Name indices.
-   New unit tests (`eytzinger_layout_test.cc`, `oslogin_passwd_cache_reader_test.cc`, `round_trip_test.cc`) to validate the cache functionality, including concurrent read access.
-   The `Makefile` is updated to build and run the new tests. The `main` function is removed from `oslogin_utils_test.cc` as `gtest_main.cc` is now linked.
When groups are disabled, this can cause the return value to be -1, and
this can break the guest agent.
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anandadalton, ChaitanyaKulkarni28

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [ChaitanyaKulkarni28,anandadalton]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 5ec79d4 into GoogleCloudPlatform:master Feb 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants