Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Using Ubuntu Server 10.04 LTS, I recently upgraded to the latest samba and smbfs via apt-get, and when I mount our windows share via SMB, I'm getting this kind of error:

root@orbital testsmb/test# mkdir "spaces test"

root@orbital testsmb/test# ll
total 5
drwxr-xr-x  3 nobody nobody    0 Aug  4 17:32 .
drwxr-xr-x 37 nobody nobody    0 Aug  4 17:24 ..
drwxr-xr-x  0 nobody nobody 4096 Aug  4 17:32 spaces test

root@orbital testsmb/test# cd spaces\ test/
dirname: extra operand `test'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

root@orbital /spaces# pwd
/home/testsmb/test/spaces test
dirname: extra operand `test'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

Even using quotes, single and double, don't work:

root@orbital /spaces# cd ..
root@orbital testsmb/test# cd "spaces test"
dirname: extra operand `test'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

root@orbital /spaces# cd ..

root@orbital testsmb/test# cd 'spaces test'
dirname: extra operand `test'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

Here is my sanitized /etc/fstab:

//192.168.xx.xx/winshare      /home/testsmb  smbfs   rw,credentials=/etc/samba/winshare.creds,uid=nobody,gid=nobody,auto   0       0
  • None of this happens on local file systems.
  • Also an older SuSE box with an ancient smbfs doesn't run into these problems.
share|improve this question
1  
Err, what happens when you use tab complete to get there using cd? ie. cd testsmb/test then cd spa<tab>. –  user606723 Aug 4 '11 at 19:53
    
The tab completion as user606723 already stated is one of the hints i can think of. The other is whether you've you tried to mount a shared folder on another linux box and check if the problem remains. –  Pavlos G. Aug 4 '11 at 20:00
    
Tab completion works fine for the first level of spaces (ie, cd 'spaces test' completes as cd spaces\ test/ ). But then further tab completion inside of that folder fails as if it has no content. –  r00fus Aug 4 '11 at 22:17
    
It would be interesting to see what is in /etc/samba/winshare.creds, and in ~/.bashrc. Also the output of type cd. –  enzotib Aug 5 '11 at 6:45
    
enzotib, the creds file is one line with domain\user followed by one line with password. Since I can actually see files on the share, I doubt it's a credentials issue. I can also reproduce this issue by directly mounting with credentials in /etc/fstab (which I prefer not to do). I can reproduce this problem with a newly added user (stock .bashrc for 10.04), so no user-modifications. type cd returns "cd is a shell builtin" –  r00fus Aug 5 '11 at 22:46

1 Answer 1

You have a broken alias setup for the cd command that is trying to do something involving dirname and su. Fix or remove the broken alias.

share|improve this answer
    
Alias reports egrep, fgrep, grep, ls, ll, and penv-reload. I unaliased the last two (as they're not stock) and I still have the same symptoms. Also this doesn't happen on the local FS, only when I'm traversing space-embedded areas on an smbfs/cifs mounted drive. –  r00fus Aug 4 '11 at 22:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.