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?
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
I know all that stuff, and looks like I decode parameters correctly.
Let's compare what I obtain in FP_ScreenRequest and FP_ScreenRequest2 notifications (I would only mention displaypath and accesspath):
So the question is: where the "displaypath" is with SP_ScreenRequest2 notification? or how I could obtain it from request->sr_displaypath which is actually "accesspath"?
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]
IIs it from 7.3.1?
Here are my outputs:
filer simulator:
============================================================================================
netapp-sim> fpolicy
CIFS file policy is enabled.
File policy quest_itfa_netapp_policy (file screening) is enabled.
File screen servers P/S Connect time (dd:hh:mm) Reqs Fails
------------------------------------------------------------------------------
10.30.37.102 \\NETAPP-CL Pri 00:00:01 7 0
ServerID: 18 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
Directory rename,Directory delete,Directory create
Above operations are monitored for CIFS only
List of extensions to screen:
???
List of extensions not to screen:
Extensions-not-to-screen list is empty.
Number of requests screened : 7
Number of screen failures : 0
Number of requests blocked locally : 0
fserver:
============================================================================================
====================================================================
2009-06-30 06:17::18.436
ver: '2'
filer: 'netapp-sim'
requestid: '2'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '1'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
accessmode: '131209'
createmode: '1'
====================================================================
2009-06-30 06:17::18.514
ver: '2'
filer: 'netapp-sim'
requestid: '3'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '8192'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
offset: '0'
length: '10'
====================================================================
2009-06-30 06:17::18.576
ver: '2'
filer: 'netapp-sim'
requestid: '4'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '1'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
accessmode: '1048704'
createmode: '1'
====================================================================
2009-06-30 06:17::18.701
ver: '2'
filer: 'netapp-sim'
requestid: '5'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '1'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\'
accessmode: '1048704'
createmode: '1'
====================================================================
2009-06-30 06:17::18.794
ver: '2'
filer: 'netapp-sim'
requestid: '6'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '1'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\'
accessmode: '1048704'
createmode: '1'
====================================================================
2009-06-30 06:17::29.642
ver: '2'
filer: 'netapp-sim'
requestid: '7'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '8'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
====================================================================
2009-06-30 06:17::29.720
ver: '2'
filer: 'netapp-sim'
requestid: '8'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '8'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
NOTE: accesspath is displayed through request->sr_displaypath
Is it from 7.3.1?
Here are my outputs:
filer simulator:
============================================================================================
netapp-sim> fpolicy
CIFS file policy is enabled.
File policy quest_itfa_netapp_policy (file screening) is enabled.
File screen servers P/S Connect time (dd:hh:mm) Reqs Fails
------------------------------------------------------------------------------
10.30.37.102 \\NETAPP-CL Pri 00:00:01 7 0
ServerID: 18 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
Directory rename,Directory delete,Directory create
Above operations are monitored for CIFS only
List of extensions to screen:
???
List of extensions not to screen:
Extensions-not-to-screen list is empty.
Number of requests screened : 7
Number of screen failures : 0
Number of requests blocked locally : 0
fserver:
============================================================================================
====================================================================
2009-06-30 06:17::18.436
ver: '2'
filer: 'netapp-sim'
requestid: '2'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '1'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
accessmode: '131209'
createmode: '1'
====================================================================
2009-06-30 06:17::18.514
ver: '2'
filer: 'netapp-sim'
requestid: '3'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '8192'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
offset: '0'
length: '10'
====================================================================
2009-06-30 06:17::18.576
ver: '2'
filer: 'netapp-sim'
requestid: '4'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '1'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
accessmode: '1048704'
createmode: '1'
====================================================================
2009-06-30 06:17::18.701
ver: '2'
filer: 'netapp-sim'
requestid: '5'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '1'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\'
accessmode: '1048704'
createmode: '1'
====================================================================
2009-06-30 06:17::18.794
ver: '2'
filer: 'netapp-sim'
requestid: '6'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '1'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\'
accessmode: '1048704'
createmode: '1'
====================================================================
2009-06-30 06:17::29.642
ver: '2'
filer: 'netapp-sim'
requestid: '7'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '8'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
====================================================================
2009-06-30 06:17::29.720
ver: '2'
filer: 'netapp-sim'
requestid: '8'
clientip: '10.30.42.75'
usersid: 'S-1-5-21-2019878313-792318229-2130781727-500'
clientop: '8'
displaypath: ''
accesspath: 'ONTAP_ADMIN$\vol\vol0\home\New Text Document.txt'
Ok, I've managed to fix the issue.
Looks like I've got broken (incomplete) fpreqest.idl. For those who are interested in comparison I've attached original version (from FPolicy 7.3 SDK) and edited.