Discussion:
[Proftpd-user] mod_quota SFTP status code
(too old to reply)
Oli Kessler
2015-10-07 13:35:24 UTC
Permalink
Hi all,

We use mod_quota with SFTP and notice that the clients get "SSH_FX_PERMISSION_DENIED" errors when the quota is exceeded. This is confusing and triggers a retry for some clients which end up in a loop of retries.

There is SSH2_FX_QUOTA_EXCEEDED which is used when the file system returns a EDQUOT. This seems not to be returned for quota exceeded with mod_quota.

Is this just not implemented or do we have to configure it somewhere?

Cheers,
-ok
------------------------------------------------------------------------------
Full-scale, agent-less Infrastructure Monitoring from a single dashboard
Integrate with 40+ ManageEngine ITSM Solutions for complete visibility
Physical-Virtual-Cloud Infrastructure monitoring from one console
Real user monitoring with APM Insights and performance trend reports
Learn More http://pubads.g.doubleclick.net/gampad/clk?id=247754911&iu=/4140
_______________________________________________
ProFTPD Users List <proftpd-***@proftpd.org>
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html
TJ Saunders
2015-10-07 15:40:35 UTC
Permalink
Post by Oli Kessler
We use mod_quota with SFTP and notice that the clients get
"SSH_FX_PERMISSION_DENIED" errors when the quota is exceeded. This is
confusing and triggers a retry for some clients which end up in a loop of
retries.
There is SSH2_FX_QUOTA_EXCEEDED which is used when the file system
returns a EDQUOT. This seems not to be returned for quota exceeded with
mod_quota.
Is this just not implemented or do we have to configure it somewhere?
Neither; the mod_sftp module does know about/implement the
SSH2_FX_QUOTA_EXCEEDED value, and it does not need to be configured.

However, the SSH2_FX_QUOTA_EXCEEDED value is only defined for SFTP
versions 4 and higher; it does NOT appear in the protocol definitions
for version 3 (the most common version, as that is what OpenSSH
implements). Thus mod_sftp will only return SSH2_FX_QUOTA_EXCEEDED if
the connecting SFTP client requests protocol version 4 or higher;
otherwise, as you noticed, mod_sftp will use something else.

In looking through the mod_sftp and mod_quotatab code, it looks like the
correct errno values are used throughout, but there might be a slight
issue in the mod_sftp handling of WRITE requests, such that an errno
value of EDQUOT (used by mod_quotatab), may not be being propagated
properly. I'll fix this shortly.

In the mean time, you might check which SFTP version your clients are
using, to see if they are capable of handling the SSH2_FX_QUOTA_EXCEEDED
value.

Cheers,
TJ

------------------------------------------------------------------------------
Full-scale, agent-less Infrastructure Monitoring from a single dashboard
Integrate with 40+ ManageEngine ITSM Solutions for complete visibility
Physical-Virtual-Cloud Infrastructure monitoring from one console
Real user monitoring with APM Insights and performance trend reports
Learn More http://pubads.g.doubleclick.net/gampad/clk?id=247754911&iu=/4140
_______________________________________________
ProFTPD Users List <proftpd-***@proftpd.org>
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html
Oli Kessler
2015-10-08 07:04:03 UTC
Permalink
Thanks for the clarification.

The client is indeed running version 3 of the protocol, so no luck there..
Post by TJ Saunders
In looking through the mod_sftp and mod_quotatab code, it looks like the
correct errno values are used throughout, but there might be a slight
issue in the mod_sftp handling of WRITE requests, such that an errno
value of EDQUOT (used by mod_quotatab), may not be being propagated
properly. I'll fix this shortly.
Perfect - We see in fact a lot of write errors when this happens and suspected other issues first before checking quota settings for the user.

Cheers
-ok

Loading...