diff --git a/pkgs/os-specific/gnu/smbfs/default.nix b/pkgs/os-specific/gnu/smbfs/default.nix index f95b22a4669d..44e346594bbb 100644 --- a/pkgs/os-specific/gnu/smbfs/default.nix +++ b/pkgs/os-specific/gnu/smbfs/default.nix @@ -2,6 +2,9 @@ let date = "2011-11-14"; + samba_patched = stdenv.lib.overrideDerivation samba (attrs: { + patches = attrs.patches ++ [ ./samba-without-byte-range-locks.patch ]; + }); in stdenv.mkDerivation rec { name = "smbfs-${date}"; @@ -19,7 +22,7 @@ stdenv.mkDerivation rec { s|^LDFLAGS=\(.*\)$|LDFLAGS=\1 -pthread|g' ''; - buildInputs = [ hurd machHeaders samba ]; + buildInputs = [ hurd machHeaders samba_patched ]; installPhase = '' mkdir -p "$out/hurd" diff --git a/pkgs/os-specific/gnu/smbfs/samba-without-byte-range-locks.patch b/pkgs/os-specific/gnu/smbfs/samba-without-byte-range-locks.patch new file mode 100644 index 000000000000..893a29c75398 --- /dev/null +++ b/pkgs/os-specific/gnu/smbfs/samba-without-byte-range-locks.patch @@ -0,0 +1,14 @@ +Since GNU/Hurd doesn't support byte-range file locks, shamelessly +disable them to allow the SMB client library to work (it uses TDB +to access /etc/samba/private/secrets.tdb, for instance.) + +--- samba/lib/tdb/common/lock.c 2010-02-08 16:12:57.000000000 +0100 ++++ samba/lib/tdb/common/lock.c 2012-03-01 23:39:02.000000000 +0100 +@@ -48,7 +48,7 @@ int tdb_brlock(struct tdb_context *tdb, + struct flock fl; + int ret; + +- if (tdb->flags & TDB_NOLOCK) { ++ if (1) { + return 0; + }