summaryrefslogtreecommitdiff
path: root/packages/google-compute-engine-oslogin/src/utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'packages/google-compute-engine-oslogin/src/utils.cc')
-rw-r--r--packages/google-compute-engine-oslogin/src/utils.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/google-compute-engine-oslogin/src/utils.cc b/packages/google-compute-engine-oslogin/src/utils.cc
index ceda0af..c97529e 100644
--- a/packages/google-compute-engine-oslogin/src/utils.cc
+++ b/packages/google-compute-engine-oslogin/src/utils.cc
@@ -545,8 +545,8 @@ bool AddUsersToGroup(std::vector<string> users, struct group* result,
}
result->gr_mem = bufp;
- for (auto& el : users) {
- if (!buf->AppendString(el, bufp, errnop)) {
+ for (int i = 0; i < (int) users.size(); i++) {
+ if (!buf->AppendString(users[i], bufp, errnop)) {
result->gr_mem = NULL;
return false;
}
@@ -689,7 +689,8 @@ bool FindGroup(struct group* result, BufferManager* buf, int* errnop) {
}
// Check for a match.
- for (auto& el : groups) {
+ for (int i = 0; i < (int) groups.size(); i++) {
+ Group el = groups[i];
if ((result->gr_name != NULL) && (string(result->gr_name) == el.name)) {
// Set the name even though it matches because the final string must
// be stored in the provided buffer.