OSDN Git Service

Move away from GLOBAL_CFLAGS for ssh configuration
authorGreg Hartman <ghartman@google.com>
Fri, 10 Jun 2016 21:05:35 +0000 (14:05 -0700)
committerGreg Hartman <ghartman@google.com>
Fri, 10 Jun 2016 22:39:24 +0000 (15:39 -0700)
Later branches will not support GLOBAL_CFLAGS.
This change turns on account mapping for all Android builds.
It allows SSHDIR to be set in BoardConfig.mk

Bug: 29277511

Change-Id: Ic1411b97468d61a919763db6d42253fdf148df79

Android.mk
auth.c

index 589194d..5f23184 100644 (file)
@@ -125,8 +125,9 @@ LOCAL_MODULE := libssh
 LOCAL_CFLAGS+=-O3 -Wno-unused-parameter
 
 LOCAL_CFLAGS += -DGCE_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
-ifneq ($(filter gce_x86 calypso, $(TARGET_DEVICE)),)
-LOCAL_CFLAGS += -DANDROID_GCE -DSSHDIR=\"/var/run/ssh\"
+
+ifneq (,$(SSHDIR))
+LOCAL_CFLAGS += -DSSHDIR=\"$(SSHDIR)\"
 endif
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/auth.c b/auth.c
index 65f3d0d..9e05678 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -629,7 +629,7 @@ getpwnamallow(const char *user)
        aix_setauthdb(user);
 #endif
 
-#ifdef ANDROID_GCE
+#if defined(ANDROID)
        // Android has a fixed set of users. Any incoming user that we can't
        // identify should be authenticated as the shell user.
        if (strcmp(user, "root") && strcmp(user, "shell")) {