Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ TOPDIR = $(realpath ..)

CPPFLAGS = -Iinclude -I/usr/include/json-c
FLAGS = -fPIC -Wall -g

ifneq ($(CUSTOM_METADATA_ENDPOINT),)
FLAGS += -DCUSTOM_METADATA_ENDPOINT=$(CUSTOM_METADATA_ENDPOINT)
endif

CFLAGS = $(FLAGS) -Wstrict-prototypes
CXXFLAGS = $(FLAGS)

Expand Down
7 changes: 7 additions & 0 deletions src/include/oslogin_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,15 @@ using std::vector;
namespace oslogin_utils {

// Metadata server URL.
#ifdef CUSTOM_METADATA_ENDPOINT
#define Q(x) #x
#define QUOTE(x) Q(x)
static const char kMetadataServerUrl[] =
"http://" QUOTE(CUSTOM_METADATA_ENDPOINT) "/computeMetadata/v1/oslogin/";
#else
static const char kMetadataServerUrl[] =
"http://169.254.169.254/computeMetadata/v1/oslogin/";
#endif /* CUSTOM_METADATA_ENDPOINT */

// BufferManager encapsulates and manages a buffer and length. This class is not
// thread safe.
Expand Down