about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/tools/networking/network-manager/0.9.8.nix58
-rw-r--r--pkgs/tools/networking/network-manager/libnl-3.2.25.patch61
-rw-r--r--pkgs/top-level/all-packages.nix3
3 files changed, 122 insertions, 0 deletions
diff --git a/pkgs/tools/networking/network-manager/0.9.8.nix b/pkgs/tools/networking/network-manager/0.9.8.nix
new file mode 100644
index 000000000000..fe19550bc67f
--- /dev/null
+++ b/pkgs/tools/networking/network-manager/0.9.8.nix
@@ -0,0 +1,58 @@
+{ stdenv, fetchurl, intltool, pkgconfig, dbus_glib
+, udev, libnl, libuuid, gnutls, dhcp
+, libgcrypt, perl }:
+
+stdenv.mkDerivation rec {
+  name = "network-manager-${version}";
+  version = "0.9.8.10";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/NetworkManager/0.9/NetworkManager-${version}.tar.xz";
+    sha256 = "0wn9qh8r56r8l19dqr68pdl1rv3zg1dv47rfy6fqa91q7li2fk86";
+  };
+
+  preConfigure = ''
+    substituteInPlace tools/glib-mkenums --replace /usr/bin/perl ${perl}/bin/perl
+  '';
+
+  # Right now we hardcode quite a few paths at build time. Probably we should
+  # patch networkmanager to allow passing these path in config file. This will
+  # remove unneeded build-time dependencies.
+  configureFlags = [
+    "--with-distro=exherbo"
+    "--with-dhclient=${dhcp}/sbin/dhclient"
+    "--with-dhcpcd=no"
+    "--with-iptables=no"
+    "--with-udev-dir=\${out}/lib/udev"
+    "--with-resolvconf=no"
+    "--sysconfdir=/etc" "--localstatedir=/var"
+    "--with-dbus-sys-dir=\${out}/etc/dbus-1/system.d"
+    "--with-crypto=gnutls" "--disable-more-warnings"
+    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+    "--with-kernel-firmware-dir=/run/current-system/firmware"
+    "--disable-ppp"
+  ];
+
+  buildInputs = [ udev libnl libuuid gnutls libgcrypt ];
+
+  propagatedBuildInputs = [ dbus_glib ];
+
+  nativeBuildInputs = [ intltool pkgconfig ];
+
+  patches =
+    [ ./libnl-3.2.25.patch
+      ./nixos-purity.patch
+    ];
+
+  preInstall =
+    ''
+      installFlagsArray=( "sysconfdir=$out/etc" "localstatedir=$out/var" )
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = http://projects.gnome.org/NetworkManager/;
+    description = "Network configuration and management tool";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/networking/network-manager/libnl-3.2.25.patch b/pkgs/tools/networking/network-manager/libnl-3.2.25.patch
new file mode 100644
index 000000000000..17c2966b7064
--- /dev/null
+++ b/pkgs/tools/networking/network-manager/libnl-3.2.25.patch
@@ -0,0 +1,61 @@
+diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c
+index ba8053e..5ac39d3 100644
+--- a/src/nm-netlink-monitor.c
++++ b/src/nm-netlink-monitor.c
+@@ -177,40 +177,15 @@ link_msg_handler (struct nl_object *obj, void *arg)
+ static int
+ event_msg_recv (struct nl_msg *msg, void *arg)
+ {
+-	struct nl_sock *nlh = arg;
+-	struct nlmsghdr *hdr = nlmsg_hdr (msg);
+ 	struct ucred *creds = nlmsg_get_creds (msg);
+-	const struct sockaddr_nl *snl;
+-	guint32 local_port;
+-	gboolean accept_msg = FALSE;
+-
+-	/* Only messages sent from the kernel */
+-	if (!creds || creds->uid != 0) {
+-		nm_log_dbg (LOGD_HW, "ignoring netlink message from UID %d",
+-		            creds ? creds->uid : -1);
+-		return NL_SKIP;
+-	}
+-
+-	snl = nlmsg_get_src (msg);
+-	g_assert (snl);
+-
+-	/* Accept any messages from the kernel */
+-	if (hdr->nlmsg_pid == 0 || snl->nl_pid == 0)
+-		accept_msg = TRUE;
+ 
+-	/* And any multicast message directed to our netlink PID, since multicast
+-	 * currently requires CAP_ADMIN to use.
+-	 */
+-	local_port = nl_socket_get_local_port (nlh);
+-	if ((hdr->nlmsg_pid == local_port) && snl->nl_groups)
+-		accept_msg = TRUE;
+-
+-	if (accept_msg == FALSE) {
+-		nm_log_dbg (LOGD_HW, "ignoring netlink message from PID %d (local PID %d, multicast %d)",
+-		            hdr->nlmsg_pid,
+-		            local_port,
+-		            (hdr->nlmsg_flags & NLM_F_MULTI));
+-		return NL_SKIP;
++	if (!creds || creds->pid || creds->uid || creds->gid) {
++		if (creds)
++			nm_log_dbg (LOGD_HW, "netlink: received non-kernel message (pid %d uid %d gid %d)",
++			            creds->pid, creds->uid, creds->gid);
++		else
++			nm_log_dbg (LOGD_HW, "netlink: received message without credentials");
++		return NL_STOP;
+ 	}
+ 
+ 	return NL_OK;
+@@ -285,7 +260,7 @@ nlh_setup (struct nl_sock *nlh,
+ {
+ 	int err;
+ 
+-	nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, cb_data);
++	nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, NULL);
+ 
+ 	if (valid_func)
+ 		nl_socket_modify_cb (nlh, NL_CB_VALID, NL_CB_CUSTOM, valid_func, cb_data);
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c40301eeb4c6..ca2beb0c5dc4 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2333,6 +2333,9 @@ let
 
   netselect = callPackage ../tools/networking/netselect { };
 
+  # stripped down, needed by steam
+  networkmanager098 = callPackage ../tools/networking/network-manager/0.9.8.nix { };
+
   networkmanager = callPackage ../tools/networking/network-manager { };
 
   networkmanager_openvpn = callPackage ../tools/networking/network-manager/openvpn.nix { };