Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] file locking options in smb.conf

12 views
Skip to first unread message

Anoop P.A.

unread,
May 5, 2009, 6:16:40 AM5/5/09
to
This is a multi-part message in MIME format.

--===============0243030544==
Content-class: urn:content-classes:message
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: base64

SGkgTGlzdCwNCg0KIA0KDQpJIGhhdmUgYSBmaWxlIHNlcnZlciB3aGljaCBydW5zIHNhbWJhLTMu
MC4yOGEuIE15IGFpbSBpcyB0byBzaGFyZSBhIGxvZ2ljYWwgdm9sdW1lICggd2l0aCBYRlMgZmls
ZXN5c3RlbSkgdXNpbmcgU0FNQkEsIE5GUyBhbmQgRlRQLiBTaW5jZSBpdCBpcyBhIGZpbGUgc2Vy
dmVyIEnigJltIHZlcnkgbXVjaCBjb25jZXJuZWQgYWJvdXQgZmlsZSBsb2NraW5nLiBBZnRlciBn
b29nbGluZyBhbmQgcmVhZGluZyBhIGxvdCBJIGhhZCBzZXQgZmlsZSBsb2NraW5nIGZsYWdzIGlu
IHNtYi5jb25mIA0KDQogDQoNCu+7v2xvY2sgZGlyZWN0b3J5ID0gL3Zhci9sb2NrL3NhbWJhDQoN
CnN0cmljdCBsb2NraW5nID0gbm8NCg0KbG9ja2luZyA9IHllcw0KDQpsZXZlbDIgb3Bsb2NrcyA9
IG5vDQoNCmtlcm5lbCBvcGxvY2tzID0geWVzDQoNCm9wbG9ja3MgPSB5ZXMNCg0KIA0KDQpCdXQg
c3RpbGwgSSBhbSBoYXZpbmcgbG90cyBvZiBwcm9ibGVtcyBpbiBmaWxlIGxvY2tpbmcuIEZvbGxv
d2luZyBjb25kaXRpb25zIGFyZSBub3Qgd29ya2luZyBhcyBleHBlY3RlZA0KDQogDQoNCkNJRlMo
bGludXgpIC0tPiBDSUZTKHdpbmRvd3MpDQoNCk5GUyAtLT4gQ0lGUw0KDQpDSUZTIC0tPiBGVFAN
Cg0KSG93IGV2ZXIgQ0lGUyh3aW5kb3dzKSAtLT4gQ0lGUyAoIHdpbmRvd3MpIGxvY2tpbmcgd29y
a2luZyBhcyBleHBlY3RlZC4NCg0KIA0KDQogDQoNCkNhbiBhbnkgb25lIHN1Z2dlc3QgYmVzdCBz
dWl0YWJsZSBjb21iaW5hdGlvbiBmaWxlIGxvY2tpbmcgcGFyYW1ldGVycyBmb3IgbWU/DQoNCiAN
Cg0KVGhhbmtzICYgUmVnYXJkcywNCg0KQW5vb3AgUCBBDQoNCiANCg0K

--===============0243030544==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
--===============0243030544==--

Volker Lendecke

unread,
May 5, 2009, 6:37:47 AM5/5/09
to

--===============1496908101==
Content-Type: multipart/signed; micalg=pgp-sha1;
protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s"
Content-Disposition: inline


--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 05, 2009 at 02:42:57AM -0700, Anoop P.A. wrote:
> Hi List,
>=20
> =20
>=20
> I have a file server which runs samba-3.0.28a. My aim is to share a logic=
al volume ( with XFS filesystem) using SAMBA, NFS and FTP. Since it is a fi=
le server I=E2=80=99m very much concerned about file locking. After googlin=
g and reading a lot I had set file locking flags in smb.conf=20
>=20
> =20
>=20
> =EF=BB=BFlock directory =3D /var/lock/samba
>=20
> strict locking =3D no
>=20
> locking =3D yes
>=20
> level2 oplocks =3D no
>=20
> kernel oplocks =3D yes
>=20
> oplocks =3D yes
>=20
> =20
>=20
> But still I am having lots of problems in file locking. Following conditi=
ons are not working as expected

Question: What do you expect with which applications?

Volker

--SLDf9lqlvOQaIe6s
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFKABaTbsgDfmnSbrYRAo44AJ0elUW+UZw/Le47OKYwuwhxswPmfACeOzGe
qxhGSLaPZq8foQTQxbkAtAE=
=eeu8
-----END PGP SIGNATURE-----

--SLDf9lqlvOQaIe6s--

--===============1496908101==


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

--===============1496908101==--

Volker Lendecke

unread,
May 5, 2009, 8:12:25 AM5/5/09
to

--===============1290282039==

Content-Type: multipart/signed; micalg=pgp-sha1;
protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s"
Content-Disposition: inline


--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 05, 2009 at 04:27:30AM -0700, Anoop P.A. wrote:
> Hi Volker,
>=20
> Thanks for the reply.=20
> I want basic file locking work as expected. ( i.e. I want to prevent file=
s from getting corrupted while shared across multiple platforms).
> If some file is opened writing in one client, other clients should not be=
able to write in to it.=20
>=20
> My server failing in many scenarios, I could explain one of the scenario =
as follows.
>=20
> 1. Opened a share using browser in Win XP machine.=20
> 2. Mounted same share in a Linux machine through nfs.
> 3. Initiated a 1 GB file transfer to share in windows
> 4. Same time tried to copy a file with same name in nfs share.It asked to=
overwrite existing file( I expect it not to start copy as write lock of th=
at file is being obtained by CIFS client)
> 5. After a while both the transfers finished. MD5SUM showed resultant fil=
e got corrupted.

No way you will achieve this cross-protocol. Unix just does
not know how to lock a complete file like Windows/CIFS does
using share modes. Your only chance is to only use Samba and
a cifs client file system and ditch NFS and local file
access.

Volker

--SLDf9lqlvOQaIe6s
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFKACe+bsgDfmnSbrYRAsGMAJ9U8jUmFJfdaubym9MHMZ+k49i7sQCgitmR
TRl/Rfbfy+y9EkrKOvO+Di8=
=RahM
-----END PGP SIGNATURE-----

--SLDf9lqlvOQaIe6s--

--===============1290282039==


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

--===============1290282039==--

Anoop P.A.

unread,
May 6, 2009, 2:38:15 AM5/6/09
to

Hi list,

Any body implemented cross protocol file locking before? Any pointer
will help me a lot

Hi Volker,

CIFS -> CIFS locking is not working as expected. It failed for me in
following scenario.

1. Opened a share using browser in Win XP machine.

2. Copied a word document (*.doc) to share.
3. Mounted CIFS share in a Ubuntu (8.04 LTS desktop).=20
4. Opened word document from Ubuntu using openoffice 2.4
5. Tried to open same file in Win XP but it didn't open and got error
message "No proper file permission" (I expect word document to open in
read only mode).

However if I open document first in Win XP and then using Open office
working as expected i.e. Document getting opened in read only mode.
=20
Thanks
Anoop

> -----Original Message-----
> From: Volker Lendecke [mailto:Volker....@SerNet.DE]
> Sent: Tuesday, May 05, 2009 5:19 PM
> To: Anoop P.A.
> Cc: sa...@lists.samba.org
> Subject: Re: [Samba] file locking options in smb.conf
>=20
> On Tue, May 05, 2009 at 04:27:30AM -0700, Anoop P.A. wrote:
> > Hi Volker,
> >

> > Thanks for the reply.


> > I want basic file locking work as expected. ( i.e. I want to prevent

> files from getting corrupted while shared across multiple platforms).


> > If some file is opened writing in one client, other clients should
not

> be able to write in to it.


> >
> > My server failing in many scenarios, I could explain one of the
scenario

> as follows.


> >
> > 1. Opened a share using browser in Win XP machine.

> > 2. Mounted same share in a Linux machine through nfs.
> > 3. Initiated a 1 GB file transfer to share in windows
> > 4. Same time tried to copy a file with same name in nfs share.It
asked

> to overwrite existing file( I expect it not to start copy as write
lock of
> that file is being obtained by CIFS client)


> > 5. After a while both the transfers finished. MD5SUM showed
resultant

> file got corrupted.
>=20


> No way you will achieve this cross-protocol. Unix just does
> not know how to lock a complete file like Windows/CIFS does
> using share modes. Your only chance is to only use Samba and
> a cifs client file system and ditch NFS and local file
> access.

>=20
> Volker

Volker Lendecke

unread,
May 6, 2009, 3:13:46 AM5/6/09
to

--===============1514873223==
Content-Type: multipart/signed; micalg=pgp-sha1;
protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi"
Content-Disposition: inline


--6c2NcOVqGQ03X4Wi


Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 05, 2009 at 11:35:54PM -0700, Anoop P.A. wrote:
>=20
> Hi list,
>=20


> Any body implemented cross protocol file locking before? Any pointer
> will help me a lot

>=20
> Hi Volker,
>=20


> CIFS -> CIFS locking is not working as expected. It failed for me in
> following scenario.

>=20


> 1. Opened a share using browser in Win XP machine.
> 2. Copied a word document (*.doc) to share.
> 3. Mounted CIFS share in a Ubuntu (8.04 LTS desktop).=20
> 4. Opened word document from Ubuntu using openoffice 2.4
> 5. Tried to open same file in Win XP but it didn't open and got error
> message "No proper file permission" (I expect word document to open in
> read only mode).

>=20


> However if I open document first in Win XP and then using Open office
> working as expected i.e. Document getting opened in read only mode.

Well, that's because Unix does not know about so-called
share modes that Microsoft Office uses. OpenOffice 3 will
solve this cross-platform using a lock file, so if you are
using that on both Windows and Linux it should work fine.

Volker

--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFKATQ0bsgDfmnSbrYRAh6ZAJkBSjEfykQynhmUL7yEDAigGMCIhgCfX0m+
MIq9EPj7ZWfdDopKgCi7a3s=
=/TH0
-----END PGP SIGNATURE-----

--6c2NcOVqGQ03X4Wi--

--===============1514873223==


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--

To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

--===============1514873223==--

Daniel Müller

unread,
May 6, 2009, 5:04:32 AM5/6/09
to
Dear all,

It is the same problem with me. I run samba 3.2.8 on suse 10.2 .
Now and then we have trouble concerning the home directories=20
writing Word and Excel files.

My smb.conf for homes:
=20
[homes]
##mit dem preexec befehl wird das userverzeichnis erstellt
root preexec=3D/windows/./userverzeichnis %U
root postexec=3D/windows/./bshares %U
comment=3DHeimatverzeichnis %U
msdfs root=3Dyes
path=3D /windows/winuser/%U
valid users=3D%S
inherit permissions=3Dyes
inherit owner=3Dyes
force group=3D "Domain Users"
read only=3Dno
create mask=3D 0750
directory mask=3D0775
browseable=3Dno
hide files=3D/Desktop.ini/Thumbs.db/lost+found/desktop.ini
veto oplock
files=3D/*.pdf/*.PST/*.pst/*.doc/*.xls/*.docx/*.mdb/*.MDB/*.dbf/*.DBF/*.p=
pt/*.
xlsx/
#vfs objects=3Dextd_audit,recycle
vfs objects=3Drecycle
recycle:exclude=3D *.tmp,*.temp,*.log,*.ldb,*.TMP,?~$*,~$*
recycle:keeptree=3DYes
recycle:exclude_dir=3Dtmp,temp,profile,.profile
recycle:touch_mtime=3Dyes
recycle:versions=3DYes

When the error occurs the word or excel file is suddenly owned mask
administrators. And the user changed it cannot save it any more. There =
are
from this moment on many temp files around this files.
Only after deleting the admins mask ownership, and the temp files by =
hand
the word, excel files will be
Writeable again.
On our old samba 2.2.7 still running we do not have this trouble (the =
same
windows versions, the same office versions!!!).
=20

-----------------------------------------------
EDV Daniel M=FCller

Leitung EDV
Tropenklinik Paul-Lechler-Krankenhaus
Paul-Lechler-Str. 24
72076 T=FCbingen

Tel.: 07071/206-463, Fax: 07071/206-499
eMail: mue...@tropenklinik.de
Internet: www.tropenklinik.de
-----------------------------------------------
-----Urspr=FCngliche Nachricht-----
Von: samba-bounces+mueller=3Dtropen...@lists.samba.org
[mailto:samba-bounces+mueller=3Dtropen...@lists.samba.org] Im =
Auftrag
von Anoop P.A.
Gesendet: Mittwoch, 6. Mai 2009 08:36
An: Volker....@SerNet.DE
Cc: sa...@lists.samba.org
Betreff: RE: [Samba] file locking options in smb.conf


Hi list,

Any body implemented cross protocol file locking before? Any pointer
will help me a lot

Hi Volker,

CIFS -> CIFS locking is not working as expected. It failed for me in
following scenario.

1. Opened a share using browser in Win XP machine.


2. Copied a word document (*.doc) to share.
3. Mounted CIFS share in a Ubuntu (8.04 LTS desktop).=20
4. Opened word document from Ubuntu using openoffice 2.4
5. Tried to open same file in Win XP but it didn't open and got error
message "No proper file permission" (I expect word document to open in
read only mode).

However if I open document first in Win XP and then using Open office


working as expected i.e. Document getting opened in read only mode.

=20
Thanks
Anoop

> -----Original Message-----
> From: Volker Lendecke [mailto:Volker....@SerNet.DE]
> Sent: Tuesday, May 05, 2009 5:19 PM
> To: Anoop P.A.
> Cc: sa...@lists.samba.org
> Subject: Re: [Samba] file locking options in smb.conf
>=20
> On Tue, May 05, 2009 at 04:27:30AM -0700, Anoop P.A. wrote:
> > Hi Volker,
> >
> > Thanks for the reply.
> > I want basic file locking work as expected. ( i.e. I want to prevent
> files from getting corrupted while shared across multiple platforms).
> > If some file is opened writing in one client, other clients should
not
> be able to write in to it.
> >
> > My server failing in many scenarios, I could explain one of the
scenario
> as follows.
> >

> > 1. Opened a share using browser in Win XP machine.

> > 2. Mounted same share in a Linux machine through nfs.
> > 3. Initiated a 1 GB file transfer to share in windows
> > 4. Same time tried to copy a file with same name in nfs share.It
asked
> to overwrite existing file( I expect it not to start copy as write
lock of
> that file is being obtained by CIFS client)
> > 5. After a while both the transfers finished. MD5SUM showed
resultant
> file got corrupted.
>=20
> No way you will achieve this cross-protocol. Unix just does
> not know how to lock a complete file like Windows/CIFS does
> using share modes. Your only chance is to only use Samba and
> a cifs client file system and ditch NFS and local file
> access.
>=20
> Volker

--=20

0 new messages