• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Farhan/openssh


Commit MetaInfo

Revisionf11ba899d5c04b2e0445e0b47cbf26d89ced4f7d (tree)
Time2018-02-16 07:12:27
AuthorElliott Hughes <enh@goog...>
CommiterElliott Hughes

Log Message

Remove assumption that _PATH_BSHELL is a compile-time constant.

The alternative would be to build sshd using the (V)NDK, and I initially
went down that route but the because (a) we build sshd for API level 19
and (b) there are a couple of dependencies on non-NDK libraries/headers,
that's a significantly larger and more complicated change.

One day, when we don't have to support anything older than API 23 we
can remove most/all of the Android-specific changes in this project,
at which time we should drop this change and just build with the (V)NDK.

Bug: http://b/67975799
Test: builds
Change-Id: If6be7947e69b24cfa514a17bee6fef3cfbddc236

Change Summary

Incremental Difference

--- a/session.c
+++ b/session.c
@@ -1201,7 +1201,14 @@ do_rc_files(Session *s, const char *shell)
12011201 if (debug_flag)
12021202 fprintf(stderr, "Running %s %s\n", _PATH_BSHELL,
12031203 _PATH_SSH_SYSTEM_RC);
1204+#ifdef __ANDROID__
1205+ /* _PATH_BSHELL is not a compile-time constant on Android. */
1206+ snprintf(cmd, sizeof cmd, "%s %s", _PATH_BSHELL,
1207+ _PATH_SSH_SYSTEM_RC);
1208+ f = popen(cmd, "w");
1209+#else
12041210 f = popen(_PATH_BSHELL " " _PATH_SSH_SYSTEM_RC, "w");
1211+#endif
12051212 if (f) {
12061213 if (do_xauth)
12071214 fprintf(f, "%s %s\n", s->auth_proto,