aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS9
-rw-r--r--doc/anubis.texi99
-rw-r--r--src/mysql.c23
-rw-r--r--src/usr.opt7
4 files changed, 117 insertions, 21 deletions
diff --git a/NEWS b/NEWS
index 7775aea..16f46b2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
1GNU Anubis NEWS -- history of user-visible changes. 2014-05-16 1GNU Anubis NEWS -- history of user-visible changes. 2014-05-18
2Copyright (C) 2001-2014 The Anubis Team. 2Copyright (C) 2001-2014 The Anubis Team.
3 3
4See the end of file for copying conditions. 4See the end of file for copying conditions.
5Please send your bug reports to <bug-anubis@gnu.org>. 5Please send your bug reports to <bug-anubis@gnu.org>.
6 6
7 7
@@ -68,12 +68,19 @@ END
68 68
69* Guile output 69* Guile output
70 70
71By default Scheme's standard error and output ports are redirected to 71By default Scheme's standard error and output ports are redirected to
72syslog, using priorities `err' and `warning' correspondingly. 72syslog, using priorities `err' and `warning' correspondingly.
73 73
74* MySQL options file
75
76When using MySQL for Anubis user database, the database parameters and
77access credentials are read from the file /etc/my.cnf, section
78"anubis". Additionally, two URL parameters are provided:
79"options-file", which sets the name of the options file, and
80"options-group", which sets the name of the group.
74 81
75 82
76* Version 4.1.1, 2008-12-20 83* Version 4.1.1, 2008-12-20
77 84
78** Automatic correction of MAIL and RCPT SMTP commands. 85** Automatic correction of MAIL and RCPT SMTP commands.
79 86
diff --git a/doc/anubis.texi b/doc/anubis.texi
index 2167225..eec5cfc 100644
--- a/doc/anubis.texi
+++ b/doc/anubis.texi
@@ -606,51 +606,81 @@ The database name is specified by the @var{dbname} element.
606 606
607Any further details needed for connecting to the database are 607Any further details needed for connecting to the database are
608given by @acronym{URL} parameters. All of them have reasonable 608given by @acronym{URL} parameters. All of them have reasonable
609default values, so you'll have to specify only those parameters that 609default values, so you'll have to specify only those parameters that
610differ from the default. The following parameters are defined: 610differ from the default. The following parameters are defined:
611 611
612@table @var 612@table @option
613@item @var{port}=@var{number} 613@item port=@var{number}
614Specifies port number the database server is listening on. 614Specifies port number the database server is listening on.
615If it is not given, the behavior depends on the value of 615If it is not given, the behavior depends on the value of the
616@var{socket} parameter (see below). If @var{socket} is not present, the 616@option{socket} parameter (see below). If @option{socket} is not present, the
617program will use the default port number for the given protocol 617program will use the default port number for the given protocol
618(i.e. 3306 for @samp{mysql} and 5432 for @samp{pgsql}. 618(i.e. 3306 for @samp{mysql} and 5432 for @samp{pgsql}.
619 619
620@item @var{socket}=@var{string} 620@item socket=@var{string}
621Specifies the UNIX file name of the socket to connect to. This 621Specifies the UNIX file name of the socket to connect to. This
622parameter cannot be used together with @var{port} (see above). 622parameter cannot be used together with @option{port} (see above).
623 623
624@item @var{bufsize}=@var{number} 624@item bufsize=@var{number}
625Sets length of the buffer for storing SQL queries. Default is 625Sets length of the buffer for storing SQL queries. Default is
6261024 bytes. 6261024 bytes.
627 627
628@item @var{table}=@var{string} 628@item table=@var{string}
629Specifies name of the database table with the authentication 629Specifies name of the database table with the authentication
630data. Default is @samp{users}. 630data. Default is @samp{users}.
631 631
632@item @var{authid}=@var{string} 632@item authid=@var{string}
633Specifies the name of a column in @var{table} which holds 633Specifies the name of a column in @option{table} which holds
634@samp{AUTHID} value. Default is @samp{authid}. 634@samp{AUTHID} value. Default is @samp{authid}.
635 635
636@item @var{passwd}=@var{string} 636@item passwd=@var{string}
637Specifies the name of a column in @var{table} which holds 637Specifies the name of a column in @option{table} which holds
638the user password. Default is @samp{passwd}. 638the user password. Default is @samp{passwd}.
639 639
640@item @var{account}=@var{string} 640@item account=@var{string}
641Specifies the name of a column in @var{table} which holds 641Specifies the name of a column in @option{table} which holds
642the name of system account to be used for this @samp{AUTHID}. Default 642the name of system account to be used for this @samp{AUTHID}. Default
643is @samp{account}. 643is @samp{account}.
644 644
645@item @var{rcfile}=@var{string} 645@item rcfile=@var{string}
646Specifies the name of a column in @var{table} which holds 646Specifies the name of a column in @option{table} which holds
647the path to the user's configuration file. Default is @samp{rcfile}. 647the path to the user's configuration file. Default is @samp{rcfile}.
648 648
649@FIXME{An example, please.} 649@FIXME{An example, please.}
650@end table
651
652@cindex options file, MySQL
653@findex my.cnf
654@findex /etc/my.cnf
655When using a MySQL database (@samp{mysql://}), database parameters and
656access credentials are first read from the file @file{/etc/my.cnf}, if
657it exists. This file called @dfn{option file} in @samp{MySQL} parlance
658@ifhtml
659(see @uref{http://dev.mysql.com/doc/refman/5.0/en/option-files.html,
660option files}).
661@end ifhtml
662@ifnothtml
663(@pxref{option-files, Using Option Files,,mysql,MySQL Manual})
664@end ifnothtml
665is organized in groups, each group beginning with the group name in
666square brackets on a separate line. Within a group, each non-empty
667line consists of a MySQL option name, optionally followed by an equal
668sign and the value. By default, the values from the @samp{anubis}
669group are read.
670
671Two additional parameters are provided to fine-tune this behavior:
650 672
673@table @option
674@item options-file=@var{file}
675Read options from @var{file} instead of @file{/etc/my.cnf}. An
676empty value (@samp{options-file=}), disables using the options file.
677
678@item options-group=@var{name}
679Set the name of the group in the MySQL configuration file, from
680which to read configuration options.
651@end table 681@end table
652 682
653@node Managing the Database 683@node Managing the Database
654@section Managing the Database 684@section Managing the Database
655 685
656Managing the user database is a complex task, which looks differently 686Managing the user database is a complex task, which looks differently
@@ -950,17 +980,52 @@ found, it will prompt you to supply them.
950@table @option 980@table @option
951@item -m @var{mech} 981@item -m @var{mech}
952@itemx --mechanism @var{mech} 982@itemx --mechanism @var{mech}
953Use the SASL mechanism @var{mech}. Give this option several times 983Use the SASL mechanism @var{mech}. Give this option several times
954to set a list of allowed mechanisms. 984to set a list of allowed mechanisms.
955 985
986@item --file=@var{file}
987@itemx -f @var{file}
988Sets the user configuration file name (default is @file{.anubisrc}).
989
990@item --netrc+@var{file}
991@itemx -n @var{file}
992Sets the name of the automatic login configuration file (default is
993@file{.netrc}).
994
956@item -v 995@item -v
957@itemx --verbose 996@itemx --verbose
958Verbose output. Multiple options increase verbosity. Maximum verbosity 997Verbose output. Multiple options increase verbosity. Maximum verbosity
959level is 3. 998level is 3.
999@end table
1000
1001Options controlling encryption:
960 1002
1003@table @option
1004@item --disable-tls
1005@itemx -d
1006Disable the use of TLS encryption.
1007
1008@item --tls-cafile=@var{file}
1009@itemx -C @var{file}
1010Sets the name of certificate authority file to use when verifying the
1011server certificate.
1012
1013@item --tls-priorities=@var{list}
1014Sets cipher suite preferences to use. The @var{list} argument may
1015contain a single initial keyword or be a colon-separated list of TLS
1016keywords. The description of TLS keywords is well beyond the scope of
1017this document. Please refer to @ref{Priority Strings,Priority
1018Strings,,gnutls,GnuTLS Manual}, for a detailed discussion.
1019
1020Default priority list is @samp{NORMAL}.
1021@end table
1022
1023Informational options:
1024
1025@table @option
961@item --version 1026@item --version
962Display program version number and exit. 1027Display program version number and exit.
963 1028
964@item --help 1029@item --help
965Display short usage summary and exit. 1030Display short usage summary and exit.
966@end table 1031@end table
@@ -1576,12 +1641,14 @@ this option does not require setting the @samp{ssl-key} and
1576@deffn Option ssl-priorities @var{list} 1641@deffn Option ssl-priorities @var{list}
1577Sets cipher suite preferences to use. The @var{list} argument may 1642Sets cipher suite preferences to use. The @var{list} argument may
1578contain a single initial keyword or be a colon-separated list of TLS 1643contain a single initial keyword or be a colon-separated list of TLS
1579keywords. The description of TLS keywords is well beyond the scope of 1644keywords. The description of TLS keywords is well beyond the scope of
1580this document. Please refer to @ref{Priority Strings,Priority 1645this document. Please refer to @ref{Priority Strings,Priority
1581Strings,,gnutls,GnuTLS Manual}, for a detailed discussion. 1646Strings,,gnutls,GnuTLS Manual}, for a detailed discussion.
1647
1648Default priority list is @samp{NORMAL}.
1582@end deffn 1649@end deffn
1583 1650
1584@deffn Option ssl-cert @var{file-name} 1651@deffn Option ssl-cert @var{file-name}
1585Specify the certificate for the @acronym{TLS/SSL} encryption. 1652Specify the certificate for the @acronym{TLS/SSL} encryption.
1586 1653
1587Default for @var{file-name} is @file{anubis.pem}. 1654Default for @var{file-name} is @file{anubis.pem}.
diff --git a/src/mysql.c b/src/mysql.c
index 676618a..81ea62c 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -120,14 +120,14 @@ mysql_db_open (void **dp, ANUBIS_URL * url, enum anubis_db_mode mode,
120 struct anubis_sql_db *amp = NULL; 120 struct anubis_sql_db *amp = NULL;
121 const char *table = anubis_url_get_arg (url, "table"); 121 const char *table = anubis_url_get_arg (url, "table");
122 const char *authid = anubis_url_get_arg (url, "authid");