From: Igor Mammedov <niallain@gmail.com>
To: Steve French <smfrench@gmail.com>
Cc: "Q (Igor Mammedov)" <qwerty0987654321@mail.ru>,
Jeremy Allison <jra@samba.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: DFS patch series - fixed
Date: Sat, 26 Apr 2008 21:41:25 +0400 [thread overview]
Message-ID: <48136945.5020004@gmail.com> (raw)
In-Reply-To: <524f69650804251734y48a1ccf8g899b4bc3a5a21262@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 795 bytes --]
Steve French wrote:
> I merged the first patch in your remaining cifs dfs series patch
> 0001-Adds-to-dns_resolver-checking-if-the-server-name-is.patch into
> the cifs tree, but isn't this section of the 2nd patch of three ie
> 0002-fixed-compatibility-issue-with-samba-a-refferal-req.patch
> incorrect? It is converting the slashes in the whole path (not in the
> UNC prefix) - so escape sequences in real posix directory and file
> names will be converted to separators. This seems wrong. We should
> be converting just the treename part here.
>
> ...
Fixed, now it converts only treeName part of the path:
0003-fixed-compatibility-issue-with-samba-a-refferal-requ.patch
In my test setup it works.
--
Best regards,
-------------------------
Igor Mammedov,
niallain "at" gmail.com
[-- Attachment #2: 0003-fixed-compatibility-issue-with-samba-a-refferal-requ.patch --]
[-- Type: text/x-patch, Size: 2343 bytes --]
>From 29f7313c1e594b5c2c9ff0e0672d551c23354c7d Mon Sep 17 00:00:00 2001
From: Igor Mammedov <niallain@gmail.com>
Date: Sat, 26 Apr 2008 21:20:28 +0400
Subject: [PATCH] fixed compatibility issue with samba:a refferal request treeName
part is canonized to '/' path separator
Signed-off-by: Igor Mammedov <niallain@gmail.com>
---
fs/cifs/cifs_dfs_ref.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index f53f41f..e0a3a56 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -81,15 +81,11 @@ static char *cifs_get_share_name(const char *node_name)
/* find sharename end */
pSep++;
pSep = memchr(UNC+(pSep-UNC), '\\', len-(pSep-UNC));
- if (!pSep) {
- cERROR(1, ("%s:2 cant find share name in node name: %s",
- __func__, node_name));
- kfree(UNC);
- return NULL;
+ if (pSep) {
+ /* trim path up to sharename end
+ * now we have share name in UNC */
+ *pSep = 0;
}
- /* trim path up to sharename end
- * * now we have share name in UNC */
- *pSep = 0;
return UNC;
}
@@ -176,7 +172,7 @@ static char *compose_mount_options(const char *sb_mountdata,
tkn_e = strchr(tkn_e+1, '\\');
if (tkn_e) {
strcat(mountdata, ",prefixpath=");
- strcat(mountdata, tkn_e);
+ strcat(mountdata, tkn_e+1);
}
}
@@ -232,7 +228,8 @@ static char *build_full_dfs_path_from_dentry(struct dentry *dentry)
return NULL;
if (cifs_sb->tcon->Flags & SMB_SHARE_IS_IN_DFS) {
- /* we should use full path name to correct working with DFS */
+ int i;
+ /* we should use full path name for correct working with DFS */
l_max_len = strnlen(cifs_sb->tcon->treeName, MAX_TREE_SIZE+1) +
strnlen(search_path, MAX_PATHCONF) + 1;
tmp_path = kmalloc(l_max_len, GFP_KERNEL);
@@ -241,8 +238,14 @@ static char *build_full_dfs_path_from_dentry(struct dentry *dentry)
return NULL;
}
strncpy(tmp_path, cifs_sb->tcon->treeName, l_max_len);
- strcat(tmp_path, search_path);
tmp_path[l_max_len-1] = 0;
+ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
+ for (i = 0; i < l_max_len; i++) {
+ if (tmp_path[i] == '\\')
+ tmp_path[i] = '/';
+ }
+ strncat(tmp_path, search_path, l_max_len - strlen(tmp_path));
+
full_path = tmp_path;
kfree(search_path);
} else {
--
1.5.3.7
next prev parent reply other threads:[~2008-04-26 17:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-26 0:34 DFS patch series Steve French
2008-04-26 17:41 ` Igor Mammedov [this message]
2008-04-28 3:40 ` DFS patch series - fixed Steve French
2008-04-28 8:05 ` Igor Mammedov
2008-04-28 23:06 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48136945.5020004@gmail.com \
--to=niallain@gmail.com \
--cc=jra@samba.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=qwerty0987654321@mail.ru \
--cc=smfrench@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).