Bug 4084 - smbclient segfaults completing filename that starts with 'dir'
Summary: smbclient segfaults completing filename that starts with 'dir'
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: smbclient (show other bugs)
Version: 3.0.23b
Hardware: x64 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
Depends on:
Reported: 2006-09-07 01:53 UTC by Steve Leung
Modified: 2006-09-11 16:35 UTC (History)
0 users

See Also:

fixes crash in completing files named dir* (487 bytes, patch)
2006-09-07 01:55 UTC, Steve Leung
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Leung 2006-09-07 01:53:09 UTC
To reproduce:
- build smbclient with readline support
- connect to a share with smbclient, specifying -U and a password on commandline
- make sure there is a local file whose name starts with 'dir'.  I used a file named 'dirvish-1.2.1.tgz'
- ensure that the remote share you're connected to doesn't have a file that starts with 'dir'.
- at the smbclient prompt, type 'put dir' and then hit TAB to complete.
- smbclient segfaults

I reproduced this on svn 18196 as well as ubuntu's 3.0.21c for amd64.

- I've tested with other filenames, but 'dir' seems to be key.  typing just 'di' and completing works ok, while typing more than just 'dir' seems to still crash.
- if a remote file exists whose name starts with 'dir', it completes ok.  but if you then 'del' the file and then try reproducing the problem (without exiting smbclient), for me the completion works but outputs garbage characters.

will attach patch that appears to fix the problem.
Comment 1 Steve Leung 2006-09-07 01:55:12 UTC
Created attachment 2129 [details]
fixes crash in completing files named dir*

The same function occurs in smbctool.c, but I'm not sure how to trigger the same problem in that function.
Comment 2 Volker Lendecke 2006-09-11 16:35:18 UTC
Remote filename completion seemed more broken to me, so I put some more work into it. SVN revision 18402 should fix it properly.

Please-reopen if it's not fixed.