summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorLiam Hopkins <liamh@google.com>2019-07-16 13:31:27 -0700
committerGitHub <noreply@github.com>2019-07-16 13:31:27 -0700
commitd497abca1a746c5ae4e55a85e64417148bf7b2d3 (patch)
treedfd1e57ef0c0c61f6f5b551bdd8c1a568a68014f /packages
parente6eab0c12df9192208233b31d8e2ac7e79cba44c (diff)
downloadgoogle-compute-image-packages-d497abca1a746c5ae4e55a85e64417148bf7b2d3.tar.gz
Fixbuild (#809)
Diffstat (limited to 'packages')
-rw-r--r--packages/google-compute-engine-oslogin/src/Makefile8
-rw-r--r--packages/google-compute-engine-oslogin/src/include/oslogin_utils.h1
-rw-r--r--packages/google-compute-engine-oslogin/src/nss/nss_oslogin.cc5
-rw-r--r--packages/google-compute-engine-oslogin/src/utils.cc7
4 files changed, 12 insertions, 9 deletions
diff --git a/packages/google-compute-engine-oslogin/src/Makefile b/packages/google-compute-engine-oslogin/src/Makefile
index 5251e66..0e607d7 100644
--- a/packages/google-compute-engine-oslogin/src/Makefile
+++ b/packages/google-compute-engine-oslogin/src/Makefile
@@ -1,12 +1,12 @@
SHELL = /bin/sh
TOPDIR = $(realpath ..)
-VERSION = 20190711.00
+VERSION = 20190708.00
CPPFLAGS = -Iinclude -I/usr/include/json-c
FLAGS = -fPIC -Wall -g
CFLAGS = $(FLAGS) -Wstrict-prototypes
-CXXFLAGS = $(FLAGS) -std=c++11
+CXXFLAGS = $(FLAGS)
LDFLAGS = -shared -Wl,-soname,$(SONAME)
LDLIBS = -lcurl -ljson-c
@@ -60,10 +60,10 @@ $(PAM_ADMIN) : pam/pam_oslogin_admin.o utils.o
# Utilities.
google_authorized_keys : authorized_keys/authorized_keys.o utils.o
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -lboost_regex $^ -o $@ $(LDLIBS)
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $^ -o $@ $(LDLIBS)
google_oslogin_nss_cache: cache_refresh/cache_refresh.o utils.o
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -lboost_regex $^ -o $@ $(LDLIBS)
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $^ -o $@ $(LDLIBS)
install: all
install -d $(DESTDIR)$(LIBDIR)
diff --git a/packages/google-compute-engine-oslogin/src/include/oslogin_utils.h b/packages/google-compute-engine-oslogin/src/include/oslogin_utils.h
index ea8beae..82763bf 100644
--- a/packages/google-compute-engine-oslogin/src/include/oslogin_utils.h
+++ b/packages/google-compute-engine-oslogin/src/include/oslogin_utils.h
@@ -15,6 +15,7 @@
#include <grp.h>
#include <pthread.h>
#include <pwd.h>
+#include <stdint.h>
#include <string>
#include <vector>
diff --git a/packages/google-compute-engine-oslogin/src/nss/nss_oslogin.cc b/packages/google-compute-engine-oslogin/src/nss/nss_oslogin.cc
index f928dcf..2a34c83 100644
--- a/packages/google-compute-engine-oslogin/src/nss/nss_oslogin.cc
+++ b/packages/google-compute-engine-oslogin/src/nss/nss_oslogin.cc
@@ -25,6 +25,7 @@
#include <sys/types.h>
#include <syslog.h>
#include <unistd.h>
+#include <stdlib.h>
#include <iostream>
#include <sstream>
@@ -147,7 +148,7 @@ enum nss_status _nss_oslogin_initgroups_dyn(const char *user, gid_t skipgroup,
}
gid_t *groups = *groupsp;
- for (auto &group : grouplist) {
+ for (int i = 0; i < (int) grouplist.size(); i++) {
// Resize the buffer if needed.
if (*start == *size) {
gid_t *newgroups;
@@ -168,7 +169,7 @@ enum nss_status _nss_oslogin_initgroups_dyn(const char *user, gid_t skipgroup,
*groupsp = groups = newgroups;
*size = newsize;
}
- groups[(*start)++] = group.gid;
+ groups[(*start)++] = grouplist[i].gid;
}
return NSS_STATUS_SUCCESS;
}
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.