Bug 1312703 - tcpcryptd: Package systemd ExecStartPre/ExecStopPost script broken.
Summary: tcpcryptd: Package systemd ExecStartPre/ExecStopPost script broken.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: tcpcrypt
Version: 23
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Paul Wouters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1213128
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-29 00:51 UTC by Edward O'Callaghan
Modified: 2016-12-20 19:05 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 19:05:33 UTC
Type: Bug


Attachments (Terms of Use)
firewalld ruleset (597 bytes, application/xml)
2016-02-29 21:53 UTC, Edward O'Callaghan
no flags Details

Description Edward O'Callaghan 2016-02-29 00:51:33 UTC
Hi,

For the following package:

$ rpm -q tcpcrypt
tcpcrypt-0.4-0.4.bb990b1b.fc23.x86_64

Which contains the following files:

$ rpm -ql tcpcrypt
/run/tcpcryptd
/usr/bin/tcnetstat
/usr/bin/tcpcryptd
/usr/bin/tcpcryptd-firewall
/usr/bin/tcs
/usr/lib/systemd/system/tcpcryptd.service
/usr/lib/tmpfiles.d/tcpcrypt.conf
/usr/share/doc/tcpcrypt
/usr/share/doc/tcpcrypt/LICENSE
/usr/share/doc/tcpcrypt/README.markdown
/usr/share/man/man8/tcnetstat.8.gz
/usr/share/man/man8/tcpcryptd.8.gz

The following systemd manifest:

$ cat /usr/lib/systemd/system/tcpcryptd.service
[Unit]
Description=tcpcryptd Server
After=syslog.target network.target

[Service]
Type=simple
ExecStartPre=mkdir -p /var/run/tcpcryptd
ExecStartPre=/usr/bin/tcpcryptd-firewall start
ExecStart=/usr/bin/tcpcryptd -f -x 0x10
ExecStopPost=/usr/bin/tcpcryptd-firewall stop

[Install]
WantedBy=multi-user.target

Runs the following script:

$ cat /usr/bin/tcpcryptd-firewall 
#!/bin/sh

if [ "$1" == "start" ]
then
        iptables -t raw -N tcpcrypt
        iptables -t raw -A tcpcrypt -p tcp -m mark --mark 0x0/0x10 -j NFQUEUE --queue-num 666
        iptables -t raw -I PREROUTING -j tcpcrypt

        iptables -t mangle -N tcpcrypt
        iptables -t mangle -A tcpcrypt -p tcp -m mark --mark 0x0/0x10 -j NFQUEUE --queue-num 666
        iptables -t mangle -I POSTROUTING -j tcpcrypt
 
        # launch `tcpcryptd` with `-x 0x10`
fi
if [ "$1" == "stop" ]
then
        iptables -t raw -F tcpcrypt
        iptables -t raw -D PREROUTING -j tcpcrypt

        iptables -t mangle -F tcpcrypt
        iptables -t mangle -D PREROUTING -j tcpcrypt
fi


*However*, Fedora uses firewalld and not iptables by default and as such the script needs to be patched so that this package can work out the box in the excepted manner.

Kind Regards,
Edward.

Comment 1 Edward O'Callaghan 2016-02-29 21:53:22 UTC
Created attachment 1131722 [details]
firewalld ruleset

Put in `/etc/firewalld/direct.xml' then run:

$ sudo firewall-cmd --reload
$ sudo firewall-cmd --direct --get-rules ipv4 raw tcpcrypt
$ sudo firewall-cmd --direct --get-rules ipv4 mangle tcpcrypt

However, checking http://tcpcrypt.org/test.php does not show things seem to work as expected :/ so there is still a minor issue somewhere?

Comment 2 Paul Wouters 2016-03-08 20:22:24 UTC
note I pushed a fixed package in rawhide. But while it shows crypted status with tcnetstat, it causes packetflow issues to the test site tcpcrypt.org, so I'm talking to upstream about what's going on.

Comment 3 Edward O'Callaghan 2016-04-17 10:24:18 UTC
(In reply to Paul Wouters from comment #2)
> note I pushed a fixed package in rawhide. But while it shows crypted status
> with tcnetstat, it causes packetflow issues to the test site tcpcrypt.org,
> so I'm talking to upstream about what's going on.

Thank you for keeping this up to date Paul, please continue to do so!

Comment 4 Fedora End Of Life 2016-11-24 15:49:13 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2016-12-20 19:05:33 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.