mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
options: Set the global known_hosts file
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit ae6b0e0f49)
This commit is contained in:
committed by
Andreas Schneider
parent
b1a7bd21ad
commit
d877969db3
@@ -1370,6 +1370,17 @@ int ssh_options_apply(ssh_session session) {
|
|||||||
free(session->opts.knownhosts);
|
free(session->opts.knownhosts);
|
||||||
session->opts.knownhosts = tmp;
|
session->opts.knownhosts = tmp;
|
||||||
|
|
||||||
|
if (session->opts.global_knownhosts == NULL) {
|
||||||
|
tmp = strdup("/etc/ssh/ssh_known_hosts");
|
||||||
|
} else {
|
||||||
|
tmp = ssh_path_expand_escape(session, session->opts.global_knownhosts);
|
||||||
|
}
|
||||||
|
if (tmp == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
free(session->opts.global_knownhosts);
|
||||||
|
session->opts.global_knownhosts = tmp;
|
||||||
|
|
||||||
if (session->opts.ProxyCommand != NULL) {
|
if (session->opts.ProxyCommand != NULL) {
|
||||||
tmp = ssh_path_expand_escape(session, session->opts.ProxyCommand);
|
tmp = ssh_path_expand_escape(session, session->opts.ProxyCommand);
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user