The Samba-Bugzilla – Attachment 380 Details for
Bug 993
Errors when creating symlinks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to smbfs and cifs implementations to allow creation of symlinks
kernel-2.6.2-rc3-symlink.diff (text/plain), 2.21 KB, created by
Roman Dubtsov
on 2004-02-04 10:52:02 UTC
(
hide
)
Description:
patch to smbfs and cifs implementations to allow creation of symlinks
Filename:
MIME Type:
Creator:
Roman Dubtsov
Created:
2004-02-04 10:52:02 UTC
Size:
2.21 KB
patch
obsolete
>diff -urN linux-2.6.2-rc3-orig/fs/cifs/link.c linux-2.6.2-rc3/fs/cifs/link.c >--- linux-2.6.2-rc3-orig/fs/cifs/link.c Fri Jan 16 22:37:17 2004 >+++ linux-2.6.2-rc3/fs/cifs/link.c Wed Feb 4 17:36:45 2004 >@@ -141,6 +141,14 @@ > struct cifsTconInfo *pTcon; > char *full_path = NULL; > struct inode *newinode = NULL; >+ char *link = NULL; >+ >+ if (!IS_ROOT(direntry)) { /*XXX: do we need this ?*/ >+ if (!(link = kmalloc(PATH_MAX, GFP_KERNEL))) >+ return -ENOMEM; >+ sprintf(link, "%s/%s", direntry->d_parent->d_name.name, symname); >+ } else >+ link = symname; > > xid = GetXid(); > >@@ -149,11 +157,11 @@ > > full_path = build_path_from_dentry(direntry); > cFYI(1, ("Full path: %s ", full_path)); >- cFYI(1, ("symname is %s", symname)); >+ cFYI(1, ("link is %s", link)); > > /* BB what if DFS and this volume is on different share? BB */ > if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) >- rc = CIFSUnixCreateSymLink(xid, pTcon, full_path, symname, >+ rc = CIFSUnixCreateSymLink(xid, pTcon, full_path, link, > cifs_sb->local_nls); > /* else > rc = CIFSCreateReparseSymLink(xid, pTcon, fromName, toName,cifs_sb_target->local_nls); */ >@@ -176,6 +184,8 @@ > } > } > >+ if (link) >+ kfree(link); > if (full_path) > kfree(full_path); > FreeXid(xid); >diff -urN linux-2.6.2-rc3-orig/fs/smbfs/proc.c linux-2.6.2-rc3/fs/smbfs/proc.c >--- linux-2.6.2-rc3-orig/fs/smbfs/proc.c Wed Feb 4 02:15:18 2004 >+++ linux-2.6.2-rc3/fs/smbfs/proc.c Wed Feb 4 13:10:11 2004 >@@ -3250,7 +3250,15 @@ > char *p, *param; > int result; > struct smb_request *req; >- >+ char *tmp; >+ >+ if (!IS_ROOT(d)) { /*XXX: do we need this ?*/ >+ if (!(tmp = kmalloc(SMB_MAXPATHLEN, GFP_KERNEL))) >+ return -ENOMEM; >+ sprintf(tmp,"%s/%s", d->d_parent->d_name.name, oldpath); >+ } else >+ tmp = oldpath; >+ > result = -ENOMEM; > if (! (req = smb_alloc_request(server, PAGE_SIZE))) > goto out; >@@ -3265,8 +3273,8 @@ > p = param + 6 + result; > > req->rq_trans2_command = TRANSACT2_SETPATHINFO; >- req->rq_ldata = strlen(oldpath) + 1; >- req->rq_data = (char *) oldpath; >+ req->rq_ldata = strlen(tmp) + 1; >+ req->rq_data = (char *) tmp; > req->rq_lparm = p - param; > req->rq_parm = param; > req->rq_flags = 0; >@@ -3282,6 +3290,7 @@ > out_free: > smb_rput(req); > out: >+ kfree(tmp); > return result; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 993
:
379
| 380 |
425
|
1051