mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
options: Set the global known_hosts file
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
bdb3bb9ccd
commit
ae6b0e0f49
@@ -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