This Question is Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
1,030 Views 6 Replies Last post: Jul 7, 2009 4:34 AM by andrey.krivosheya RSS
andrey.krivosheya Enthusiast 16 posts since
Jun 3, 2009
Currently Being Moderated

Jun 29, 2009 7:39 AM

FPolicy FP_ScreenRequest2 problem

Hi, Guys

 

I got 7.3.1 simulator and FPolicy 7.3 SDK. I am writing some sample to check what notifications I could obtain through fpolicy. The FServer succesfully registers itself with filer weather I pass optional parameters as last argument to FP_Registration or not.

 

Now If I pass no additional parameters to FP_Registration, just "\\computer\domain", I receive notification through FP_ScreenRequest and displaypath is valid file access path. But if I pass some additional parameters to FP_Registration, like "\\computer\domain\size_and_owner=true", I will receive all notifications through FP_ScreenRequest2, where request->sr_displaypath would contain the data which was in accesspath (with FP_ScreenRequest notification) and request->sr_accespath is NULL. So with FP_ScreenRequest2 (which I really need to get notified about reads and writes) I did not get displaypath.

 

The question is: is it some kind of bag or misconfiguration of my environment? is there some way to garantly convert accesspath to displaypath?

rameshc NetApp Employee Novice 4 posts since
Jun 29, 2009
Currently Being Moderated
Jun 29, 2009 10:13 PM in response to: andrey.krivosheya
Re: FPolicy FP_ScreenRequest2 problem

Hi ,

 

FP_ScreenRequest2 is the new version of Screen Request RPc and it is having different set of parameters then FP_ScreenRequest.

 

It has two parameters:

 

DWORD
FP_ScreenRequest2(

   [in] handle_t FilerHandle,
   [in, ptr] srequest_t *request);

 

The second parameter is a composite structure containing common parameters and options parameters according to the request types:

 

typedef struct screenrequest {
        /*
         * Common fields.
         */
        DWORD           sr_filerid;     /* FPolicy server assigned ID */
        DWORD           sr_requestid;   /* Unique request id */
        [string] TSTR   *sr_clientip;   /* NFS/CIFS client's IP addr */
        userid_t        sr_usercont;    /* User context that initiated the req*/
        userid_t        sr_owner;       /* User context of the file owner */
        [string] TSTR   *sr_usergids;   /* GIDs if applicable, else NULL */
        nfs_fh_t        sr_fh;          /* File handle of the file object */
        [string] TSTR   *sr_accesspath; /* Access Path for the file */
        [string] TSTR   *sr_displaypath;/* File's Display Path (only CIFS) */
        DWORDLONG       sr_size;        /* File size (at the time of event) */
        DWORD           sr_proto;       /* Protocol - NFS/CIFS */

 

        /*
         * Operation specific portion.
         */
        OpData_t        sr_opdata;
} srequest_t;

 

 

Make sure you are doing correct decoding for the parameters.

 

 

-Regards,

Ramesh

rameshc NetApp Employee Novice 4 posts since
Jun 29, 2009
Currently Being Moderated
Jun 30, 2009 7:09 AM in response to: andrey.krivosheya
Re: FPolicy FP_ScreenRequest2 problem

I tried it myself, I could see both the path correctly

 

Filer

---------

 

f3050-209-39*> fpolicy

 

CIFS file policy is enabled.

 


File policy fp1 (file screening) is enabled.

 

File screen servers                P/S Connect time (dd:hh:mm)  Reqs    Fails
------------------------------------------------------------------------------
10.72.209.13    \\W2K3-209-13     Pri    00:00:01                 6        0

 

ServerID: 17        IDL Version: 1    SMB Request Pipe Name: \ntapfprq
        Options enabled: version2, size-and-owner

 


Operations monitored:
File open,File create,File rename,File close,File delete,File read,File write,Setattr
Directory rename,Directory delete,Directory create
Above operations are monitored for NFS and CIFS

 

Lookup, Getattr, Link, Symlink
Above operations are monitored for NFS only

 

List of extensions to screen:
???

 

List of extensions not to screen:
Extensions-not-to-screen list is empty.

 

Number of requests screened          :  239250
Number of screen failures            :  0
Number of requests blocked locally   :  0

 

 

Fpolicy Server

--------------------------

Filer ID    = 1
Req ID      = 239250
Client IP   = 10.73.41.163
Offline     = No
Usr context = UID:0,SID:S-1-5-21-3398730926-3070593403-3870472450-500
Owner       = UID:0,SID:S-1-5-32-544
User GIDS   = NULL
Access Path = ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt
Display Path= \\F3050-209-39\HOME\New Text Document.txt
size        = 5 [5]
Filehandle  = inode: 0, fsid = 0, gen = 0 Snapid = 0
protocol    = CIFS
Client Op   = write [0x4000]
===========
Filer ID    = 1
Req ID      = 239251
Client IP   = 10.73.41.163
Offline     = No
Usr context = UID:0,SID:S-1-5-21-3398730926-3070593403-3870472450-500
Owner       = UID:0,SID:S-1-5-32-544
User GIDS   = NULL
Access Path = ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt
Display Path= \\F3050-209-39\HOME\New Text Document.txt
size        = 5 [5]
Filehandle  = inode: 0, fsid = 0, gen = 0 Snapid = 0
protocol    = CIFS
Client Op   = file close [0x8]

More Like This

  • Retrieving data ...

Bookmarked By (0)