зеркало из https://github.com/Azure/sonic-openssh.git
- (djm) Replace "/bin/sh" with _PATH_BSHELL
- (djm) Replace "/usr/bin/login" with LOGIN_PROGRAM
This commit is contained in:
Родитель
8e81ed3081
Коммит
7b413d2d17
|
@ -1,6 +1,8 @@
|
||||||
20000701
|
20000701
|
||||||
- (djm) Fix Tru64 SIA problems reported by John P Speno <speno@isc.upenn.edu>
|
- (djm) Fix Tru64 SIA problems reported by John P Speno <speno@isc.upenn.edu>
|
||||||
- (djm) Login fixes from Tom Bertelson <tbert@abac.com>
|
- (djm) Login fixes from Tom Bertelson <tbert@abac.com>
|
||||||
|
- (djm) Replace "/bin/sh" with _PATH_BSHELL
|
||||||
|
- (djm) Replace "/usr/bin/login" with LOGIN_PROGRAM
|
||||||
|
|
||||||
20000628
|
20000628
|
||||||
- (djm) Fixes to lastlog code for Irix
|
- (djm) Fixes to lastlog code for Irix
|
||||||
|
|
10
session.c
10
session.c
|
@ -1057,9 +1057,9 @@ do_child(const char *command, struct passwd * pw, const char *term,
|
||||||
if (!options.use_login) {
|
if (!options.use_login) {
|
||||||
if (stat(SSH_USER_RC, &st) >= 0) {
|
if (stat(SSH_USER_RC, &st) >= 0) {
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
fprintf(stderr, "Running /bin/sh %s\n", SSH_USER_RC);
|
fprintf(stderr, "Running "_PATH_BSHELL" %s\n", SSH_USER_RC);
|
||||||
|
|
||||||
f = popen("/bin/sh " SSH_USER_RC, "w");
|
f = popen(_PATH_BSHELL " " SSH_USER_RC, "w");
|
||||||
if (f) {
|
if (f) {
|
||||||
if (auth_proto != NULL && auth_data != NULL)
|
if (auth_proto != NULL && auth_data != NULL)
|
||||||
fprintf(f, "%s %s\n", auth_proto, auth_data);
|
fprintf(f, "%s %s\n", auth_proto, auth_data);
|
||||||
|
@ -1068,9 +1068,9 @@ do_child(const char *command, struct passwd * pw, const char *term,
|
||||||
fprintf(stderr, "Could not run %s\n", SSH_USER_RC);
|
fprintf(stderr, "Could not run %s\n", SSH_USER_RC);
|
||||||
} else if (stat(SSH_SYSTEM_RC, &st) >= 0) {
|
} else if (stat(SSH_SYSTEM_RC, &st) >= 0) {
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
fprintf(stderr, "Running /bin/sh %s\n", SSH_SYSTEM_RC);
|
fprintf(stderr, "Running "_PATH_BSHELL" %s\n", SSH_SYSTEM_RC);
|
||||||
|
|
||||||
f = popen("/bin/sh " SSH_SYSTEM_RC, "w");
|
f = popen(_PATH_BSHELL " " SSH_SYSTEM_RC, "w");
|
||||||
if (f) {
|
if (f) {
|
||||||
if (auth_proto != NULL && auth_data != NULL)
|
if (auth_proto != NULL && auth_data != NULL)
|
||||||
fprintf(f, "%s %s\n", auth_proto, auth_data);
|
fprintf(f, "%s %s\n", auth_proto, auth_data);
|
||||||
|
@ -1160,7 +1160,7 @@ do_child(const char *command, struct passwd * pw, const char *term,
|
||||||
} else {
|
} else {
|
||||||
/* Launch login(1). */
|
/* Launch login(1). */
|
||||||
|
|
||||||
execl("/usr/bin/login", "login", "-h", get_remote_ipaddr(),
|
execl(LOGIN_PROGRAM, "login", "-h", get_remote_ipaddr(),
|
||||||
"-p", "-f", "--", pw->pw_name, NULL);
|
"-p", "-f", "--", pw->pw_name, NULL);
|
||||||
|
|
||||||
/* Login couldn't be executed, die. */
|
/* Login couldn't be executed, die. */
|
||||||
|
|
|
@ -108,15 +108,15 @@ ssh_proxy_connect(const char *host, u_short port, uid_t original_real_uid,
|
||||||
|
|
||||||
/* Stderr is left as it is so that error messages get
|
/* Stderr is left as it is so that error messages get
|
||||||
printed on the user's terminal. */
|
printed on the user's terminal. */
|
||||||
argv[0] = "/bin/sh";
|
argv[0] = _PATH_BSHELL;
|
||||||
argv[1] = "-c";
|
argv[1] = "-c";
|
||||||
argv[2] = command_string;
|
argv[2] = command_string;
|
||||||
argv[3] = NULL;
|
argv[3] = NULL;
|
||||||
|
|
||||||
/* Execute the proxy command. Note that we gave up any
|
/* Execute the proxy command. Note that we gave up any
|
||||||
extra privileges above. */
|
extra privileges above. */
|
||||||
execv("/bin/sh", argv);
|
execv(_PATH_BSHELL, argv);
|
||||||
perror("/bin/sh");
|
perror(_PATH_BSHELL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
/* Parent. */
|
/* Parent. */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче