PDA

View Full Version : Problem with FTP Quotas


FreeVPS
30th October 2006, 11:16
When I have these in my pure-ftpd mysql config file:

# Optional : query to get the maximal number of files
# Pure-FTPd must have been compiled with virtual quotas support.

# MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L"

MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")


# Optional : query to get the maximal disk usage (virtual quotas)
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support.

# MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L"

MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")


The service won't start however if I comment them out the service runs fine. I'm storing all my details in a table called ftpd all other areas work except this, i've been trying various different ways of amending the sql query but no joy - anyone?

FreeVPS
30th October 2006, 15:39
I've tried running strace on this for about an hour and cannot see why it's failing.

This is all is in my logs:

Oct 30 13:25:57 mercury pure-ftpd: (?@?) [ERROR] Configuration error: Invalid SQL configuration file: /etc/pure-ftpd/mysql.conf
Oct 30 13:26:49 mercury last message repeated 2 times
Oct 30 13:28:02 mercury pure-ftpd: (?@?) [ERROR] Configuration error: Invalid SQL configuration file: /etc/pure-ftpd/mysql.conf
Oct 30 13:31:49 mercury last message repeated 2 times

I'm using Fedora Core 5

As I say above if i remove those two lines it works ok - but if I enable them ftp falls over.

falko
31st October 2006, 18:18
I think you must escape the quotation marks in the two lines:

MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User="\L" AND status=\"1\" AND (ipaccess = \"*\" OR ipaccess LIKE \"\\R\")

MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User="\L" AND status=\"1\" AND (ipaccess = \"*\" OR ipaccess LIKE \"\\R\")

FreeVPS
1st November 2006, 13:11
Same problem :(

Nov 1 11:10:17 mercury pure-ftpd: (?@?) [ERROR] Configuration error: Invalid SQL configuration file: /etc/pure-ftpd/mysql.conf

falko
2nd November 2006, 15:27
What's in /etc/pure-ftpd/mysql.conf now?

perldork
1st January 2007, 06:50
Hi,

You have to pass

--with-quotas

to configure to enable the MySQLGetQTASZ and MySQLGetQTAFS configuration directives. Not well documented, I had to search through the source to find the

#ifdef QUOTAS

section that showed the code and then the configure script itself to find which configure switch caused QUOTAS to be defined for compilation.