EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Folder Atrributes in SFTP Server

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#32844
Posted: 03/30/2015 08:51:15
by ITSG (Standard support level)
Joined: 06/27/2013
Posts: 34

Hey,

i am creating virtual Folder in sFTP Server.
Works fine. But i could figure out, wher to set folder permissions like Read/Write/Delete. Any Ideas ?

Here is my code:

Code
TElSftpFileAttributes attrs = info.Attributes;
info.Name = m_dirList[m_dirIndex];
attrs.CTime = DateTime.Now;
attrs.ATime = DateTime.Now;
attrs.MTime = DateTime.Now;
attrs.Size = 0;
attrs.Directory = true;
attrs.FileType = SBSftpCommon.TSBSftpFileType.ftDirectory;
#32845
Posted: 03/30/2015 08:58:37
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

You can use parameter of TElSftpFileInfo type and its Attributes property to set attributes for individual files and folders. This parameter is passed to TElSFTPServer.OnFindNext/OnFindFirst event handlers that are used to enumerate directory content.
#32847
Posted: 03/30/2015 09:40:16
by ITSG (Standard support level)
Joined: 06/27/2013
Posts: 34

mh, this is what i actually do.
this line was missing:
Code
TElSftpFileInfo info

and these are attributs i found:
Code
attrs.UserExecute = false;
attrs.UserRead = true;
attrs.UserWrite = true;
attrs.GroupExecute = false;
attrs.GroupRead = true;
attrs.GroupWrite = true;
attrs.OtherExecute = false;
attrs.OtherRead = true;
attrs.OtherWrite = true;

but i am missing attributes like DELETE etc.
#32848
Posted: 03/30/2015 09:47:34
by Eugene Mayevski (Team)

On Unix the only attributes that control file access are a bit mask that you've listed (9 bits). There's no room for other flags there.

Windows has totally different, ACL-based scheme of access control. SFTP potentially supports ACL attrbiutes since version 4 but they are almost never used.

Also there's no uniform way to translate Unix security attributes into ACLs and vice versa.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 575 times

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




|

Back to top

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

Got it!