Ksmbd (Samba3/4 alternative, ex cifsd/smbd) package support thread

anyone know how to get upper case letter in the share name ?

I'm having the same issue on WDR4300 on Ksmbd: 3.2.1 Kmod: 3.1.3 on OpenWRT 19.07.3.

Does anyone know of a fix? Either stuff gets stuck on 99%, or alternatively if I try to create/delete/modify just 1 file or folder, File explorer on Windows 10 crashes and doesn't respond inside the shared folder.

Updated OpenWRT to 19.07.4, fresh install with no backup restores. Just did a straight install of ksmbd-server, ksmbd-utils and luci-app-ksmbd. Added user samba50 with a password.

Works just fine on Android through FX Explorer. Logs in with the user, can transfer/delete files no problem. But on Windows 10, I can't map it because it says "the network folder specified is currently mapped using different user name and password". If I just try to simply go to \192.168.1.1\share, it will take me there and show me folders/files without even asking for login, but changing anything will freeze the connection, sometimes it will straight up crash the router. Guest access is disabled.

I've tried everything it seems. But Windows 10 just refuses to play nicely with the samba share from OpenWRT. For sanity check I tried to access it on my laptop, but even if I can access the share, changing/adding/deleting anything will utterly crash file explorer.

Try snapshot builds or samba4 on 19.07.x, there is a issue that prevents me from upgrading ksmbd on 19.x. The snapshot updates will be picked-up for 20.x, which should improve stability.

General advice: When switching SMB servers, or SMB server versions, or fiddling around with configurations, it is sensible to delete all the currently open network connections, using

net * /d

and reset Windows' Kerberos credential cache using

klist purge

on the Windows command line (with administrator privileges). If connections are left open and/or cached Kerberos tickets mismatch, it can lead to all kinds of minor and major problems.

2 Likes

Hi, I'm testing the current snapshot r15223. The ksmbd service is always semi-killed at system startup.

  • Kernel message:

[ 29.366912] ksmbd: kill command received

  • system log
root@OpenWrt:~# logread |grep smb
Sun Dec  6 00:26:17 2020 daemon.notice ksmbd: Starting Ksmbd userspace service.
Sun Dec  6 00:26:19 2020 daemon.info ksmbd: triggering kill_server
Sun Dec  6 00:26:19 2020 daemon.notice ksmbd: Starting Ksmbd userspace service.
Sun Dec  6 00:26:19 2020 kern.info kernel: [   29.494030] ksmbd: kill command received

Solved with this patch (sleep added):

diff --git a/net/ksmbd-tools/files/ksmbd.init b/net/ksmbd-tools/files/ksmbd.init
index 5eb347085..a1ec924d2 100644
--- a/net/ksmbd-tools/files/ksmbd.init
+++ b/net/ksmbd-tools/files/ksmbd.init
@@ -169,6 +169,7 @@ start_service()
 	
 	# NOTE: We don't do a soft-reload via signal, since [global] smb.conf setting changes will be ignored, so always reset hard.
 	kill_server
+	sleep 3
 	
 	[ ! -e /sys/module/ksmbd ] && modprobe ksmbd 2> /dev/null
 	if [ ! -e /sys/module/ksmbd ]; then

Probably there is a better way to fix it, but this may help to show the bug.

Regards.
Daniel

1 Like

ping @Andy2244

Just tried to setup a share on the current master branch version
and it no longer works with a $ at the end for a hidden share "c$"
this works with the 19.07 versions
also still not showing capital letters in shares

trying it on a Zyxel Kirkwood NSA310s with latest u-boot and latest snapshot from today 22/02/2021...
All works fine... I have to enable the service and reboot to get the luci-app-ksmbd showing up inside services ?!...

there is a problem after copying folders, they appears as files...

I need to do something like this on them :
find . -type d -exec setfattr -x user.DOSATTRIB "{}" \;

Firmware Version = OpenWrt 19.07.7 r11306-c4a6851c72 / LuCI openwrt-19.07 branch git-21.050.37945-c33df8f|
Kernel Version = 4.14.221


kmbd-server v3.3..4-1
kmod-fs-ksmbd v4.14.221+3.3.4-1
luci-app-ksmbd git-21.050.37945-c33dff8f-1

Files/folders copy correctly from W10 client (including folders copying correctly as folders)

Files/folders fail to delete from Explorer properly, staying in a Deleting state.
image

Files/folders delete properly from Administrator Command prompt.

Files/folders delete properly from Regular Command prompt.

This is really windows just being shit

1 Like

Cool story.

Deleting stuff works fine under Samba3/4 hosts though, so, kinda seems like ksmbd is having some growing pains.

Testing under Samba4 client (Solus 4.2):
Deletion of empty directory created by Samba4 Client :heavy_check_mark:
Deletion of non-empty directory created by Samab4 Client :x:
Deletion of empty directory created by Win10 Client :heavy_check_mark:
Deletion of non-empty directory created by Win10 Client :heavy_check_mark:

folders are preserved as folder while copying with command line (cp -R)... I am using ubuntu 20.10 with default file browser (nautilus)...
the mount is made using gvfs...

1 Like

What version of Nautilus do you have? I have similar with Solus Budgie, but my Natilus is 3.38.2-stable, and folders copy over just fine.

1 Like

$ nautilus --version
GNOME nautilus 3.38.1

1 Like

A few hours after all of these failed/hung deletes, ksmbd seems to have hung completely. No shares were accesible from any client (Windows, Linux, eComStation, Android). A restart of ksmbd from Luci restored functionality.

All other router services and functions were operating properly during the ksmbd outage.

1 Like

same problem of folders becoming files with Ksmbd: 3.3.4 Kmod: 3.3.5


[ 1765.711828] ksmbd: ndr_decode_dos_attr:180: v0 version is not supported                                                                
[ 1765.741612] ksmbd: ndr_decode_dos_attr:180: v0 version is not supported                                                                                                          
[ 1765.757393] ksmbd: ndr_decode_dos_attr:180: v27695 version is not supported      
[ 1765.757393] ksmbd: ndr_decode_dos_attr:180: v27695 version is not supported

some error logged with smb.conf :

[global]
	netbios name = |NAME|
	server string = |DESCRIPTION|
	workgroup = |WORKGROUP|
	interfaces = |INTERFACES|
	bind interfaces only = yes
	ipc timeout = 20
	deadtime = 15
	map to guest = nobody
	smb2 max read = 64K
	smb2 max write = 64K
	smb2 max trans = 64K
	cache read buffers = no
	cache trans buffers = no
	ea support = yes
	map hidden = no
	map system = no
	map archive = no
	map readonly = no
	store dos attributes = yes

@Saijin_Naib @erdoukki
Please open a issue with a detailed report at https://github.com/cifsd-team/cifsd/issues, thanks.

2 Likes