summaryrefslogtreecommitdiff
path: root/docs/htmldocs/vfs.html
blob: fcaca133fed69577bae5a6e84e51d2a35ef15f9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>Stackable VFS modules</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="SAMBA Project Documentation"
HREF="samba-howto-collection.html"><LINK
REL="UP"
TITLE="Advanced Configuration"
HREF="optional.html"><LINK
REL="PREVIOUS"
TITLE="PAM Configuration for Centrally Managed Authentication"
HREF="pam.html"><LINK
REL="NEXT"
TITLE="Hosting a Microsoft Distributed File System tree on Samba"
HREF="msdfs.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SAMBA Project Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="pam.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="msdfs.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="VFS"
></A
>Chapter 21. Stackable VFS modules</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>21.1. <A
HREF="vfs.html#AEN3600"
>Introduction and configuration</A
></DT
><DT
>21.2. <A
HREF="vfs.html#AEN3609"
>Included modules</A
></DT
><DD
><DL
><DT
>21.2.1. <A
HREF="vfs.html#AEN3611"
>audit</A
></DT
><DT
>21.2.2. <A
HREF="vfs.html#AEN3619"
>extd_audit</A
></DT
><DT
>21.2.3. <A
HREF="vfs.html#AEN3623"
>recycle</A
></DT
><DT
>21.2.4. <A
HREF="vfs.html#AEN3660"
>netatalk</A
></DT
></DL
></DD
><DT
>21.3. <A
HREF="vfs.html#AEN3667"
>VFS modules available elsewhere</A
></DT
><DD
><DL
><DT
>21.3.1. <A
HREF="vfs.html#AEN3671"
>DatabaseFS</A
></DT
><DT
>21.3.2. <A
HREF="vfs.html#AEN3679"
>vscan</A
></DT
></DL
></DD
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN3600"
>21.1. Introduction and configuration</A
></H1
><P
>Since samba 3.0, samba supports stackable VFS(Virtual File System) modules.  
Samba passes each request to access the unix file system thru the loaded VFS modules. 
This chapter covers all the modules that come with the samba source and references to 
some external modules.</P
><P
>You may have problems to compile these modules, as shared libraries are
compiled and linked in different ways on different systems.
They currently have been tested against GNU/linux and IRIX.</P
><P
>To use the VFS modules, create a share similar to the one below.  The
important parameter is the <B
CLASS="COMMAND"
>vfs object</B
> parameter which must point to
the exact pathname of the shared library objects. For example, to log all access 
to files and use a recycle bin:

<PRE
CLASS="PROGRAMLISTING"
>       [audit]
                comment = Audited /data directory
                path = /data
                vfs object = /path/to/audit.so /path/to/recycle.so
                writeable = yes
                browseable = yes</PRE
></P
><P
>The modules are used in the order they are specified.</P
><P
>Further documentation on writing VFS modules for Samba can be found in
the Samba Developers Guide.</P
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN3609"
>21.2. Included modules</A
></H1
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3611"
>21.2.1. audit</A
></H2
><P
>A simple module to audit file access to the syslog
facility.  The following operations are logged:
<P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
>share</TD
></TR
><TR
><TD
>connect/disconnect</TD
></TR
><TR
><TD
>directory opens/create/remove</TD
></TR
><TR
><TD
>file open/close/rename/unlink/chmod</TD
></TR
></TBODY
></TABLE
><P
></P
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3619"
>21.2.2. extd_audit</A
></H2
><P
>This module is identical with the <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>audit</I
></SPAN
> module above except
that it sends audit logs to both syslog as well as the smbd log file/s. The 
loglevel for this module is set in the smb.conf file. At loglevel = 0, only file
and directory deletions and directory and file creations are logged. At loglevel = 1
file opens are renames and permission changes are logged , while at loglevel = 2 file
open and close calls are logged also.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3623"
>21.2.3. recycle</A
></H2
><P
>A recycle-bin like modules. When used any unlink call
will be intercepted and files moved to the recycle
directory instead of beeing deleted.</P
><P
>Supported options:
<P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>vfs_recycle_bin:repository</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:keeptree</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:versions</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:touch</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:maxsize</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:exclude</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:exclude_dir</DT
><DD
><P
>FIXME</P
></DD
><DT
>vfs_recycle_bin:noversions</DT
><DD
><P
>FIXME</P
></DD
></DL
></DIV
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3660"
>21.2.4. netatalk</A
></H2
><P
>A netatalk module, that will ease co-existence of samba and
netatalk file sharing services.</P
><P
>Advantages compared to the old netatalk module:
<P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
>it doesn't care about creating of .AppleDouble forks, just keeps ones in sync</TD
></TR
><TR
><TD
>if share in smb.conf doesn't contain .AppleDouble item in hide or veto list, it will be added automatically</TD
></TR
></TBODY
></TABLE
><P
></P
></P
></DIV
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN3667"
>21.3. VFS modules available elsewhere</A
></H1
><P
>This section contains a listing of various other VFS modules that 
have been posted but don't currently reside in the Samba CVS 
tree for one reason ot another (e.g. it is easy for the maintainer 
to have his or her own CVS tree).</P
><P
>No statemets about the stability or functionality any module
should be implied due to its presence here.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3671"
>21.3.1. DatabaseFS</A
></H2
><P
>URL: <A
HREF="http://www.css.tayloru.edu/~elorimer/databasefs/index.php"
TARGET="_top"
>http://www.css.tayloru.edu/~elorimer/databasefs/index.php</A
></P
><P
>By <A
HREF="mailto:elorimer@css.tayloru.edu"
TARGET="_top"
>Eric Lorimer</A
>.</P
><P
>I have created a VFS module which implements a fairly complete read-only
filesystem.  It presents information from a database as a filesystem in
a modular and generic way to allow different databases to be used
(originally designed for organizing MP3s under directories such as
"Artists," "Song Keywords," etc... I have since applied it to a student
roster database very easily).  The directory structure is stored in the
database itself and the module makes no assumptions about the database
structure beyond the table it requires to run.</P
><P
>Any feedback would be appreciated: comments, suggestions, patches,
etc...  If nothing else, hopefully it might prove useful for someone
else who wishes to create a virtual filesystem.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN3679"
>21.3.2. vscan</A
></H2
><P
>URL: <A
HREF="http://www.openantivirus.org/"
TARGET="_top"
>http://www.openantivirus.org/</A
></P
><P
>samba-vscan is a proof-of-concept module for Samba, which
uses the VFS (virtual file system) features of Samba 2.2.x/3.0
alphaX. Of couse, Samba has to be compiled with VFS support. 
samba-vscan supports various virus scanners and is maintained 
by Rainer Link.</P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="pam.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="samba-howto-collection.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="msdfs.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>PAM Configuration for Centrally Managed Authentication</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="optional.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Hosting a Microsoft Distributed File System tree on Samba</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>