Public bug reported:
Ubuntu 26.10, samba 2:4.24.7+dfsg-1ubuntu1. The code is unchanged on
upstream master.
smb.conf(5) says for "deadtime": "A deadtime of zero indicates that no
auto-disconnection should be performed".
That is not true for a session without a tree connect.
deadtime_fn() in source3/smbd/smb2_process.c runs every IDLE_CLOSED_TIMEOUT (60
s, source3/include/local.h,
via event_add_idle()). When conn_num_open(sconn) == 0 it sends MSG_SHUTDOWN
without looking at "deadtime". So an
authenticated session that has done TREE_DISCONNECT and keeps no tree is closed
0 to 60 s later, whatever
"deadtime" says. Neither the man page nor the docs mention this rule.
Reproducer (any share, any valid user):
[global]
deadtime = 0
( echo tdis; sleep 75; echo 'tcon <share>'; echo ls ) | smbclient
//<server>/<share> -U <user> -m SMB3
Expected: ls lists the share. Actual: smbclient prints
"The connection is disconnected now: NT_STATUS_CONNECTION_DISCONNECTED" about
60 s after connecting, and smbd
logs (log level 3):
Closing idle connection
got a SHUTDOWN message
exit_server_common: Server exit (normal exit)
A second client that kept its tree connected stayed up (tested for 130 s). Seen
with deadtime = 0 (close
60.3 s after connect) and, with macOS Finder as the client, with the default
deadtime.
Impact: macOS Finder lists a server's shares over IPC$, sends TREE_DISCONNECT
and keeps the session for the
next click. smbd drops it a minute later; Finder still shows "Connected as" and
a double-click on a share then
fails with "The operation can't be completed because the original item for
"<share>" can't be found."
That the Mac does not simply reconnect is a client bug, which I am reporting to
Apple separately. But the
60 s close is what makes Finder hit it within a minute. A Windows server counts
a connection as idle only
when it has no open handles, and closes it after "Autodisconnect" (15 minutes
by default).
Suggestion: for an authenticated session without trees, apply "deadtime" (or a
new documented parameter)
instead of the fixed 60 s, and keep the short timeout for connections that
never authenticated. At minimum,
document the 60 s rule in the "deadtime" entry.
Related, also documentation: rpc_worker.c reads "<worker>:idle_seconds" (for
example
rpcd_classic:idle_seconds, default 60) to decide when an idle rpcd_* worker
exits. It is not in smb.conf(5).
Without it, the first share enumeration after a minute without RPC cold-starts
samba-dcerpcd; here a Finder
visit took 5.2 to 6.5 s to show the share list, and 0.8 s with
rpcd_classic:idle_seconds and
rpcd_winreg:idle_seconds set high.
Related upstream: Samba bug 14783 (deadtime defeated by open pipes; fixed,
different code path). I found no
existing report of this in Launchpad or Samba Bugzilla. I have no Samba
Bugzilla account; could the Ubuntu
server team forward this upstream if it is confirmed?
This report was prepared with an AI assistant; I have reviewed it.
ProblemType: Bug
DistroRelease: Ubuntu 26.10
Package: samba 2:4.24.7+dfsg-1ubuntu1
ProcVersionSignature: Ubuntu 7.3.0-10.10-generic 7.3.0
Uname: Linux 7.3.0-10-generic x86_64
ApportVersion: 2.36.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: pass
Date: Sun Nov 15 16:24:07 2026
InstallationDate: Installed on 2026-02-14 (275 days ago)
InstallationMedia: Ubuntu-Server 25.10 "Questing Quokka" - Release amd64
(20251007.1)
ProcEnviron:
LANG=en_US.UTF-8
PATH=(custom, user)
SHELL=/bin/bash
TERM=tmux-256color
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: samba
UpgradeStatus: Upgraded to stonking on 2026-11-01 (14 days ago)
** Affects: samba (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug stonking third-party-packages
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174554
Title:
smbd closes an authenticated session that has no tree connect after a
hard-coded 60 s, ignoring “deadtime” (even deadtime = 0)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2174554/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs