r22882: It seems entirly reasonable to follow metze's suggestion and check for
authorAndrew Bartlett <abartlet@samba.org>
Tue, 15 May 2007 06:51:18 +0000 (06:51 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:52:28 +0000 (14:52 -0500)
a valid file handle first.

Andrew Bartlett
(This used to be commit 3947db3dcbfe97e9ccb9b9bd2b3a69cf7683af9f)

source4/ntvfs/ipc/vfs_ipc.c

index 20b70415aa13d558f44a21df2a21711b5c48c458..70dd3e356187e0c605dab99fdd82521e3fa7496b 100644 (file)
@@ -610,14 +610,13 @@ static NTSTATUS ipc_qfileinfo(struct ntvfs_module_context *ntvfs,
                              struct ntvfs_request *req, union smb_fileinfo *info)
 {
        struct ipc_private *private = ntvfs->private_data;
+       struct pipe_state *p = pipe_state_find(private, info->generic.in.file.ntvfs);
+       if (!p) {
+               return NT_STATUS_INVALID_HANDLE;
+       }
        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, '\\');