Skip to content

Commit b7f2985

Browse files
committed
Update README.md
1 parent 0bd6cf9 commit b7f2985

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
vfs_python
22
==========
33

4-
Write Samba VFS modules in Python
4+
An experimental Samba module which lets you control execution of Samba actions in your own Python script.
5+
6+
Installation
7+
------------
8+
You must have the Python headers installed (python-dev) and the Samba sourcecode lying around.
9+
10+
Clone this repository, then compile as follows:
11+
12+
./configure --enable-debug --enable-developer --with-samba-source=/path/to/samba/source3
13+
make
14+
15+
Copy / symlink the resulting `vfs_python.so` to `/usr/local/samba/lib/vfs/python.so` (or wherever your VFS modules are).
16+
17+
In your smb.conf, enable vfs_python per share:
18+
19+
[myshare]
20+
path = /tmp
21+
vfs objects = python
22+
python:script = /path/to/your/handler.py
23+
24+
and make sure that the script path is valid.
25+
26+
The Python code
27+
-------------------
28+
Take a look at [the `handler.py`](https://github.com/vortec/vfs_python/blob/master/handler.py) to see how it looks like and which Samba calls are supported at the moment (hint: not too many).
29+
30+
When a user performs an action, the corresponding Python function will be called. You can either allow or deny that action by returning a boolean.
31+
32+
The Python script will be imported every time a user connects and is valid for the duration of the connection.

0 commit comments

Comments
 (0)