Samba: how to lock file in use

New to Debian (Or Linux in general)? Ask your questions here!

Samba: how to lock file in use

Postby gi4mpy » 2017-12-22 11:31

Hello fellows,

This is my first request so let me a few introduction: I'm Davide from Italy and living in Spain right now. I've been working as sys admin during 2 years...4 years ago! Last version of Debian I've worked was Lenny. Now I'm working for a web agency as web developer and I started to propose some internal improvements: configure the server we have for basic needs, and first of all SAMBA.

I already installed Debian 9 and configured basics network stuff, installed Samba, created users and everything is working fine..but most important issue is to prevent anyone from opening a file in use, and seems it's not working/set.

I tried with a PSD and my mate did the same with that file, but it wasn't flag as locked.

Any suggestions? I Googled with different terms but nothing..

Thanks in advance to the community:)
gi4mpy
 
Posts: 7
Joined: 2017-12-22 10:24

Re: Samba: how to lock file in use

Postby acewiza » 2017-12-22 13:42

You might have better luck here: https://www.samba.org/
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
User avatar
acewiza
 
Posts: 358
Joined: 2013-05-28 12:38
Location: Out West

Re: Samba: how to lock file in use

Postby 4D696B65 » 2017-12-22 19:15

acewiza wrote:You might have better luck here: https://www.samba.org/

+1
I always go there for my samba issues. Very good docs and easy to navigate.
User avatar
4D696B65
 
Posts: 2158
Joined: 2009-06-28 06:09

Re: Samba: how to lock file in use

Postby gi4mpy » 2017-12-23 00:46

4D696B65 wrote:
acewiza wrote:You might have better luck here: https://www.samba.org/

+1
I always go there for my samba issues. Very good docs and easy to navigate.


well I'm kinda dumb then cuz I didn't consider it :D

Ok thanks I'll check and let you know.
gi4mpy
 
Posts: 7
Joined: 2017-12-22 10:24

Re: Samba: how to lock file in use

Postby Segfault » 2017-12-23 00:49

I've found the best place to put secrets is README file.
Segfault
 
Posts: 664
Joined: 2005-09-24 12:24

Re: Samba: how to lock file in use

Postby gi4mpy » 2017-12-26 07:32

No luck on Samba.org

anyway ideas? I was thinking even to set just a "read-only" when file is opened from another user, it's not really necessary to "lock" it
gi4mpy
 
Posts: 7
Joined: 2017-12-22 10:24

Re: Samba: how to lock file in use

Postby steve_v » 2017-12-26 07:51

gi4mpy wrote:No luck on Samba.org
Elaborate. What did you try?
Presumably, as this machine is a "server", file access will be over SAMBA, and SAMBA only?
I'm pretty sure SAMBA supports this type of locking by default, You have looked here, right?
If you have non-samba writers as well, you will probably want to look into kernel oplocks.
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Samba: how to lock file in use

Postby gi4mpy » 2017-12-26 11:49

steve_v wrote:
gi4mpy wrote:No luck on Samba.org
Elaborate. What did you try?
Presumably, as this machine is a "server", file access will be over SAMBA, and SAMBA only?
I'm pretty sure SAMBA supports this type of locking by default, You have looked here, right?
If you have non-samba writers as well, you will probably want to look into kernel oplocks.


I tried oplocks and locking...but I just mind that in the office all the employees are working with Mac OS. I suppose it changes everything because the documentation is about Windows

anyway right now this is the following config on smb.conf regarding the folder

---
[foldername]
path = /home/foldername
browseable = yes
guest ok = no
security = user
read only = no
create mask = 0775
directory mask = 0775
valid users = @groupname
---

anyway what I just want to prevent is to "overwrite" a file if someone is already working on it. As I said I worked on Debian more than 4 years ago and the major problem is that I don't remember a lot of things..
gi4mpy
 
Posts: 7
Joined: 2017-12-22 10:24

Re: Samba: how to lock file in use

Postby steve_v » 2017-12-26 12:26

gi4mpy wrote:in the office all the employees are working with Mac OS.
Dunno whether this changes anything or not, oplocks do require client cooperation but I know zilch about the SMB implementation on MacOS.
All I can say is that locking works as described with both samba and windows 7 clients, for me at any rate.
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Samba: how to lock file in use

Postby acewiza » 2017-12-26 16:58

Now that I see you are trying to integrate different filesystem comm protocols (Apple-CIFS, SAMBA, and ExtX), I wish you luck. Apple is notorious for tweaking their comm and FS protocols without any sort of cooperation and notification to the outside world. Things that worked well with Apple one day turn up broken the next, for no apparent reason.
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
User avatar
acewiza
 
Posts: 358
Joined: 2013-05-28 12:38
Location: Out West

Re: Samba: how to lock file in use

Postby gi4mpy » 2017-12-27 08:04

acewiza wrote:Now that I see you are trying to integrate different filesystem comm protocols (Apple-CIFS, SAMBA, and ExtX), I wish you luck. Apple is notorious for tweaking their comm and FS protocols without any sort of cooperation and notification to the outside world. Things that worked well with Apple one day turn up broken the next, for no apparent reason.


Basically I'm fuc**d :D

Sorry if I didn't provide properly all the details. So I suppose the "best" solution is to keep the actual configuration and live with it. There aren't more than 10 employees so maybe it will not be a big deal.

Thank you all guys, we can close this thread.
gi4mpy
 
Posts: 7
Joined: 2017-12-22 10:24

Re: Samba: how to lock file in use

Postby steve_v » 2017-12-27 11:33

Well if samba doesn't do what you need, and you run an all Apple house, and you're feeling adventurous... there's always the Mac way.
I can't help you set it up though, my knowledge of AFP goes as far as "it exists, and somebody probably uses it".
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Samba: how to lock file in use

Postby gi4mpy » 2017-12-27 12:15

steve_v wrote:Well if samba doesn't do what you need, and you run an all Apple house, and you're feeling adventurous... there's always the Mac way.
I can't help you set it up though, my knowledge of AFP goes as far as "it exists, and somebody probably uses it".


Wow I didn't know about this :D looks interesting but I prefer to keep Debian.. I love Debian. Anyhow I want to install more services on this machine to one more reason to stay Debian and stay cool^

Thanks a lot for the tip :P
gi4mpy
 
Posts: 7
Joined: 2017-12-22 10:24

Re: Samba: how to lock file in use

Postby steve_v » 2017-12-27 14:30

gi4mpy wrote:I didn't know about this :D looks interesting but I prefer to keep Debian..
Netatalk is in the Debian repos...
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Samba: how to lock file in use

Postby gi4mpy » 2017-12-27 14:37

steve_v wrote:
gi4mpy wrote:I didn't know about this :D looks interesting but I prefer to keep Debian..
Netatalk is in the Debian repos...


Ouch I dunno why I thought it was a distro linux-based for Mac OS
gi4mpy
 
Posts: 7
Joined: 2017-12-22 10:24

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable