]> arthur.barton.de Git - netatalk.git/blob - doc/README.veto
Change all references to db3/DB3 to BDB. We now support Berkeley DB
[netatalk.git] / doc / README.veto
1 Veto Options Patch for Netatalk
2 ===============================
3
4    The patch at the below address adds a function similar to Samba's
5 "veto files" option to Netatalk. It is not derived from Samba is anyway
6 so GPL'ing Netatalk wasn't a factor. :-)
7
8 http://ariel.ucs.unimelb.edu.au/~epl/netatalk/veto/netatalk-veto.diff
9
10    For those people who do not use Samba, it allows the server to hide
11 files which the user could otherwise access. Hopefully, if this patch
12 works, clients will not be able to see any veto'ed files/directories.
13 Nor will they be able to create, rename or move files/directories
14 matching the veto'ed filespecs (on the Unix side).
15
16    For example, if you use Samba and Netatalk, you would commonly have
17 the following line in Samba's configuration files. That line hides the
18 files on the filesystem which Netatalk/Mac client creates, but the
19 Mac-user never sees. By hiding it, users cannot fiddle with these
20 directories and nor will they confuse themselves by files appear in
21 Windows which doesn't appear under Macs.
22
23 veto files = /.AppleDouble/.AppleDesktop/Network Trash Folder/TheVolumeSettingsFolder/
24
25    Likewise, Windows often create some "special" files which you may
26 wish to hide from mac users. Hence, the following line might be useful.
27
28 veto:recycled/desktop.ini/Folder.htt/Folder Settings/
29
30    The option as implemented is case sensitive, so YMMV.
31
32 Limitations and other notes
33 ===========================
34 - This patch may have a memory leak as a result of strdup()'ing v_veto,
35   but not freeing it anywhere. I'm not sure if this is a practical
36   problem, as presumably v_veto should be free()'ed when the user
37   disconnects. Upon which the fork()'ed ``afpd'' will die and its
38   memory resources reclaimed by the operating system.
39 - This patch does not deal with wildcards at all. Once I've worked out
40   a good design and algorithm, I might add it. It currently fulfills
41   all my requirements. But if there is a demand for wildcard support,
42   I'd be happy to spend additional time on this problem. Until then, I
43   want to make sure that the rest of the code is correct.
44 - In theory, (with the veto option of veto:foobar/) it would be able to
45   create a filename named ":66oobar" on the unix side which will then
46   appear to the mac client as "foobar". Due to other code in Netatalk
47   (not related to this patch), this won't actually work. However, there
48   is no fundamental reason why the mac client would not be able to
49   read files which seemingly matched the veto filespec (from the mac).
50
51 How was the patch made
52 ======================
53 I did things in the following steps.
54 1) I added per-volume support for the "veto:string" option to
55    ``volume.{c,h}''.
56 2) I determined that the veto option was functionally most similar to
57    the "validupath()" function. Therefore, after every "validupath()"
58    call, I added a "veto_file()".
59 3) I placed the "veto_file()" function in the ``etc/afpd/filedir.c''
60    source file. It could also be in any of the other files, but I
61    figured that filedir.c was the best spot. The "veto_file()" function
62    takes the "veto_str" parameter directly from value "string" in point
63    1) above.
64 4) Inside "veto_file()", uncomment the DEBUG code if you want.
65
66    If you want more information, contact me at <epl@unimelb.edu.au>.