Author: abartlet
Date: 2007-05-15 01:21:20 +0000 (Tue, 15 May 2007)
New Revision: 22874

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22874

Log:
Expand the RPC-QFILEINFO-IPC test, and add a server implementation to match.

This should help with Vista joins.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c
   branches/SAMBA_4_0/source/torture/raw/qfileinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c       2007-05-15 00:10:18 UTC 
(rev 22873)
+++ branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c       2007-05-15 01:21:20 UTC 
(rev 22874)
@@ -149,7 +149,14 @@
 static NTSTATUS ipc_qpathinfo(struct ntvfs_module_context *ntvfs,
                              struct ntvfs_request *req, union smb_fileinfo 
*info)
 {
-       return NT_STATUS_ACCESS_DENIED;
+       switch (info->generic.level) {
+       case  RAW_FILEINFO_GENERIC:
+               return NT_STATUS_INVALID_DEVICE_REQUEST;
+       case RAW_FILEINFO_GETATTR:
+               return NT_STATUS_ACCESS_DENIED;
+       default:
+               return ntvfs_map_qpathinfo(ntvfs, req, info);
+       }
 }
 
 /*
@@ -602,6 +609,39 @@
 static NTSTATUS ipc_qfileinfo(struct ntvfs_module_context *ntvfs,
                              struct ntvfs_request *req, union smb_fileinfo 
*info)
 {
+       struct ipc_private *private = ntvfs->private_data;
+       switch (info->generic.level) {
+       case RAW_FILEINFO_GENERIC: 
+       {
+               struct pipe_state *p;
+               p = pipe_state_find(private, info->generic.in.file.ntvfs);
+               if (!p) {
+                       return NT_STATUS_INVALID_HANDLE;
+               }
+               ZERO_STRUCT(info->generic.out);
+               info->generic.out.attrib = FILE_ATTRIBUTE_NORMAL;
+               info->generic.out.fname.s = strrchr(p->pipe_name, '\\');
+               info->generic.out.alloc_size = 4096;
+               info->generic.out.nlink = 1;
+               /* What the heck?  Match Win2k3: IPC$ pipes are delete pending 
*/
+               info->generic.out.delete_pending = 1;
+               return NT_STATUS_OK;
+       }
+       case RAW_FILEINFO_ALT_NAME_INFO:
+       case RAW_FILEINFO_ALT_NAME_INFORMATION:
+       case RAW_FILEINFO_STREAM_INFO:
+       case RAW_FILEINFO_STREAM_INFORMATION:
+       case RAW_FILEINFO_COMPRESSION_INFO:
+       case RAW_FILEINFO_COMPRESSION_INFORMATION:
+       case RAW_FILEINFO_NETWORK_OPEN_INFORMATION:
+       case RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION:
+               return NT_STATUS_INVALID_PARAMETER;
+       case  RAW_FILEINFO_ALL_EAS:
+               return NT_STATUS_ACCESS_DENIED;
+       default:
+               return ntvfs_map_qfileinfo(ntvfs, req, info);
+       }
+       
        return NT_STATUS_ACCESS_DENIED;
 }
 

Modified: branches/SAMBA_4_0/source/torture/raw/qfileinfo.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/qfileinfo.c   2007-05-15 00:10:18 UTC 
(rev 22873)
+++ branches/SAMBA_4_0/source/torture/raw/qfileinfo.c   2007-05-15 01:21:20 UTC 
(rev 22874)
@@ -732,6 +732,24 @@
                  "ALL_INFO",      all_info,      directory);
        VAL_CHECK("STANDARD_INFO", standard_info, nlink, 
                  "ALL_INFO",      all_info,      nlink);
+       s1 = fnum_find("BASIC_INFO");
+       if (s1 && is_ipc) {
+               if (s1->basic_info.out.attrib != FILE_ATTRIBUTE_NORMAL) {
+                       printf("(%d) attrib basic_info/nlink incorrect - %d 
should be %d\n", __LINE__, s1->basic_info.out.attrib, FILE_ATTRIBUTE_NORMAL);
+                       ret = False;
+               }
+       }
+       s1 = fnum_find("STANDARD_INFO");
+       if (s1 && is_ipc) {
+               if (s1->standard_info.out.nlink != 1) {
+                       printf("(%d) nlinks standard_info/nlink incorrect - %d 
should be 1\n", __LINE__, s1->standard_info.out.nlink);
+                       ret = False;
+               }
+               if (s1->standard_info.out.delete_pending != 1) {
+                       printf("(%d) nlinks standard_info/delete_pending 
incorrect - %d should be 1\n", __LINE__, s1->standard_info.out.delete_pending);
+                       ret = False;
+               }
+       }
        VAL_CHECK("EA_INFO",       ea_info,       ea_size, 
                  "ALL_INFO",      all_info,      ea_size);
        if (!is_ipc) {

Reply via email to