#9610 ipa-client rpm post script creates always ssh_config.orig even if nothing needs to be changed
Closed: fixed by frenaud. Opened by frenaud.

What were you trying to do that didn't work?

The ipa-client rpm %post script has a cleanup command to remove 'HostKeyAlgorithms ssh-rsa,ssh-dss'.

The sed command doing this is always called, even if there is no HostKeyAlgorithms line in the /etc/ssh/ssh_config and because of the sed backup file option it also creates an unneeded ssh_config.orig file.

$ diff -u /etc/ssh/ssh_config.orig /etc/ssh/ssh_config

Please provide the package NVR for which bug is seen:

$ rpm -q ipa-client
ipa-client-4.11.0-10.el9_4.x86_64

Expected results:

Can the rpm %post please be updated to check also if the Sed command needs to be used? One additional grep the if-clause would prevent the sed command from running when nothing is going to be replaced

E.g. the following line can be used:

if [ -f "$SSH_CLIENT_SYSTEM_CONF" ] && grep -Eq '^(HostKeyAlgorithms ssh-rsa,ssh-dss)$'; then

Created as a clone of https://issues.redhat.com/browse/RHEL-41194


Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://issues.redhat.com/browse/RHEL-41194

Metadata Update from @frenaud:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/7397

master:

  • 8075512338836c82132ee51cb931611d84c9841d spec file: do not create /etc/ssh/ssh_config.orig if unchanged
  • 78e96707091e42e0b3e96cf04ac15ff3a93cca5b ipatests: add test for ticket 9610

ipa-4-12:

  • 09e66dc936cf2d99bcc44d60d6851aafa9ede46a spec file: do not create /etc/ssh/ssh_config.orig if unchanged
  • 4d51446bd3cd9ab222f9978f8f5def1f3a37fa0e ipatests: add test for ticket 9610

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://issues.redhat.com/browse/RHEL-41194, https://issues.redhat.com/browse/RHEL-46606 (was: https://issues.redhat.com/browse/RHEL-41194)

Metadata