Hi Scott,

Note that even if the known_hosts file doesn't exist, this change will allow
things to work no matter what.  It's just that nothing will be written to the
known_hosts file since it is non-existent.  If it does exist, the known_hosts
file will be updated with the information.  So, either way, it will work.

Jake

Quoting [EMAIL PROTECTED]:

> Author: sdeboy
> Date: Wed Aug  9 23:09:57 2006
> New Revision: 430277
>
> URL: http://svn.apache.org/viewvc?rev=430277&view=rev
> Log:
> setting strict host checking to "no" - users no longer have to use another
> tool to get the target server into the known_hosts file - thanks to Jake for
> the pointer
> With this change, a user only needs to create an empty
> $user.dir/.ssh/known_hosts file - JSch will add the server entry to the
> known_hosts file automatically
>
> Modified:
>
>
logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
>
> Modified:
>
logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
> URL:
>
http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java?rev=430277&r1=430276&r2=430277&view=diff
> ==============================================================================
> ---
>
logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
> (original)
> +++
>
logging/chainsaw/trunk/src/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
> Wed Aug  9 23:09:57 2006
> @@ -40,8 +40,10 @@
>  import org.apache.commons.vfs.FileObject;
>  import org.apache.commons.vfs.FileSystemException;
>  import org.apache.commons.vfs.FileSystemManager;
> +import org.apache.commons.vfs.FileSystemOptions;
>  import org.apache.commons.vfs.VFS;
>  import org.apache.commons.vfs.provider.URLFileName;
> +import org.apache.commons.vfs.provider.sftp.SftpFileSystemConfigBuilder;
>  import org.apache.log4j.chainsaw.receivers.VisualReceiver;
>  import org.apache.log4j.varia.LogFilePatternReceiver;
>
> @@ -276,7 +278,10 @@
>            getLogger().info("attempting to load file: " + getFileURL());
>            try {
>              FileSystemManager fileSystemManager = VFS.getManager();
> -            FileObject fileObject =
> fileSystemManager.resolveFile(getFileURL());
> +            FileSystemOptions opts = new FileSystemOptions();
> +
> SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(opts,
> "no");
> +
> +            FileObject fileObject =
> fileSystemManager.resolveFile(getFileURL(), opts);
>              reader = new
> InputStreamReader(fileObject.getContent().getInputStream());
>              //now that we have a reader, remove additional portions of the
> file url (sftp passwords, etc.)
>              //check to see if the name is a URLFileName..if so, set file
> name to not include username/pass
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to