EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Folder Atrributes in SFTP Server

Posted: 03/30/2015 08:51:15
by ITSG (Standard support level)
Joined: 06/27/2013
Posts: 34


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:

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;
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.
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:
TElSftpFileInfo info

and these are attributs i found:
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.
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



Topic viewed 600 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!