Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 568778

Summary: samba-swat does not properly store group names with spaces in them
Product: Red Hat Enterprise Linux 5 Reporter: Jim Roland, RHCE <jroland>
Component: samba3xAssignee: Guenther Deschner <gdeschner>
Status: CLOSED WORKSFORME QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: low    
Version: 5.6CC: azelinka, dpal
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-30 09:38:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jim Roland, RHCE 2010-02-26 15:47:01 UTC
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 Roland, RHCE 2010-02-26 15:52:24 UTC
Additional comments on workaround:
Workarounds: None known, even using typical shell-style or POSIX-style escape techniques to escape the space.

Comment 2 Jim Roland, RHCE 2010-02-26 16:01:07 UTC
Sorry (don't mean to self post), more additional info:  Reported on Samba as well, their bugzilla #7187.

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 4 Guenther Deschner 2010-06-30 13:43:42 UTC
Can you please just try setting the strings like this in samba3x swat ?

"@Domain Admins" or
"@MYDOMAIN\Domain Admins"

(including the quotes)

That just worked fine here.

Comment 5 Guenther Deschner 2010-08-05 12:18:12 UTC
Did you had a chance to try this ? Does it work for you ?

Comment 6 Guenther Deschner 2010-08-30 09:38:34 UTC
No feedback in two months, closing as worksforme