Topic "Incorrect display of user and group permissions when file owner's name contains one or more spaces"

Author Message
Medalha
[View user's profile]

Joined: 2015-03-13
Posts: 10
I just found that when a file owner's name contains one or more spaces WinSCP will send everything after the first space to the column for group permissions. For example, when owner is "domain admins" and group is "domain admins", these permissions will appear as owner "domain" and group "admins domain admins". Another example: "enterprise read-only domain controllers" + "domain admins" will show as "enterprise" + "read-only domain controllers domain admins".

This bug is probably related to the previous bugs 1288/1212. It is present up to version 5.80 Beta.

I must add that Putty 0.66 shows the permissions correctly.

Attached is a session log showing the reported behavior at line 141.

Thank you again four your outstanding work.
WinSCP.log (11.2 KB) [Download]

Description: WinSCP session log file showing incorrect display of permissions when file owner's name contains spaces. Line 141 shows the error.

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Thanks for your report. How do you suggest to resolve the problem? I do not think there's a reliable way to parse the listing, if there a space in the a group or owner name.
Medalha
[View user's profile]

Joined: 2015-03-13
Posts: 10
prikryl wrote:
Thanks for your report. How do you suggest to resolve the problem? I do not think there's a reliable way to parse the listing, if there a space in the a group or owner name.


Thank you for your answer.

I am not a programmer, so I will probably say something irrelevant, but Putty presents the names correctly. Can we "consult" its source to see how it's done there? Or does that case not apply at all to WinSCP?

This "problem" arises, for example, when looking at Samba directories whose files carry Windows permissions, which often contain spaces. The user ID numbers are of course not affected, this is a esthetic problem only. Nevertheless, it would be nice to fix it.
Medalha
[View user's profile]

Joined: 2015-03-13
Posts: 10
In order to provide further information on this subject, I enclose a slice of a screen capture showing Putty's correct display of user and group names containing spaces.
PuttyCapture.JPG (31.23 KB) [Download]

Description: Putty session screen capture. Response to command "ls -al". User and group names containing spaces are shown correctly.

Medalha
[View user's profile]

Joined: 2015-03-13
Posts: 10
An equivalent slice for WinSCP.
WinSCPCapture.JPG (25.4 KB) [Download]

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
PuTTY does not even try to understand the listing it just prints it.
Medalha
[View user's profile]

Joined: 2015-03-13
Posts: 10
prikryl wrote:
PuTTY does not even try to understand the listing it just prints it.


So how does Putty correctly align the user and group names when displaying them? If I switch the user and group names, the respective columns are redimensioned to accommodate them. Doesn't this mean that Putty knows which words correspond to user and which correspond to group? It must somehow know when the name begins and when it ends.
Medalha
[View user's profile]

Joined: 2015-03-13
Posts: 10
Medalha wrote:
prikryl wrote:
PuTTY does not even try to understand the listing it just prints it.


So how does Putty correctly align the user and group names when displaying them? If I switch the user and group names, the respective columns are redimensioned to accommodate them. Doesn't this mean that Putty knows which words correspond to user and which correspond to group? It must somehow know when the name begins and when it ends.


The image I'm now uploading shows the two cases I referred to in the quoted post. Putty somehow knows where the owner's name ends, regardless of spaces contained therein, and formats the column width accordingly.
PuttyCapture.png (19.29 KB) [Download]

Description: Screen capture of Putty session showing adjustment of column width according to owner's name length

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
PuTTY does not know anything. PuTTY is a dumb terminal.

You execute a remote ls command in PuTTY. The remote ls has a direct access to the remote file system, where the group and owner are two distinct fields. So the ls command knows what is owner name and what is group name. It can then print the formatted line for each file and send it to PuTTY. The PuTTY displays the line only, without any need to understand the line.
Medalha
[View user's profile]

Joined: 2015-03-13
Posts: 10
prikryl wrote:
PuTTY does not know anything. PuTTY is a dumb terminal.

You execute a remote ls command in PuTTY. The remote ls has a direct access to the remote file system, where the group and owner are two distinct fields. So the ls command knows what is owner name and what is group name. It can then print the formatted line for each file and send it to PuTTY. The PuTTY displays the line only, without any need to understand the line.


What you are saying makes perfect sense. Thank you for explaining it.

Do you mean that there's no way to solve this issue with WinSCP? I suppose I will have to live with it. Thank you again.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
I'm afraid that there's no reliable way.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License