xref: /illumos-gate/usr/src/cmd/fs.d/smbclnt/fksmbcl/README (revision d0b3c59ba652f183eeec1414dd9fbdc56bf05cc8)
1
2#
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
6# 1.0 of the CDDL.
7#
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.
11#
12
13#
14# Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
15#
16
17This directory builds a program linking all of the SMB client code
18into a user-level process.  The result is not a fully functional
19SMB client but is very useful for some kinds of development work.
20
21The architecture of this roughly parallels the in-kernel version,
22where the kernel modules are built as libraries including:
23  libfksmbfs, libfknsmb
24
25Just as with the kernel code, there are mdb modules that know
26how to walk data structures in libfksmbfs, etc.
27
28For debugging, etc. it's easiest to run this as a normal user,
29i.e. yourself (not root)
30
31Now you can run fksmbcl from the proto area using this script:
32  ./Run.sh -df
33
34You can also run it under dbx (see the .dbxrc file).
35To run it under mdb (with mdb modules build here):
36  mdb -L $ROOT/usr/lib/mdb/proc:/usr/lib/mdb/proc ...
37where ... is one of: fksmbcl, core.nnn, -p $PID
38
39There are also some dtrace scripts in here, and in ../dtrace
40for watching either all activity or only selected areas.
41Run these like:  dtrace -s Watch-all.d -p $PID -o output
42
43These two (from over in ../dtrace) also work with fksmbcl:
44	dtrace -s fksmbcl.d -p `pgrep fksmbcl`  -o output
45
46Here is the help output:
47
48	> help
49	Commands:
50	help
51	exit
52	logon [user [dom [pass]]]
53	logoff [close-driver]
54	shares
55	mount {share} [optstr]
56	umount
57	unmount
58	statfs
59	dir {rdir} [lfile]
60	dirx {rdir} [lfile]
61	get {rfile} [lfile]
62	put {lfile} [rfile]
63	mv {from} {to}
64	rm {rfile}
65	mkdir {rfile}
66	rmdir {rfile}
67	opt {option}
68
69
70Here is an example of how to connect, mount, and list a directory:
71
72	$ ./Run.sh //myserver
73	# Start with:
74	> logon [user [dom [pw]]]
75	> shares
76	> mount {share}
77
78	> logon test test test
79	> shares
80	open pipe: /srvsvc
81	enum strings
82	junk
83	c$
84	Default Share
85	test1
86	ipc$
87	Remote IPC
88	test
89	> mount test
90	> dir
91	    1224750917    .
92	    1224750917    ..
93	     900818955    test9.dat
94	    3908265151    lock1.txt
95	    2452346625    test_dir
96	> umount
97	> logoff
98	> exit
99	$
100