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
|
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2017 Nexenta Systems, Inc. All rights reserved.
#
This directory builds a program linking all of the SMB client code
into a user-level process. The result is not a fully functional
SMB client but is very useful for some kinds of development work.
The architecture of this roughly parallels the in-kernel version,
where the kernel modules are built as libraries including:
libfksmbfs, libfknsmb
Just as with the kernel code, there are mdb modules that know
how to walk data structures in libfksmbfs, etc.
For debugging, etc. it's easiest to run this as a normal user,
i.e. yourself (not root)
Now you can run fksmbcl from the proto area using this script:
./Run.sh -df
You can also run it under dbx (see the .dbxrc file).
To run it under mdb (with mdb modules build here):
mdb -L $ROOT/usr/lib/mdb/proc:/usr/lib/mdb/proc ...
where ... is one of: fksmbcl, core.nnn, -p $PID
There are also some dtrace scripts in here, and in ../dtrace
for watching either all activity or only selected areas.
Run these like: dtrace -s Watch-all.d -p $PID -o output
These two (from over in ../dtrace) also work with fksmbcl:
dtrace -s fksmbcl.d -p `pgrep fksmbcl` -o output
Here is the help output:
> help
Commands:
help
exit
logon [user [dom [pass]]]
logoff [close-driver]
shares
mount {share} [optstr]
umount
unmount
statfs
dir {rdir} [lfile]
dirx {rdir} [lfile]
get {rfile} [lfile]
put {lfile} [rfile]
mv {from} {to}
rm {rfile}
mkdir {rfile}
rmdir {rfile}
opt {option}
Here is an example of how to connect, mount, and list a directory:
$ ./Run.sh //myserver
# Start with:
> logon [user [dom [pw]]]
> shares
> mount {share}
> logon test test test
> shares
open pipe: /srvsvc
enum strings
junk
c$
Default Share
test1
ipc$
Remote IPC
test
> mount test
> dir
1224750917 .
1224750917 ..
900818955 test9.dat
3908265151 lock1.txt
2452346625 test_dir
> umount
> logoff
> exit
$
|