Bug 10320 - smbpasswd crashes on invalid input.
smbpasswd crashes on invalid input.
Status: RESOLVED FIXED
Product: Samba 4.0
Classification: Unclassified
Component: Tools
unspecified
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-12 17:27 UTC by Jeremy Allison
Modified: 2014-02-05 10:19 UTC (History)
0 users

See Also:


Attachments
git-am fix for master and 4.1.x. (3.34 KB, patch)
2013-12-12 17:52 UTC, Jeremy Allison
no flags Details
git-am fix for 4.1.next, 4.0.next. (3.54 KB, patch)
2013-12-17 21:06 UTC, Jeremy Allison
vl: review+
Details
git-am fix for 4.1.x (3.58 KB, patch)
2014-01-17 22:09 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2013-12-12 17:27:06 UTC
Reported by Joonas Kuorilehto <joneskoo@codenomicon.com>

--------------------------------------------------------
# echo test | /opt/superdemo/samba/bin/smbpasswd -a test
New SMB password:
Retype new SMB password:Segmentation fault

Oops, I accidently the smbpasswd.

--------------------------------------------------------

The underlying issue is that some of the getpass functions
return NULL on error, some return "". Patch to make this
consistent to follow.

Jeremy.
Comment 1 Jeremy Allison 2013-12-12 17:52:55 UTC
Created attachment 9524 [details]
git-am fix for master and 4.1.x.

Once it's gone into master I'll upload the back-port for 4.0.next.
Comment 2 Jeremy Allison 2013-12-17 21:06:29 UTC
Created attachment 9531 [details]
git-am fix for 4.1.next, 4.0.next.

git fix containing cherry-pick info from master.
Comment 3 Volker Lendecke 2013-12-17 21:15:20 UTC
Karo, please pick for 4.0 and 4.1
Thanks!
Comment 4 Karolin Seeger 2013-12-18 18:38:53 UTC
Pushed to autobuild-v4-0-test.

Patch does not apply to current v4-1-test (80c09fc1cd5a):
user@host:/data/git/samba/v4-1-test$ git am 0001-s3-smbpasswd-fix-crashes-on-invalid-input.patch
Applying: s3: smbpasswd - fix crashes on invalid input.
error: patch failed: source3/utils/passwd_util.c:61
error: source3/utils/passwd_util.c: patch does not apply
Patch failed at 0001 s3: smbpasswd - fix crashes on invalid input.
Comment 5 Karolin Seeger 2013-12-18 18:39:20 UTC
Re-assigning to Jeremy.
Comment 6 Jeremy Allison 2013-12-18 18:56:37 UTC
Hmm - doing the cherry-pick directly from master works.

Can you do:

~/src/samba/git/samba-4-0-test$ git fetch ../master/ master
~/src/samba/git/samba-4-0-test$ git cherry-pick -x ef5a3bedab74420baf0c653cf8e304fe6c2a13b4

instead ?

Jeremy.
Comment 7 Jeremy Allison 2014-01-17 22:09:15 UTC
Created attachment 9603 [details]
git-am fix for 4.1.x

Here is the same patch as applied cleanly to 4.0.x patched with patch -p1 <file
and then re-committed as a git-am fix.

Re-assigning to Karolin for inclusion in 4.1.next.
Comment 8 Karolin Seeger 2014-01-25 15:25:26 UTC
Pushed to autobuild-v4-1-test
Comment 9 Karolin Seeger 2014-02-05 10:19:53 UTC
Pushed to v4-1-test.
Closing out bug report.

Thanks!