You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Guillaume Nodet <gn...@gmail.com> on 2010/05/05 21:18:35 UTC
SFTP problems
Thanks for the pointer. The SFTP subsystem is now using that code.
Any more issues ?
On Wed, May 5, 2010 at 18:43, Sai Pullabhotla
<sa...@jmethods.com>wrote:
> Okay, I see the fix for the dates, but they are still incorrect when
> the client interprets its. Couple of things -
>
> I believe time should be on a 24 hour clock basis - so the format need
> to be changed to HH instead of hh.
>
> The listing is not compatible with UNIX style listing. So files older
> than 6 months should show the year, but not the time. Files in the
> last 6 months should show time, but not year. Unless SFTP has a
> standard for the directory list format.
>
> In essence, FileZilla shows a file that is modified in year 2006 as 2010.
>
> There is some code in the FtpServer project that we may want to steal.
> It is org.apache.ftpserver.util.DateUtils.getUnixDate(long).
>
>
> Regards,
> Sai Pullabhotla
>
>
>
>
>
> On Wed, May 5, 2010 at 11:15 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> > Which dates ? I've fixed the "Jan 01 ..." thing if that's why you're
> > referring to.
> > But using filezilla, there are still things that we don't support, but
> i've
> > been able to download directories recursively without problems.
> >
> > On Wed, May 5, 2010 at 17:49, Sai Pullabhotla
> > <sa...@jmethods.com>wrote:
> >
> >> How about the dates on the files?
> >>
> >> Regards,
> >> Sai Pullabhotla
> >>
> >>
> >>
> >>
> >>
> >> On Wed, May 5, 2010 at 10:13 AM, Guillaume Nodet <gn...@gmail.com>
> wrote:
> >> > Fixed, let me know if you find any other easily fixed issues.
> >> >
> >> > On Wed, May 5, 2010 at 16:41, Sai Pullabhotla
> >> > <sa...@jmethods.com>wrote:
> >> >
> >> >> I just noticed that the code checked in just replaces "\" with "/". I
> >> >> think for best compliance on all operating systems and file systems,
> >> >> it should replace File.separatorChar with "/". Not sure if there are
> >> >> any file systems that use a separator other than "/" and "\".
> >> >>
> >> >> Regards,
> >> >> Sai Pullabhotla
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> On Wed, May 5, 2010 at 9:22 AM, Guillaume Nodet <gn...@gmail.com>
> >> wrote:
> >> >> > I've committed the changes. Could you give a try ?
> >> >> >
> >> >> > On Wed, May 5, 2010 at 16:20, Guillaume Nodet <gn...@gmail.com>
> >> wrote:
> >> >> >
> >> >> >> Removing the second string works with FileZilla but fails with the
> >> sftp
> >> >> >> command line utility.
> >> >> >>
> >> >> >>
> >> >> >> On Wed, May 5, 2010 at 16:13, Guillaume Nodet <gn...@gmail.com>
> >> wrote:
> >> >> >>
> >> >> >>> Yeah, that's what I'm trying.
> >> >> >>> Let me try with removing the double name though.
> >> >> >>>
> >> >> >>>
> >> >> >>> On Wed, May 5, 2010 at 15:50, Sai Pullabhotla <
> >> >> >>> sai.pullabhotla@jmethods.com> wrote:
> >> >> >>>
> >> >> >>>> How about something like this:
> >> >> >>>>
> >> >> >>>> protected void sendAbsoluteName(int id, File file) throws
> >> >> IOException
> >> >> >>>> {
> >> >> >>>> Buffer buffer = new Buffer();
> >> >> >>>> buffer.putByte((byte) SSH_FXP_NAME);
> >> >> >>>> buffer.putInt(id);
> >> >> >>>> buffer.putInt(1);
> >> >> >>>> String path = file.getPath();
> >> >> >>>> if(File.separatorChar != '/') {
> >> >> >>>> path = path.replace(File.separatorChar, '/');
> >> >> >>>> }
> >> >> >>>> if(path.charAt(0) != '/') {
> >> >> >>>> path = '/' + path;
> >> >> >>>> }
> >> >> >>>> buffer.putString(path);
> >> >> >>>> //buffer.putString(file.getPath());
> >> >> >>>> writeAttrs(buffer, file);
> >> >> >>>> send(buffer);
> >> >> >>>> }
> >> >> >>>>
> >> >> >>>> Regards,
> >> >> >>>> Sai Pullabhotla
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>
> >> >> >>>> On Wed, May 5, 2010 at 8:45 AM, Sai Pullabhotla
> >> >> >>>> <sa...@jmethods.com> wrote:
> >> >> >>>> > I removed the second call to place the path in the buffer and
> >> seems
> >> >> to
> >> >> >>>> > be working fine.
> >> >> >>>> >
> >> >> >>>> > Regards,
> >> >> >>>> > Sai Pullabhotla
> >> >> >>>> >
> >> >> >>>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> --
> >> >> >>> Cheers,
> >> >> >>> Guillaume Nodet
> >> >> >>> ------------------------
> >> >> >>> Blog: http://gnodet.blogspot.com/
> >> >> >>> ------------------------
> >> >> >>> Open Source SOA
> >> >> >>> http://fusesource.com
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> Cheers,
> >> >> >> Guillaume Nodet
> >> >> >> ------------------------
> >> >> >> Blog: http://gnodet.blogspot.com/
> >> >> >> ------------------------
> >> >> >> Open Source SOA
> >> >> >> http://fusesource.com
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Cheers,
> >> >> > Guillaume Nodet
> >> >> > ------------------------
> >> >> > Blog: http://gnodet.blogspot.com/
> >> >> > ------------------------
> >> >> > Open Source SOA
> >> >> > http://fusesource.com
> >> >> >
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Cheers,
> >> > Guillaume Nodet
> >> > ------------------------
> >> > Blog: http://gnodet.blogspot.com/
> >> > ------------------------
> >> > Open Source SOA
> >> > http://fusesource.com
> >> >
> >>
> >
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Blog: http://gnodet.blogspot.com/
> > ------------------------
> > Open Source SOA
> > http://fusesource.com
> >
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: DecodingStateProtocolDecoder's problem
Posted by Emmanuel Lecharny <el...@gmail.com>.
On 5/10/10 3:56 AM, Stanley Ding wrote:
> Here is the core decoding code:
>
Can you give us a bit more context?
> My question is: what's gonna happen when the current buffer has only 2 bytes but the "state" needs 4 bytes to decode? the state can't consume 1 byte so an IllegalStateException will be thrown out?
>
Yes. In any case, you have to deal with buffer fragmentation. The core
idea is to handle the incoming data as if it arrives byte by byte. Doing
so, you'll cover all the use cases.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com
DecodingStateProtocolDecoder's problem
Posted by Stanley Ding <gh...@hotmail.com>.
Here is the core decoding code:
for (;;) {
IoBuffer b = undecodedBuffers.peek();
if (b == null) {
break;
}
int oldRemaining = b.remaining();
state.decode(b, out);
int newRemaining = b.remaining();
if (newRemaining != 0) {
if (oldRemaining == newRemaining) {
throw new IllegalStateException(
DecodingState.class.getSimpleName() + " must " +
"consume at least one byte per decode().");
}
} else {
undecodedBuffers.poll();
}
}
My question is: what's gonna happen when the current buffer has only 2 bytes but the "state" needs 4 bytes to decode? the state can't consume 1 byte so an IllegalStateException will be thrown out?
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969
Re: SFTP problems
Posted by Guillaume Nodet <gn...@gmail.com>.
Wanna give it another try ?
About adding the SFTP subsystem by default, I have no real opinion. I'm
just not sure if people would be willing to give access to the file system
by default.
On Thu, May 6, 2010 at 15:03, Sai Pullabhotla
<sa...@jmethods.com>wrote:
> I've setup the root directory for the SFTP subsystem to be "C:\".
>
> The login, and cd'ing, listing to subdirectories is working fine. But,
> I cannot "cd" to C:\ again using "cd ..". So if my working directory
> is "/dev", doing a "cd .." should put me back in "/" (whose real path
> is "C:\"). But the directory is unchanged. The "cd .." works well for
> directories that are deeper than one level. In other words, if my
> current dir is "/dev/apis" and doing a "cd .." puts me back in "/dev".
>
> Also, should the Default SSH server setup the SFTP subsystem as well?
>
> Regards,
> Sai Pullabhotla
>
>
>
>
>
> On Thu, May 6, 2010 at 4:54 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> > I've made a few other fixes (including SSHD-86) which helps a lot.
> > Please have a look and i'll cut a release tonight or tomorrow.
> >
> > On Wed, May 5, 2010 at 21:18, Guillaume Nodet <gn...@gmail.com> wrote:
> >
> >> Thanks for the pointer. The SFTP subsystem is now using that code.
> >> Any more issues ?
> >>
> >> On Wed, May 5, 2010 at 18:43, Sai Pullabhotla <
> >> sai.pullabhotla@jmethods.com> wrote:
> >>
> >>> Okay, I see the fix for the dates, but they are still incorrect when
> >>> the client interprets its. Couple of things -
> >>>
> >>> I believe time should be on a 24 hour clock basis - so the format need
> >>> to be changed to HH instead of hh.
> >>>
> >>> The listing is not compatible with UNIX style listing. So files older
> >>> than 6 months should show the year, but not the time. Files in the
> >>> last 6 months should show time, but not year. Unless SFTP has a
> >>> standard for the directory list format.
> >>>
> >>> In essence, FileZilla shows a file that is modified in year 2006 as
> 2010.
> >>>
> >>> There is some code in the FtpServer project that we may want to steal.
> >>> It is org.apache.ftpserver.util.DateUtils.getUnixDate(long).
> >>>
> >>>
> >>> Regards,
> >>> Sai Pullabhotla
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Wed, May 5, 2010 at 11:15 AM, Guillaume Nodet <gn...@gmail.com>
> >>> wrote:
> >>> > Which dates ? I've fixed the "Jan 01 ..." thing if that's why you're
> >>> > referring to.
> >>> > But using filezilla, there are still things that we don't support,
> but
> >>> i've
> >>> > been able to download directories recursively without problems.
> >>> >
> >>> > On Wed, May 5, 2010 at 17:49, Sai Pullabhotla
> >>> > <sa...@jmethods.com>wrote:
> >>> >
> >>> >> How about the dates on the files?
> >>> >>
> >>> >> Regards,
> >>> >> Sai Pullabhotla
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> >>> >> On Wed, May 5, 2010 at 10:13 AM, Guillaume Nodet <gn...@gmail.com>
> >>> wrote:
> >>> >> > Fixed, let me know if you find any other easily fixed issues.
> >>> >> >
> >>> >> > On Wed, May 5, 2010 at 16:41, Sai Pullabhotla
> >>> >> > <sa...@jmethods.com>wrote:
> >>> >> >
> >>> >> >> I just noticed that the code checked in just replaces "\" with
> "/".
> >>> I
> >>> >> >> think for best compliance on all operating systems and file
> systems,
> >>> >> >> it should replace File.separatorChar with "/". Not sure if there
> are
> >>> >> >> any file systems that use a separator other than "/" and "\".
> >>> >> >>
> >>> >> >> Regards,
> >>> >> >> Sai Pullabhotla
> >>> >> >>
> >>> >> >>
> >>> >> >>
> >>> >> >>
> >>> >> >>
> >>> >> >> On Wed, May 5, 2010 at 9:22 AM, Guillaume Nodet <
> gnodet@gmail.com>
> >>> >> wrote:
> >>> >> >> > I've committed the changes. Could you give a try ?
> >>> >> >> >
> >>> >> >> > On Wed, May 5, 2010 at 16:20, Guillaume Nodet <
> gnodet@gmail.com>
> >>> >> wrote:
> >>> >> >> >
> >>> >> >> >> Removing the second string works with FileZilla but fails with
> >>> the
> >>> >> sftp
> >>> >> >> >> command line utility.
> >>> >> >> >>
> >>> >> >> >>
> >>> >> >> >> On Wed, May 5, 2010 at 16:13, Guillaume Nodet <
> gnodet@gmail.com>
> >>> >> wrote:
> >>> >> >> >>
> >>> >> >> >>> Yeah, that's what I'm trying.
> >>> >> >> >>> Let me try with removing the double name though.
> >>> >> >> >>>
> >>> >> >> >>>
> >>> >> >> >>> On Wed, May 5, 2010 at 15:50, Sai Pullabhotla <
> >>> >> >> >>> sai.pullabhotla@jmethods.com> wrote:
> >>> >> >> >>>
> >>> >> >> >>>> How about something like this:
> >>> >> >> >>>>
> >>> >> >> >>>> protected void sendAbsoluteName(int id, File file) throws
> >>> >> >> IOException
> >>> >> >> >>>> {
> >>> >> >> >>>> Buffer buffer = new Buffer();
> >>> >> >> >>>> buffer.putByte((byte) SSH_FXP_NAME);
> >>> >> >> >>>> buffer.putInt(id);
> >>> >> >> >>>> buffer.putInt(1);
> >>> >> >> >>>> String path = file.getPath();
> >>> >> >> >>>> if(File.separatorChar != '/') {
> >>> >> >> >>>> path = path.replace(File.separatorChar, '/');
> >>> >> >> >>>> }
> >>> >> >> >>>> if(path.charAt(0) != '/') {
> >>> >> >> >>>> path = '/' + path;
> >>> >> >> >>>> }
> >>> >> >> >>>> buffer.putString(path);
> >>> >> >> >>>> //buffer.putString(file.getPath());
> >>> >> >> >>>> writeAttrs(buffer, file);
> >>> >> >> >>>> send(buffer);
> >>> >> >> >>>> }
> >>> >> >> >>>>
> >>> >> >> >>>> Regards,
> >>> >> >> >>>> Sai Pullabhotla
> >>> >> >> >>>>
> >>> >> >> >>>>
> >>> >> >> >>>>
> >>> >> >> >>>>
> >>> >> >> >>>>
> >>> >> >> >>>> On Wed, May 5, 2010 at 8:45 AM, Sai Pullabhotla
> >>> >> >> >>>> <sa...@jmethods.com> wrote:
> >>> >> >> >>>> > I removed the second call to place the path in the buffer
> and
> >>> >> seems
> >>> >> >> to
> >>> >> >> >>>> > be working fine.
> >>> >> >> >>>> >
> >>> >> >> >>>> > Regards,
> >>> >> >> >>>> > Sai Pullabhotla
> >>> >> >> >>>> >
> >>> >> >> >>>>
> >>> >> >> >>>
> >>> >> >> >>>
> >>> >> >> >>>
> >>> >> >> >>> --
> >>> >> >> >>> Cheers,
> >>> >> >> >>> Guillaume Nodet
> >>> >> >> >>> ------------------------
> >>> >> >> >>> Blog: http://gnodet.blogspot.com/
> >>> >> >> >>> ------------------------
> >>> >> >> >>> Open Source SOA
> >>> >> >> >>> http://fusesource.com
> >>> >> >> >>>
> >>> >> >> >>>
> >>> >> >> >>>
> >>> >> >> >>
> >>> >> >> >>
> >>> >> >> >> --
> >>> >> >> >> Cheers,
> >>> >> >> >> Guillaume Nodet
> >>> >> >> >> ------------------------
> >>> >> >> >> Blog: http://gnodet.blogspot.com/
> >>> >> >> >> ------------------------
> >>> >> >> >> Open Source SOA
> >>> >> >> >> http://fusesource.com
> >>> >> >> >>
> >>> >> >> >>
> >>> >> >> >>
> >>> >> >> >
> >>> >> >> >
> >>> >> >> > --
> >>> >> >> > Cheers,
> >>> >> >> > Guillaume Nodet
> >>> >> >> > ------------------------
> >>> >> >> > Blog: http://gnodet.blogspot.com/
> >>> >> >> > ------------------------
> >>> >> >> > Open Source SOA
> >>> >> >> > http://fusesource.com
> >>> >> >> >
> >>> >> >>
> >>> >> >
> >>> >> >
> >>> >> >
> >>> >> > --
> >>> >> > Cheers,
> >>> >> > Guillaume Nodet
> >>> >> > ------------------------
> >>> >> > Blog: http://gnodet.blogspot.com/
> >>> >> > ------------------------
> >>> >> > Open Source SOA
> >>> >> > http://fusesource.com
> >>> >> >
> >>> >>
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > Cheers,
> >>> > Guillaume Nodet
> >>> > ------------------------
> >>> > Blog: http://gnodet.blogspot.com/
> >>> > ------------------------
> >>> > Open Source SOA
> >>> > http://fusesource.com
> >>> >
> >>>
> >>
> >>
> >>
> >> --
> >> Cheers,
> >> Guillaume Nodet
> >> ------------------------
> >> Blog: http://gnodet.blogspot.com/
> >> ------------------------
> >> Open Source SOA
> >> http://fusesource.com
> >>
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Blog: http://gnodet.blogspot.com/
> > ------------------------
> > Open Source SOA
> > http://fusesource.com
> >
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: SFTP problems
Posted by Sai Pullabhotla <sa...@jmethods.com>.
I've setup the root directory for the SFTP subsystem to be "C:\".
The login, and cd'ing, listing to subdirectories is working fine. But,
I cannot "cd" to C:\ again using "cd ..". So if my working directory
is "/dev", doing a "cd .." should put me back in "/" (whose real path
is "C:\"). But the directory is unchanged. The "cd .." works well for
directories that are deeper than one level. In other words, if my
current dir is "/dev/apis" and doing a "cd .." puts me back in "/dev".
Also, should the Default SSH server setup the SFTP subsystem as well?
Regards,
Sai Pullabhotla
On Thu, May 6, 2010 at 4:54 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> I've made a few other fixes (including SSHD-86) which helps a lot.
> Please have a look and i'll cut a release tonight or tomorrow.
>
> On Wed, May 5, 2010 at 21:18, Guillaume Nodet <gn...@gmail.com> wrote:
>
>> Thanks for the pointer. The SFTP subsystem is now using that code.
>> Any more issues ?
>>
>> On Wed, May 5, 2010 at 18:43, Sai Pullabhotla <
>> sai.pullabhotla@jmethods.com> wrote:
>>
>>> Okay, I see the fix for the dates, but they are still incorrect when
>>> the client interprets its. Couple of things -
>>>
>>> I believe time should be on a 24 hour clock basis - so the format need
>>> to be changed to HH instead of hh.
>>>
>>> The listing is not compatible with UNIX style listing. So files older
>>> than 6 months should show the year, but not the time. Files in the
>>> last 6 months should show time, but not year. Unless SFTP has a
>>> standard for the directory list format.
>>>
>>> In essence, FileZilla shows a file that is modified in year 2006 as 2010.
>>>
>>> There is some code in the FtpServer project that we may want to steal.
>>> It is org.apache.ftpserver.util.DateUtils.getUnixDate(long).
>>>
>>>
>>> Regards,
>>> Sai Pullabhotla
>>>
>>>
>>>
>>>
>>>
>>> On Wed, May 5, 2010 at 11:15 AM, Guillaume Nodet <gn...@gmail.com>
>>> wrote:
>>> > Which dates ? I've fixed the "Jan 01 ..." thing if that's why you're
>>> > referring to.
>>> > But using filezilla, there are still things that we don't support, but
>>> i've
>>> > been able to download directories recursively without problems.
>>> >
>>> > On Wed, May 5, 2010 at 17:49, Sai Pullabhotla
>>> > <sa...@jmethods.com>wrote:
>>> >
>>> >> How about the dates on the files?
>>> >>
>>> >> Regards,
>>> >> Sai Pullabhotla
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> On Wed, May 5, 2010 at 10:13 AM, Guillaume Nodet <gn...@gmail.com>
>>> wrote:
>>> >> > Fixed, let me know if you find any other easily fixed issues.
>>> >> >
>>> >> > On Wed, May 5, 2010 at 16:41, Sai Pullabhotla
>>> >> > <sa...@jmethods.com>wrote:
>>> >> >
>>> >> >> I just noticed that the code checked in just replaces "\" with "/".
>>> I
>>> >> >> think for best compliance on all operating systems and file systems,
>>> >> >> it should replace File.separatorChar with "/". Not sure if there are
>>> >> >> any file systems that use a separator other than "/" and "\".
>>> >> >>
>>> >> >> Regards,
>>> >> >> Sai Pullabhotla
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> On Wed, May 5, 2010 at 9:22 AM, Guillaume Nodet <gn...@gmail.com>
>>> >> wrote:
>>> >> >> > I've committed the changes. Could you give a try ?
>>> >> >> >
>>> >> >> > On Wed, May 5, 2010 at 16:20, Guillaume Nodet <gn...@gmail.com>
>>> >> wrote:
>>> >> >> >
>>> >> >> >> Removing the second string works with FileZilla but fails with
>>> the
>>> >> sftp
>>> >> >> >> command line utility.
>>> >> >> >>
>>> >> >> >>
>>> >> >> >> On Wed, May 5, 2010 at 16:13, Guillaume Nodet <gn...@gmail.com>
>>> >> wrote:
>>> >> >> >>
>>> >> >> >>> Yeah, that's what I'm trying.
>>> >> >> >>> Let me try with removing the double name though.
>>> >> >> >>>
>>> >> >> >>>
>>> >> >> >>> On Wed, May 5, 2010 at 15:50, Sai Pullabhotla <
>>> >> >> >>> sai.pullabhotla@jmethods.com> wrote:
>>> >> >> >>>
>>> >> >> >>>> How about something like this:
>>> >> >> >>>>
>>> >> >> >>>> protected void sendAbsoluteName(int id, File file) throws
>>> >> >> IOException
>>> >> >> >>>> {
>>> >> >> >>>> Buffer buffer = new Buffer();
>>> >> >> >>>> buffer.putByte((byte) SSH_FXP_NAME);
>>> >> >> >>>> buffer.putInt(id);
>>> >> >> >>>> buffer.putInt(1);
>>> >> >> >>>> String path = file.getPath();
>>> >> >> >>>> if(File.separatorChar != '/') {
>>> >> >> >>>> path = path.replace(File.separatorChar, '/');
>>> >> >> >>>> }
>>> >> >> >>>> if(path.charAt(0) != '/') {
>>> >> >> >>>> path = '/' + path;
>>> >> >> >>>> }
>>> >> >> >>>> buffer.putString(path);
>>> >> >> >>>> //buffer.putString(file.getPath());
>>> >> >> >>>> writeAttrs(buffer, file);
>>> >> >> >>>> send(buffer);
>>> >> >> >>>> }
>>> >> >> >>>>
>>> >> >> >>>> Regards,
>>> >> >> >>>> Sai Pullabhotla
>>> >> >> >>>>
>>> >> >> >>>>
>>> >> >> >>>>
>>> >> >> >>>>
>>> >> >> >>>>
>>> >> >> >>>> On Wed, May 5, 2010 at 8:45 AM, Sai Pullabhotla
>>> >> >> >>>> <sa...@jmethods.com> wrote:
>>> >> >> >>>> > I removed the second call to place the path in the buffer and
>>> >> seems
>>> >> >> to
>>> >> >> >>>> > be working fine.
>>> >> >> >>>> >
>>> >> >> >>>> > Regards,
>>> >> >> >>>> > Sai Pullabhotla
>>> >> >> >>>> >
>>> >> >> >>>>
>>> >> >> >>>
>>> >> >> >>>
>>> >> >> >>>
>>> >> >> >>> --
>>> >> >> >>> Cheers,
>>> >> >> >>> Guillaume Nodet
>>> >> >> >>> ------------------------
>>> >> >> >>> Blog: http://gnodet.blogspot.com/
>>> >> >> >>> ------------------------
>>> >> >> >>> Open Source SOA
>>> >> >> >>> http://fusesource.com
>>> >> >> >>>
>>> >> >> >>>
>>> >> >> >>>
>>> >> >> >>
>>> >> >> >>
>>> >> >> >> --
>>> >> >> >> Cheers,
>>> >> >> >> Guillaume Nodet
>>> >> >> >> ------------------------
>>> >> >> >> Blog: http://gnodet.blogspot.com/
>>> >> >> >> ------------------------
>>> >> >> >> Open Source SOA
>>> >> >> >> http://fusesource.com
>>> >> >> >>
>>> >> >> >>
>>> >> >> >>
>>> >> >> >
>>> >> >> >
>>> >> >> > --
>>> >> >> > Cheers,
>>> >> >> > Guillaume Nodet
>>> >> >> > ------------------------
>>> >> >> > Blog: http://gnodet.blogspot.com/
>>> >> >> > ------------------------
>>> >> >> > Open Source SOA
>>> >> >> > http://fusesource.com
>>> >> >> >
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > --
>>> >> > Cheers,
>>> >> > Guillaume Nodet
>>> >> > ------------------------
>>> >> > Blog: http://gnodet.blogspot.com/
>>> >> > ------------------------
>>> >> > Open Source SOA
>>> >> > http://fusesource.com
>>> >> >
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Cheers,
>>> > Guillaume Nodet
>>> > ------------------------
>>> > Blog: http://gnodet.blogspot.com/
>>> > ------------------------
>>> > Open Source SOA
>>> > http://fusesource.com
>>> >
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>>
>>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
Re: SFTP problems
Posted by Guillaume Nodet <gn...@gmail.com>.
If you look at sshd-core/src/docs/draf-ietf-secsh-filexfer-13.txt,
the SSH_FXP_REALPATH can include a control byte, and the default value
is SSH_FXP_REALPATH_NO_CHECK which means that the call must not fail. I
guess we should check this flag correctly and default to the right behavior
(which would not throw the exception in writeAttrs).
Would you write a patch for that ? I'll be travelling tomorrow but i would
try to review and apply tomorrow evening.
On Sun, May 9, 2010 at 16:15, Frank van der Kleij <kl...@hotmail.com> wrote:
>
> I was doing some tests and found a problem on uploading.
>
> When doing the upload REALPATH is called on the file that is about to be
> created, but in writeAttrs there is a check whether the file actually exists
> and an exception is thrown.
>
> When I remove the exception throwing in writeAttrs then all seems to work
> correctly, so that is the easy solution.
>
> I believe that in the specs it says that on REALPATH dummy attributes
> should be sent so that's an option too.
>
> Any preference?
>
> Frank
>
> PS: this is unrelated, but if getUnixDate would be public I could use it in
> my subclass...
>
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
RE: SFTP problems
Posted by Frank van der Kleij <kl...@hotmail.com>.
Great! and thanks
> Date: Mon, 10 May 2010 07:33:45 +0200
> Subject: Re: SFTP problems
> From: gnodet@gmail.com
> To: dev@mina.apache.org
>
> I think I've actually fixed the issue. The problem is that in version 3,
> the reply to SSH_FXP_REALPATH should always send back dummy attributes.
>
> On Sun, May 9, 2010 at 16:15, Frank van der Kleij <kl...@hotmail.com> wrote:
>
> >
> > I was doing some tests and found a problem on uploading.
> >
> > When doing the upload REALPATH is called on the file that is about to be
> > created, but in writeAttrs there is a check whether the file actually exists
> > and an exception is thrown.
> >
> > When I remove the exception throwing in writeAttrs then all seems to work
> > correctly, so that is the easy solution.
> >
> > I believe that in the specs it says that on REALPATH dummy attributes
> > should be sent so that's an option too.
> >
> > Any preference?
> >
> > Frank
> >
> > PS: this is unrelated, but if getUnixDate would be public I could use it in
> > my subclass...
> >
> >
> > _________________________________________________________________
> > Express yourself instantly with MSN Messenger! Download today it's FREE!
> > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> >
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
_________________________________________________________________
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop
Re: SFTP problems
Posted by Guillaume Nodet <gn...@gmail.com>.
I think I've actually fixed the issue. The problem is that in version 3,
the reply to SSH_FXP_REALPATH should always send back dummy attributes.
On Sun, May 9, 2010 at 16:15, Frank van der Kleij <kl...@hotmail.com> wrote:
>
> I was doing some tests and found a problem on uploading.
>
> When doing the upload REALPATH is called on the file that is about to be
> created, but in writeAttrs there is a check whether the file actually exists
> and an exception is thrown.
>
> When I remove the exception throwing in writeAttrs then all seems to work
> correctly, so that is the easy solution.
>
> I believe that in the specs it says that on REALPATH dummy attributes
> should be sent so that's an option too.
>
> Any preference?
>
> Frank
>
> PS: this is unrelated, but if getUnixDate would be public I could use it in
> my subclass...
>
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
RE: SFTP problems
Posted by Frank van der Kleij <kl...@hotmail.com>.
I was doing some tests and found a problem on uploading.
When doing the upload REALPATH is called on the file that is about to be created, but in writeAttrs there is a check whether the file actually exists and an exception is thrown.
When I remove the exception throwing in writeAttrs then all seems to work correctly, so that is the easy solution.
I believe that in the specs it says that on REALPATH dummy attributes should be sent so that's an option too.
Any preference?
Frank
PS: this is unrelated, but if getUnixDate would be public I could use it in my subclass...
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Re: SFTP problems
Posted by Guillaume Nodet <gn...@gmail.com>.
Sorry, i missed that call.
Last try ?
On Thu, May 6, 2010 at 17:39, Frank van der Kleij <kl...@hotmail.com> wrote:
>
>
> Hi Guillaume,
>
> I still have the FileNotFoundException when I start in e.g. d:\temp with
>
> f = new File(normalizedPath);
>
> For me it works only with f = resolveFile(normalizedPath);
>
> What are your settings? Do you start in '/' on Mac?
>
> Regards
>
> _________________________________________________________________
> New Windows 7: Find the right PC for you. Learn more.
> http://windows.microsoft.com/shop
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
RE: SFTP problems
Posted by Frank van der Kleij <kl...@hotmail.com>.
Hi Guillaume,
I still have the FileNotFoundException when I start in e.g. d:\temp with
f = new File(normalizedPath);
For me it works only with f = resolveFile(normalizedPath);
What are your settings? Do you start in '/' on Mac?
Regards
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop
Re: SFTP problems
Posted by Guillaume Nodet <gn...@gmail.com>.
Well, the problem i had was when resolving the root dir, i could end with an
empty file name, which would cause parsing errors in filezilla when sending
the getLongFileName().
We need to always return a name, but maybe there's a better way.
On Thu, May 6, 2010 at 13:58, Frank van der Kleij <kl...@hotmail.com> wrote:
>
>
> I'm testing on Windows in a non-root directory and the folder navigation
> works but I have errors in the log because of this:
>
> line 790:
>
> f = new File(normalizedPath);
> if (f.getName().length() == 0) {
> f = new File(f, ".");
> }
>
> It causes errors in writeAttrs because the file doesn't really exist in the
> normalized path (it is relative to the root).
>
> I am not sure if it is necessary to reassign f, but if you need it you
> should do resolveFile(f) to resolve it relative to the root.
> Probably even "." should be resolved relative to the root.
>
> Frank
>
> _________________________________________________________________
> New Windows 7: Find the right PC for you. Learn more.
> http://windows.microsoft.com/shop
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
RE: SFTP problems
Posted by Frank van der Kleij <kl...@hotmail.com>.
I'm testing on Windows in a non-root directory and the folder navigation works but I have errors in the log because of this:
line 790:
f = new File(normalizedPath);
if (f.getName().length() == 0) {
f = new File(f, ".");
}
It causes errors in writeAttrs because the file doesn't really exist in the normalized path (it is relative to the root).
I am not sure if it is necessary to reassign f, but if you need it you should do resolveFile(f) to resolve it relative to the root.
Probably even "." should be resolved relative to the root.
Frank
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop
Re: SFTP problems
Posted by Guillaume Nodet <gn...@gmail.com>.
I've made a few other fixes (including SSHD-86) which helps a lot.
Please have a look and i'll cut a release tonight or tomorrow.
On Wed, May 5, 2010 at 21:18, Guillaume Nodet <gn...@gmail.com> wrote:
> Thanks for the pointer. The SFTP subsystem is now using that code.
> Any more issues ?
>
> On Wed, May 5, 2010 at 18:43, Sai Pullabhotla <
> sai.pullabhotla@jmethods.com> wrote:
>
>> Okay, I see the fix for the dates, but they are still incorrect when
>> the client interprets its. Couple of things -
>>
>> I believe time should be on a 24 hour clock basis - so the format need
>> to be changed to HH instead of hh.
>>
>> The listing is not compatible with UNIX style listing. So files older
>> than 6 months should show the year, but not the time. Files in the
>> last 6 months should show time, but not year. Unless SFTP has a
>> standard for the directory list format.
>>
>> In essence, FileZilla shows a file that is modified in year 2006 as 2010.
>>
>> There is some code in the FtpServer project that we may want to steal.
>> It is org.apache.ftpserver.util.DateUtils.getUnixDate(long).
>>
>>
>> Regards,
>> Sai Pullabhotla
>>
>>
>>
>>
>>
>> On Wed, May 5, 2010 at 11:15 AM, Guillaume Nodet <gn...@gmail.com>
>> wrote:
>> > Which dates ? I've fixed the "Jan 01 ..." thing if that's why you're
>> > referring to.
>> > But using filezilla, there are still things that we don't support, but
>> i've
>> > been able to download directories recursively without problems.
>> >
>> > On Wed, May 5, 2010 at 17:49, Sai Pullabhotla
>> > <sa...@jmethods.com>wrote:
>> >
>> >> How about the dates on the files?
>> >>
>> >> Regards,
>> >> Sai Pullabhotla
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Wed, May 5, 2010 at 10:13 AM, Guillaume Nodet <gn...@gmail.com>
>> wrote:
>> >> > Fixed, let me know if you find any other easily fixed issues.
>> >> >
>> >> > On Wed, May 5, 2010 at 16:41, Sai Pullabhotla
>> >> > <sa...@jmethods.com>wrote:
>> >> >
>> >> >> I just noticed that the code checked in just replaces "\" with "/".
>> I
>> >> >> think for best compliance on all operating systems and file systems,
>> >> >> it should replace File.separatorChar with "/". Not sure if there are
>> >> >> any file systems that use a separator other than "/" and "\".
>> >> >>
>> >> >> Regards,
>> >> >> Sai Pullabhotla
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Wed, May 5, 2010 at 9:22 AM, Guillaume Nodet <gn...@gmail.com>
>> >> wrote:
>> >> >> > I've committed the changes. Could you give a try ?
>> >> >> >
>> >> >> > On Wed, May 5, 2010 at 16:20, Guillaume Nodet <gn...@gmail.com>
>> >> wrote:
>> >> >> >
>> >> >> >> Removing the second string works with FileZilla but fails with
>> the
>> >> sftp
>> >> >> >> command line utility.
>> >> >> >>
>> >> >> >>
>> >> >> >> On Wed, May 5, 2010 at 16:13, Guillaume Nodet <gn...@gmail.com>
>> >> wrote:
>> >> >> >>
>> >> >> >>> Yeah, that's what I'm trying.
>> >> >> >>> Let me try with removing the double name though.
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> On Wed, May 5, 2010 at 15:50, Sai Pullabhotla <
>> >> >> >>> sai.pullabhotla@jmethods.com> wrote:
>> >> >> >>>
>> >> >> >>>> How about something like this:
>> >> >> >>>>
>> >> >> >>>> protected void sendAbsoluteName(int id, File file) throws
>> >> >> IOException
>> >> >> >>>> {
>> >> >> >>>> Buffer buffer = new Buffer();
>> >> >> >>>> buffer.putByte((byte) SSH_FXP_NAME);
>> >> >> >>>> buffer.putInt(id);
>> >> >> >>>> buffer.putInt(1);
>> >> >> >>>> String path = file.getPath();
>> >> >> >>>> if(File.separatorChar != '/') {
>> >> >> >>>> path = path.replace(File.separatorChar, '/');
>> >> >> >>>> }
>> >> >> >>>> if(path.charAt(0) != '/') {
>> >> >> >>>> path = '/' + path;
>> >> >> >>>> }
>> >> >> >>>> buffer.putString(path);
>> >> >> >>>> //buffer.putString(file.getPath());
>> >> >> >>>> writeAttrs(buffer, file);
>> >> >> >>>> send(buffer);
>> >> >> >>>> }
>> >> >> >>>>
>> >> >> >>>> Regards,
>> >> >> >>>> Sai Pullabhotla
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>> On Wed, May 5, 2010 at 8:45 AM, Sai Pullabhotla
>> >> >> >>>> <sa...@jmethods.com> wrote:
>> >> >> >>>> > I removed the second call to place the path in the buffer and
>> >> seems
>> >> >> to
>> >> >> >>>> > be working fine.
>> >> >> >>>> >
>> >> >> >>>> > Regards,
>> >> >> >>>> > Sai Pullabhotla
>> >> >> >>>> >
>> >> >> >>>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> --
>> >> >> >>> Cheers,
>> >> >> >>> Guillaume Nodet
>> >> >> >>> ------------------------
>> >> >> >>> Blog: http://gnodet.blogspot.com/
>> >> >> >>> ------------------------
>> >> >> >>> Open Source SOA
>> >> >> >>> http://fusesource.com
>> >> >> >>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>
>> >> >> >>
>> >> >> >> --
>> >> >> >> Cheers,
>> >> >> >> Guillaume Nodet
>> >> >> >> ------------------------
>> >> >> >> Blog: http://gnodet.blogspot.com/
>> >> >> >> ------------------------
>> >> >> >> Open Source SOA
>> >> >> >> http://fusesource.com
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > Cheers,
>> >> >> > Guillaume Nodet
>> >> >> > ------------------------
>> >> >> > Blog: http://gnodet.blogspot.com/
>> >> >> > ------------------------
>> >> >> > Open Source SOA
>> >> >> > http://fusesource.com
>> >> >> >
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Cheers,
>> >> > Guillaume Nodet
>> >> > ------------------------
>> >> > Blog: http://gnodet.blogspot.com/
>> >> > ------------------------
>> >> > Open Source SOA
>> >> > http://fusesource.com
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > Cheers,
>> > Guillaume Nodet
>> > ------------------------
>> > Blog: http://gnodet.blogspot.com/
>> > ------------------------
>> > Open Source SOA
>> > http://fusesource.com
>> >
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
>
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com