Smbmount broken?
Urban Widmark
urban at teststation.com
Mon Dec 17 14:12:09 GMT 2001
On Sun, 16 Dec 2001, Vance Lankhaar wrote:
> So, I decided to try out 3.0alpha8. It appears that smbmount is broken. :(
> When I mount a share, it appears to mount properly, but when I try to
> list the files in that directory, nothing appears. When I run mount without
> args, it says that it is mounted. Oh yeah - smbmount works as expected in
> 2.2.2, but not HEAD/3.0alpha8.
Someone was a bit too good at removing things when cleaning up some newly
created double-free's. There needs to be a 'c = NULL' for a loop not to be
skipped, causing smbfs to complain and that in turn makes smbmount unmount
the fs.
If you had looked at /proc/mounts instead of /etc/mtab (through 'mount')
you would have seen that smbfs was not actually mounted.
Patch at the end of this email. Let me know if it works so I can get it
added.
Note that the current HEAD version of the smbd server is being nasty. I
negotiate non-unicode but it still sends unicode replies (verified through
tcpdump). So it won't work to run smbfs vs such a server.
After fixing this I am unable to repeat the disappearing directory
problem (never tested before). But I don't think I fixed anything related
to that.
/Urban
Index: source/client/smbmount.c
===================================================================
RCS file: /cvsroot/samba/source/client/smbmount.c,v
retrieving revision 1.49
diff -u -u -r1.49 smbmount.c
--- source/client/smbmount.c 28 Nov 2001 03:56:30 -0000 1.49
+++ source/client/smbmount.c 17 Dec 2001 21:55:18 -0000
@@ -184,6 +184,11 @@
}
}
+ /* This should be right for current smbfs. Future versions will support
+ large files as well as unicode and oplocks. */
+ c->capabilities &= ~(CAP_UNICODE | CAP_LARGE_FILES | CAP_NT_SMBS |
+ CAP_NT_FIND | CAP_STATUS32 | CAP_LEVEL_II_OPLOCKS);
+ c->force_dos_errors = True;
if (!cli_session_setup(c, username,
password, strlen(password),
password, strlen(password),
@@ -355,6 +360,7 @@
If we don't do this we will "leak" sockets and memory on
each reconnection we have to make. */
cli_shutdown(c);
+ c = NULL;
if (!closed) {
/* redirect stdout & stderr since we can't know that
@@ -807,15 +813,6 @@
/* here we are interactive, even if run from autofs */
setup_logging("mount.smbfs",True);
-
- /* CLI_FORCE_ASCII=false makes smbmount negotiate unicode. The default
- is to not announce any unicode capabilities as current smbfs does
- not support it. */
- p = getenv("CLI_FORCE_ASCII");
- if (p && !strcmp(p, "false"))
- unsetenv("CLI_FORCE_ASCII");
- else
- setenv("CLI_FORCE_ASCII", "true", 1);
in_client = True; /* Make sure that we tell lp_load we are */
More information about the samba-technical
mailing list