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
|
This is a prelodable shared library that provides SMB client services
for existing executables. Using this you can simulate a smb
filesystem.
*** This is code under development. Some things don't work yet ***
Currently this code has only been tested on:
- Linux 2.0 with glibc2 (RH5.1)
- Linux 2.1 with glibc2
- Solaris 2.5.1 with gcc
- Solaris 2.6 with gcc
- SunOS 4.1.3 with gcc
- IRIX 6.4 with cc
It probably won't run on other systems without some porting.
To use it you need to do this:
1) build smbwrapper.so using the command "make smbwrapper"
3) run smbsh
You will be asked for a username and password. After that you will be
returned to a shell prompt. It is actually a subshell running with
smbwrapper enabled. You can confirm this by checking if the SMBW_USER
environment variable is defined.
Now try to access /smb/SERVER for some SMB server name and see what
happens. If you set SMBW_WORKGROUP to your workgroup or have workgroup
set in yoru smb.conf then listing /smb/ should list all SMB servers in
your workgroup.
Environment variables
---------------------
SMBW_USER
This is usually set by smbsh but you can set it manually. It
specifies the username you will connect to servers with.
SMBW_PASSWORD
This is usually set by smbsh but you can set it manually. It
specifies the password used to connect to smb servers.
SMBW_DEBUG
This is an integer that controls the internal debug level of smbw. It
defaults to 0, which means no debug info.
SMBW_LOGFILE
The place where smbw debug logs are put. If this is not set then
stderr is used.
SMBW_PREFIX
The root of the SMB filesystem. This defaults to /smb/ but you can
set it to any name you like.
SMBW_WORKGROUP
This is the workgroup used for browsing (ie. listing machines in the
/smb/ directory). It defaults to the one set in smb.conf.
Things that I have tried and do seem to work include:
emacs, tar, ls, cmp, cp, rsync, du, cat, rm, mv, less, more, wc, head,
tail, bash, tcsh, mkdir, rmdir, vim, xedit, diff
things that I know don't work:
anything executing from the share
anything that uses mmap
redirection within shells to smbsh files
If you want to help with the development of this code then join the
samba-technical mailing list.
|