susmb.md - www.codemadness.org - www.codemadness.org saait content files
HTML git clone git://git.codemadness.org/www.codemadness.org
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
susmb.md (3958B)
---
1 usmb is a program to mount SMB shares from userland via FUSE.
2 Under-the-hood it uses Samba and exposes the network share as a regular local filesystem.
3 Programs can just access the filesystem and for example do not need to add code for SMB support or link against Samba.
4 It is more convenient than scripting around smbclient in some cases.
5 smbclient(1): <https://www.samba.org/samba/docs/current/man-html/smbclient.1.html>
6
7 susmb is a fork of usmb from 2013-02-04.
8 <http://repo.or.cz/w/usmb.git/snapshot/aa94e132c12faf1a00f547ea4a96b5728612dea6.tar.gz>
9 (git commit aa94e132c12faf1a00f547ea4a96b5728612dea6)
10
11 usmb has been unmaintained since 2013. Sometimes programs are finished and so
12 being unmaintained is not so bad. I think the general idea of the code was good
13 and it is still a useful program for some systems, probably mostly BSD systems.
14 Linux has a SMB/CIFS driver anyway.
15
16 The two main reasons I forked usmb were performance issues with it on OpenBSD
17 (because of hardcoded options and assumptions for FUSE for Linux) and issues by
18 using it in non-interactive mode.
19
20
21 ## Clone
22
23 git clone git://git.codemadness.org/susmb
24
25
26 ## Browse
27
28 You can browse the source-code at:
29
30 * <https://git.codemadness.org/susmb/>
31 * <gopher://codemadness.org/1/git/susmb>
32
33
34 ## Download releases
35
36 Releases are available at:
37
38 * <https://codemadness.org/releases/susmb/>
39 * <gopher://codemadness.org/1/releases/susmb>
40
41
42 ## Build and install
43
44 $ make
45 # make install
46
47
48 ## Dependencies
49
50 * C compiler.
51 * libc + BSD extensions (libbsd on Linux).
52 * FUSE 2.6 or later (and probably version <3).
53 * Samba / libsmbclient 4.20+.
54
55
56 ## Usage example
57
58 susmb \
59 -u hiltjo \
60 -f \
61 -o 'uid=1000,gid=1000,allow_other' \
62 "smb://domain\someuser@192.168.1.1/Storage" \
63 /mnt/share
64
65
66 ## Changes
67
68 susmb has the patches applied from OpenBSD ports 7.6:
69 <https://cvsweb.openbsd.org/ports/sysutils/usmb/patches>
70
71 Below is a summary of the most important changes:
72
73
74 ## Performance
75
76 * Set struct stat st.st_blksiz to a higher number for more efficient buffering
77 for programs using the standard FILE* stdio interfaces. Huge improvement for
78 reads and writes.
79 On OpenBSD the default block size for FUSE is 512 bytes.
80 This crippled network performance.
81 On OpenBSD there is no FUSE caching layer (at time of writing 2025-09-07), so
82 each read call had more overhead.
83 * Remove the hardcoded FUSE mount option max_read=N.
84 This crippled network performance.
85
86
87 ## Security
88
89 * Many code simplifications and deletions (reducing attack surface and makes it
90 easier to review).
91 * Use unveil(2) syscall to lock down much of the filesystem except the
92 mountpoint and required FUSE devices.
93 * Optional privilege dropping support: on OpenBSD FUSE would need to run as root:
94 (sysctl kern.usermount was removed around July 2016, around
95 commit 65c8a8a0394483b41de8f02c862e65fb529cf538).
96 After mounting the filesystem and acquiring access to the FUSE driver
97 privileges are dropped. This is not perfect, but at least now the Samba smbclient
98 code runs as a user again.
99 * Reading the password from the terminal in a secure way using readpassphrase(3).
100
101
102 ## Cleanups
103
104 * Merge everything into one C file for easier code review.
105 * Remove Samba < 3.3 compatibility layer and code. This is hard to test
106 nowadays anyway.
107 * Use getopt for option parsing: remove dependencies on glib which was used for
108 option parsing only.
109 * Remove long option support.
110 * Remove libxml2 dependency and configuration via XML. Configuration is now
111 done via a simpler syntax as a URI from the command-line. This was also
112 listed in the man page under the BUGS section as a wanted feature.
113 * Remove autoconf and Debian-specific packaging files. Use a simple Makefile.
114 * Man page rewritten from roff to mandoc.
115
116
117 ## OpenBSD port added as sysutils/susmb
118
119 An OpenBSD port was added to sysutils/susmb (thanks to Pascal Stumpf!).
120
121 Mailinglist thread: <https://marc.info/?l=openbsd-ports&m=177169411929407&w=2>