IIS服务器:目录不能通过符号链接与目录结点进行比较(仅适用于第一个用户)

我们有一个Web服务器的下列设置:Windows Server 2008 R2标准,IIS 7.5.7600.16385,PHP 5.3.28,我们使用的HMVC框架是Kohana 。

Kohana需要一个caching目录在D:\inetpub\www\application\cacheD:\inetpub\www\是我们的webroot)中是可写的。 我们删除了这个位置的caching目录,并创build了一个符号链接到webroot之外的一个目录: D:\cache ,它是可写的。

它看起来像访问该网站的第一个用户得到错误“caching目录不可写”,这是一个错误Kohana触发,当它没有权限写在目录中的一个错误。 第二,第三等用户不会得到这个错误。 奇怪的是,只有这第一个用户不断得到这个错误,而其他人从来没有看到它。

我们的解决scheme是使用目录连接

我读了 很多关于符号链接和目录交叉点之间差异的 文档 ,但是我不能把它和我们得到的错误联系起来。 我能想到的唯一的事实是,在客户端处理符号链接,而在服务器端处理联结。

哈里·约翰斯顿在这篇文章中的评论指向了两个新的链接,但是我们无法find一个好的解释来解决我们的问题。

@Daan符号链接跨越中小企业的事实记载在SMB有什么新东西? 我不知道任何明确指出连接点不存在的文档,但是它们的实现方式是固有的,我发现创build了SYSVOL Root和Staging区域连接点 ,否则这些连接点不起作用。 (大多数情况下,这只是经验。)

更新:

我监视了进程监视器中的目录,得到如下结果:

用户:Test2,第一个用户(在这里我得到了错误)

 10:21:52.7311891 AM php-cgi.exe QueryOpen D:\inetpub\www\application\cache SUCCESS CreationTime: 8/28/2015 5:12:56 PM, LastAccessTime: 8/28/2015 5:12:56 PM, LastWriteTime: 8/28/2015 5:12:56 PM, ChangeTime: 8/28/2015 5:12:56 PM, AllocationSize: 0, EndOfFile: 0, FileAttributes: DRP 10:21:52.7313164 AM php-cgi.exe CreateFile D:\inetpub\www\application\cache SUCCESS Desired Access: Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NL-COMPUTER1\Test2, OpenResult: Opened 10:21:52.7313552 AM php-cgi.exe QuerySecurityFile D:\inetpub\www\application\cache BUFFER OVERFLOW Information: Owner, Group, DACL 10:21:52.7313725 AM php-cgi.exe CloseFile D:\inetpub\www\application\cache SUCCESS 10:21:52.7314490 AM php-cgi.exe CreateFile D:\inetpub\www\application\cache SUCCESS Desired Access: Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NL-COMPUTER1\Test2, OpenResult: Opened 10:21:52.7314729 AM php-cgi.exe QuerySecurityFile D:\inetpub\www\application\cache SUCCESS Information: Owner, Group, DACL 10:21:52.7314867 AM php-cgi.exe CloseFile D:\inetpub\www\application\cache SUCCESS 

用户:Test3,第二个用户(这里我没有错误)

 10:28:01.7973266 AM php-cgi.exe 5220 QueryOpen D:\inetpub\www\application\cache SUCCESS CreationTime: 8/28/2015 5:12:56 PM, LastAccessTime: 8/28/2015 5:12:56 PM, LastWriteTime: 8/28/2015 5:12:56 PM, ChangeTime: 8/28/2015 5:12:56 PM, AllocationSize: 0, EndOfFile: 0, FileAttributes: DRP 10:28:01.7974467 AM php-cgi.exe 5220 CreateFile D:\inetpub\www\application SUCCESS Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NL-COMPUTER1\Test3, OpenResult: Opened 10:28:01.7974702 AM php-cgi.exe 5220 QueryDirectory D:\inetpub\www\application\cache SUCCESS Filter: cache, 1: cache 10:28:01.7974943 AM php-cgi.exe 5220 CloseFile D:\inetpub\www\application SUCCESS 10:28:01.7975657 AM php-cgi.exe 5220 CreateFile D:\inetpub\www\application\cache SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: None, AllocationSize: n/a, Impersonating: NL-COMPUTER1\Test3, OpenResult: Opened 10:28:01.7976098 AM php-cgi.exe 5220 FileSystemControl D:\inetpub\www\application\cache SUCCESS Control: FSCTL_GET_REPARSE_POINT 10:28:01.7976285 AM php-cgi.exe 5220 CloseFile D:\inetpub\www\application\cache SUCCESS 10:28:01.7977090 AM php-cgi.exe 5220 CreateFile D:\cache SUCCESS Desired Access: Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NL-COMPUTER1\Test3, OpenResult: Opened 10:28:01.7977524 AM php-cgi.exe 5220 QuerySecurityFile D:\cache BUFFER OVERFLOW Information: Owner, Group, DACL 10:28:01.7977657 AM php-cgi.exe 5220 CloseFile D:\cache SUCCESS 10:28:01.7978337 AM php-cgi.exe 5220 CreateFile D:\cache SUCCESS Desired Access: Read Control, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NL-COMPUTER1\Test3, OpenResult: Opened 10:28:01.7978573 AM php-cgi.exe 5220 QuerySecurityFile D:\cache SUCCESS Information: Owner, Group, DACL 10:28:01.7978703 AM php-cgi.exe 5220 CloseFile D:\cache SUCCESS 

有谁知道为什么当我们使用符号链接而不是目录连接时,第一个用户不能在目录中写入?