|
From: TJ S. <tj...@ca...> - 2026-05-19 15:58:57
|
> I have a working ProFTPD configuration with a MariaDB backend. > The users and their quotas are stored in the database. > > Files are transferred only via SFTP/SCP. > > If I set the “quotalimittype” to “hard” and the quota is reached during > the upload, the file is deleted from the server, as I would expect and I > see a logentry like: "STOR: quota reached: 'filename' removed". Excellent question. The mod_quotatab module (and its documentation) were originally written for FTP operations. SFTP/SCP, being binary protocols, do not have the same freeform response code/message that FTP operations do, so some things, like the above "STOR: quota reached" messages simply are not supported for SFTP/SCP. However, as you rightly point out, there is an SFTP-specific status code defined that looks appropriate for these situations: > In the draft > https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13#section-9.1, > there is the error code SSH_FX_QUOTA_EXCEEDED (15), which, in my > opinion, should be returned here. > > May this be a bug or are my exptectations wrong? In the mod_quotatab source code, there is the get_quota_exceeded_errno() function, which tries to find the right errno value to express when quotas have been exceeded. Not every platform defines/supports the (preferred) EDQUOTA errno value, unfortunately, so there is a series of fallback errno values, such as EFBIG or ENOSPC. In mod_sftp, when an file upload fails, we check the errno value. It should be one of these errno values that mod_quotatab selected. The mod_sftp modules checks for EDQUOTA, and if that is the errno value, then the SSH_FX_QUOTA_EXCEEDED status code is used. But if the errno value is something else, a different status code is used. Then there is the question of that an SFTP/SCP client would do, present to the end user, if the SSH_FX_QUOTA_EXCEEDED status code is received. Would the client present it differently than other errors, or would the client treat that status code like anything else? All of this means that -- depending on your platform -- the Right Thing(tm) may be happening. We'd need more details to double-check that EDQUOT is being selected by mod_quotatab, and properly handled by mod_sftp. Assuming that that is all working as expected, there is then the question of what your client does, when it receives SSH_FX_QUOTA_EXCEEDED -- and for that, we'd need specifics of the clients in question; not all SFTP/SCP clients behave the same way. Hope this helps, TJ |