LOCAL_C_INCLUDES := external/openssl/include external/zlib
PRIVATE_C_INCLUDES := external/openssl/openbsd-compat
-LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
+LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz libcutils
include $(BUILD_EXECUTABLE)
if (fstat(fileno(f), &st) < 0 ||
(st.st_uid != 0 && st.st_uid != uid) ||
(st.st_mode & 022) != 0) {
- snprintf(err, errlen, "bad ownership or modes for file %s",
- buf);
- return -1;
+#ifdef ANDROID
+ /* needed to allow root login on android */
+ if (getuid() != 0)
+#endif
+ {
+ snprintf(err, errlen, "bad ownership or modes for file %s",
+ buf);
+ return -1;
+ }
}
/* for each component of the canonical path, walking upwards */
#include "channels.h"
#include "groupaccess.h"
+#ifdef ANDROID
+#include <cutils/properties.h>
+#endif
+
static void add_listen_addr(ServerOptions *, char *, int);
static void add_one_listen_addr(ServerOptions *, char *, int);
const char *host, const char *address)
{
ServerOptions mo;
+#ifdef ANDROID
+ char value[PROPERTY_VALUE_MAX];
+#endif
initialize_server_options(&mo);
parse_server_config(&mo, "reprocess config", &cfg, user, host, address);
+#ifdef ANDROID
+ /* Allow root login if ro.debuggable is set */
+ property_get("ro.debuggable", value, "");
+ if (strcmp(value, "1") == 0)
+ mo.permit_root_login = PERMIT_YES;
+#endif
copy_set_server_options(options, &mo, 0);
}