Bug 113199

Summary: redhat-config-samba cuts passwords short if they contain special characters
Product: [Fedora] Fedora Reporter: Forrest <forresttaylor2000>
Component: redhat-config-sambaAssignee: Brent Fox <bfox>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: mitr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 19:00:41 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:
Attachments:
Description Flags
Put quotes around the password when calling smbpasswd. none

Description Forrest 2004-01-09 17:28:34 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031030

Description of problem:
redhat-config-samba cuts passwords short if they contain special
characters (e.g., &*><, etc.).  Looking at the source, I see that
smbpasswd is called like this:

os.system('/usr/bin/smbpasswd -a -s %s %s' %(unix_name, password))

Running this from the command-line with a password of Hello&GoodBye
yields:

# smbpasswd -a -s username Hello&GoodBye
[1] 26495
bash: GoodBye: command not found

Obviously it expands the &.  Simple quotes fix it:

# smbpasswd -a -s username 'Hello&GoodBye'

Thus the os.system call needs to be changed:

os.system("/usr/bin/smbpasswd -a -s %s '%s'" %(unix_name, password))


Version-Release number of selected component (if applicable):
redhat-config-samba-1.1.4-1

How reproducible:
Always

Steps to Reproduce:
1.  Run redhat-config-passwd and try using a password with special
bash characters.

Actual Results:  Trying to mount an SMB share using that password will
not work because the command interprets the special characters.

Comment 1 Forrest 2004-01-09 17:30:02 UTC
Created attachment 96862 [details]
Put quotes around the password when calling smbpasswd.

Comment 2 Brent Fox 2004-01-12 21:53:29 UTC

*** This bug has been marked as a duplicate of 112528 ***

Comment 3 Red Hat Bugzilla 2006-02-21 19:00:41 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.