View Single Post
Old 03-19-2018, 04:44 PM
berdmann berdmann is offline
VanDyke Technical Support
Join Date: Aug 2017
Posts: 284
Hi npbrewer,

Unable to prune transport “x.x.x.x”
Unable to remove outdated backup: “Cpanel::Transport::Files::_perms_str2oct” was given an invalid permissions string: 0
This error is referenced on cPanel's site:


What I can't tell is if this problem has been resolved in a newer version of the cPanel client or not; the data on the posting I've linked to above seems to indicate it's not yet fixed.

Perhaps the job of the _perms_str2oct function is designed to turn a UNIX style permissions field (rwxrwxrwx) into an octal representation (e.g. 777).

If so, it suggests the "Cpanel" sftp client may be trying to parse the sftp "long file listing" format which the SFTP protocol spec says clients should *not* do. Here's a snippet from the SFTP v3 protocol spec:

The format of the `longname' field is unspecified by this 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). However, clients SHOULD NOT attempt to parse the longname field for file attributes; they SHOULD use the attrs field instead.

The recommended format for the longname field is as follows:

-rwxr-xr-x 1 mjos staff 348911 Mar 25 14:29 t-filexfer

One of the reasons why this longname field SHOULD NOT be parsed by SFTP clients is that the recommended format doesn't account for the fact that an SFTP server might be running on a Windows machine for which the style of permissions present on a Linux machine does not apply (the '-rwxr-xr-x' in the recommended format shown above). VShell on Windows presents things to clients in the way that Windows file listing (MSDOS) would be presented. There is a registry-only configuration setting that one can use to tell VShell to provide a UNIX style listing in order to attempt to achieve compatibility with clients that disregard the protocol specification:

HKLM\Software\VanDyke\VShell\Server\Use UNIX Format For SFTP File Listing (set the value to 1, default is 0)

One possible way cPanel's limited client *might* be able to work with VShell on Windows is if you enable the "Use UNIX Format for SFTP File Listing" option described above.

Even after setting the option to have VShell return UNIX style long file listings so that broken SFTP clients can parse these successfully, it *may* still fail when the cPanel SFTP client gets the long permissions listing in Unix format because there is no accurate translation from NTFS permissions to UNIX style permissions.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote