aboutsummaryrefslogtreecommitdiff
path: root/doc/wydawca.texi
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-01-06 13:25:39 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2010-01-06 13:25:39 +0200
commit1a0f319a747220e48bde4fae8b80c0b00d22e69c (patch)
tree5912bfb14ac3d26b29eff947ded1eefa008e80be /doc/wydawca.texi
parentfa78a9f21ff4fd85fb568232c9bee957b9c83497 (diff)
downloadwydawca-1a0f319a747220e48bde4fae8b80c0b00d22e69c.tar.gz
wydawca-1a0f319a747220e48bde4fae8b80c0b00d22e69c.tar.bz2
Improve SQL configuration.
* src/config.c (sql_kw): New statements: config-file and config-group. * src/sql.c (sql_init_dictionary): Handle config-file and config-group. Set CLIENT_MULTI_RESULTS option. * src/sql.h (struct sqlconn): New members: config_file and config_group. * NEWS, doc/wydawca.texi: Update.
Diffstat (limited to 'doc/wydawca.texi')
-rw-r--r--doc/wydawca.texi71
1 files changed, 70 insertions, 1 deletions
diff --git a/doc/wydawca.texi b/doc/wydawca.texi
index ab18e47..7e69831 100644
--- a/doc/wydawca.texi
+++ b/doc/wydawca.texi
@@ -1189,6 +1189,8 @@ releases).
@smallexample
@group
sql @var{id} @{
+ config-file @var{file};
+ config-group @var{group};
host @var{hostname};
database @var{dbname};
user @var{username};
@@ -1199,11 +1201,57 @@ sql @var{id} @{
@end smallexample
Here, @var{id} is a string uniquely identifying this
-database. It is used by another configuration statements (e.g. by
+database. It is used by other configuration statements (e.g. by
dictionaries, see the next section) to refer to this
database.
@end deffn
+@deffn {Config: sql} config-file @var{name}
+ Set the name of the @acronym{SQL} configuration file to read.
+@end deffn
+
+@deffn {Config: sql} config-group @var{name}
+ Set the name of the group in the @acronym{SQL} configuration file,
+from where to read configuration options.
+@end deffn
+
+ The statements above allow to keep all security-sensitive
+information, such as @acronym{SQL} username and password, in an
+external configuration file and thus to relax permission requirements
+for @file{wydawca.rc}. The exact format of such external configuration
+file depends on the flavor of @acronym{SQL} @acronym{DBMS} in use.
+As of version @value{VERSION} @command{wydawca} supports only
+@samp{MySQL}, so the configuration file is what is called @dfn{option
+file} in @samp{MySQL} parlance (@pxref{option-files, Using Option
+Files,,mysql,MySQL Manual}).
+
+ For example, suppose your @file{wydawca.rc} contains the following:
+
+@smallexample
+sql default @{
+ config-file /etc/wydawca.mysql;
+ config-group wydawca;
+@}
+@end smallexample
+
+@noindent
+ Then, the @file{/etc/wydawca.mysql} would contain the actual
+parameters for accessing the database, e.g.:
+
+@smallexample
+[wydawca]
+socket = /var/db/mysql.sock
+database = savane
+user = savane
+pass = guessme
+@end smallexample
+
+ Another way to specify database credentials is by using the
+statements described below. If you prefer this way, you will have to
+tighten the permissions of @file{wydawca.rc} so that no third person
+could see the @acronym{SQL} password. The recommended permissions are
+@samp{0600}.
+
@deffn {Config: sql} host @var{hostname}[:@var{port-or-socket}]
Set the hostname or @acronym{IP} address of the host running the
database. Optional @var{port-or-socket} specifies port number (for
@@ -1243,6 +1291,22 @@ sql default @{
@end group
@end smallexample
+ It is possible to combine both methods, e.g.:
+
+@smallexample
+@group
+sql default @{
+ config-file /etc/wydawca.sql;
+ host project.database.com:3306;
+ database savane;
+@}
+@end group
+@end smallexample
+
+ Then, @command{wydawca} will attempt to obtain the missing
+information (username and password, in this case) from the
+@file{/etc/wydawca.sql} file.
+
@node dictionaries
@section Dictionaries
@cindex dictionaries
@@ -2822,6 +2886,11 @@ gpg-homedir @var{arg:@i{string}};
# @r{Define SQL database}.
# @xref{sql}.
sql @var{id:@i{string}} @{
+ # @r{Set the name of the configuration file to read.}
+ config-file @var{name:@i{string}};
+ # @r{Set the name of the configuration file group to use.}
+ config-group @var{name:@i{string}};
+
# @r{Set SQL server hostname or IP address.}
host @var{host:@i{string}};

Return to:

Send suggestions and report system problems to the System administrator.