Farhan/openssh
Revision | f11ba899d5c04b2e0445e0b47cbf26d89ced4f7d (tree) |
---|---|
Time | 2018-02-16 07:12:27 |
Author | Elliott Hughes <enh@goog...> |
Commiter | Elliott Hughes |
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
@@ -1201,7 +1201,14 @@ do_rc_files(Session *s, const char *shell) | ||
1201 | 1201 | if (debug_flag) |
1202 | 1202 | fprintf(stderr, "Running %s %s\n", _PATH_BSHELL, |
1203 | 1203 | _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 | |
1204 | 1210 | f = popen(_PATH_BSHELL " " _PATH_SSH_SYSTEM_RC, "w"); |
1211 | +#endif | |
1205 | 1212 | if (f) { |
1206 | 1213 | if (do_xauth) |
1207 | 1214 | fprintf(f, "%s %s\n", s->auth_proto, |