BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares  <p style="margin:0in 0in 10pt"><font face=calibri>I’ve found a bug in how Vista treats SeBackupPrivilege when accessing network shares exported by SMB version 1 servers.  Even after SeBackupPrivilege is enabled in a Vista session, the SMB packets created by calls to FindFirstFile()/FindNextFile() will result in Access Denied if the NTFS ACL’s on the server would block the caller’s request.  The result is that backup applications running on Vista cannot backup shares hosted on Windows 2003.</font></p> <p style="margin:0in 0in 10pt"><font face=calibri>I’ve captured a packet trace using Microsoft Network Monitor 3.2 and attached it to this message. I believe the error can be seen in Frame 19.  If you examine the FindFirst2ParamaterBlock section, you will see that <b>BackupIntent</b>  is set to <b>find without backup intent</b>. This is an error. The BackupIntent needs to be enabled.</font></p> <p style="margin:0in 0in 10pt"><img alt="" src="http://www.carroll.com/images/ScreenShot.jpg"></p> <p style="margin:0in 0in 10pt"><font face=calibri><br><a href="http://www.carroll.com/images/smbcapture.cap"><strong>Download full capture</strong></a><strong> <br></strong><br>Interesting Note: I examined a similar packet trace initiated from a W2k3 client accessing the W2k3 server and it shows that BackupIntent is enabled. The request therefore succeeded.</font></p> <p style="margin:0in 0in 10pt"><font face=calibri>What’s interesting is the problem does not manifest when accessing SMB2 exported shares. Vista clients have no difficulty accessing another Vista system acting as a server. The problem also does not manifest when W2k3 acts as a client accessing another W2k3 server (which is SMB version 1 to SMB version 1).</font></p> <p style="margin:0in 0in 10pt"><b><font face=calibri>The problem only happens when accessing an SMB version 1 share exported from a W2k3 server, accessed from a Vista client.</font></b></p> <p style="margin:0in 0in 10pt"><font face=calibri> </font></p> <h2 style="margin:12pt 0in 3pt"><i><font face=cambria>The setup</font></i></h2> <p style="margin:0in 0in 10pt"><font face=calibri>On W2K3, create the folder C:\Temp\t\sub. Remove inheritance from the ACL of C:\Temp\t\sub. Set the owner to a non-administrator/”regular” user. Remove all other ACL’s. Share out C:\Temp</font></p> <p style="margin:0in 0in 10pt"><font face=calibri>On Vista (32-bit Business Edition, SP1), open a command prompt as elevated Administrator. “NET USE” to the W2k3 share using the credentials of an account in the Backup Operator’s group of the W2k3 server.</font></p> <p style="margin:0in 0in 10pt"><font face=calibri>Run the following program</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>#include</font><font face="'courier new'" size=1> <font color="#a31515">&quot;stdafx.h&quot;</font> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#a31515" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>bool</font><font face="'courier new'" size=1> enablepriv(<font color="#0000ff">const</font> TCHAR priv[]);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>int</font><font face="'courier new'" size=1> recurse(TCHAR path[]);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>int</font><font face="'courier new'" size=1> _tmain(<font color="#0000ff">int</font> argc, _TCHAR* argv[]){</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (argc &lt; 2) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;usage: %s  {path-name}\n&quot;</font>),argv[0]);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (enablepriv(SE_BACKUP_NAME) != TRUE)</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>      <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">return</font> recurse(argv[1]);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>int</font><font face="'courier new'" size=1> recurse(TCHAR path[]) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   _tprintf(TEXT(<font color="#a31515">&quot;DIR  %s\\\n&quot;</font>),path);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   TCHAR ppath[2048];</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">const</font> size_t psz = 2048;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   _tcscpy_s(ppath, psz, path);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   _tcscat_s(ppath, psz, TEXT(<font color="#a31515">&quot;\\*&quot;</font>));</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   WIN32_FIND_DATA fdata;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   HANDLE hnd = FindFirstFile(ppath, &amp;fdata);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (hnd == INVALID_HANDLE_VALUE) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Can't access path %s, w32error %d\n&quot;</font>),path,GetLastError());</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       } </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">do</font> {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#008000">// skip '.' and '..'</font> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">if</font> (_tcscmp(fdata.cFileName, TEXT(<font color="#a31515">&quot;.&quot;</font>)) == 0 || _tcscmp(fdata.cFileName,TEXT(<font color="#a31515">&quot;..&quot;</font>)) == 0)</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          <font color="#0000ff">continue</font>;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">if</font> (fdata.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          <font color="#0000ff">if</font> (fdata.dwFileAttributes &amp; FILE_ATTRIBUTE_REPARSE_POINT) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              <font color="#008000">// skip reparse points</font> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          <font color="#0000ff">else</font>{</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              _tcscpy_s(ppath, psz, path);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              _tcscat_s(ppath, psz, TEXT(<font color="#a31515">&quot;\\&quot;</font>));</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              _tcscat_s(ppath, psz, fdata.cFileName);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              <font color="#0000ff">if</font> (recurse(ppath) != 0)</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>                 <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">else</font>{</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          _tprintf(TEXT(<font color="#a31515">&quot;FILE %s\\%s\n&quot;</font>),path, fdata.cFileName);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       } <font color="#0000ff">while</font>(FindNextFile(hnd, &amp;fdata) != 0);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   DWORD rc = GetLastError();</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   FindClose(hnd);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (rc != ERROR_NO_MORE_FILES) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Error retrieving directory %s, w32error %d\n&quot;</font>),path,rc);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">return</font> 0;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>bool</font><font face="'courier new'" size=1> enablepriv(<font color="#0000ff">const</font> TCHAR priv[]) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   HANDLE token;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (!OpenThreadToken(GetCurrentThread(),TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, TRUE, &amp;token))</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &amp;token);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (token == 0) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Unable to retrieve token. w32error %d\n&quot;</font>), GetLastError());</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> FALSE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   LUID mluid;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (0 == LookupPrivilegeValue(0, priv, &amp;mluid)) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Can't lookup privilege %s, w32error %d\n&quot;</font>), priv, GetLastError());</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> FALSE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   TOKEN_PRIVILEGES tp;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   tp.PrivilegeCount = 1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   tp.Privileges[0].Luid = mluid;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (0 == AdjustTokenPrivileges(token, FALSE, &amp;tp, 0, 0, 0)) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Can't adjust privilege, w32error %d\n&quot;</font>), GetLastError());</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> FALSE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (GetLastError() == ERROR_NOT_ALL_ASSIGNED) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;You lack the necessary privileges to set %s\n&quot;</font>), priv);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> FALSE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">return</font> TRUE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> <br></font></p></font> <p style="margin:0in 0in 0pt;line-height:normal"> <p></p> <p></p></font> <p style="margin:0in 0in 0pt;line-height:normal"> <p></p> <p></p></font> <p></p> <p>Any insight offered would be greatly appreciated.<br><br>---<br>Jim C.</p><hr size="1" align="left" width="25%">Jim C© 2009 Microsoft Corporation. All rights reserved.Mon, 26 Jan 2009 20:08:24 Z913ba4ce-f57a-43f2-8a3d-116b28697c56http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#913ba4ce-f57a-43f2-8a3d-116b28697c56http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#913ba4ce-f57a-43f2-8a3d-116b28697c56Jim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares  <p style="margin:0in 0in 10pt"><font face=calibri>I’ve found a bug in how Vista treats SeBackupPrivilege when accessing network shares exported by SMB version 1 servers.  Even after SeBackupPrivilege is enabled in a Vista session, the SMB packets created by calls to FindFirstFile()/FindNextFile() will result in Access Denied if the NTFS ACL’s on the server would block the caller’s request.  The result is that backup applications running on Vista cannot backup shares hosted on Windows 2003.</font></p> <p style="margin:0in 0in 10pt"><font face=calibri>I’ve captured a packet trace using Microsoft Network Monitor 3.2 and attached it to this message. I believe the error can be seen in Frame 19.  If you examine the FindFirst2ParamaterBlock section, you will see that <b>BackupIntent</b>  is set to <b>find without backup intent</b>. This is an error. The BackupIntent needs to be enabled.</font></p> <p style="margin:0in 0in 10pt"><img alt="" src="http://www.carroll.com/images/ScreenShot.jpg"></p> <p style="margin:0in 0in 10pt"><font face=calibri><br><a href="http://www.carroll.com/images/smbcapture.cap"><strong>Download full capture</strong></a><strong> <br></strong><br>Interesting Note: I examined a similar packet trace initiated from a W2k3 client accessing the W2k3 server and it shows that BackupIntent is enabled. The request therefore succeeded.</font></p> <p style="margin:0in 0in 10pt"><font face=calibri>What’s interesting is the problem does not manifest when accessing SMB2 exported shares. Vista clients have no difficulty accessing another Vista system acting as a server. The problem also does not manifest when W2k3 acts as a client accessing another W2k3 server (which is SMB version 1 to SMB version 1).</font></p> <p style="margin:0in 0in 10pt"><b><font face=calibri>The problem only happens when accessing an SMB version 1 share exported from a W2k3 server, accessed from a Vista client.</font></b></p> <p style="margin:0in 0in 10pt"><font face=calibri> </font></p> <h2 style="margin:12pt 0in 3pt"><i><font face=cambria>The setup</font></i></h2> <p style="margin:0in 0in 10pt"><font face=calibri>On W2K3, create the folder C:\Temp\t\sub. Remove inheritance from the ACL of C:\Temp\t\sub. Set the owner to a non-administrator/”regular” user. Remove all other ACL’s. Share out C:\Temp</font></p> <p style="margin:0in 0in 10pt"><font face=calibri>On Vista (32-bit Business Edition, SP1), open a command prompt as elevated Administrator. “NET USE” to the W2k3 share using the credentials of an account in the Backup Operator’s group of the W2k3 server.</font></p> <p style="margin:0in 0in 10pt"><font face=calibri>Run the following program</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>#include</font><font face="'courier new'" size=1> <font color="#a31515">&quot;stdafx.h&quot;</font> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#a31515" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>bool</font><font face="'courier new'" size=1> enablepriv(<font color="#0000ff">const</font> TCHAR priv[]);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>int</font><font face="'courier new'" size=1> recurse(TCHAR path[]);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>int</font><font face="'courier new'" size=1> _tmain(<font color="#0000ff">int</font> argc, _TCHAR* argv[]){</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (argc &lt; 2) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;usage: %s  {path-name}\n&quot;</font>),argv[0]);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (enablepriv(SE_BACKUP_NAME) != TRUE)</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>      <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">return</font> recurse(argv[1]);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>int</font><font face="'courier new'" size=1> recurse(TCHAR path[]) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   _tprintf(TEXT(<font color="#a31515">&quot;DIR  %s\\\n&quot;</font>),path);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   TCHAR ppath[2048];</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">const</font> size_t psz = 2048;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   _tcscpy_s(ppath, psz, path);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   _tcscat_s(ppath, psz, TEXT(<font color="#a31515">&quot;\\*&quot;</font>));</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   WIN32_FIND_DATA fdata;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   HANDLE hnd = FindFirstFile(ppath, &amp;fdata);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (hnd == INVALID_HANDLE_VALUE) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Can't access path %s, w32error %d\n&quot;</font>),path,GetLastError());</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       } </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">do</font> {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#008000">// skip '.' and '..'</font> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">if</font> (_tcscmp(fdata.cFileName, TEXT(<font color="#a31515">&quot;.&quot;</font>)) == 0 || _tcscmp(fdata.cFileName,TEXT(<font color="#a31515">&quot;..&quot;</font>)) == 0)</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          <font color="#0000ff">continue</font>;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">if</font> (fdata.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          <font color="#0000ff">if</font> (fdata.dwFileAttributes &amp; FILE_ATTRIBUTE_REPARSE_POINT) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              <font color="#008000">// skip reparse points</font> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          <font color="#0000ff">else</font>{</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              _tcscpy_s(ppath, psz, path);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              _tcscat_s(ppath, psz, TEXT(<font color="#a31515">&quot;\\&quot;</font>));</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              _tcscat_s(ppath, psz, fdata.cFileName);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              <font color="#0000ff">if</font> (recurse(ppath) != 0)</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>                 <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>              }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">else</font>{</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          _tprintf(TEXT(<font color="#a31515">&quot;FILE %s\\%s\n&quot;</font>),path, fdata.cFileName);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>          }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       } <font color="#0000ff">while</font>(FindNextFile(hnd, &amp;fdata) != 0);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   DWORD rc = GetLastError();</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   FindClose(hnd);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (rc != ERROR_NO_MORE_FILES) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Error retrieving directory %s, w32error %d\n&quot;</font>),path,rc);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> -1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">return</font> 0;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font style="" face="'courier new'" color="#0000ff" size=1>bool</font><font face="'courier new'" size=1> enablepriv(<font color="#0000ff">const</font> TCHAR priv[]) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   HANDLE token;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (!OpenThreadToken(GetCurrentThread(),TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, TRUE, &amp;token))</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &amp;token);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (token == 0) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Unable to retrieve token. w32error %d\n&quot;</font>), GetLastError());</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> FALSE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   LUID mluid;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (0 == LookupPrivilegeValue(0, priv, &amp;mluid)) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Can't lookup privilege %s, w32error %d\n&quot;</font>), priv, GetLastError());</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> FALSE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   TOKEN_PRIVILEGES tp;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   tp.PrivilegeCount = 1;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   tp.Privileges[0].Luid = mluid;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (0 == AdjustTokenPrivileges(token, FALSE, &amp;tp, 0, 0, 0)) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;Can't adjust privilege, w32error %d\n&quot;</font>), GetLastError());</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> FALSE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">if</font> (GetLastError() == ERROR_NOT_ALL_ASSIGNED) {</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       _tprintf(TEXT(<font color="#a31515">&quot;You lack the necessary privileges to set %s\n&quot;</font>), priv);</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       <font color="#0000ff">return</font> FALSE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>       }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> </font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   <font color="#0000ff">return</font> TRUE;</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1>   }</font></p> <p style="margin:0in 0in 0pt;line-height:normal"><font face="'courier new'" size=1> <br></font></p></font> <p style="margin:0in 0in 0pt;line-height:normal"> <p></p> <p></p></font> <p style="margin:0in 0in 0pt;line-height:normal"> <p></p> <p></p></font> <p></p> <p>Any insight offered would be greatly appreciated.<br><br>---<br>Jim C.</p><hr size="1" align="left" width="25%">Jim CMon, 13 Oct 2008 00:13:50 Z2008-10-13T00:13:50Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#60d606d0-40a4-4972-a6f8-48299df63fa0http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#60d606d0-40a4-4972-a6f8-48299df63fa0Bill Wesse MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Bill%20Wesse%20MSFTBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) sharesGood morning Jim. I have alerted our Protocols Support team concerning your questions about [MS-SMB] and Vista SeBackupPrivilege. One of our team members will be in contact with you soon. Please note we may need to reroute your question to another internal team, as it might not be specific to the protocol documentation. <p>Thanks for your questions!<br></p><hr size="1" align="left" width="25%">Escalation EngineerMon, 13 Oct 2008 13:47:25 Z2008-10-13T13:47:25Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#f9d5f8cd-855d-4762-917e-3585453882adhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#f9d5f8cd-855d-4762-917e-3585453882adObaid Farooqihttp://social.msdn.microsoft.com/Profile/en-US/?user=Obaid%20FarooqiBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Good Morning Jim C.<br> My name is Obaid Farooqi and I would be helping you with this case.<hr size="1" align="left" width="25%">Regards, Obaid FarooqiMon, 13 Oct 2008 16:20:02 Z2008-10-13T16:20:02Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#ba9d88fa-a269-42c8-9a58-d1a613cb3e9dhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#ba9d88fa-a269-42c8-9a58-d1a613cb3e9dJim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Sounds good Obaid. Let me know if I can provide further information.  <br><br>Thanks<br>Jim C.<br><hr size="1" align="left" width="25%">Jim CMon, 13 Oct 2008 16:56:52 Z2008-10-13T16:56:52Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#5a88c77c-bcd5-489f-9773-eef4262de0e5http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#5a88c77c-bcd5-489f-9773-eef4262de0e5Jim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Hi Obaid. <br><br>Sorry to be a pest, but we've been working on this for quite some time, and we're now roadblocked.<br><br>Is there an update? <br><hr size="1" align="left" width="25%">Jim CTue, 14 Oct 2008 17:32:44 Z2008-10-14T17:32:44Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#d3fb698a-5ec7-45d1-ad34-722dc6e71d04http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#d3fb698a-5ec7-45d1-ad34-722dc6e71d04Obaid Farooqihttp://social.msdn.microsoft.com/Profile/en-US/?user=Obaid%20FarooqiBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Good Afternoon Jim:<br>I am working on your problem. What exactly is the error you see on the Vista side when you run your program?<br><br><hr size="1" align="left" width="25%">Regards, Obaid FarooqiFri, 17 Oct 2008 23:06:29 Z2008-10-17T23:06:29Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#bf071e04-39e6-4d82-ac01-4131facce7f5http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#bf071e04-39e6-4d82-ac01-4131facce7f5Jim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares<em>(note, first map W2k3 share as h: drive)<br></em><br>C:\&gt; SMBTest h:\t<br><br>DIR  h:\t\<br>DIR  h:\t\sub\<br>Can't access path h:\t\sub, w32error 5<br><br><br>Obaid, any chance I can get your email address?<br><br>Jim C<br><hr size="1" align="left" width="25%">Jim CSat, 18 Oct 2008 04:11:56 Z2008-10-18T04:11:56Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#0394f45a-6691-474e-9264-a47213e82317http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#0394f45a-6691-474e-9264-a47213e82317Obaid Farooqihttp://social.msdn.microsoft.com/Profile/en-US/?user=Obaid%20FarooqiBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Good Afternoon<span style="font-size:7pt;font-family:'Verdana','sans-serif'"> Jim:<br>Looking at your code, I need info about a flag DF_NT_SMBS. Can you please send me the trace with negotiate command and response in it?</span><hr size="1" align="left" width="25%">Regards, Obaid FarooqiTue, 21 Oct 2008 00:25:52 Z2008-10-21T00:25:52Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#c215b29d-eccc-42a7-b0ee-344856105b11http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#c215b29d-eccc-42a7-b0ee-344856105b11Jim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Obaid,<br><br>I'd be happy to do as you ask, but I'm not sure what flag you're referring to. I don't use DT_NT_SMB in the code.  Can you clarify what you mean?<br><br>Jim <br><hr size="1" align="left" width="25%">Jim CTue, 21 Oct 2008 01:19:05 Z2008-10-21T01:19:05Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#2084a5b8-8c6a-4d16-9b4a-6a7511d29671http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#2084a5b8-8c6a-4d16-9b4a-6a7511d29671Obaid Farooqihttp://social.msdn.microsoft.com/Profile/en-US/?user=Obaid%20FarooqiBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Good Morning Jim:<br>I apologize for confusion. Please do not pay attention to the flag I mentioned. Please send me the trace with negotiate in it.<br><br> <p style="margin:0in 0in 0pt"><span style="font-size:7pt;font-family:'Verdana','sans-serif'">If you want to communicate through email there is a problem. Since this thread has public visibility, there may be people who are following this thread. Taking this thread private would be leaving other interested peoplebehind.<br><br>If you need to send me email (for something that you do not want to post or cannot post), you can send to <a href="mailto:dochelp@microsoft.com"><font color="#0000ff">dochelp@microsoft.com</font></a>. Please mention the case number SRX081013600115 in the subject line.<br></span></p> <hr size="1" align="left" width="25%">Regards, Obaid FarooqiTue, 21 Oct 2008 14:55:00 Z2008-10-21T14:55:00Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#3b1fb621-89fe-49df-ab1d-c23ec63cf572http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#3b1fb621-89fe-49df-ab1d-c23ec63cf572Jim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares No problem.<br><br>I wasn't able to figure out how to post a trace using the forum, so I linked to it in my original article. For quick reference, here's the URL to download the full trace<br><br><a href="http://www.carroll.com/images/smbcapture.cap">http://www.carroll.com/images/smbcapture.cap</a><br><br>Jim<br><hr size="1" align="left" width="25%">Jim CTue, 21 Oct 2008 22:54:14 Z2008-10-21T22:54:14Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#b3c1de48-847e-41a3-978c-fe289e0c8ad8http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#b3c1de48-847e-41a3-978c-fe289e0c8ad8Obaid Farooqihttp://social.msdn.microsoft.com/Profile/en-US/?user=Obaid%20FarooqiBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Good Morning Jim:<br>I looked at the trace but it does not have negotiate phase in it. Negotiate may happen earlier than running your program. It also may happen at the time you create the network drive. Here is how you can get a trace with negotiate in it.<br>1. Reboot your vista machine<br>2. start netmon.<br>3. create network drive<br>4. run your program.<hr size="1" align="left" width="25%">Regards, Obaid FarooqiWed, 22 Oct 2008 16:58:16 Z2008-10-22T16:58:16Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#e545e926-3c6c-4f6d-aadd-7a0fb280e621http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#e545e926-3c6c-4f6d-aadd-7a0fb280e621Jim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Got it.<br><br>You can download the trace from<br><br><a href="http://www.carroll.com/images/Negotiate-HsvistaLab.cap">http://www.carroll.com/images/Negotiate-HsvistaLab.cap</a><br><br>The trace was made from the server side of the conversation (a machine called AS10) using Microsoft Network Monitor 3.2.<br><br>For completeness, I all took a snapshot of &quot;<strong>whoami /all&quot;</strong> of the account <strong>AS10\Backups</strong> which was used to negotiate the session.<br><br> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">C:\&gt;whoami /all</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">USER INFORMATION</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">----------------</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">User Name    SID</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">============ ==============================================</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">as10\backups S-1-5-21-1948780959-2201808987-1963200826-1029</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">GROUP INFORMATION</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">-----------------</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">Group Name                       Type             SID          Attributes</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">================================ ================ ============ ===============================================================</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">Everyone                         Well-known group S-1-1-0      Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">BUILTIN\Users                    Alias            S-1-5-32-545 Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">BUILTIN\Backup Operators         Alias            S-1-5-32-551 Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">BUILTIN\Remote Desktop Users     Alias            S-1-5-32-555 Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">BUILTIN\Administrators           Alias            S-1-5-32-544 Mandatory group, Enabled by default, Enabled group, Group owner</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">NT AUTHORITY\INTERACTIVE         Well-known group S-1-5-4      Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">NT AUTHORITY\Authenticated Users Well-known group S-1-5-11     Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">NT AUTHORITY\This Organization   Well-known group S-1-5-15     Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">LOCAL                            Well-known group S-1-2-0      Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10  Mandatory group, Enabled by default, Enabled group</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">PRIVILEGES INFORMATION</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">----------------------</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'"> </span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">Privilege Name                  Description                               State</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">=============================== ========================================= ========</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeChangeNotifyPrivilege         Bypass traverse checking                  Enabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeBackupPrivilege               Back up files and directories             Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeRestorePrivilege              Restore files and directories             Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeShutdownPrivilege             Shut down the system                      Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeSecurityPrivilege             Manage auditing and security log          Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeSystemtimePrivilege           Change the system time                    Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeRemoteShutdownPrivilege       Force shutdown from a remote system       Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeTakeOwnershipPrivilege        Take ownership of files or other objects  Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeDebugPrivilege                Debug programs                            Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeSystemEnvironmentPrivilege    Modify firmware environment values        Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeSystemProfilePrivilege        Profile system performance                Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeProfileSingleProcessPrivilege Profile single process                    Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeIncreaseBasePriorityPrivilege Increase scheduling priority              Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeLoadDriverPrivilege           Load and unload device drivers            Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeCreatePagefilePrivilege       Create a pagefile                         Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeIncreaseQuotaPrivilege        Adjust memory quotas for a process        Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeUndockPrivilege               Remove computer from docking station      Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeManageVolumePrivilege         Perform volume maintenance tasks          Disabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeImpersonatePrivilege          Impersonate a client after authentication Enabled</span></p> <p style="margin:0in 0in 0pt"><span style="font-size:8pt;font-family:'Courier New'">SeCreateGlobalPrivilege         Create global objects                     Enabled</span></p><hr size="1" align="left" width="25%">Jim CThu, 23 Oct 2008 14:09:59 Z2008-10-23T14:09:59Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#c1c062d6-35b0-44fe-9e8c-db545c46dac3http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#c1c062d6-35b0-44fe-9e8c-db545c46dac3Obaid Farooqihttp://social.msdn.microsoft.com/Profile/en-US/?user=Obaid%20FarooqiBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Good Afternoon Jim C.:<br>The second trace has negotiate but it is missing the error part. Please send a trace from the very beginning (negotiate) all the way to the point where error happens. <br>If you have difficulty posting a big trace, you can email me at <a href="mailto:dochelp@microsoft.com">dochelp@microsoft.com</a>. Please mention case number SRX081013600115 in the subject line.<hr size="1" align="left" width="25%">Regards, Obaid FarooqiTue, 28 Oct 2008 19:41:42 Z2008-10-28T19:41:42Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#776432de-f629-425c-93b0-7c9fd5f89c6chttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#776432de-f629-425c-93b0-7c9fd5f89c6cJim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares Hi Obaid,<br><br>As requested, I performed the complete trace (from negotiate all the way through to the refused access), and sent it tou you via email.<br><br>Jim<hr size="1" align="left" width="25%">Jim CWed, 29 Oct 2008 15:17:23 Z2008-10-29T15:17:23Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#2f88f6f1-9a0c-43a0-b5a1-04dd1f7548f7http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#2f88f6f1-9a0c-43a0-b5a1-04dd1f7548f7Obaid Farooqihttp://social.msdn.microsoft.com/Profile/en-US/?user=Obaid%20FarooqiBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares<p style="margin:0in 0in 0pt"><font face=Calibri>Hi Jim:</font></p> <p style="margin:0in 0in 0pt"><font face=Calibri>As per our conversation over email, it appears that the solution delivered (hotfix) to you resolves the issue you are facing. This issue arises due to a Windows Vista bug . You documented the situation in which this bug manifests itself in excellent detail in your original posting. For the benefit of the community, I would like to clarify that the proper channel to get help on this problem is through Windows Support.</font></p> <p style="margin:0in 0in 0pt"><font face=Calibri> </font></p> <p style="margin:0in 0in 0pt"><font face=Calibri>Thank you for bringing this issue to our attention.</font></p><hr size="1" align="left" width="25%">Regards, Obaid FarooqiWed, 05 Nov 2008 23:01:41 Z2008-11-05T23:01:41Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#d8410f84-434c-4567-aea6-168692665017http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#d8410f84-434c-4567-aea6-168692665017Brian - SLogichttp://social.msdn.microsoft.com/Profile/en-US/?user=Brian%20-%20SLogicBUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares<p> Hi Obaid,</p> <p>This bug in Vista is causing problems with our customers as well. Can you please post information or send me an email directly on how to access this hotfix?</p> <p>Thanks,</p> <p>Brian</p>Mon, 26 Jan 2009 18:15:39 Z2009-01-26T18:15:39Zhttp://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#da657400-bb84-4188-84a3-7c06d82c5362http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/913ba4ce-f57a-43f2-8a3d-116b28697c56#da657400-bb84-4188-84a3-7c06d82c5362Jim1234http://social.msdn.microsoft.com/Profile/en-US/?user=Jim1234BUG: SeBackupPrivilege not honored by Vista when accessing SMB (version 1) shares<p>For those who stumble across this thread in the future. The issue has been repaired by Microsoft. They've issued a HotFix which is discussed in Knowledge base article  KB950790  (<a href="http://support.microsoft.com/kb/950790">http://support.microsoft.com/kb/950790</a>). </p> <p>We've tested it successfully on ~1 billion files/folders in the lab and in the field.  It has worked flawlessly for us.</p> <p> </p><hr class="sig">Jim CMon, 26 Jan 2009 20:08:21 Z2009-01-26T20:08:21Z