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

Advertisement

Medalha
Joined:
Posts:
10

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

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.
Description: WinSCP session log file showing incorrect display of permissions when file owner's name contains spaces. Line 141 shows the error.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

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

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.

Reply with quote

Medalha
Joined:
Posts:
10

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

martin 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.

Reply with quote

Medalha
Joined:
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.

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

PuttyCapture.JPG

Reply with quote

Advertisement

martin
Site Admin
martin avatar

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

PuTTY does not even try to understand the listing it just prints it.

Reply with quote

Medalha
Joined:
Posts:
10

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

martin 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.

Reply with quote

Medalha
Joined:
Posts:
10

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

Medalha wrote:

martin 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.

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

PuttyCapture.png

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

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

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.

Reply with quote

Advertisement

Medalha
Joined:
Posts:
10

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

martin 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.

Reply with quote

martin
Site Admin
martin avatar

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

I'm afraid that there's no reliable way.

Reply with quote

Advertisement

You can post new topics in this forum