/*
- * Copyright (c) 2008-2011 Kernel Drivers, LLC.
- * Copyright (c) 2009-2011 Your File System, Inc.
+ * Copyright (c) 2008-2013 Kernel Drivers, LLC.
+ * Copyright (c) 2009-2013 Your File System, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
- * notice,
- * this list of conditions and the following disclaimer in the
- * documentation
- * and/or other materials provided with the distribution.
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
* - Neither the name of Kernel Drivers, LLC nor the names of its
- * contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission from Kernel Drivers, LLC
- * and Your File System, Inc.
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission from
+ * Kernel Drivers, LLC and Your File System, Inc.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
#define AFS_VOLUME_ACTIVE_GLOBAL_ROOT 0x00000008
//
+// Authentication Group Flags
+//
+
+#define AFS_AUTHGROUP_REPARSE_POLICY_SET 0x00000001
+#define AFS_AUTHGROUP_REPARSE_POINT_TO_FILE_AS_FILE 0x00000002
+
+//
// Need this to handle the break point definition
//
struct _AFSFSD_PROVIDER_CONNECTION_CB *ProviderEnumerationList;
+ //
+ // Reparse point policy
+ //
+
+ ULONG ReparsePointPolicy;
+
} RDR;
struct
#define AFS_FILE_ACCESS_EXCLUSIVE 0x00000001
#define AFS_FILE_ACCESS_SHARED 0x00000002
+//
+// Reparse Point processing policy
+//
+
+#define AFS_REPARSE_POINT_POLICY_RESET 0x00000000 // This will reset the policy to default
+ // behavior which is to process the
+ // "open as reparse point" flag during
+ // Create per normal operation.
+
+#define AFS_REPARSE_POINT_TO_FILE_AS_FILE 0x00000001 // If indicated then ignore any attempt to
+ // "open as reparse point" when the target is
+ // a file.
+
+#define AFS_REPARSE_POINT_VALID_POLICY_FLAGS 0x00000001
+
+//
+// Reparse Point policy scope
+//
+
+#define AFS_REPARSE_POINT_POLICY_GLOBAL 0x00000000
+
+#define AFS_REPARSE_POINT_POLICY_AUTHGROUP 0x00000001
+
#endif /* _AFS_USER_DEFINE_H */
#define IOCTL_AFS_CONFIG_LIBRARY_TRACE CTL_CODE( FILE_DEVICE_DISK_FILE_SYSTEM, 0x101B, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_AFS_SET_REPARSE_POLICY CTL_CODE( FILE_DEVICE_DISK_FILE_SYSTEM, 0x101C, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
#endif /* _AFS_USER_IOCTL_H */
\ No newline at end of file
} AFSFileIOResultCB;
+typedef struct _AFS_SET_REPARSE_POINT_POLICY
+{
+
+ ULONG Policy;
+
+ ULONG Scope;
+
+} AFSSetReparsePointPolicyCB;
+
#endif /* _AFS_USER_STRUCT_H */
}
return STATUS_SUCCESS;
+ case IOCTL_AFS_SET_REPARSE_POLICY:
+
+ //
+ // Anyone can call this
+ //
+
+ return STATUS_SUCCESS;
+
default:
//
break;
}
+ case IOCTL_AFS_SET_REPARSE_POLICY:
+ {
+
+ AFSSetReparsePointPolicyCB *pPolicy = (AFSSetReparsePointPolicyCB *)Irp->AssociatedIrp.SystemBuffer;
+
+ if( pPolicy == NULL ||
+ pIrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof( AFSSetReparsePointPolicyCB))
+ {
+ ntStatus = STATUS_INVALID_PARAMETER;
+ break;
+ }
+
+ ntStatus = AFSSetReparsePointPolicy( pPolicy);
+
+ break;
+ }
+
default:
{
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Kernel Drivers, LLC.
- * Copyright (c) 2009, 2010, 2011 Your File System, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Kernel Drivers, LLC.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Your File System, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
- * notice,
- * this list of conditions and the following disclaimer in the
- * documentation
- * and/or other materials provided with the distribution.
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
* - Neither the names of Kernel Drivers, LLC and Your File System, Inc.
* nor the names of their contributors may be used to endorse or promote
* products derived from this software without specific prior written
return ntStatus;
}
+NTSTATUS
+AFSSetReparsePointPolicy( IN AFSSetReparsePointPolicyCB *PolicyCB)
+{
+
+ NTSTATUS ntStatus = STATUS_SUCCESS;
+ AFSDeviceExt* pDeviceExt = (AFSDeviceExt *)AFSRDRDeviceObject->DeviceExtension;
+ ULONG ulPolicy = 0;
+
+ __Enter
+ {
+
+ ulPolicy = (PolicyCB->Policy & AFS_REPARSE_POINT_VALID_POLICY_FLAGS);
+
+ if ( PolicyCB->Scope == AFS_REPARSE_POINT_POLICY_GLOBAL)
+ {
+
+ pDeviceExt->Specific.RDR.ReparsePointPolicy = ulPolicy;
+ }
+ else if ( PolicyCB->Scope == AFS_REPARSE_POINT_POLICY_AUTHGROUP)
+ {
+
+ ntStatus = STATUS_NOT_SUPPORTED;
+ }
+ }
+
+ return ntStatus;
+}
NTSTATUS
AFSProcessSetProcessDacl( IN AFSProcessCB *ProcessCB);
+NTSTATUS
+AFSSetReparsePointPolicy( IN AFSSetReparsePointPolicyCB *Policy);
+
//
// Prototypes in AFSFastIoSupprt.cpp
//