Merge pull request #19982 from sternenseemann/netcat

Make netcat-openbsd the default netcat
This commit is contained in:
Tim Steinbach 2016-11-02 19:44:29 -04:00 committed by GitHub
commit 04b22dd935
10 changed files with 23 additions and 20 deletions

View file

@ -13,7 +13,7 @@ import ./make-test.nix (pkgs: {
networking.firewall.allowedTCPPorts = [ 4444 ];
systemd.services.listener.serviceConfig.ExecStart = "${pkgs.netcat}/bin/nc -l -p 4444";
systemd.services.listener.serviceConfig.ExecStart = "${pkgs.netcat}/bin/nc -l 4444";
};
probe = { config, lib, pkgs, ...}: {
@ -36,7 +36,7 @@ import ./make-test.nix (pkgs: {
$machine->waitForShutdown;
$machine->start;
$probe->waitForUnit("network.target");
$probe->waitUntilSucceeds("echo test | nc -c machine 4444");
$probe->waitUntilSucceeds("echo test | nc machine 4444");
'';
})

View file

@ -299,9 +299,9 @@ let
-pf /run/dhclient.pid \
-v eth0 eth1
otherIP="$(${pkgs.netcat}/bin/netcat -clp 1234 || :)"
otherIP="$(${pkgs.netcat}/bin/nc -l 1234 || :)"
${pkgs.iputils}/bin/ping -I eth1 -c1 "$otherIP"
echo "$otherIP reachable" | ${pkgs.netcat}/bin/netcat -clp 5678 || :
echo "$otherIP reachable" | ${pkgs.netcat}/bin/nc -l 5678 || :
'';
sysdDetectVirt = pkgs: ''
@ -461,11 +461,11 @@ in mapAttrs mkVBoxTest {
my $test1IP = waitForIP_test1 1;
my $test2IP = waitForIP_test2 1;
$machine->succeed("echo '$test2IP' | netcat -c '$test1IP' 1234");
$machine->succeed("echo '$test1IP' | netcat -c '$test2IP' 1234");
$machine->succeed("echo '$test2IP' | nc '$test1IP' 1234");
$machine->succeed("echo '$test1IP' | nc '$test2IP' 1234");
$machine->waitUntilSucceeds("netcat -c '$test1IP' 5678 >&2");
$machine->waitUntilSucceeds("netcat -c '$test2IP' 5678 >&2");
$machine->waitUntilSucceeds("nc '$test1IP' 5678 >&2");
$machine->waitUntilSucceeds("nc '$test2IP' 5678 >&2");
shutdownVM_test1;
shutdownVM_test2;

View file

@ -7,7 +7,7 @@
, gnupg1compat
, icoutils
, imagemagick
, netcat
, netcat-gnu
, p7zip
, python2Packages
, unzip
@ -34,7 +34,7 @@ let
gnupg1compat
icoutils
imagemagick
netcat
netcat-gnu
p7zip
unzip
wget

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl, vmTools, writeScript, writeText, runCommand, makeInitrd
, python, perl, coreutils, dosfstools, gzip, mtools, netcat, openssh, qemu
, python, perl, coreutils, dosfstools, gzip, mtools, netcat-gnu, openssh, qemu
, samba, socat, vde2, cdrkit, pathsFromGraph, gnugrep
}:
@ -10,7 +10,7 @@ with stdenv.lib;
let
controller = import ./controller {
inherit stdenv writeScript vmTools makeInitrd;
inherit samba vde2 openssh socat netcat coreutils gzip gnugrep;
inherit samba vde2 openssh socat netcat-gnu coreutils gzip gnugrep;
};
mkCygwinImage = import ./cygwin-iso {

View file

@ -1,5 +1,5 @@
{ stdenv, writeScript, vmTools, makeInitrd
, samba, vde2, openssh, socat, netcat, coreutils, gnugrep, gzip
, samba, vde2, openssh, socat, netcat-gnu, coreutils, gnugrep, gzip
}:
{ sshKey
@ -79,7 +79,7 @@ let
${coreutils}/bin/chmod 600 /ssh.key
'' + (if installMode then ''
echo -n "Waiting for Windows installation to finish..."
while ! ${netcat}/bin/netcat -z 192.168.0.1 22; do
while ! ${netcat-gnu}/bin/netcat -z 192.168.0.1 22; do
echo -n .
# Print a dot every 10 seconds only to shorten line length.
${coreutils}/bin/sleep 10
@ -118,7 +118,7 @@ let
${samba}/sbin/smbd -D
echo -n "Waiting for Windows VM to become available..."
while ! ${netcat}/bin/netcat -z 192.168.0.1 22; do
while ! ${netcat-gnu}/bin/netcat -z 192.168.0.1 22; do
echo -n .
${coreutils}/bin/sleep 1
done

View file

@ -3,7 +3,7 @@ pkgs:
let
bootstrapper = import ./bootstrap.nix {
inherit (pkgs) stdenv vmTools writeScript writeText runCommand makeInitrd;
inherit (pkgs) coreutils dosfstools gzip mtools netcat openssh qemu samba;
inherit (pkgs) coreutils dosfstools gzip mtools netcat-gnu openssh qemu samba;
inherit (pkgs) socat vde2 fetchurl python perl cdrkit pathsFromGraph;
inherit (pkgs) gnugrep;
};

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, intltool, gnome2, libxfce4ui,
libxfce4util, xfce4panel, libnotify, lm_sensors, hddtemp, netcat
libxfce4util, xfce4panel, libnotify, lm_sensors, hddtemp, netcat-gnu
}:
stdenv.mkDerivation rec {
@ -26,14 +26,14 @@ stdenv.mkDerivation rec {
libnotify
lm_sensors
hddtemp
netcat
netcat-gnu
];
enableParallelBuilding = true;
configureFlags = [
"--with-pathhddtemp=${hddtemp}/bin/hddtemp"
"--with-pathnetcat=${netcat}/bin/netcat"
"--with-pathnetcat=${netcat-gnu}/bin/netcat"
];
meta = {

View file

@ -21,6 +21,7 @@ stdenv.mkDerivation rec {
installPhase = ''
install -Dm0755 nc $out/bin/nc
install -Dm0644 nc.1 $out/share/man/man1/nc.1
'';
meta = {

View file

@ -2816,7 +2816,9 @@ in
netboot = callPackage ../tools/networking/netboot {};
netcat = callPackage ../tools/networking/netcat { };
netcat = netcat-openbsd;
netcat-gnu = callPackage ../tools/networking/netcat-gnu { };
netcat-openbsd = callPackage ../tools/networking/netcat-openbsd { };