EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Sharing a Network Mounting Point

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#28789
Posted: 03/17/2014 04:26:36
by abc123 (Standard support level)
Joined: 03/17/2014
Posts: 4

I want to be able to share my mounting point (have a "Share" tab on a right click). I checked the CallbackFileSystem.AddMountingPoint method, and it says:

Quote
If you are creating the network mounting point, you can expose it as a network share which can be used by other computers (SMB share). This is done by specifying one of CBFS_SYMLINK_NETWORK_READ_NETWORK_ACCESS or CBFS_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS flags in Flags parameter. If the share is to be created, the following conditions must be met:

1. The ServerName part of MountingPoint parameter must be either empty or equal to the value returned by GetComputerName() function of Windows API.
2. The process, which creates a network share, must have proper security rights that allow creation of network shares. If the rights are insufficient, the function fails.
3. CBFS_SYMLINK_NETWORK_READ_NETWORK_ACCESS or CBFS_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS flag must be the only flag set in Flags parameter.


What do you mean by: CBFS_SYMLINK_NETWORK_READ_NETWORK_ACCESS or CBFS_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS flag must be the only flag set in Flags parameter?

Shouldn't I add CBFS_SYMLINK_NETWORK flag as well?

What I am trying right now is:
Code
fileSystem.AddMountingPoint(SiteMountPoint + ";;" + SiteName, CallbackFileSystem.CBFS_SYMLINK_NETWORK | CallbackFileSystem.CBFS_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS, null);


It adds the network mounting point, but it cannot be shared.

Another question is how do I add a "Security" tab (in addition to the "Share" tab) when I right click on my drive?
#28798
Posted: 03/17/2014 06:08:27
by Volodymyr Zinin (EldoS Corp.)

The documentation is slightly incorrect. These flags must always be ORed with the CBFS_SYMLINK_NETWORK flag. Also both of these flags can also be used simultaneously (ORed).

In order to have the "Share" tab create a mounting point with the CBFS_SYMLINK_MOUNT_MANAGER flag. Right clicking on it in Explorer will show this tab.

In order to have the "Security" tab the optional OnGetFileSecurity and OnSetFileSecurity callbacks must be implemented. In the Mapper sample they exist but, it seems, commented.

Quote
abc123 wrote:
What I am trying right now is: Code

fileSystem.AddMountingPoint(SiteMountPoint + ";;" + SiteName, CallbackFileSystem.CBFS_SYMLINK_NETWORK | CallbackFileSystem.CBFS_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS, null);

Could you modify one of the CBFS sample in order to have this call and give it to me with information what to do in order to reproduce the problem?
Thanks.
#28799
Posted: 03/17/2014 06:51:45
by abc123 (Standard support level)
Joined: 03/17/2014
Posts: 4

Thanks Vladimir,
I took the C# CBFS VDisk sample, and inside btnAddPoint_Click, I replaced the AddMountingPoint:
Code
//mCbFs.AddMountingPoint(edtMountinPoint.Text);  - old code
mCbFs.AddMountingPoint(edtMountinPoint.Text + ";;" + "ABC", CallbackFileSystem.CBFS_SYMLINK_NETWORK | CallbackFileSystem.CBFS_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS, null);


It mapped a network drive, but I still can't share it (screenshot of the tabs are added as an attachment)

I also tried
Code
mCbFs.AddMountingPoint(edtMountinPoint.Text + ";;" + "ABC", CallbackFileSystem.CBFS_SYMLINK_MOUNT_MANAGER, null);

and
Code
mCbFs.AddMountingPoint(edtMountinPoint.Text + ";;" + "ABC", CallbackFileSystem.CBFS_SYMLINK_MOUNT_MANAGER | CallbackFileSystem.CBFS_SYMLINK_NETWORK_WRITE_NETWORK_ACCESS, null);

but in both cases I got errors. Plus according to the documentation, CBFS_SYMLINK_MOUNT_MANAGER it is used to mount folders on existing NTFS drive, but I want a network drive.

Also, inside VDiskForm_Load, I added:
Code
mCbFs.OnGetFileSecurity = new CbFsGetFileSecurityEvent(CbFsGetFileSecurity);
mCbFs.OnSetFileSecurity = new CbFsSetFileSecurityEvent(CbFsSetFileSecurity);

In the latest sample the implementation of CbFsSetFileSecurity comes with a comment:
Code
// Disable setting of new security for the backend file because
// these new security attributes can prohibit manipulation
// with the file from the callbacks (for example if read/write
// is not allowed for this process).

So is it okay to use this code? Will it cause problems to read and write files?


#28800
Posted: 03/17/2014 06:56:17
by Eugene Mayevski (EldoS Corp.)

Have you specified the license key?


Sincerely yours
Eugene Mayevski
#28801
Posted: 03/17/2014 07:02:50
by abc123 (Standard support level)
Joined: 03/17/2014
Posts: 4

Yes, of course.
It works, just the network drive cannot be shared.
#28802
Posted: 03/17/2014 07:11:09
by Eugene Mayevski (EldoS Corp.)

I'll move the question to the HelpDesk


Sincerely yours
Eugene Mayevski
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 2452 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!