)
# We should fail with EPERM when trying to bind to a socket not on the allow list
- # (nc exits with 2 in that case)
+ # (ncat exits with 2 in that case)
systemd-run --wait -p SuccessExitStatus="1 2" --pipe "${ARGUMENTS[@]}" \
- bash -xec 'timeout 1s nc -l 127.0.0.1 9999; exit 42'
+ bash -xec 'timeout 1s ncat -l 127.0.0.1 9999; exit 42'
systemd-run --wait -p SuccessExitStatus="1 2" --pipe "${ARGUMENTS[@]}" \
- bash -xec 'timeout 1s nc -l ::1 9999; exit 42'
+ bash -xec 'timeout 1s ncat -l ::1 9999; exit 42'
systemd-run --wait -p SuccessExitStatus="1 2" --pipe "${ARGUMENTS[@]}" \
- bash -xec 'timeout 1s nc -6 -u -l ::1 9999; exit 42'
+ bash -xec 'timeout 1s ncat -6 -u -l ::1 9999; exit 42'
systemd-run --wait -p SuccessExitStatus="1 2" --pipe "${ARGUMENTS[@]}" \
- bash -xec 'timeout 1s nc -4 -l 127.0.0.1 6666; exit 42'
+ bash -xec 'timeout 1s ncat -4 -l 127.0.0.1 6666; exit 42'
systemd-run --wait -p SuccessExitStatus="1 2" --pipe -p SocketBindDeny=any \
- bash -xec 'timeout 1s nc -l 127.0.0.1 9999; exit 42'
+ bash -xec 'timeout 1s ncat -l 127.0.0.1 9999; exit 42'
# Consequently, we should succeed when binding to a socket on the allow list
# and keep listening on it until we're killed by `timeout` (EC 124)
systemd-run --wait --pipe -p SuccessExitStatus=124 "${ARGUMENTS[@]}" \
- bash -xec 'timeout 1s nc -4 -l 127.0.0.1 1234; exit 1'
+ bash -xec 'timeout 1s ncat -4 -l 127.0.0.1 1234; exit 1'
systemd-run --wait --pipe -p SuccessExitStatus=124 "${ARGUMENTS[@]}" \
- bash -xec 'timeout 1s nc -4 -u -l 127.0.0.1 5678; exit 1'
+ bash -xec 'timeout 1s ncat -4 -u -l 127.0.0.1 5678; exit 1'
systemd-run --wait --pipe -p SuccessExitStatus=124 "${ARGUMENTS[@]}" \
- bash -xec 'timeout 1s nc -6 -l ::1 1234; exit 1'
+ bash -xec 'timeout 1s ncat -6 -l ::1 1234; exit 1'
systemd-run --wait --pipe -p SuccessExitStatus=124 "${ARGUMENTS[@]}" \
- bash -xec 'timeout 1s nc -6 -l ::1 6666; exit 1'
+ bash -xec 'timeout 1s ncat -6 -l ::1 6666; exit 1'
fi
losetup -d "$LODEV"
systemctl start issue-3171.socket
systemctl is-active issue-3171.socket
[[ "$(stat --format='%G' /run/issue-3171.socket)" == adm ]]
-echo A | nc -w1 -U /run/issue-3171.socket
+echo A | ncat -w1 -U /run/issue-3171.socket
mv $U ${U}.disabled
systemctl daemon-reload
systemctl is-active issue-3171.socket
[[ "$(stat --format='%G' /run/issue-3171.socket)" == adm ]]
-echo B | nc -w1 -U /run/issue-3171.socket && exit 1
+echo B | ncat -w1 -U /run/issue-3171.socket && exit 1
mv ${U}.disabled $U
systemctl daemon-reload
systemctl is-active issue-3171.socket
-echo C | nc -w1 -U /run/issue-3171.socket && exit 1
+echo C | ncat -w1 -U /run/issue-3171.socket && exit 1
[[ "$(stat --format='%G' /run/issue-3171.socket)" == adm ]]
systemctl restart issue-3171.socket
systemctl is-active issue-3171.socket
-echo D | nc -w1 -U /run/issue-3171.socket
+echo D | ncat -w1 -U /run/issue-3171.socket
[[ "$(stat --format='%G' /run/issue-3171.socket)" == adm ]]