Bug 7187 - samba-swat does not properly store group names with spaces in them
Summary: samba-swat does not properly store group names with spaces in them
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 3.3
Classification: Unclassified
Component: SWAT (show other bugs)
Version: unspecified
Hardware: All Linux
: P3 major
Target Milestone: ---
Assignee: Kai Blin
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-26 09:52 UTC by Jim R
Modified: 2013-09-02 12:55 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim R 2010-02-26 09:52:11 UTC
Reference RedHat Bugzilla reported on: 568778
Workarounds: None known, even using typical shell-style or POSIX-style escape techniques to escape the space.

Description of problem:
When editing with swat, group or user listings (such as global or share-based
configuration items like "admin users" or "write list") do not get stored
properly.  When typing in the admin interface (even with double quotes), I get
a comma in place of the space, thus making the config file split the entry into
two groups (DOMAIN\\Domain Admins turns into 2 groups: DOMAIN\\Domain and
another called Admins: DOMAIN\\Domain, Admins instead of the intended
DOMAIN\\Domain Admins or "DOMAIN\\Domain Admins" or DOMAIN\\Domain\ Admins)

Version-Release number of selected component (if applicable):
3.0.33, release 3.15.el5_4.1:
Installed Packages
Name       : samba-swat
Arch       : i386
Version    : 3.0.33
Release    : 3.15.el5_4.1
Size       : 16 M


How reproducible:
Every time, just add a group such as "DOMAIN\\Domain Admins" and you will get
in the result list after saving:  DOMAIN\\Domain, Admins instead of the correct
string.

Steps to Reproduce:
1. Edit any entry in swat requiring a user or group name
2. Include a space in the name, surround with double quotes, or even
backslash-escape a space in the string (eg: @DOMAIN\\Domain Admins or
@DOMAIN\\Domain\ Admins will result in an entry @DOMAIN\\Domain, Admins or
@DOMAIN\\Domain\, Admins), does not matter if quotes are used or not, no
difference.

Resulting entries in the file (for reference, used "\ " to escape the space,
however it still places a comma as if I never inserted the space):
[Share]
        comment = Administrative Share for Admins
        path = /samba-shares
        valid users = @DOMAIN\\Domain\, Admins
        admin users = @DOMAIN\\Domain\, Admins
        read only = No
Comment 1 Jim R 2010-02-26 09:58:38 UTC
Additional information:  This is also a problem in smb.conf, unless the group name with a space has quotation marks in it, it is interpreted as 2 groups as well, even if trailed by a comma in the correct place.  To make the group (with a space in the name) work, the smb.conf file must be manually edited and quoted (with double quotes), then smbd/nmbd sees the group properly, even though not correctly created/edited by swat.  Only double-quotes work (backslash shell-escaping the space does not work)
Comment 2 Björn Jacke 2013-09-02 12:55:22 UTC
swat is removed in 4.1