Bug 106026 - smbmount does not exit
smbmount does not exit
Status: CLOSED DUPLICATE of bug 103202
Product: Red Hat Linux
Classification: Retired
Component: samba (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jay Fenlason
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-01 22:20 EDT by Zenon Panoussis
Modified: 2014-08-31 19:25 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 13:58:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Zenon Panoussis 2003-10-01 22:20:17 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030613

Description of problem:

The following scriptlet, containing a wrong password among the
mount options,

  #!/bin/bash
  /bin/mount -t smbfs -o  \
  "netbiosname=mymachine,workgroup=group,username=user, \
  password=wrongpasswd,ro,debug=4" //machine/c /mnt/dir
  /bin/echo "Exit $?"

returns invariably

  mount.smbfs started (version 2.2.7a-security-rollup-fix)
  added interface ip=192.168.0.53 bcast=192.168.0.255 nmask=255.255.255.0
  resolve_lmhosts: Attempting lmhosts lookup for name machine<0x20>
  getlmhostsent: lmhost entry: 127.0.0.1 localhost
  resolve_hosts: Attempting host lookup for name machine<0x20>
  Connecting to 192.168.0.50 at port 139
  3457: session request ok
  3457: session setup failed: ERRDOS - ERRnoaccess (Access denied.)
  SMB connection failed
  Exit 1

However, the exact same code containing the right password
hangs at the end of the line and doesn't return any exit code
at all:

  #!/bin/bash
  /bin/mount -t smbfs -o  \
  "netbiosname=mymachine,workgroup=group,username=user, \
  password=rightpasswd,ro,debug=4" //machine/c /mnt/dir
  /bin/echo "Exit $?"

reports

  mount.smbfs started (version 2.2.7a-security-rollup-fix)
  added interface ip=192.168.0.53 bcast=192.168.0.255 nmask=255.255.255.0
  resolve_lmhosts: Attempting lmhosts lookup for name machine<0x20>
  getlmhostsent: lmhost entry: 127.0.0.1 localhost
  resolve_hosts: Attempting host lookup for name machine<0x20>
  Connecting to 192.168.0.50 at port 139
  3472: session request ok
  3472: session setup ok
  3472: tconx ok

That's all. The share is correctly mounted and accessible, but
the script hangs forever waiting for mount/smbmount to exit.

Substituting smbmount //machine/c /mnt/dir -o [same options]
for the mount command makes absolutely no difference. Increasing
the debug level to 10 gives no additional information after
"tconx ok". The log contains entries like

  [2003/10/02 02:27:34, 0] client/smbmount.c:send_fs_socket(383)
    mount.smbfs: entering daemon mode for service \\machine\c, pid=3487

and nothing else.

Running mount with strace -v -f -s 128 gives the following:

  <snip endless normal-looking output>

  [pid  3493] open("/mnt/machine", O_RDONLY|O_LARGEFILE) = 6
  [pid  3493] ioctl(6, SMB_IOC_NEWCONN, 0xbfffd080) = 0
  [pid  3493] setsid()                    = 3493
  [pid  3493] kill(3492, SIGTERM)         = 0
  [pid  3493] close(6)                    = 0
  [pid  3493] brk(0)                      = 0x811e000
  [pid  3493] brk(0)                      = 0x811e000
  [pid  3493] brk(0x80fe000)              = 0x80fe000
  [pid  3493] brk(0)                      = 0x80fe000
  [pid  3493] close(3)                    = 0
  [pid  3493] open("/dev/null", O_WRONLY|O_LARGEFILE) = 3
  [pid  3493] getrlimit(0x7, 0xbfffd000)  = 0
  [pid  3493] close(0)                    = 0
  [pid  3493] close(1)                    = 0
  [pid  3493] close(2)                    = 0
  [pid  3493] close(4)                    = 0
  [pid  3493] close(5)                    = 0
  [pid  3493] close(6)                    = -1 EBADF (Bad file descriptor)
  [pid  3493] close(7)                    = -1 EBADF (Bad file descriptor)
  [pid  3493] close(8)                    = -1 EBADF (Bad file descriptor)
  [pid  3493] close(9)                    = -1 EBADF (Bad file descriptor)

  <snip 1011 identical lines>

  [pid  3493] close(1021)                 = -1 EBADF (Bad file descriptor)
  [pid  3493] close(1022)                 = -1 EBADF (Bad file descriptor)
  [pid  3493] close(1023)                 = -1 EBADF (Bad file descriptor)
  [pid  3493] dup2(3, 1)                  = 1
  [pid  3493] dup2(3, 2)                  = 2
  [pid  3493] close(3)                    = 0
  [pid  3493] umask(022)                  = 022
  [pid  3493] open("/var/log/samba/smbmount.log",
  O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = 0
  [pid  3493] fstat64(0, {st_dev=makedev(3, 2), st_ino=32770,
  st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096,
  st_blocks=8, st_size=3221, st_atime=2003/10/02-02:28:44,
  st_mtime=2003/10/02-02:27:34, st_ctime=2003/10/02-02:27:34}) = 0
  [pid  3493] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
  -1, 0) = 0x40018000
  [pid  3493] fstat64(0, {st_dev=makedev(3, 2), st_ino=32770,
  st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096,
  st_blocks=8, st_size=3221, st_atime=2003/10/02-02:28:44,
  st_mtime=2003/10/02-02:27:34, st_ctime=2003/10/02-02:27:34}) = 0
  [pid  3493] _llseek(0, 3221, [3221], SEEK_SET) = 0
  [pid  3493] munmap(0x40018000, 4096)    = 0
  [pid  3493] umask(022)                  = 022
  [pid  3493] time(NULL)                  = 1065054607
  [pid  3493] geteuid32()                 = 0
  [pid  3493] write(0, "[2003/10/02 02:30:07, 0]
  client/smbmount.c:send_fs_socket(383)\n", 63) = 63
  [pid  3493] getpid()                    = 3493
  [pid  3493] geteuid32()                 = 0
  [pid  3493] write(0, "  mount.smbfs: entering daemon mode for service
  \\\\machine\\c, pid=3493\n", 69) = 69
  [pid  3493] rt_sigaction(SIGUSR1, {0x804b150, [USR1], SA_RESTORER|SA_RESTART,
  0x420276f8}, NULL, 8) = 0
  [pid  3493] pause(

And there it stops.

All of Samba comes from the Redhat 9 latest updated binary package,
the system is a freshly-installed stock Redhat 9 with updates and 
the Windows host is an NT4sp6a machine.


Version-Release number of selected component (if applicable):
samba-client-2.2.7a-8.9.0, samba-common-2.2.7a-8.9.0

How reproducible:
Always

Steps to Reproduce:
1. Run mount -t smbfs -o [options]
2. Wait forever


Expected Results:  mount / smbmount should exit 0.

Additional info:

Posted to samba@samba.org, dosn't need to be sent upstream.
Comment 1 Zenon Panoussis 2003-10-01 22:28:57 EDT
Searching properly is better than searching sloppily. The same bug has been
recently reported as #103202. 

Comment 2 David Lawrence 2003-10-02 15:05:46 EDT

*** This bug has been marked as a duplicate of 103202 ***
Comment 3 Red Hat Bugzilla 2006-02-21 13:58:52 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.