Default [homes] share template uses incorrect %S macro.

Bug #668368 reported by Adam Buchbinder
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Debian)
samba (Ubuntu)

Bug Description

Binary package hint: samba

The default smb.conf suggests a rather unhelpful default for the 'valid users' option in the [homes] section. It's commented out by default, but uncommenting the template leads to some unexpected behavior.

(See for some more background; that's a related problem which exists upstream.)

The suggestion is to use %S as a parameter ("valid users = %S"); back around 2005, this expanded to the username, meaning that this setting enforced that users could only log into their own home share, as described. Now, however, it expands to the current service name, which is very unlikely to match the username. The configuration incorrectly states that %S expands to the username, which is no longer true. Using the default configuration leads to confusing failures; the proper setting here is to have "valid users = %U" as the default, since %U expands to the name of the current user, according to the smb.conf(5) manpage.

This is present in samba 2:3.4.7~dfsg-1ubuntu3.2 on Lucid, at least. It was, according to debian/changelog, added in 3.0.22-1ubuntu3, and is still present in debian/smb.conf in the current version, 2:3.5.4~dfsg-1ubuntu8, in Maverick. The attached patch against debian/smb.conf from the version in Maverick fixes the issue.

Tags: patch
Revision history for this message
Adam Buchbinder (adam-buchbinder) wrote :
tags: added: patch
James Page (james-page)
Changed in samba (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for reporting this issue and attaching a patch. The best way for us to fix this in Ubuntu is to get it fixed in the upstream Debian package. Could you please file a bug in the upstream Debian bug tracker and link the upstream bug report here? (


Revision history for this message
Bryce Harrington (bryce) wrote :

According to the upstream bug report:

To my understanding, %S (== the name of the service connected to) is
appropriate here, since the user connects to a share with name equal to the
user's name, so in this special case, %S is the same as the username.

So it is unclear if changing from %U to %S is actually appropriate here.
Please investigate further and re-subscribe sponsors when a more definitive solution is identified.

Changed in samba (Debian):
importance: Undecided → Unknown
status: New → Unknown
Revision history for this message
Christian Perrier (bubulle) wrote :

I use the %S macro in about all my servers, so it works perfectly well and this bug is invalid

Changed in samba (Ubuntu):
status: Triaged → Invalid
Changed in samba (Debian):
importance: Unknown → Low
status: Unknown → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.