Version: 1.1.2 (using KDE KDE 3.0.4) Installed from: SuSE RPMs OS: Linux File times in fish are 1 hour behind the file times in a ssh shell.
Created attachment 317 [details] screenshot
I can confirm the situation. File times are always shown in GMT for fish. I tested that by connecting to a system at GMT-3, while myself I am at GMT+1. The problem occurs on 3.1 RC6.
Just commited a fix to solve this bug RCS file: /home/kde/kdebase/kioslave/fish/fish.cpp,v retrieving revision 1.21 diff -u -p -r1.21 fish.cpp --- fish.cpp 5 Mar 2003 14:29:21 -0000 1.21 +++ fish.cpp 16 Mar 2003 14:51:38 -0000 @@ -244,7 +244,7 @@ fishProtocol::fishProtocol(const QCStrin sendLen = -1; connectionAuth.keepPassword = true; connectionAuth.url.setProtocol("fish"); - epoch.setTime_t(0); + epoch.setTime_t(0, Qt::UTC); outBufPos = -1; outBuf = NULL; outBufLen = 0;
*** Bug has been marked as fixed ***.
current CVS of today, displays UTC instead of Timezone of user, who logged in both boxes run at UTC time the users have CET as TZ and KDE setting
BTW sftp displays the time correctly
The fish KIO salve assumes the same local time locally than on the remote computer. (May be it is an error/drawback of the specification of the FISH protocol.) (As for "seconds to epoch" errors, there are still some in code too.) Have a nice day!
SVN commit 461343 by goutte: Be more careful about local time, UTC and seconds since epoch (That is only locally, as the FISH protocol assume local time, which is bad.) CCBUG:49881 (Not tested) M +3 -6 fish.cpp M +0 -2 fish.h --- branches/KDE/3.5/kdebase/kioslave/fish/fish.cpp #461342:461343 @@ -273,7 +273,6 @@ setMultipleAuthCaching( true ); connectionAuth.keepPassword = true; connectionAuth.url.setProtocol("fish"); - epoch.setTime_t(0, Qt::UTC); outBufPos = -1; outBuf = NULL; outBufLen = 0; @@ -768,9 +767,7 @@ int fishProtocol::makeTimeFromLs(const QString &monthStr, const QString &dayStr, const QString &timeyearStr) { - QDateTime dt; - dt.setTime_t(time(0)); - dt.setTime(QTime()); + QDateTime dt(QDate::currentDate(Qt::UTC)); int year = dt.date().year(); int month = dt.date().month(); int currentMonth = month; @@ -797,7 +794,7 @@ } dt.date().setYMD(year,month,day); - return epoch.secsTo(dt); + return dt.toTime_t(); } /** @@ -929,7 +926,7 @@ if (pos < 0 || pos2 < 0 || pos3 < 0) break; dt.setTime(QTime(line.mid(pos+1,pos2-pos-1).toInt(),line.mid(pos2+1,pos3-pos2-1).toInt(),line.mid(pos3+1).toInt())); errorCount--; - atom.m_long = epoch.secsTo(dt); + atom.m_long = dt.toTime_t(); udsEntry.append(atom); break; --- branches/KDE/3.5/kdebase/kioslave/fish/fish.h #461342:461343 @@ -171,8 +171,6 @@ /** number of bytes read so far */ int dataRead; time_t t_last, t_start; - /** unix timestamp "0" as QDateTime */ - QDateTime epoch; /** details about each fishCommand */ static const struct fish_info { const char *command;
SVN commit 461344 by goutte: Be more careful about local time, UTC and seconds since epoch (That is only locally, as the FISH protocol assume local time, which is bad.) CCBUG:49881 (Foreward port of revision 461343; might not compile; not tested) M +3 -6 fish.cpp M +0 -2 fish.h --- trunk/KDE/kdebase/kioslave/fish/fish.cpp #461343:461344 @@ -262,7 +262,6 @@ setMultipleAuthCaching( true ); connectionAuth.keepPassword = true; connectionAuth.url.setProtocol("fish"); - epoch.setTime_t(0, Qt::UTC); outBufPos = -1; outBuf = NULL; outBufLen = 0; @@ -753,9 +752,7 @@ int fishProtocol::makeTimeFromLs(const QString &monthStr, const QString &dayStr, const QString &timeyearStr) { - QDateTime dt; - dt.setTime_t(time(0)); - dt.setTime(QTime()); + QDateTime dt(QDate::currentDate(Qt::UTC)); int year = dt.date().year(); int month = dt.date().month(); int currentMonth = month; @@ -782,7 +779,7 @@ } dt.date().setYMD(year,month,day); - return epoch.secsTo(dt); + return dt.toTime_t(); } /** @@ -914,7 +911,7 @@ if (pos < 0 || pos2 < 0 || pos3 < 0) break; dt.setTime(QTime(line.mid(pos+1,pos2-pos-1).toInt(),line.mid(pos2+1,pos3-pos2-1).toInt(),line.mid(pos3+1).toInt())); errorCount--; - atom.m_long = epoch.secsTo(dt); + atom.m_long = dt.toTime_t(); udsEntry.append(atom); break; --- trunk/KDE/kdebase/kioslave/fish/fish.h #461343:461344 @@ -173,8 +173,6 @@ /** number of bytes read so far */ int dataRead; time_t t_last, t_start; - /** unix timestamp "0" as QDateTime */ - QDateTime epoch; /** details about each fishCommand */ static const struct fish_info { const char *command;
*** Bug 121636 has been marked as a duplicate of this bug. ***
Still displaying in UTC.
*** Bug 125783 has been marked as a duplicate of this bug. ***
SVN commit 601882 by mkoller: BUG: 49881 set kio_fish's timezone to UTC so that mktime (used by QDateTime.toTime_t()) interprets the struct tm really in UTC M +2 -0 fish.cpp M +10 -9 fish.pl --- branches/KDE/3.5/kdebase/kioslave/fish/fish.cpp #601881:601882 @@ -135,6 +135,8 @@ exit(-1); } + setenv("TZ", "UTC", true); + struct sigaction act; memset(&act,0,sizeof(act)); act.sa_handler = ripper; --- branches/KDE/3.5/kdebase/kioslave/fish/fish.pl #601881:601882 @@ -12,7 +12,7 @@ use Fcntl; $|++; -#open(DEBUG,">/tmp/kio_fish.debug.$$.log"); +open(DEBUG,">/tmp/kio_fish.debug.$$.log"); # save code in initial directory if just transferred if (defined $code) { unlink('.fishsrv.pl'); @@ -42,7 +42,7 @@ chomp; chomp; next if !length($_) || substr($_,0,1) ne '#'; -# print DEBUG "$_\n"; + print DEBUG "$_\n"; s/^#//; /^VER / && do { # We do not advertise "append" capability anymore, as "write" is @@ -74,7 +74,7 @@ sysopen(OFH,$fn,O_WRONLY|O_CREAT|O_TRUNC) || do { close(FH); print "### 500 $!\n"; next; }; local $/ = undef; my $buffer = ''; - while ($size > 16384 && ($read = sysread(FH,$buffer,16384)) > 0) { + while ($size > 32768 && ($read = sysread(FH,$buffer,32768)) > 0) { $size -= $read; if (syswrite(OFH,$buffer,$read) != $read) { close(FH); close(OFH); @@ -254,13 +254,13 @@ print "### 100\n"; my $buffer = ''; my $read = 1; - while ($size > 16384 && ($read = sysread(FH,$buffer,16384)) > 0) { -# print DEBUG "$size left, $read read\n"; + while ($size > 32768 && ($read = sysread(FH,$buffer,32768)) > 0) { + print DEBUG "$size left, $read read\n"; $size -= $read; print $buffer; } while ($size > 0 && ($read = sysread(FH,$buffer,$size)) > 0) { -# print DEBUG "$size left, $read read\n"; + print DEBUG "$size left, $read read\n"; $size -= $read; print $buffer; } @@ -280,6 +280,7 @@ sub write_loop { my $size = int($_[0]); my $fn = unquote($_[1]); + print DEBUG "write_loop called $size size, $fn fn, $_[2]\n"; my $error = ''; sysopen(FH,$fn,$_[2]) || do { print "### 400 $!\n"; return; }; eval { flock(FH,2); }; @@ -290,13 +291,13 @@ print "### 100\n"; my $buffer = ''; my $read = 1; - while ($size > 16384 && ($read = read(STDIN,$buffer,16384)) > 0) { -# print DEBUG "$size left, $read read\n"; + while ($size > 32768 && ($read = read(STDIN,$buffer,32768)) > 0) { + print DEBUG "$size left, $read read\n"; $size -= $read; $error ||= $! if (syswrite(FH,$buffer,$read) != $read); } while ($size > 0 && ($read = read(STDIN,$buffer,$size)) > 0) { -# print DEBUG "$size left, $read read\n"; + print DEBUG "$size left, $read read\n"; $size -= $read; $error ||= $! if (syswrite(FH,$buffer,$read) != $read); }