Bug 131 - smbd/vfs.c:reduce_name not handling sym links correctly
Summary: smbd/vfs.c:reduce_name not handling sym links correctly
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 2.2
Classification: Unclassified
Component: File Services (show other bugs)
Version: 2.2.8a
Hardware: All Solaris
: P2 regression
Target Milestone: ---
Assignee: Gerald (Jerry) Carter (dead mail address)
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-27 04:37 UTC by Eric Boehm
Modified: 2005-11-14 09: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 Eric Boehm 2003-05-27 04:37:01 UTC
I am seeing some odd behavior on a Solaris 8 system. If I try to
access a symlinked file, reduce_name is having a problem with the link
    
>From a level 10 log:
    
[2003/05/12 11:50:12, 3, pid=18558] lib/util.c:(387)
  unix_clean_name [/disk2/OC192/syee_test1.bat]
[2003/05/12 11:50:12, 3, pid=18558] smbd/vfs.c:(800)
  reduce_name [disk2/OC192/syee_test1.bat] [/vobstore]
[2003/05/12 11:50:12, 3, pid=18558] smbd/vfs.c:(574)
  vfs_ChDir to disk2/OC192
[2003/05/12 11:50:12, 3, pid=18558] smbd/vfs.c:(574)
  vfs_ChDir to /vobstore
[2003/05/12 11:50:12, 3, pid=18558] smbd/vfs.c:(744)
  reduce_name: file path name /vobstore/disk2/OC192/syee_test1.bat is a symlink
  Checking it's path
[2003/05/12 11:50:12, 3, pid=18558] lib/util.c:(387)
  unix_clean_name [/vobstore/../SYEE/syee_test1.bat]
    
The file
    
/vobstore/disk2/OC192/syee_test1.bat is a relative symlink to
/vobstore/disk2/SYEE/syee_test1.bat
    
That is, /vobstore/disk2/OC192 contains
syee_test1.bat -> ../SYEE/syee_test1.bat


[2003/05/12 11:50:12, 2, pid=18558] smbd/vfs.c:(755)
  Bad access attempt? s=/vobstore/disk2/OC192/syee_test1.bat dir=/vobstore
+newname=/SYEE/syee_test1.bat l=9

For some reason, it's parsing the symlink as
    
/vobstore/SYEE/syee_test1.bat, leaving out the disk2 component.
    

[2003/05/12 11:50:12, 3, pid=18558] smbd/vfs.c:(574)
  vfs_ChDir to /vobstore/disk2/OC192
[2003/05/12 11:50:12, 2, pid=18558] smbd/vfs.c:(864)
  Bad access attemt? disk2/OC192/syee_test1.bat is a symlink outside the share
+pathcall_trans2qfilepathinfo: check_name of disk2/OC192/syee_test1.bat failed
(Error 0)

The very odd part is that if the symlink is an absolute symlink, it
works fine.
  
Just to confuse things further, if I reproduce this structure on
another server, it never appears to call reduce_name -- it just goes
ahead and reads the file.
    
The pattern of access in the 2 level 10 logs is different. The 2 logs
files are about 600 lines each.

I hesitate to attach them here but can provide them if someone can
take a look.
Comment 1 Gerald (Jerry) Carter (dead mail address) 2004-02-17 08:46:02 UTC
Sorry, but the 2.2 is not under development any longer.
If you can reproduce this bug against the latest 3.0 release, 
please reopen this bug and change the version in the report.
Thanks.
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:27:10 UTC
database cleanup