|
From: Dieter B. <pr...@bl...> - 2026-05-20 13:52:44
|
Hello TJ, thank you for your answer! I've done some little tests and created two sftp debug logfiles. One test was with sftp from debian trixie, which uses sftpv3 and one test with winscp, which uses sftpv6 To me it looks like for both sftp versions the upload was successfull. I expect, that the client receive an error when reach the limit. You can download the sftp debugfiles from: https://bloms.de/download/sftp-debug-openssh-sftp.log.gz https://bloms.de/download/sftp-debug-winscp.log.gz Thank you very much for your support! On Tue, May 19, TJ Saunders wrote: > > 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 > > > _______________________________________________ > ProFTPD Users List <pro...@li...> > Unsubscribe problems? > http://www.proftpd.org/list-unsub.html -- Gruß Dieter -- I do not get viruses because I do not use MS software. If you use Outlook then please do not put my email address in your address-book so that WHEN you get a virus it won't use my address in the From field. |