Q : How to support RaidenFTPD extended file attributes in MLSD and resetting of attributes via site commands?

A : RaidenFTPD allows a ftp client to retrieve win32 extended file attributes via a new extended fact in MLSD machine readable directory listing.

TO IDENTIFY IF A RAIDENFTPD SERVER SUPPORTS THIS EXTENSION (RaidenFTPD v2.4.2040 and above)

send a FEAT (feature negotiation command) and see if this appears in the response

[R] FEAT
[R] 211-Extensions supported:
[R] SIZE
[R] MDTM
[R] MDTM YYYYMMDDHHMMSS filename
[R] LIST -laT
[R] STAT -laT
[R] MODE Z
[R] MLST type*;lang*;size*;modify*;create*;UNIX.mode*;UNIX.owner*;UNIX.group*;WIN32.ea*
[R] MLSD
[R] REST STREAM
[R] XCRC filename;start;end
[R] XMD5 filename;start;end
[R] TVFS
[R] CLNT client_type
[R] LANG EN;FR;JA;DE;IT;SV;ES;RU;ZH-TW;ZH-CN
[R] AUTH SSL
[R] AUTH TLS
[R] PROT
[R] PBSZ
[R] SSCN
[R] UTF8
[R] 211 END

TO PARSE WIN32 EXTENDED ATTRIBUTES

A client software first has to support MLSD, see: http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.txt

if your client already supports it, it's easy to add this new feature. here is a sample of directory listing with win32.ea information

size=0;lang=utf8;modify=20050308020346;create=20041109093936;type=cdir;UNIX.mode=0666;UNIX.owner=a;UNIX.group=default;win32.ea=0x00000810 .
size=0;lang=utf8;modify=20050308020346;create=20041109093936;type=pdir;UNIX.mode=0666;UNIX.owner=a;UNIX.group=default;win32.ea=0x00000810 ..
size=4879403;lang=utf8;modify=20040412054240;create=20041109093936;type=file;UNIX.mode=0666;UNIX.owner=a;UNIX.group=default;win32.ea=0x00000820 01.mp3

The win32.ea is a DWORD value dwFileAttributes which is a member of WIN32_FIND_DATA (WIN32 base structure, defined in WINNT.H), a detailed infromation can be found on microsoft site: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/win32_find_data_str.asp

with this information, the following file attributes can be identified

NOTE: the server may hide certain attributes if it found that it's not suitable for the client.

FILE_ATTRIBUTE_ARCHIVE
FILE_ATTRIBUTE_COMPRESSED
FILE_ATTRIBUTE_DIRECTORY
FILE_ATTRIBUTE_ENCRYPTED
FILE_ATTRIBUTE_HIDDEN
FILE_ATTRIBUTE_NORMAL
FILE_ATTRIBUTE_OFFLINE
FILE_ATTRIBUTE_READONLY
FILE_ATTRIBUTE_REPARSE_POINT
FILE_ATTRIBUTE_SPARSE_FILE
FILE_ATTRIBUTE_SYSTEM
FILE_ATTRIBUTE_TEMPORARY

CLIENT SIDE IMPLEMENTATION RECOMMENDATION

Many of the clients have both local file/dir browser and remote file/dir browser, and in the local part, they can already display files with different attributes using different kind of icons, it is recommended to do the same on the remote file/dir browser. Or if you like the windows style, it uses different color for text if the file is compressed or encrypted.

HOW TO ADD CUSTOM SITE COMMAND TO RESET FILE ATTRIBUTE IN POPULAR FTP CLIENTS

SmartFTP http://www.smartftp.com/

menu > commands > custom commands > edit custom commands > expand raidenftpd-admin-file icon > right mouse click > new > insert command >

name it as +ReadOnly > commands = site attrib +r %ff

name it as +Archive > commands = site attrib +a %ff

name it as +System > commands = site attrib +s %ff

name it as +Hidden > commands = site attrib +h %ff

name it as +Normal > commands = site attrib +n %ff

 

FtpVoyager http://www.ftpvoyager.com/

menu > tools > custom commands > define > add

name it as +ReadOnly > commands = site attrib +r %f

name it as +Archive > commands = site attrib +a %f

name it as +System > commands = site attrib +s %f

name it as +Hidden > commands = site attrib +h %f

name it as +Normal > commands = site attrib +n %f

 


FlashFXP http://www.flashfxp.com/

menu > commands > edit commands > new commands

name it as +ReadOnly > commands = site attrib +r %f

name it as +Archive > commands = site attrib +a %f

name it as +System > commands = site attrib +s %f

name it as +Hidden > commands = site attrib +h %f

name it as +Normal > commands = site attrib +n %f

That's ALL

Copyright © RaidenFTPD TEAM , ALL RIGHTS RESERVED

REVISION 2.4 , 2005/03/08

The copyrighted works contained in this information service shall not be copied, reproduced, varied, altered, modified, adapted, distributed, performed and displayed in any form without the written permission of the copyright owner. All trademarks belong to their respective owners .