Bugzilla – Attachment 3414 Details for
Bug 3185
.ssh/rc: No such file or directory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Make sshrc use absolute path
ssh-userrc-absolute-path.patch (text/plain), 1.51 KB, created by
Darren Tucker
on 2020-06-22 11:13:50 AEST
(
hide
)
Description:
Make sshrc use absolute path
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2020-06-22 11:13:50 AEST
Size:
1.51 KB
patch
obsolete
>Index: session.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/session.c,v >retrieving revision 1.319 >diff -u -p -r1.319 session.c >--- session.c 13 Mar 2020 03:17:07 -0000 1.319 >+++ session.c 22 Jun 2020 01:08:31 -0000 >@@ -966,19 +966,20 @@ static void > do_rc_files(struct ssh *ssh, Session *s, const char *shell) > { > FILE *f = NULL; >- char cmd[1024]; >+ char cmd[1024], *user_rc = NULL; > int do_xauth; > struct stat st; > > do_xauth = > s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL; >+ user_rc = tilde_expand_filename("~/" _PATH_SSH_USER_RC, getuid()); > > /* ignore _PATH_SSH_USER_RC for subsystems and admin forced commands */ > if (!s->is_subsystem && options.adm_forced_command == NULL && > auth_opts->permit_user_rc && options.permit_user_rc && >- stat(_PATH_SSH_USER_RC, &st) >= 0) { >+ stat(user_rc, &st) >= 0) { > snprintf(cmd, sizeof cmd, "%s -c '%s %s'", >- shell, _PATH_BSHELL, _PATH_SSH_USER_RC); >+ shell, _PATH_BSHELL, user_rc); > if (debug_flag) > fprintf(stderr, "Running %s\n", cmd); > f = popen(cmd, "w"); >@@ -989,7 +990,7 @@ do_rc_files(struct ssh *ssh, Session *s, > pclose(f); > } else > fprintf(stderr, "Could not run %s\n", >- _PATH_SSH_USER_RC); >+ user_rc); > } else if (stat(_PATH_SSH_SYSTEM_RC, &st) >= 0) { > if (debug_flag) > fprintf(stderr, "Running %s %s\n", _PATH_BSHELL, >@@ -1029,6 +1030,7 @@ do_rc_files(struct ssh *ssh, Session *s, > cmd); > } > } >+ free(user_rc); > } > > static void
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 3185
: 3414