Bug 4018 - Problem accessings files from NetApp filers
Summary: Problem accessings files from NetApp filers
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.20b
Hardware: x86 Linux
: P3 major
Target Milestone: none
Assignee: Derrell Lipman
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-15 12:49 UTC by Stefan Fink
Modified: 2007-05-25 15:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Fink 2006-08-15 12:49:04 UTC
Hello

We use several NetApp filers to share files to windows desktops. If I try to access any file of those NetApp filers from Linux via smbget or via Konqueror and kio_slave kio_smb (which uses libsmbclient) I get a 'smbc_open: Not a directory' error. This problem has been reported a long time ago to the kde buglist by other users of NetApp filers (http://bugs.kde.org/show_bug.cgi?id=80833) but is probably more a libsmbclient problem.

It seems that the problem lies in the fact, that the NetApp filers insist on leading backslashes for the paths to access and that libsmbclient does not generate this leading backslash when splitting smb:// style urls.

I patched the smbc_parse_path() function in libsmbclient.c so that it returns always a leading backslash for the path component:

--- libsmbclient.c      2006-08-15 19:27:42.000000000 +0200
+++ libsmbclient.c.orig 2006-08-15 16:04:43.000000000 +0200
@@ -364,8 +364,7 @@

        }

-       /* make sure path starts with '/' by copying also the separator '/' between the share and the path */
-        safe_strcpy(path, p - 1, path_len - 1);
+        safe_strcpy(path, p, path_len - 1);

        all_string_sub(path, "/", "\\", 0);

This patch resolved the described problem. It seems that the problem exists for all Samba 3.0 version. No testing or analysing of Samba 4 has been done.

Greetings

Stefan Fink
Comment 1 Derrell Lipman 2006-09-02 20:38:56 UTC
This should be fixed by check-in 18012.  Stefan, please test and let me know whether this fixes the problem, since I have no NetApp filer to test against.

Derrell
Comment 2 Stefan Fink 2006-09-15 04:10:30 UTC
Hello Derrell

I've testet your version of the patch.

Everything fine and working.

Thanks

Stefan
Comment 3 Derrell Lipman 2006-09-15 08:03:42 UTC
Thanks!  Closing.
Comment 4 Steve French 2007-05-25 15:27:29 UTC
Some asked if Linux cifs client also had this problem - linux cifs client always begins paths with a / or \ (depending on the server) so it should not have had this problem.