3 # This file and its contents are supplied under the terms of the
4 # Common Development and Distribution License ("CDDL"), version 1.0.
5 # You may only use this file in accordance with the terms of version
8 # A full copy of the text of the CDDL should have accompanied this
9 # source. A copy of the CDDL is also available via the Internet at
10 # http://www.illumos.org/license/CDDL.
14 # Copyright 2013 Nexenta Systems, Inc. All rights reserved.
17 This directory builds a program linking all of the SMB server code
18 into a user-level process. The result is not a fully functional
19 SMB server but is very useful for some kinds of development work.
21 The architecture of this roughly parallels the in-kernel version,
22 where the fksmbd program corresponds to the real smbd, the library
23 libfksmbsrv corresponds to the smbsrv kernel module, and all the
24 required kernel interfaces are simulated in libfakekernel.
26 Just as with the kernel code, there are mdb modules that know
27 how to walk data structures in libfksmbsrv, etc.
29 For debugging, etc. it's easiest to run this as a normal user,
30 i.e. yourself (not root); but before you can do that, there are
31 some prerequisites to take care of:
33 a: Install ../bind-helper in /usr/lib/smbsrv/.
34 It needs to be either setuid root (easiest) or added to
35 the exec_attr as described in the top of bind-helper.c
36 (This must be in /usr/lib/smbsrv, not the proto area.)
38 b: Setup an SMB account for guest, i.e.
39 Add pam_smb_passwd.so.1 to pam.conf if not already there
40 (other password required pam_smb_passwd.so.1 nowarn)
42 % smbadm enable-user guest
43 % passwd guest (sets the SMB p/w hash too)
44 Make sure guest shows in /var/smb/smbpasswd
46 c: chown/chmod the directories: /var/smb /var/run/smb
47 to yourself, mode 755. Reboot will chown these
48 back to root, so repeat this after a reboot.
50 Now you can run fksmbd from the proto area using this script:
53 You can also run it under dbx (see the .dbxrc file).
54 To run it under mdb (with mdb modules build here):
55 mdb -L $ROOT/usr/lib/mdb/proc:/usr/lib/mdb/proc ...
56 where ... is one of: fksmbd, core.nnn, -p $PID
58 There are also some dtrace scripts in here, and in ../dtrace
59 for watching either all activity or only selected areas.
60 Run these like: dtrace -s Watch-all.d -p $PID -o output
62 These two (from over in ../dtrace) also work with fksmbd:
63 dtrace -s smbd-authsvc.d -p `pgrep fksmbd` -o output
64 dtrace -s smbd-pipesvc.d -p `pgrep fksmbd` -o output
67 Here are a couple simple, handy tests you can try:
69 smbclient -L localhost -U guest%guest
71 smbclient //localhost/test -U guest%guest -c dir
73 smbtorture //localhost/test -U guest%guest base