SMBFS: Disable byte-range locking in Samba's TDB.

svn path=/nixpkgs/trunk/; revision=32732
This commit is contained in:
Ludovic Courtès 2012-03-01 23:07:56 +00:00
parent f20a947a5d
commit bb08271aa6
2 changed files with 18 additions and 1 deletions

View File

@ -2,6 +2,9 @@
let let
date = "2011-11-14"; date = "2011-11-14";
samba_patched = stdenv.lib.overrideDerivation samba (attrs: {
patches = attrs.patches ++ [ ./samba-without-byte-range-locks.patch ];
});
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "smbfs-${date}"; name = "smbfs-${date}";
@ -19,7 +22,7 @@ stdenv.mkDerivation rec {
s|^LDFLAGS=\(.*\)$|LDFLAGS=\1 -pthread|g' s|^LDFLAGS=\(.*\)$|LDFLAGS=\1 -pthread|g'
''; '';
buildInputs = [ hurd machHeaders samba ]; buildInputs = [ hurd machHeaders samba_patched ];
installPhase = installPhase =
'' mkdir -p "$out/hurd" '' mkdir -p "$out/hurd"

View File

@ -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;
}