Bug 1797540

Summary: rexecd prints incorrect IP addresses with -D
Product: [Fedora] Fedora Reporter: Michal Ruprich <mruprich>
Component: rshAssignee: Michal Ruprich <mruprich>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: luhliari, mruprich, msekleta, vonsch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rsh-0.17-92.fc30 rsh-0.17-93.fc31 rsh-0.17-93.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-12 01:40:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Ruprich 2020-02-03 11:35:34 UTC
Description of problem:
There is a bug in the netkit-rsh-0.17-ipv6-rexec.patch when it generates the address for reporting when no DNS mode is selected (-D).

Version-Release number of selected component (if applicable):
rsh-0.17-92.fc31

How reproducible:
Always

Steps to Reproduce:
1. Edit /usr/lib/systemd/system/rexec@.service, add -D in the ExecStart line:
 ExecStart=-/usr/sbin/in.rexecd -D

2. Start rexec.socket:
 #systemctl start rexec.socket

3. Connect to rexec:
 #rexec -l <user> -p <passwd> localhost 'echo hello'

Actual results:
The address shown in log(audit for instance) is utter nonsense:
... msg='op=PAM:setcred grantors=pam_securetty,pam_localuser,pam_unix acct="test" exe="/usr/sbin/in.rexecd" hostname=a00:c63c:: addr=a00:c63c:: ...
 
Expected results:
... msg='op=PAM:setcred grantors=pam_securetty,pam_localuser,pam_unix acct="test" exe="/usr/sbin/in.rexecd" hostname=::1 addr=::1 ...

Additional info:
The lines

  if (from.ss_family == AF_INET)
    remote = inet_ntop(AF_INET, &from, remote_addr, INET_ADDRSTRLEN);
  else
    remote = inet_ntop(AF_INET6, &from, remote_addr, INET6_ADDRSTRLEN);

should be

  if (from.ss_family == AF_INET)
    remote = inet_ntop(AF_INET, &((struct sockaddr_in *) &from)->sin_addr,
                        remote_addr, INET_ADDRSTRLEN);
  else
    remote = inet_ntop(AF_INET6, &((struct sockaddr_in6 *) &from)->sin6_addr,
                        remote_addr, INET6_ADDRSTRLEN);

Comment 1 Fedora Update System 2020-02-03 13:31:39 UTC
FEDORA-2020-30558f2e05 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2020-30558f2e05

Comment 2 Fedora Update System 2020-02-03 13:32:08 UTC
FEDORA-2020-b51f0fb25d has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b51f0fb25d

Comment 3 Fedora Update System 2020-02-04 00:59:27 UTC
rsh-0.17-93.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b51f0fb25d

Comment 4 Fedora Update System 2020-02-04 01:47:34 UTC
rsh-0.17-92.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-30558f2e05

Comment 5 Fedora Update System 2020-02-04 02:08:36 UTC
rsh-0.17-93.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-d2f02beacc

Comment 6 Fedora Update System 2020-02-12 01:40:57 UTC
rsh-0.17-92.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2020-02-12 02:14:58 UTC
rsh-0.17-93.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2020-02-19 02:06:12 UTC
rsh-0.17-93.el8 has been pushed to the Fedora EPEL 8 stable repository. If problems still persist, please make note of it in this bug report.