net.sf.hermesftp.cmd.impl
Class FtpCmdOpts

java.lang.Object
  extended by net.sf.hermesftp.cmd.AbstractFtpCmd
      extended by net.sf.hermesftp.cmd.impl.FtpCmdOpts
All Implemented Interfaces:
java.lang.Cloneable, FtpCmd, FtpConstants

public class FtpCmdOpts
extends AbstractFtpCmd

OPTS Command

The OPTS (options) command allows a user-PI to specify the desired behavior of a server-FTP process when another FTP command (the target command) is later issued. The exact behavior, and syntax, will vary with the target command indicated, and will be specified with the definition of that command. Where no OPTS behavior is defined for a particular command there are no options available for that command.

Request Syntax:

            opts             = opts-cmd SP command-name
            [ SP command-options ] CRLF
            opts-cmd         = "opts"
            command-name     = <any FTP command which allows option setting>
            command-options  = <format specified by individual FTP command>
 
Response Syntax:
            opts-response    = opts-good / opts-bad
            opts-good        = "200" SP response-message CRLF
            opts-bad         = "451" SP response-message CRLF /
            "501" SP response-message CRLF
            response-message = *TCHAR
 
An "opts-good" response (200 reply) MUST be sent when the command- name specified in the OPTS command is recognized, and the command- options, if any, are recognized, and appropriate. An "opts-bad" response is sent in other cases. A 501 reply is appropriate for any permanent error. That is, for any case where simply repeating the command at some later time, without other changes of state, will also be an error. A 451 reply should be sent where some temporary condition at the server, not related to the state of communications between user and server, prevents the command being accepted when issued, but where if repeated at some later time, a changed environment for the server-FTP process may permit the command to succeed. If the OPTS command itself is not recognized, a 500 or 502 reply will, of course, result.

The OPTS command MUST be implemented whenever the FEAT command is implemented. Because of that, there is no indication in the list of features returned by FEAT to indicate that the OPTS command itself is supported. Neither the FEAT command, nor the OPTS command, have any optional functionality, thus there are no "OPTS FEAT" or "OPTS OPTS" commands.

Security Considerations: No significant new security issues, not already present in the FTP protocol, are believed to have been created by this extension. However, this extension does provide a mechanism by which users can determine the capabilities of an FTP server, and from which additional information may be able to be deduced. While the same basic information could be obtained by probing the server for the various commands, if the FEAT command were not provided, that method may reveal an attacker by logging the attempts to access various extension commands. This possibility is not considered a serious enough threat to be worthy of any remedial action. The security of any additional features that might be reported by the FEAT command, and manipulated by the OPTS command, should be addressed where those features are defined.

[Excerpt from RFC-2389, Hethmon and Elz]

Author:
Lars Behnke

Field Summary
 
Fields inherited from interface net.sf.hermesftp.common.FtpConstants
ATTR_CLIENT_NAME, ATTR_DATA_PROT, ATTR_FILE_OFFSET, ATTR_FORCE_UTF8, ATTR_GROUP_DATA, ATTR_LOGIN_TIME, ATTR_RENAME_FILE, ATTR_RESTART_MARKERS, ATTR_SSL, ATTR_USER_DATA, BYTE_LENGTH, BYTE_MASK, DEFAULT_BEAN_RES, DEFAULT_KEYSTORE, DEFAULT_KEYSTORE_PASS, DT_ASCII, DT_BINARY, DT_EBCDIC, HERMES_HOME, MILLI, MODE_BLOCK, MODE_COMPRESS, MODE_STREAM, MODE_ZIP, MSG_GOODBYE, MSG150, MSG200, MSG200_NOTED, MSG200_PBSZ, MSG200_SIZE, MSG200_TYPE, MSG202, MSG211_FEAT_ENTRY, MSG211_FEAT_FOOTER, MSG211_FEAT_HEADER, MSG211_STAT, MSG213_SIZE, MSG213_TIME, MSG214, MSG220, MSG220_WEL, MSG226, MSG227, MSG229, MSG230, MSG234, MSG250, MSG257, MSG331, MSG350, MSG350_REST, MSG421, MSG425, MSG426, MSG431, MSG450, MSG451, MSG500, MSG500_CMD, MSG501, MSG501_PATH, MSG501_SIZE, MSG503, MSG503_USR, MSG504, MSG522, MSG530, MSG530_AUTH, MSG534, MSG536, MSG550, MSG550_COMM, MSG550_EXISTS, MSG550_MSG, MSG550_NOTEMPTY, MSG550_PERM, MSG553, OPT_ALLOWED_PASSIVE_PORTS, OPT_BUFFER_SIZE, OPT_CHARSET_ASCII, OPT_CHARSET_EBCDIC, OPT_EMULATE_UNIX, OPT_FTP_PORT, OPT_IPV4_BLACK_LIST, OPT_IPV6_BLACK_LIST, OPT_MAX_CONNECTIONS, OPT_MAX_DOWNLOAD_RATE, OPT_MAX_IDLE_SECONDS, OPT_MAX_UPLOAD_RATE, OPT_MSG_GOODBYE, OPT_MSG_WELCOME, OPT_REMOTE_DIR, OPT_SSL_ALLOW_EXPLICIT, OPT_SSL_ALLOW_IMPLICIT, OPT_SSL_CIPHER_SUITES, OPT_SSL_FORCE, OPT_SSL_KEYSTORE_FILE, OPT_SSL_KEYSTORE_PASS, OPT_SSL_PORT_IMPLICIT, PRIV_NONE, PRIV_READ, PRIV_READ_WRITE, PRIV_WRITE, PWD, SEPARATOR, SERVER_STATUS_HALTED, SERVER_STATUS_INIT, SERVER_STATUS_READY, SERVER_STATUS_UNDEF, SPACE, STAT_BYTES_DOWNLOADED, STAT_BYTES_UPLOADED, STAT_DOWNLOAD_RATE, STAT_FILES_DOWNLOADED, STAT_FILES_UPLOADED, STAT_UPLOAD_RATE, STRUCT_FILE, STRUCT_RECORD, TYPE_NAMES, WILDCARD
 
Constructor Summary
FtpCmdOpts()
           
 
Method Summary
 void execute()
          Executes the command.
 java.lang.String getHelp()
          Returns a short help text for the command.
 boolean isAuthenticationRequired()
          Returns whether authentication is needed or not.
 
Methods inherited from class net.sf.hermesftp.cmd.AbstractFtpCmd
getAbsPath, getAndResetFileOffset, getArguments, getCtx, getPathArg, getPermission, getToken, handleAsyncCmd, isResponded, msg, msg, msg, msgOut, msgOut, msgOut, out, setArguments, setCtx, setToken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpCmdOpts

public FtpCmdOpts()
Method Detail

execute

public void execute()
             throws FtpCmdException
Executes the command.

Throws:
FtpCmdException - Thrown on any exception occuring while the command is executed.

getHelp

public java.lang.String getHelp()
Returns a short help text for the command.

Returns:
The help text.

isAuthenticationRequired

public boolean isAuthenticationRequired()
Returns whether authentication is needed or not.

Returns:
True, if the command requires authentication.


Copyright © 2005-2007 Lars Behnke. All Rights Reserved.