Skip to content

Commit 4ef4241

Browse files
aplopezalexey-tikhonov
authored andcommitted
SSH: Remove sss_ssh_knownhostsproxy and keep the stub
The --with-ssh-known-host-proxy option is removed from ./configure. The tool sss_ssh_knownhostproxy is removed along with all the code specific to it and its man page. The stub displaying an error message is kept, and is the only thing that is now built. The RPM's post-install script deletes any remaining /var/lib/sss/pubconf/known_hosts file. :relnote: The deprecated tool 'sss_ssh_knownhostsproxy' was finally removed, together with the './configure' option '--with-ssh-known-host-proxy' used to built it. It is now replaced by a stub which displays an error message. Instead of this tool, you must now use 'sss_ssh_knownhosts`. Please check the sss_ssh_knownhosts(1) man page for detailed information. Reviewed-by: Iker Pedrosa <[email protected]> Reviewed-by: Tomáš Halman <[email protected]>
1 parent aebb4e1 commit 4ef4241

15 files changed

+4
-939
lines changed

Makefile.am

+2-8
Original file line numberDiff line numberDiff line change
@@ -1571,10 +1571,7 @@ sssd_ssh_SOURCES = \
15711571
src/responder/ssh/ssh_cert_to_ssh_key.c \
15721572
$(SSSD_RESPONDER_OBJ) \
15731573
$(NULL)
1574-
if BUILD_SSH_KNOWN_HOSTS_PROXY
1575-
sssd_ssh_SOURCES += \
1576-
src/responder/ssh/ssh_known_hosts.c
1577-
endif
1574+
15781575
sssd_ssh_LDADD = \
15791576
$(LIBADD_DL) \
15801577
$(SSSD_LIBS) \
@@ -2604,10 +2601,7 @@ ssh_srv_tests_SOURCES = \
26042601
src/responder/ssh/ssh_reply.c \
26052602
src/responder/ssh/ssh_cert_to_ssh_key.c \
26062603
$(NULL)
2607-
if BUILD_SSH_KNOWN_HOSTS_PROXY
2608-
ssh_srv_tests_SOURCES += \
2609-
src/responder/ssh/ssh_known_hosts.c
2610-
endif
2604+
26112605
ssh_srv_tests_CFLAGS = \
26122606
-U SSSD_LIBEXEC_PATH -DSSSD_LIBEXEC_PATH=\"$(abs_builddir)\" \
26132607
-I$(abs_builddir)/src \

configure.ac

-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ WITH_SUBID
186186
WITH_SUBID_LIB_PATH
187187
WITH_PASSKEY
188188
WITH_SSH
189-
WITH_SSH_KNOWN_HOSTS_PROXY
190189
WITH_SYSLOG
191190
WITH_SAMBA
192191
WITH_NFS

contrib/sssd.spec.in

+1-12
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@
3737

3838
%global build_passkey 1
3939

40-
%if 0%{?fedora} >= 41 || 0%{?rhel} >= 10
41-
%global build_ssh_known_hosts_proxy 0
42-
%else
43-
%global build_ssh_known_hosts_proxy 1
44-
%endif
45-
4640
# we don't want to provide private python extension libs
4741
%define __provides_exclude_from %{python3_sitearch}/.*\.so$
4842

@@ -574,9 +568,6 @@ autoreconf -ivf
574568
%endif
575569
%if %{build_passkey}
576570
--with-passkey \
577-
%endif
578-
%if %{build_ssh_known_hosts_proxy}
579-
--with-ssh-known-hosts-proxy \
580571
%endif
581572
%{nil}
582573

@@ -818,9 +809,6 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf
818809
%{_datadir}/sssd/cfg_rules.ini
819810
%{_mandir}/man1/sss_ssh_authorizedkeys.1*
820811
%{_mandir}/man1/sss_ssh_knownhosts.1*
821-
%if %{build_ssh_known_hosts_proxy}
822-
%{_mandir}/man1/sss_ssh_knownhostsproxy.1*
823-
%endif
824812
%{_mandir}/man5/sssd.conf.5*
825813
%{_mandir}/man5/sssd-simple.5*
826814
%{_mandir}/man5/sssd-sudo.5*
@@ -1062,6 +1050,7 @@ getent passwd sssd >/dev/null || useradd -r -g sssd -d /run/sssd -s /sbin/nologi
10621050
%__rm -f %{mcpath}/group
10631051
%__rm -f %{mcpath}/initgroups
10641052
%__rm -f %{mcpath}/sid
1053+
%__rm -f %{pubconfpath}/known_hosts
10651054
%__chown -f -R root:%{sssd_user} %{_sysconfdir}/sssd || true
10661055
%__chmod -f -R g+r %{_sysconfdir}/sssd || true
10671056
%__chown -f %{sssd_user}:%{sssd_user} %{dbpath}/* || true

src/conf_macros.m4

-16
Original file line numberDiff line numberDiff line change
@@ -709,22 +709,6 @@ AC_DEFUN([WITH_SSH],
709709
AM_CONDITIONAL([BUILD_SSH], [test x"$with_ssh" = xyes])
710710
])
711711

712-
AC_DEFUN([WITH_SSH_KNOWN_HOSTS_PROXY],
713-
[ AC_ARG_WITH([ssh-known-hosts-proxy],
714-
[AC_HELP_STRING([--with-ssh-known-hosts-proxy],
715-
[Whether to build the sss_ssh_knownhostsproxy tool [no]]
716-
)
717-
],
718-
[with_ssh_know_hosts_proxy=$withval],
719-
with_ssh_know_hosts_proxy=no
720-
)
721-
722-
if test x"$with_ssh" = xyes -a x"$with_ssh_know_hosts_proxy" = xyes; then
723-
AC_DEFINE(BUILD_SSH_KNOWN_HOSTS_PROXY, 1, [whether to build the sss_ssh_knownhostsproxy tool])
724-
fi
725-
AM_CONDITIONAL([BUILD_SSH_KNOWN_HOSTS_PROXY], [test x"$with_ssh" = xyes -a x"$with_ssh_know_hosts_proxy" = xyes])
726-
])
727-
728712
AC_DEFUN([WITH_SAMBA],
729713
[ AC_ARG_WITH([samba],
730714
[AC_HELP_STRING([--with-samba],

src/confdb/confdb.h

-10
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,6 @@
168168

169169
/* SSH */
170170
#define CONFDB_SSH_CONF_ENTRY "config/ssh"
171-
#ifdef BUILD_SSH_KNOWN_HOSTS_PROXY
172-
/****************************************************************************
173-
* Don't forget to update src/config/cfg_rules.ini when these options are
174-
* definitively removed.
175-
****************************************************************************/
176-
#define CONFDB_SSH_HASH_KNOWN_HOSTS "ssh_hash_known_hosts"
177-
#define CONFDB_DEFAULT_SSH_HASH_KNOWN_HOSTS false
178-
#define CONFDB_SSH_KNOWN_HOSTS_TIMEOUT "ssh_known_hosts_timeout"
179-
#define CONFDB_DEFAULT_SSH_KNOWN_HOSTS_TIMEOUT 180
180-
#endif
181171
#define CONFDB_SSH_CA_DB "ca_db"
182172
#define CONFDB_DEFAULT_SSH_CA_DB SYSCONFDIR"/sssd/pki/sssd_auth_ca_db.pem"
183173
#define CONFDB_SSH_USE_CERT_KEYS "ssh_use_certificate_keys"

src/config/cfg_rules.ini

-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ option = responder_idle_timeout
202202
option = cache_first
203203

204204
# ssh service
205-
option = ssh_hash_known_hosts
206-
option = ssh_known_hosts_timeout
207205
option = ca_db
208206
option = ssh_use_certificate_keys
209207
option = ssh_use_certificate_matching_rules

src/man/Makefile.am

+1-7
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ AUTOFS_CONDS = ;with_autofs
1717
endif
1818
if BUILD_SSH
1919
SSH_CONDS = ;with_ssh
20-
if BUILD_SSH_KNOWN_HOSTS_PROXY
21-
SSH_KNOWN_HOSTS_PROXY_CONDS = ;with_ssh_known_hosts_proxy
22-
endif
2320
endif
2421
if BUILD_PAC_RESPONDER
2522
PAC_RESPONDER_CONDS = ;with_pac_responder
@@ -68,7 +65,7 @@ LIBNL_CONDS = ;have_libnl
6865
endif
6966

7067

71-
CONDS = with_false$(SUDO_CONDS)$(AUTOFS_CONDS)$(SSH_CONDS)$(SSH_KNOWN_HOSTS_PROXY_CONDS)$(PAC_RESPONDER_CONDS)$(GPO_CONDS)$(SYSTEMD_CONDS)$(KCM_CONDS)$(STAP_CONDS)$(KCM_RENEWAL_CONDS)$(LOCKFREE_CLIENT_CONDS)$(HAVE_INOTIFY_CONDS)$(PASSKEY_CONDS)$(SSSD_NON_ROOT_USER_CONDS)$(ENUM_CONDS)$(LIBNL_CONDS)$(AD_CONDS)
68+
CONDS = with_false$(SUDO_CONDS)$(AUTOFS_CONDS)$(SSH_CONDS)$(PAC_RESPONDER_CONDS)$(GPO_CONDS)$(SYSTEMD_CONDS)$(KCM_CONDS)$(STAP_CONDS)$(KCM_RENEWAL_CONDS)$(LOCKFREE_CLIENT_CONDS)$(HAVE_INOTIFY_CONDS)$(PASSKEY_CONDS)$(SSSD_NON_ROOT_USER_CONDS)$(ENUM_CONDS)$(LIBNL_CONDS)$(AD_CONDS)
7269

7370

7471
#Special Rules:
@@ -98,9 +95,6 @@ endif
9895
if BUILD_SSH
9996
man_MANS += sss_ssh_authorizedkeys.1 \
10097
sss_ssh_knownhosts.1
101-
if BUILD_SSH_KNOWN_HOSTS_PROXY
102-
man_MANS += sss_ssh_knownhostsproxy.1
103-
endif
10498
endif
10599

106100
if BUILD_SUDO

src/man/po/po4a.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
[type:docbook] sss_rpcidmapd.5.xml $lang:$(builddir)/$lang/sss_rpcidmapd.5.xml
2222
[type:docbook] sss_ssh_authorizedkeys.1.xml $lang:$(builddir)/$lang/sss_ssh_authorizedkeys.1.xml
2323
[type:docbook] sss_ssh_knownhosts.1.xml $lang:$(builddir)/$lang/sss_ssh_knownhosts.1.xml
24-
[type:docbook] sss_ssh_knownhostsproxy.1.xml $lang:$(builddir)/$lang/sss_ssh_knownhostsproxy.1.xml
2524
[type:docbook] idmap_sss.8.xml $lang:$(builddir)/$lang/idmap_sss.8.xml
2625
[type:docbook] sssctl.8.xml $lang:$(builddir)/$lang/sssctl.8.xml
2726
[type:docbook] sssd-session-recording.5.xml $lang:$(builddir)/$lang/sssd-session-recording.5.xml

src/man/sss_ssh_knownhostsproxy.1.xml

-122
This file was deleted.

src/man/sssd.conf.5.xml

-24
Original file line numberDiff line numberDiff line change
@@ -2062,30 +2062,6 @@ pam_gssapi_indicators_map = sudo:pkinit, sudo-i:pkinit
20622062
These options can be used to configure the SSH service.
20632063
</para>
20642064
<variablelist>
2065-
<varlistentry condition="with_ssh_known_hosts_proxy">
2066-
<term>ssh_hash_known_hosts (bool)</term>
2067-
<listitem>
2068-
<para>
2069-
Whether or not to hash host names and addresses in
2070-
the managed known_hosts file.
2071-
</para>
2072-
<para>
2073-
Default: false
2074-
</para>
2075-
</listitem>
2076-
</varlistentry>
2077-
<varlistentry condition="with_ssh_known_hosts_proxy">
2078-
<term>ssh_known_hosts_timeout (integer)</term>
2079-
<listitem>
2080-
<para>
2081-
How many seconds to keep a host in the managed
2082-
known_hosts file after its host keys were requested.
2083-
</para>
2084-
<para>
2085-
Default: 180
2086-
</para>
2087-
</listitem>
2088-
</varlistentry>
20892065
<varlistentry>
20902066
<term>ssh_use_certificate_keys (bool)</term>
20912067
<listitem>

src/responder/ssh/ssh_cmd.c

-29
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,6 @@ ssh_check_non_sssd_user(const char *username)
5454
}
5555

5656

57-
#ifdef BUILD_SSH_KNOWN_HOSTS_PROXY
58-
static struct sss_domain_info *
59-
ssh_get_result_domain(struct resp_ctx *rctx,
60-
struct cache_req_result *result,
61-
const char *name)
62-
{
63-
if (result != NULL) {
64-
return result->domain;
65-
}
66-
67-
return find_domain_by_name(rctx->domains, name, true);
68-
}
69-
#endif
70-
7157
static void ssh_cmd_get_user_pubkeys_done(struct tevent_req *subreq);
7258

7359
static errno_t ssh_cmd_get_user_pubkeys(struct cli_ctx *cli_ctx)
@@ -361,27 +347,12 @@ static void ssh_cmd_get_host_pubkeys_done(struct tevent_req *subreq)
361347
struct cache_req_result *result = NULL;
362348
struct ssh_cmd_ctx *cmd_ctx;
363349
errno_t ret;
364-
#ifdef BUILD_SSH_KNOWN_HOSTS_PROXY
365-
struct sss_domain_info *domain;
366-
struct ssh_ctx *ssh_ctx;
367-
#endif
368350

369351
cmd_ctx = tevent_req_callback_data(subreq, struct ssh_cmd_ctx);
370352

371353
ret = cache_req_ssh_host_id_by_name_recv(cmd_ctx, subreq, &result);
372354
talloc_zfree(subreq);
373355

374-
#ifdef BUILD_SSH_KNOWN_HOSTS_PROXY
375-
if (ret == EOK || ret == ENOENT) {
376-
ssh_ctx = talloc_get_type(cmd_ctx->cli_ctx->rctx->pvt_ctx, struct ssh_ctx);
377-
domain = ssh_get_result_domain(ssh_ctx->rctx, result, cmd_ctx->domain);
378-
379-
ssh_update_known_hosts_file(ssh_ctx->rctx->domains, domain,
380-
cmd_ctx->name, ssh_ctx->hash_known_hosts,
381-
ssh_ctx->known_hosts_timeout);
382-
}
383-
#endif
384-
385356
if (ret != EOK) {
386357
ssh_protocol_done(cmd_ctx->cli_ctx, ret);
387358
goto done;

0 commit comments

Comments
 (0)