lbug wrote: 2023-07-28, 12:38 UTC
Hi,
I hope, I do not touch any rejected topic here since I did not manually read the 90 pages of discussion. But I did search and found only similar topics concerning the main application and the included FTP-functionality, not the SFTP-plugin yet.
So I would like to request some extra columns for the SFTP-plugin. - For me only "owner" and "group" would be sufficient.
It is very cumbersome to [Alt]+[Enter] on every single file - and start again from the beginning if I just forgot the first owners already!
Really searched? On page 90 of this thread - on which you have posted(!) -, you can find this: viewtopic.php?p=429570#p429570:
JOUBE wrote: 2023-04-26, 08:18 UTC
Please add columns for user and group in long view of the sftp plugin
Even to find this thread I had to manually browse the forum.
And yes, I read the opening post as well as skimmed through page 90 - sadly overlooking your keywords "user" and "group"!
But at least this does show the demand for such a functionality.
lbug wrote: 2023-07-28, 13:26 UTC
But at least this does show the demand for such a functionality.
The last three months here in the forum were characterized by the preparations for the release of TC Version 11. It started with Tc11 Beta 1 on May 3rd, 2023. In the meantime, 11 betas and 3 release candidates have appeared and numerous new functions have been tested. And TC11 is imminent.
I explain this so that you understand why ghisler(author) didn't have the time and quiet to turn to the SFTP plugin. That's why I wrote a summary suggestion in between, which you are welcome to comment on and add to if necessary. I also find that there is a need for the SFTP plugin: When Tc11 is released, next step should be a look at the SFTP plugin
I do know how much work goes into all this development and I did not want to stress somebody.
I really just thought this specific topic was not mentioned before in context of the SFTP-plugin ... according to my insufficient search.
Unfortunately reading a directory via SFTP only returns numerical UID and GID values. Only the stat command used on Alt+Enter returns both the numerical values and the user/group name.
ghisler(Author) wrote: 2023-07-30, 08:26 UTC
Unfortunately reading a directory via SFTP only returns numerical UID and GID values. Only the stat command used on Alt+Enter returns both the numerical values and the user/group name.
This is not true. If you have enabled detailedlog=1 in the settings of a connection and have a look at the logfile while a directory is listed, you will see user and group.
struct _LIBSSH2_SFTP_ATTRIBUTES {
/* If flags & ATTR_* bit is set, then the value in this struct will be
* meaningful Otherwise it should be ignored
*/
unsigned long flags;
libssh2_uint64_t filesize;
unsigned long uid, gid;
unsigned long permissions;
unsigned long atime, mtime;
};
The line you see in the log seems to be raw data from the server which still needs to be interpreted. It may differ between servers, especially if the server isn't Unix based.
Just as a hint:
Maybe you could look at the source of WinSCP (open source) - how they are getting this piece of information?
Though, I do not know what libraries they are using.
But it should be possible in an efficient way. - Using WinSCP I can easily open directories which do contain thousands of files (with user and group names already on every entry) and it does not take any noticeable time longer to load than the SFTP-plugin.
2ghisler(author)
This - which you called "raw data" - come from the servers. I think it comes from OpenSSH *), because windows10/11 send exact the same. Because you use findfirst/findnext to get the data (within your sftpfunc.cpp: SftpFindFirstFileW() and SftpFindNextFileW() and - (if detailedlog is true) at line 3214 - ShowStatus(completeline); ) and the answer of the servers are allways unsorted and you store this unsorted data to tcftp.log. I can simulate this unsorted data by sending "ls -laU" where -U means unsorted, and the sorting VIA SHELL in this case is exact the same 'order' with the ssh/scp/sfpt:finsfirst/findnext. I will send you some log data in next post or via email after i have anonymized them.
Joube
*) and other if they have implmented version 2.xx
Edit typo: 'oder' -> 'order', same -> some, date -> data
Last edited by JOUBE on 2023-08-01, 06:38 UTC, edited 4 times in total.
lbug wrote: 2023-07-31, 10:54 UTC
Just as a hint:
Maybe you could look at the source of WinSCP (open source) - how they are getting this piece of information?
This is not necessary as everything is there in his sources and in the log and ghisler(author) will see it immediately.
lbug wrote: 2023-07-31, 10:54 UTC
Though, I do not know what libraries they are using.
But it should be possible in an efficient way. - Using WinSCP I can easily open directories which do contain thousands of files (with user and group names already on every entry) and it does not take any noticeable time longer to load than the SFTP-plugin.
Not so complicated please, everything is already there and arrives "for free" via ssh.
Last edited by JOUBE on 2023-07-31, 11:45 UTC, edited 1 time in total.
libssh2_sftp_readdir_ex :
longentry - is a pointer to a pre-allocated buffer of at least longentry_maxlen bytes to read data into. The format of the `longname' field is unspecified by SFTP protocol. It MUST be suitable for use in the output of a directory listing command (in fact, the recommended operation for a directory listing command is to simply display this data). So:
ghisler(Author) wrote: 2023-07-31, 08:11 UTC
The line you see in the log seems to be raw data from the server which still needs to be interpreted.
Yes. But it is very easy to do that. And it is needed to do that for a full and usefull sftp implementation. If you do not want to implement columns for user and group itself, than you have to implement in long view a column with this *longentry completely.
ghisler(Author) wrote: 2023-07-31, 08:11 UTC
It may differ between servers, especially if the server isn't Unix based.
(Unix based = ?, Linux = OpenSSH based, Windows based = Openssh based (pre w10 = ?), Mac = ?) I will check that (with some other ssh Server). Version 2.
JOUBE wrote: 2023-08-01, 06:42 UTC (Unix based = ?, Linux = OpenSSH based, Windows based = Openssh based (pre w10 = ?), Mac = ?) I will check that (with some other ssh Server). Version 2.
Who says there's only OpenSSH for Linux? Dropbear is another SSH server for Linux, a very lightweight one that is primarily used in embedded systems, as well as in the x86 distro named Fli4l. And I'm pretty sure there are other SSH servers for Linux. And don't forget FreeBSD, NetBSD, HP-UX, Sun and other systems with a different architecture and software packages. All of them could behave differently, deliver different outputs and so on.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64