Bug 3021 - Openssh/sftp question related to timezone difference with "ls -l"
Summary: Openssh/sftp question related to timezone difference with "ls -l"
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: 7.7p1
Hardware: Other Linux
: P5 trivial
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-20 00:49 AEST by Sebastian Woell
Modified: 2019-06-20 00:49 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Woell 2019-06-20 00:49:56 AEST
Hi team,

I am experiencing some strange behaviour when I run an “ls -l” in an sftp session (both server and client are openssh) – and I am wondering if the behaviour is a feature or a bug.

The issue occurs if server time zone differs from client time zone. And I have also tested this with different combinations of openssh server and client versions on different operating systems (AIX, Linux and Solaris) – the issue always exists.

The issue is the following:
When I run an “ls –l” in a dir, the timestamp of the files in the dir are shown in server (remote) time zone. But if I run the “ls –l “ for a specific file, the time is shown in client time zone.

Sample log of the connection:

Client: Openssh version 7.70.11.0, AIX 7.1, Timezone Europe/Berlin
Server: Openssh version 7.50.14.0, RHEL 7.4, Timezone Asia/Singapore

sftp> ls -l
-rwxr-xr-x    1 root     system       1267 Jun 19 15:05 test.sh
sftp> ls -l test.sh
-rwxr-xr-x    ? 0        0            1267 Jun 19 21:05 test.sh

What I also see is that in the “ls –l <filename>” version, the owner and group are also no longer shown as names.
Is there anyone that can explain this to me?

Thanks,
Sebastian