README for podfuk-smb program ----------------------------- This document describes how to obtain, compile and run the podfuk-smb program. Please note that the hostname for the anonymous cvs server has changed from cvs.samba.org to pserver.samba.org. Work areas checked out using the old hostname will not be able to be updated. Either check out a new workarea or follow the instructions at http://www.samba.org/samba/cvs.html for how to point your work area at the new server. 1. Obtaining podfuk-smb Install a recent copy of cvs. All you really need is a copy of the cvs client binary. Run the command: cvs -d :pserver:cvs@pserver.samba.org:/cvsroot login When it asks you for a password type 'cvs' without the quotes. Now run the command: cvs -z3 -d :pserver:cvs@pserver.samba.org:/cvsroot co podfuk-smb This will create a directory called podfuk-smb containing the latest source code. Whenever you want to merge in the latest code changes use the following command from within the podfuk-smb directory: cvs update -d -P Once the podfuk-smb source has been obtained it is necessary to also obtain the latest Samba source code. The instructions for this are similar to the ones above for obtaining the podfuk-smb source. These instructions can be found at: http://www.samba.org/samba/cvs.html Note that we wish to have a copy of the HEAD branch source which is different from the official released version of Samba 2.0.7. This source code must live in a subdirectory of the podfuk-smb directory called samba-head. 2. Compiling podfuk-smb After initially checking out the required source code, configure Samba by typing 'make configure'. This only needs to be done once. After this type 'make all' to build the podfuk-smb executable. Running 'make install' is then necessary to install appropriate codepages and the podfuk-smb daemon and authentication program suite. 3. Configuring podfuk-smb To run podfuk-smb, some configuration is required. Run the following commands as root: # make cfs0 # mkdir /smb For convenience, the following entry can be added to the /etc/fstab file: /dev/cfs0 /smb coda noauto,user 0 0 Obviously you'll need coda filesystem support in the kernel. It can be compiled either as a module or statically linked - it doesn't really matter. If coda is compiled as a module, the following line may be needed in /etc/conf.modules for the module to be automatically loaded: alias char-major-67 coda podfuk-smb attempts to load a configuration file named podfuk-smb.conf. This file nominally lives in the LIBDIR defined in the Makefile, currently this is /etc/samba.d/. This file is the same format as a regular smb.conf. It can be used to set defaults for the Samba library code such as the default workgroup name and default code page. 4. Running podfuk-smb As an ordinary user, run podfuk-smb. The -W options can be used to specify a workgroup. As the ordinary user, mount /smb with the command $ mount /smb Note that if the filesystem is mounted as a non-root user, the exec mount option is not set and scripts or executables cannot be run. 5. Running the authentication daemon and client programs Windows usernames and passwords can be communicated to the podfuk-smb process using an authentication daemon and client. These programs are podfuk-smb-authd and podfuk-smb-auth respectively. The authentication daemon creates a UNIX domain socket which listens for requests from the authentication client or the podfuk-smb program. To start the daemon simply run it and it will become a daemon program and run in the background. If the -i option is specified the daemon stays in the forground. This can be useful for debugging. The authentication daemon needs to be run as root. The authentication client is used to send commands to the authentication daemon. If executed with no arguments the following help text is printed out. Usage: ./podfuk-smb-auth [-arcClLf] [-U user%pass] [-W workgroup] \ [-S sharename] Commands: -a add user token -r remove user token -c clear user tokens -l list user tokens -f fetch token (requires root) -C clear all tokens (requires root) -L list all tokens (requires root) Arguments: -S sharename specify sharename -U user%pass specify username and password -W workgroup specify workgroup/domain To add an authentication token for the SMB share called //npsd-pdc/tmp run the following command. $ podfuk-smb-auth -a -S //npsd-pdc/tmp -W npsd-wg -U user0%pass0 This will add an authentication token for the //npsd-pdc/tmp share. When the podfuk-smb daemon tries to connect to this share, it will provide the username 'user0', workgroup 'npsd-wg' and password 'pass0'. Tokens can be removed using the -r option: $ podfuk-smb-auth -r -S //npsd-pdc/tmp all tokens can be cleared like this: $ podfuk-smb-auth -c To specify an authentication token for all shares on a machine, simply specify the server name without the share. The following command creates a token for all shares under the server1 machine: $ podfuk-smb-auth -a -S //server1 -W npsd-wg -U user0%pass0 To specify an authentication token for all shares on all machines, use the string '//' as the share name: $ podfuk-smb-auth -a -S // -W npsd-wg -U user0%pass0 6. Example session We assume the setup described in Sections 3 and 4 have already been performed. First command prompt: stamp-collection:~$ ./podfuk-smb [the shell this runs in will contain podfuk-smb debug messages] Second command prompt: stamp-collection:~$ mount /smb stamp-collection:~$ cd /smb stamp-collection:/smb$ ls total 1 0 ./ 1 ../ 0 STAMP/ 0 TWEEDLE/ stamp-collection:/smb$ cd STAMP stamp-collection:/smb/STAMP$ ls total 0 0 ./ 0 ../ 0 scratch/ stamp-collection:/smb/STAMP$ cd scratch stamp-collection:/smb/STAMP/scratch$ ls total 115825 0 ./ 0 ../ 0 1/ 0 2/ 0 3/ 272 Arkham.pdb 87 Bones.pdb 0 BuzzWord/ 8 BuzzWord.zip 1 Changes.TXT 0 Dragon Hunter Pinball v1_0/ [...]