summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-21 11:30:51 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2009-02-21 11:31:26 (GMT)
commit1213cf065e9b3a5fb45d00276b3d168462838c17 (patch) (side-by-side diff)
tree8d8f3cb7617465139f0051c10ef80fa9c2c91369
parent5bfe69d55cff8940fd3a84ff479e6e8308b164f4 (diff)
downloadwydawca-1213cf065e9b3a5fb45d00276b3d168462838c17.tar.gz
wydawca-1213cf065e9b3a5fb45d00276b3d168462838c17.tar.bz2
Remove trailing whitespace
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--doc/Makefile.am4
-rwxr-xr-xdoc/check-docs.sh6
-rw-r--r--doc/mastermenu.el4
-rw-r--r--doc/rendition.texi2
-rw-r--r--doc/wydawca.texi144
-rw-r--r--src/builtin.c22
-rw-r--r--src/cmdline.opt2
-rw-r--r--src/config.c94
-rw-r--r--src/directive.c36
-rw-r--r--src/diskio.c76
-rw-r--r--src/exec.c12
-rw-r--r--src/getopt.m460
-rw-r--r--src/gpg.c34
-rw-r--r--src/interval.c8
-rw-r--r--src/mail.c30
-rw-r--r--src/method.c22
-rw-r--r--src/process.c18
-rw-r--r--src/sql.c14
-rw-r--r--src/triplet.c48
-rw-r--r--src/verify.c22
-rw-r--r--src/wydawca.c46
-rw-r--r--src/wydawca.h18
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/atlocal.in2
-rw-r--r--tests/mailstats.at26
25 files changed, 377 insertions, 377 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 7afd676..0ef1e64 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -53,7 +53,7 @@ check-options:
'/@c option --/{s///;s/^\(help\|version\|usage\)//;p}' \
$(top_srcdir)/src/cmdline.opt -- \
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
- $(info_TEXINFOS)
+ $(info_TEXINFOS)
check-refs:
@sed -e = $(info_TEXINFOS) $(wydawca_TEXINFOS) | \
@@ -93,7 +93,7 @@ check-unrevised:
all-check-docs: check-format check-options check-refs check-fixmes check-unrevised check-writeme
-check-docs:
+check-docs:
$(MAKE) -k all-check-docs
master-menu:
diff --git a/doc/check-docs.sh b/doc/check-docs.sh
index c0b0487..16b6b0e 100755
--- a/doc/check-docs.sh
+++ b/doc/check-docs.sh
@@ -42,7 +42,7 @@ do
fi
source="$source $1"
shift
-done
+done
TEMPDIR=/tmp/mfck.$$
mkdir $TEMPDIR || exit 1
@@ -57,14 +57,14 @@ join -v1 $TEMPDIR/src $TEMPDIR/doc > $TEMPDIR/src-doc
join -v2 $TEMPDIR/src $TEMPDIR/doc > $TEMPDIR/doc-src
(if [ -s $TEMPDIR/src-doc ]; then
echo "Not documented $item:"
- cat $TEMPDIR/src-doc
+ cat $TEMPDIR/src-doc
fi
if [ -s $TEMPDIR/doc-src ]; then
echo "Non-existing $item:"
cat $TEMPDIR/doc-src
fi) > $TEMPDIR/report
-if [ -s $TEMPDIR/report ]; then
+if [ -s $TEMPDIR/report ]; then
cat $TEMPDIR/report
rm -rf $TEMPDIR
exit 1
diff --git a/doc/mastermenu.el b/doc/mastermenu.el
index 3ab3341..a38e824 100644
--- a/doc/mastermenu.el
+++ b/doc/mastermenu.el
@@ -26,11 +26,11 @@
;; This file redefines texinfo-master-menu-list so that it takes into
;; account included files.
-;; Known bugs: @menu without previous sectioning command will inherit
+;; Known bugs: @menu without previous sectioning command will inherit
;; documentation string from the previous menu. However, since such a
;; menu is illegal in a texinfo file, we can live with it.
-(require 'texinfo)
+(require 'texinfo)
(require 'texnfo-upd)
(defun texinfo-master-menu-list-recursive (title)
diff --git a/doc/rendition.texi b/doc/rendition.texi
index 016583d..c4092ea 100644
--- a/doc/rendition.texi
+++ b/doc/rendition.texi
@@ -1,7 +1,7 @@
@c Let's use the concept of 'renditions' by Fra@,{c}ois Pinard
@c I extended it by adding a FIXME_FOOTNOTE variable, which controls
@c whether FIXME information should be placed in footnotes or
-@c inlined.
+@c inlined.
@c ======================================================================
@c This document has three levels of rendition: PUBLISH, DISTRIB or PROOF,
diff --git a/doc/wydawca.texi b/doc/wydawca.texi
index 3f5a682..876a8fa 100644
--- a/doc/wydawca.texi
+++ b/doc/wydawca.texi
@@ -159,7 +159,7 @@ distributed tarball must be placed, and clear-signs it using his
From now on, it is the responsibility of a @dfn{release submission daemon}
to scan the source directories, gather the triplets, verify them,
and to move any files that had passed the verification successfully to
-their distribution sites.
+their distribution sites.
@command{Wydawca} is such a release submission daemon. It is able to
handle any number of @samp{source/destination} pairs, offers an
@@ -265,7 +265,7 @@ etc.
@dfn{configuration file} (@pxref{wydawca.rc}). The default
configuration file is @file{@var{sysconfdir}/wydawca.rc}, but if it is
located elsewhere, you can specify its new location with the
-@option{--config-file} (@option{-c}) command line option.
+@option{--config-file} (@option{-c}) command line option.
@anchor{lint}
@xopindex{lint, described}
@@ -308,7 +308,7 @@ it may be necessary when debugging new configurations. Each
@command{wydawca -dd} to obtain level 2, for example. The maximum
debugging level currently is 4, which prints an impractically big
amount of information, which is useful mainly for @command{wydawca}
-developers.
+developers.
@anchor{dry-run}
@xopindex{dry-run, described}
@@ -321,7 +321,7 @@ diagnostics output to the standard error, as if @option{--debug
--stderr} options have been given. You can raise debugging level
further by supplying additional @option{--debug} options. The
@option{--dry-run} option is useful when testing new configurations,
-for example:
+for example:
@smallexample
$ wydawca -c new.cfg --dry-run
@@ -333,7 +333,7 @@ $ wydawca -c new.cfg --dry-run
@sopindex{v, described}
In addition, the two usual informational options are available as well:
@option{--help} (@option{-h}) prints a short usage summary, and
-@option{--version} (@option{-v}) prints program version number.
+@option{--version} (@option{-v}) prints program version number.
@node configuring, wydawca.rc, starting, Top
@chapter How to Configure @command{wydawca}.
@@ -378,7 +378,7 @@ statements (both simple and compound) may appear.
When a statement appears outside of any block statement, we say that
it appears at @dfn{the top level} or @dfn{its scope is global}. When
it appears within a block statement, we say that @dfn{it has block
-scope}.
+scope}.
This subsection will guide you through the @command{wydawca}
configuration on a step-by-step basis.
@@ -402,7 +402,7 @@ configuration on a step-by-step basis.
@UNREVISED
You can request inclusion of any file into your configuration file
using @code{include} statement. Its only argument supplies the name of
-file to be included. For example:
+file to be included. For example:
@smallexample
include /etc/wydawca/msg
@@ -452,7 +452,7 @@ file name of the configuration file. This form might be useful when
debugging new configurations. For example, the following command
runs @command{wydawca} in dry run mode, using configuration file
@file{./test.rc}, and looking for include files in the current working
-directory:
+directory:
@smallexample
$ wydawca --config ./test.rc -I --dry-run
@@ -472,7 +472,7 @@ effect.
Unless told otherwise, @command{wydawca} uses @code{syslog} to print
its diagnostic messages. By default, the program uses the
@samp{local1} facility. To change this, use @code{syslog-facility}
-statement:
+statement:
@smallexample
syslog-facility local2
@@ -488,7 +488,7 @@ syslog-facility local2
values are: @samp{auth}, @samp{authpriv}, @samp{cron}, @samp{daemon},
@samp{ftp}, @samp{local0} through @samp{local7}, and
@samp{mail}. These names are case-insensitive and may be optionally
-prefixed with @samp{log_} (case-insensitive as well).
+prefixed with @samp{log_} (case-insensitive as well).
@kwindex syslog-tag
@cindex syslog tag, configuring
@@ -525,7 +525,7 @@ releases).
@kwindex sql
A database is defined using @code{sql} block statement. It has the
-following syntax:
+following syntax:
@smallexample
@group
@@ -597,7 +597,7 @@ in the table below:
@item builtin
This method is reserved for future use.
-@kwindex sql@r{, access method type}
+@kwindex sql@r{, access method type}
@item sql
Retrieve data from an @acronym{SQL} database. Currently only
@command{MySQL} is supported.
@@ -605,7 +605,7 @@ in the table below:
@kwindex external@r{, access method type}
@item external
Retrieve data using an external program. This method is reserved for
-future use.
+future use.
@end table
Access methods are defined in configuration file using the
@@ -624,7 +624,7 @@ where @var{method-name} is the predefined name of the access method,
the configuration file, or inside a @code{directory} statement
(@pxref{directory pairs}). Global definitions affect all directory
pairs in the configuration file, and ones inside a @code{directory}
-statement override them for that particular directory pair.
+statement override them for that particular directory pair.
There are four predefined methods, which are described later in this
section. The @var{type} must currently always be @samp{sql}. The
@@ -667,8 +667,8 @@ shortest initial prefix of that value, not containing slashes.
by @var{method-name} in the syntax above) used by
@command{wydawca}. They are illustrated by example definitions, based
on the database structure used in
-@uref{http://gna.org/projects/savane, @command{Savane} system}.
-
+@uref{http://gna.org/projects/savane, @command{Savane} system}.
+
@deffn {Access Method} gpg-key
@cindex @acronym{PGP} public key, retrieving
@cindex public @acronym{PGP} key, retrieving
@@ -676,18 +676,18 @@ on the database structure used in
return exactly one string.
The sample definition is:
-
+
@smallexample
gpg-key sql default SELECT gpg_key \
FROM user \
WHERE user_name='%@{user@}'
@end smallexample
@end deffn
-
+
@deffn {Access Method} project-owner
Retrieve email addresses and real names of administrators (or
@dfn{owners}) of a project. It may return any number of rows, each one
-consisting of two columns: an email address and a user name, in this order.
+consisting of two columns: an email address and a user name, in this order.
@smallexample
@group
@@ -704,7 +704,7 @@ project-owner sql default SELECT user.email, user.realname \
@deffn {Access Method} user-data
Return email address and real name of a user. This method must
return one tuple, consisting of two columns: an email address and a user
-name, in this order.
+name, in this order.
@smallexample
@group
@@ -714,7 +714,7 @@ user-data sql default SELECT email, realname \
@end group
@end smallexample
@end deffn
-
+
@deffn {Access Method} verify-user
Verify if a user is allowed to make uploads for a certain project. This
method must return the system name of the user if he is allowed to
@@ -722,9 +722,9 @@ make uploads.
The following definition allows uploads only for project
administrators:
-
+
@smallexample
-@group
+@group
verify-user sql default SELECT user.user_name \
FROM user,user_group,groups \
WHERE user_group.user_id=user.user_id \
@@ -750,7 +750,7 @@ warning messages:
@smallexample
sendfile: copying @var{source} to @var{dest} failed: Invalid value
-
+
sendfile: copying @var{source} to @var{dest} failed: Function not
implemented
@end smallexample
@@ -765,7 +765,7 @@ enable-sendfile no
In particular, you need to disable sendfile when compiling
@command{wydawca} for Linux kernels starting from version 2.6.9 and
-higher.
+higher.
@node archivation
@section Archivation
@@ -777,7 +777,7 @@ existing distributed files with another ones, having the same names.
@command{wydawca} needs to first @dfn{archive} the already existing
file, and then put the new one in its place. Moreover, the directive
file format allows maintainers to explicitly require archivation of
-their existing files.
+their existing files.
@cindex archivation methods
@kwindex archive
@@ -786,20 +786,20 @@ their existing files.
is configured using @code{archive} statement. This statement can
appear either in the global scope, in which case it affects all
directory pairs, or within a @code{directory} block (@pxref{directory
-pairs}), where it affects only the given directory pair.
+pairs}), where it affects only the given directory pair.
This statement takes several arguments. The first argument specifies
-the archivation type:
+the archivation type:
@table @asis
@kwindex none@r{, archivation}
@item none
Disable archivation.
-
+
@kwindex tar@r{, archivation}
@item tar
Use @command{tar} archive.
-
+
@kwindex directory@r{, archivation}
@item directory
Use a separate directory or a directory hierarchy.
@@ -831,13 +831,13 @@ file name), an exact copy of the distribution directory hierarchy will
be created under it. For example, given this configuration:
@smallexample
-archive directory /var/backups/gnu
+archive directory /var/backups/gnu
@end smallexample
@noindent
all files from @file{/home/@/ftp/@/gnu/@/tar} will be archived in
@file{/var/@/backups/@/gnu/@/tar}, and files from
-@file{/home/@/ftp/@/gnu/@/tar/@/old}
+@file{/home/@/ftp/@/gnu/@/tar/@/old}
will be archived in @file{/var/@/backups/@/gnu/@/tar/@/old}, etc.
If the directory name does not begin with a slash, it will be located
@@ -852,7 +852,7 @@ archive directory .archive
mean that files from @file{/home/@/ftp/@/gnu/@/tar} will be archived in the
directory @file{/home/@/ftp/@/gnu/@/tar/@/.archive}, files from
@file{/home/@/ftp/@/gnu/@/tar/@/old} --- in
-@file{/home/@/ftp/@/gnu/@/tar/@/.archive/@/old}, etc.
+@file{/home/@/ftp/@/gnu/@/tar/@/.archive/@/old}, etc.
@anchor{backup-methods}
@vindex version-control @r{Emacs variable}
@@ -886,7 +886,7 @@ Always make simple backups.
@end table
@vindex VERSION_CONTROL
- If no backup method is given, the value of the @env{VERSION_CONTROL}
+ If no backup method is given, the value of the @env{VERSION_CONTROL}
environment variable will be used. And if @env{VERSION_CONTROL} is
not set, the @samp{existing} is used by default.
@@ -896,7 +896,7 @@ not set, the @samp{existing} is used by default.
be located in the same directory as the files they belong to. To
enforce this rule, @command{wydawca} implements
@dfn{implicit signature archivation} facility. It works as
-follows. When archivation of @var{file} is requested by
+follows. When archivation of @var{file} is requested by
@code{archive: @var{file}} statement in the directive
file (@pxref{FTP Upload Directive File - v1.1, Standalone directives,,
maintain.info, Information For Maintainers of GNU Software}),
@@ -939,10 +939,10 @@ the destination directory. Apart from these obligatory statements, a
methods}). Any of these statements, if present, overrides the
corresponding global definition for this directory pair. A
@code{directory} statement ends with the @code{end} keyword on a
-separate line.
+separate line.
For example, the following definition says that valid uploads to
-@file{/home/ftp/incoming/ftp} should be transferred to @file{/home/ftp/gnu}:
+@file{/home/ftp/incoming/ftp} should be transferred to @file{/home/ftp/gnu}:
@smallexample
@group
@@ -1005,7 +1005,7 @@ symlinks removed: 0
Each item in this statistics is configurable, and a
unique configuration keyword is associated with it. The statistics
items and their corresponding keywords are described in the table
-below:
+below:
@table @code
@kwindex errors@r{, statistics}
@@ -1100,7 +1100,7 @@ statistics none
output. This keyword may also be followed by any number of statistics
keywords, which are in this case @emph{excluded} from the
summary. For example, to output all statistics, except errors and
-warnings one would set:
+warnings one would set:
@smallexample
statistics all errors warnings
@@ -1156,7 +1156,7 @@ mailer @var{url}
@cindex mailer @acronym{URL}
A mailer @acronym{URL} begins with a protocol specification.
Two protocol specifications are currently supported: @samp{sendmail}
-and @samp{smtp}. The former means to use a
+and @samp{smtp}. The former means to use a
@command{sendmail}-compatible program to send mails. Such a program
must be able to read mail from its standard input and must support the
following options:
@@ -1189,14 +1189,14 @@ A special form of a sendmail @acronym{URL}, consisting of protocol
specification only (@samp{sendmail:}) is also allowed. It means
``use the sendmail binary from the @code{_PATH_SENDMAIL}
macro in your @file{/usr/include/paths.h} file''. This is the default
-mailer.
+mailer.
The @samp{smtp} protocol means to use an @acronym{SMTP} server directly.
In this case, mailer location consists of two slashes,
followed by the @acronym{IP} address or host name of the @acronym{SMTP}
server, and, optionally, the port number. If the port number is
present, it is separated from the rest of @acronym{URL} by a colon.
-For example:
+For example:
@smallexample
@group
@@ -1284,7 +1284,7 @@ The rest of arguments is a list of statistics keywords as described in
counters for at least one of the requested categories are not
zero. For example, the following statement requires sending
notifications only if there occurred any errors or access violation
-attempts, or any bad signature was uploaded:
+attempts, or any bad signature was uploaded:
@smallexample
mail-admin-stat stat-msg errors access-violations bad-signatures
@@ -1321,11 +1321,11 @@ processed.
@kwindex stat:incomplete_triplets
@item stat:incomplete_triplets @tab Number of incomplete triplets left
in the source directory.
-@kwindex stat:bad_triplets
+@kwindex stat:bad_triplets
@item stat:bad_triplets @tab Number of bad triplets seen.
@kwindex stat:expired_triplets
-@item stat:expired_triplets @tab Number of expired triplets.
-@kwindex stat:triplet_success
+@item stat:expired_triplets @tab Number of expired triplets.
+@kwindex stat:triplet_success
@item stat:triplet_success @tab Number of successfully processed
triplets.
@kwindex stat:uploads
@@ -1347,14 +1347,14 @@ Subject: Wydawca stats
This is to notify you that my run on %@{date@}
caused the following results:
-errors ............................. %@{stat:errors@}
-warning ............................ %@{stat:warnings@}
-bad signatures ..................... %@{stat:bad_signatures@}
-access violation attempts .......... %@{stat:access_violations@}
+errors ............................. %@{stat:errors@}
+warning ............................ %@{stat:warnings@}
+bad signatures ..................... %@{stat:bad_signatures@}
+access violation attempts .......... %@{stat:access_violations@}
Regards,
Wydawca
-end
+end
@end smallexample
@node event notification
@@ -1365,31 +1365,31 @@ The following @dfn{events} are tracked during the execution. Any of
them can be used to trigger an email notification of any party
concerned: the system administrator, project administrators, or
the user that initiated the upload:
-
+
@table @code
@kwindex success
@item success
Successful upload.
-
+
@kwindex bad-ownership
@item bad-ownership
An unauthorized user attempted to upload files for their project.
-
+
@kwindex bad-directive-signature
@item bad-directive-signature
The directive signature does not match the public key of the
uploader.
-
+
@kwindex bad-detached-signature
@item bad-detached-signature
The detached signature does not match the public key of the
uploader.
@end table
-@kwindex notify-event
+@kwindex notify-event
These notifications are configured using the following statement:
-@smallexample
+@smallexample
notify-event @var{event} @var{who} @var{msg-id}
@end smallexample
@@ -1422,7 +1422,7 @@ different templates:
notify-event bad-directive-signature user user-bad-directive-signature
notify-event bad-directive-signature owner owner-bad-directive-signature
@end smallexample
-
+
The following macro-variables may be used in templates for these
notifications:
@@ -1464,7 +1464,7 @@ See below for an example.
@kwindex triplet:upload
@item triplet:upload
-Listing of the uploaded files (see below).
+Listing of the uploaded files (see below).
@kwindex triplet:dist
@item triplet:dist
@@ -1504,11 +1504,11 @@ example, here is a possible @code{%@{triplet:full@}} listing:
-rw-r--r-- gray user 62 2007-09-06 22:14:35 tar-1.18.tar.gz.directive.asc
@end smallexample
-
+
The following example shows how to configure success notification
for the user:
-
+
@smallexample
# @r{Define a message template.}
define-message user-success
@@ -1571,7 +1571,7 @@ triplet file.
@cindex backups
For @samp{directive} archivation type, the optional @var{backup-method}
parameter specifies how to back up an existing file whose name
-coincides with the one @command{wydawca} is about to create. If
+coincides with the one @command{wydawca} is about to create. If
@var{backup-method} is not specified, the value of the @env{VERSION_CONTROL}
environment variable will be used. And if @env{VERSION_CONTROL} is not set,
the @samp{existing} method (see below) is used by default.
@@ -1600,7 +1600,7 @@ Always make simple backups.
@end deffn
@deffn {Wydawca Statement} syslog-facility @var{facility}
-Output diagnostics to the given syslog facility. The @var{facility}
+Output diagnostics to the given syslog facility. The @var{facility}
may be one of the following: @samp{user}, @samp{daemon}, @samp{auth},
@samp{authpriv}, @samp{local0} through @samp{local7}, and @samp{mail}.
the string matching is case insensitive. optionally, @samp{log_}
@@ -1684,7 +1684,7 @@ removed.
The @var{interval} is a string that defines a time interval, much
the same way we do this in English: it consists of one or more pairs
``@samp{number} @samp{time unit}''. For example, the following are
-valid interval specifications:
+valid interval specifications:
@smallexample
@group
@@ -1712,7 +1712,7 @@ not an absolute file name, it will be searched in @env{PATH}.
@end deffn
@deffn {Wydawca Block Statement} sql @var{identifier}
-This statement begins a MySQL database definition. It may contain
+This statement begins a MySQL database definition. It may contain
several sub-statements, defining how to access the database. The
statement ends with the @code{end} keyword on a line by itself.
@@ -1780,7 +1780,7 @@ directory [@var{url}]
end
@end group
@end smallexample
-
+
@noindent
where optional @var{url} specifies the @acronym{URL} of the
distribution site defined by this directory (for diagnostic purposes),
@@ -1788,7 +1788,7 @@ distribution site defined by this directory (for diagnostic purposes),
defining source and distribution directories, and @var{statements} are
any optional archive and/or access method definitions, overriding the
global ones for this directory pair.
-
+
@xref{directory pairs}, for more information.
The following statements must be present in a @code{directory} block:
@@ -1846,7 +1846,7 @@ Sets the sender address for mail notifications.
@xref{notification}, for more information on this statement.
@end deffn
-@deffn {Wydawca Statement} mail-admin-stat @var{msg-id} @var{condition-list}
+@deffn {Wydawca Statement} mail-admin-stat @var{msg-id} @var{condition-list}
Defines statistics categories that trigger statistic reports.
@xref{statreports}.
@@ -1883,7 +1883,7 @@ Sets the mailer @acronym{URL} to use.
@cindex command line options
@UNREVISED
This chapter presents a short reference of all @command{wydawca}
-command line options, in alphabetical order.
+command line options, in alphabetical order.
@table @option
@opsummary{config-file}
@@ -1903,7 +1903,7 @@ Log all diagnostics to syslog.
@xref{stderr, The @option{--syslog} option}.
@opsummary{debug}
-@item --debug
+@item --debug
@itemx -d
Increase debugging level by 1.
@@ -1947,7 +1947,7 @@ exit with code 0, if the syntax is OK, and with code 1 otherwise.
Print a concise usage summary and exit.
@opsummary{version}
-@item --version
+@item --version
@itemx -v
Print the program version and exit.
@end table
@@ -1962,7 +1962,7 @@ sure to include a detailed information when reporting a bug. The minimum
information needed is:
@itemize
-@item Program version you use (see the output of @command{wydawca --version}.
+@item Program version you use (see the output of @command{wydawca --version}.
@item A description of the bug.
@item Conditions under which the bug appears.
@item It is often helpful to send the contents of @file{config.log}
diff --git a/src/builtin.c b/src/builtin.c
index 7d2c276..761a01a 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -48,7 +48,7 @@ builtin_open (struct access_method *meth)
#define RF_BASIC 0x2
#define STRMATCH(s, p, len) \
- (len == sizeof(s) - 1 && memcmp (s, p, sizeof(s) - 1) == 0)
+ (len == sizeof(s) - 1 && memcmp (s, p, sizeof(s) - 1) == 0)
typedef int (*strcmp_fn) (const char *, const char *, int flags);
@@ -89,7 +89,7 @@ cmp_regex (const char *pat, const char *str, int flags)
rc = regexec (&regex, str, 0, NULL, 0);
regfree (&regex);
return rc == 0;
-}
+}
int
parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf)
@@ -97,7 +97,7 @@ parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf)
size_t len = strcspn (pat, ",");
int flags = 0;
int cmp;
-
+
if (STRMATCH ("exact", pat, len))
cmp = CMP_EXACT;
else if (STRMATCH ("fnmatch", pat, len))
@@ -117,11 +117,11 @@ parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf)
case 'i':
flags |= RF_ICASE;
break;
-
+
case 'b':
flags |= RF_BASIC;
break;
-
+
default:
logmsg (LOG_NOTICE, "unrecognized comparison flag: %c", *pat);
}
@@ -174,7 +174,7 @@ builtin_run (struct access_method *meth, void *handle, const char *req)
strcmp_fn cmpfn = cmp_exact;
struct builtin_data_storage *bds;
int ncol = default_ncol[meth->id];
-
+
if (meth->parmc == 0)
{
meth->nrow = meth->ncol = 0;
@@ -182,12 +182,12 @@ builtin_run (struct access_method *meth, void *handle, const char *req)
}
obstack_init (&stk);
-
+
for (i = 0; i < meth->parmc; i++)
{
char *pat = meth->parmv[i];
char *val;
-
+
if (pat[0] == '/')
{
pat++;
@@ -197,7 +197,7 @@ builtin_run (struct access_method *meth, void *handle, const char *req)
if (i + ncol >= meth->parmc)
break;
-
+
if (cmpfn (pat, req, flags))
{
size_t j;
@@ -239,9 +239,9 @@ builtin_run (struct access_method *meth, void *handle, const char *req)
}
rc = 0;
}
-
+
meth->storage = bds;
-
+
return rc;
}
diff --git a/src/cmdline.opt b/src/cmdline.opt
index 5b3ed22..cb269f6 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -80,7 +80,7 @@ OPTION(,E,,
[<preprocess config and exit>])
BEGIN
preprocess_only = 1;
-END
+END
OPTION(dump-grammar-trace,,,
[<dump configuration grammar traces>])
diff --git a/src/config.c b/src/config.c
index 61cf324..c22074f 100644
--- a/src/config.c
+++ b/src/config.c
@@ -38,13 +38,13 @@ static struct notification *default_notification = NULL;
/home/user/../smith --> /home/smith
/home/user/../.. --> /
../file --> NULL
-*/
+*/
char *
safe_file_name (char *file_name)
{
int len;
char *p;
-
+
if (!file_name)
return file_name;
@@ -99,7 +99,7 @@ safe_file_name (char *file_name)
continue;
}
}
-
+
p++;
}
@@ -130,7 +130,7 @@ string_to (const char *what, const char *str,
gconf_locus_t *locus)
{
ptrdiff_t x = ARGMATCH (str, args, vals);
-
+
if (x == (ptrdiff_t)-1)
{
gconf_error (locus, 0, _("unknown %s: %s"), what, str);
@@ -250,7 +250,7 @@ get_arg (gconf_locus_t *locus, gconf_value_t *value, unsigned n, int type)
}
return value;
}
-
+
static int
cb_mailer (enum gconf_callback_command cmd,
@@ -289,7 +289,7 @@ cb_email_address (enum gconf_callback_command cmd,
{
int rc;
mu_address_t addr;
-
+
if (assert_string_arg (locus, cmd, value))
return 1;
rc = mu_address_create (&addr, value->v.string);
@@ -310,7 +310,7 @@ cb_interval (enum gconf_callback_command cmd,
int rc;
time_t interval;
const char *endp;
-
+
/* FIXME 1: Support arrays */
if (assert_string_arg (locus, cmd, value))
return 1;
@@ -333,7 +333,7 @@ cb_absolute_name (enum gconf_callback_command cmd,
void *cb_data)
{
char *word;
-
+
/* FIXME 1: Support arrays */
if (assert_string_arg (locus, cmd, value))
return 1;
@@ -355,7 +355,7 @@ cb_set_umask (enum gconf_callback_command cmd,
{
char *p;
mode_t m;
-
+
if (assert_string_arg (locus, cmd, value))
return 1;
m = strtoul (value->v.string, &p, 8) & 0777;
@@ -408,13 +408,13 @@ parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
{
const char *arg;
ptrdiff_t x;
-
+
if (val->type != GCONF_TYPE_STRING)
{
gconf_error (locus, 0, _("expected scalar value but found list"));
return 1;
}
-
+
arg = val->v.string;
if (strcmp (arg, "all") == 0)
@@ -429,9 +429,9 @@ parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
*invert = 0;
return 0;
}
-
+
x = ARGMATCH (arg, stat_args, stat_types);
-
+
if (x == (ptrdiff_t)-1)
{
gconf_error (locus, 0, _("unknown statistics type: %s"), arg);
@@ -458,11 +458,11 @@ parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask)
case GCONF_TYPE_STRING:
err = parse_single_statmask (loc, val, &mask, &invert);
break;
-
+
case GCONF_TYPE_ARRAY:
{
int i;
-
+
for (i = 0; i < val->v.arg.c; i++)
{
unsigned long x;
@@ -485,7 +485,7 @@ parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask)
{
const gconf_value_t *vp = p;
unsigned long x;
-
+
if (parse_single_statmask (loc, vp, &x, &invert))
err = 1;
else if (invert)
@@ -500,7 +500,7 @@ parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask)
*pmask = mask;
return err;
}
-
+
static int
cb_statistics (enum gconf_callback_command cmd,
gconf_locus_t *locus,
@@ -521,7 +521,7 @@ cb_sql_host (enum gconf_callback_command cmd,
{
struct sqlconn *pconn = varptr;
char *p;
-
+
if (assert_string_arg (locus, cmd, value))
return 1;
@@ -569,7 +569,7 @@ cb_sql (enum gconf_callback_command cmd,
{
struct sqlconn *pconn;
void **pdata = cb_data;
-
+
switch (cmd) {
case gconf_callback_section_begin:
if (!value || value->type != GCONF_TYPE_STRING)
@@ -594,7 +594,7 @@ cb_sql (enum gconf_callback_command cmd,
}
return 0;
}
-
+
static struct gconf_keyword sql_kw[] = {
{ "host", N_("host"), N_("Set SQL server hostname or IP address"),
gconf_type_string, NULL, 0, cb_sql_host },
@@ -633,7 +633,7 @@ cb_define_message (enum gconf_callback_command cmd,
void *cb_data)
{
const char *ident;
-
+
if (cmd != gconf_callback_set_value)
{
gconf_error (locus, 0, _("Unexpected block statement"));
@@ -661,8 +661,8 @@ cb_define_message (enum gconf_callback_command cmd,
register_message_template (ident, value->v.arg.v[1].v.string);
return 0;
}
-
-
+
+
static struct gconf_keyword syslog_kw[] = {
{ "facility",
@@ -677,7 +677,7 @@ static struct gconf_keyword syslog_kw[] = {
gconf_type_bool, &syslog_include_prio },
{ NULL },
};
-
+
static char const * const backup_args[] =
{
@@ -741,7 +741,7 @@ cb_backup (enum gconf_callback_command cmd,
void *cb_data)
{
enum backup_type *ptype = varptr;
-
+
if (assert_string_arg (locus, cmd, value))
return 1;
*ptype = get_backup_version (locus, NULL, value->v.string);
@@ -778,13 +778,13 @@ cb_archive (enum gconf_callback_command cmd,
gconf_error (locus, 0, _("expected tag"));
return 1;
}
-
+
if (value->type != GCONF_TYPE_STRING)
{
gconf_error (locus, 0, _("expected scalar value but found list"));
return 1;
}
-
+
if (strcmp (value->v.string, "none") == 0)
arch->type = archive_none;
else if (strcmp (value->v.string, "tar") == 0)
@@ -806,7 +806,7 @@ cb_archive (enum gconf_callback_command cmd,
if (arch->type == archive_none)
return 0;
-
+
if (arch->name == NULL)
{
gconf_error (locus, 0, _("at least archive name must be set"));
@@ -818,7 +818,7 @@ cb_archive (enum gconf_callback_command cmd,
gconf_warning (locus, 0, _("backup type ignored for this archive type"));
return 1;
}
-
+
return 0;
}
@@ -842,7 +842,7 @@ cb_event (enum gconf_callback_command cmd,
void *cb_data)
{
enum notification_event *pev = varptr;
-
+
if (assert_string_arg (locus, cmd, value))
return 1;
string_to_notification_event (locus, value->v.string, pev);
@@ -857,7 +857,7 @@ cb_recipient (enum gconf_callback_command cmd,
void *cb_data)
{
enum notification_target *tgt = varptr;
-
+
if (assert_string_arg (locus, cmd, value))
return 1;
string_to_notification_target (locus, value->v.string, tgt);
@@ -978,14 +978,14 @@ cb_access_method_params (enum gconf_callback_command cmd,
meth->parmc = size;
meth->parmv = xcalloc (size + 1, sizeof (meth->parmv[0]));
-
+
for (i = 0; gl_list_iterator_next (&itr, &p, NULL); i++)
{
const gconf_value_t *vp = p;
-
+
if (assert_string_arg (locus, cmd, vp))
break;
-
+
meth->parmv[i] = xstrdup (vp->v.string);
}
meth->parmv[i] = NULL;
@@ -1011,15 +1011,15 @@ string_to_access_method_id (gconf_locus_t *locus,
{
static const char *id_str[] = {
"verify-user",
- "gpg-key",
+ "gpg-key",
"project-owner",
"user-data",
NULL
};
static int id_num[] = {
- verify_method,
- gpg_key_method,
- project_owner_method,
+ verify_method,
+ gpg_key_method,
+ project_owner_method,
user_data_method
};
ARGMATCH_VERIFY (id_str, id_num);
@@ -1032,7 +1032,7 @@ string_to_access_method_id (gconf_locus_t *locus,
*idp = res;
return rc;
}
-
+
static int
cb_access_method (enum gconf_callback_command cmd,
gconf_locus_t *locus,
@@ -1043,7 +1043,7 @@ cb_access_method (enum gconf_callback_command cmd,
struct access_method **pmeth, *meth;
void **pdata = cb_data;
enum access_method_id id;
-
+
switch (cmd) {
case gconf_callback_section_begin:
if (!value || value->type != GCONF_TYPE_STRING)
@@ -1075,7 +1075,7 @@ cb_access_method (enum gconf_callback_command cmd,
meth->type = method_none;
}
break;
-
+
default:
/* FIXME: More checks ? */
break;
@@ -1122,7 +1122,7 @@ cb_directory (enum gconf_callback_command cmd,
struct directory_pair *dpair;
void **pdata = cb_data;
int ec, i;
-
+
switch (cmd)
{
case gconf_callback_section_begin:
@@ -1175,12 +1175,12 @@ cb_directory (enum gconf_callback_command cmd,
if (!dpair->notification)
dpair->notification = default_notification;
-
+
register_directory_pair (dpair);
free (dpair);
*pdata = NULL;
break;
-
+
case gconf_callback_set_value:
gconf_error (locus, 0, _("invalid use of block statement"));
}
@@ -1196,7 +1196,7 @@ static struct gconf_keyword wydawca_kw[] = {
gconf_type_string, &admin_address, 0, cb_email_address },
{ "from-address", N_("email"), N_("Set sender email address"),
gconf_type_string, &from_address, 0, cb_email_address },
-
+
{ "enable-sendfile", N_("arg"), N_("Enable or disable sendfile(2) support"),
gconf_type_bool, &enable_sendfile },
@@ -1240,7 +1240,7 @@ static struct gconf_keyword wydawca_kw[] = {
{ "directory", NULL, N_("Define distribution directory"),
gconf_type_section, NULL, 0,
cb_directory, NULL, directory_kw },
-
+
{ NULL }
};
@@ -1258,7 +1258,7 @@ void
config_init()
{
int i;
-
+
gconf_set_keywords (wydawca_kw);
gconf_include_path_setup (DEFAULT_VERSION_INCLUDE_DIR,
DEFAULT_INCLUDE_DIR, NULL);
diff --git a/src/directive.c b/src/directive.c
index ec06f15..d99f65b 100644
--- a/src/directive.c
+++ b/src/directive.c
@@ -28,12 +28,12 @@ directive_parse (struct file_triplet *trp)
if (debug_level > 2)
logmsg (LOG_DEBUG, "%s: parsing directive blurb: %s",
trp->file[file_directive].name, trp->blurb);
-
+
dcount = 0;
for (p = trp->blurb; *p; p++)
if (*p == '\n')
dcount++;
-
+
trp->directive = xcalloc (dcount + 1, sizeof trp->directive[0]);
p = trp->blurb;
for (i = j = 0; i < dcount; i++)
@@ -105,7 +105,7 @@ _directive_seq_get (int n, struct file_triplet *trp,
if (trp->directive[n] == NULL)
return 0;
-
+
p = strchr (trp->directive[n], ':');
len = p - trp->directive[n];
if (len + 1 > trp->tmpsize)
@@ -170,7 +170,7 @@ directive_version_in_range_p (struct file_triplet *trp,
{
const char *val;
unsigned version;
-
+
if (directive_get_value (trp, "version", &val))
{
logmsg (LOG_ERR, "%s: missing `version' directive",
@@ -187,7 +187,7 @@ directive_version_in_range_p (struct file_triplet *trp,
if (from <= version && version <= to)
return 1;
-
+
logmsg (LOG_ERR, "%s: version %s is not in the allowed range",
trp->file[file_directive].name, val);
return 0;
@@ -239,7 +239,7 @@ verify_directive_format (struct file_triplet *trp)
{
int n, dnum;
const char *key;
-
+
if (!directive_version_in_range_p (trp, MIN_DIRECTIVE_VERSION,
MAX_DIRECTIVE_VERSION))
return 1;
@@ -277,10 +277,10 @@ verify_directive_format (struct file_triplet *trp)
logmsg (LOG_ERR, "%s:%d: unknown directive `%s'",
trp->file[file_directive].name, n, key);
return 1;
- }
+ }
}
}
-
+
if (trp->file[file_dist].name && trp->file[file_signature].name)
{
const char *filename;
@@ -307,7 +307,7 @@ process_directives (struct file_triplet *trp, struct directory_pair *dpair)
int n;
const char *key, *val;
char *relative_dir;
-
+
UPDATE_STATS (STAT_COMPLETE_TRIPLETS);
for (n = directive_first (trp, &key, &val); n;
n = directive_next (trp, n, &key, &val))
@@ -318,22 +318,22 @@ process_directives (struct file_triplet *trp, struct directory_pair *dpair)
case unknown_dir:
/* should not happen */
abort ();
-
+
case comment_dir:
logmsg (LOG_NOTICE, "%s: COMMENT: %s",
trp->file[file_directive].name, val);
break;
-
+
case directory_dir:
relative_dir = safe_file_name_alloc (val);
if (!relative_dir || relative_dir[0] == '/')
{
- logmsg (LOG_ERR, "%s: invalid directory: %s",
+ logmsg (LOG_ERR, "%s: invalid directory: %s",
trp->file[file_directive].name, val);
return 1;
}
break;
-
+
case filename_dir:
if (verify_detached_signature (trp, dpair) == 0)
{
@@ -347,11 +347,11 @@ process_directives (struct file_triplet *trp, struct directory_pair *dpair)
return 1;
}
break;
-
+
case version_dir:
/* Already processed */
break;
-
+
case archive_dir:
if (archive_file (trp, dpair, relative_dir, val))
return 1;
@@ -369,7 +369,7 @@ process_directives (struct file_triplet *trp, struct directory_pair *dpair)
val, strerror (rc));
return 1;
}
-
+
if (argc != 2)
{
rc = 1;
@@ -379,13 +379,13 @@ process_directives (struct file_triplet *trp, struct directory_pair *dpair)
}
else
rc = symlink_file (trp, dpair, relative_dir, argv[0], argv[1]);
-
+
argcv_free (argc, argv);
if (rc)
return 1;
}
break;
-
+
case rmsymlink_dir:
if (rmsymlink_file (trp, dpair, relative_dir, val))
return 1;
diff --git a/src/diskio.c b/src/diskio.c
index 18f3960..e30b215 100644
--- a/src/diskio.c
+++ b/src/diskio.c
@@ -32,7 +32,7 @@ sub_dir_p (char *arg, char *dir)
if (!arg)
return 0;
-
+
dlen = strlen (dir);
return strlen (arg) > dlen
@@ -49,7 +49,7 @@ concat_dir (const char *base, const char *name, size_t *pbaselen)
size_t len = strlen (base);
size_t size;
char *dir;
-
+
while (len > 0 && base[len-1] == '/')
len--;
@@ -72,7 +72,7 @@ create_hierarchy (char *dir, size_t baselen, uid_t uid, gid_t gid)
int rc;
struct stat st;
char *p;
-
+
if (stat (dir, &st) == 0)
{
if (!S_ISDIR (st.st_mode))
@@ -87,7 +87,7 @@ create_hierarchy (char *dir, size_t baselen, uid_t uid, gid_t gid)
logmsg (LOG_ERR, "cannot stat file %s: %s", dir, strerror (errno));
return 1;
}
-
+
p = strrchr (dir, '/');
if (p)
{
@@ -162,7 +162,7 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
close (in_fd);
return 1;
}
-
+
out_fd = creat (dst_file, CREAT_PERMISSIONS);
if (out_fd == -1)
{
@@ -171,13 +171,13 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
close (in_fd);
return 1;
}
-
+
#ifdef USE_SENDFILE
if (enable_sendfile)
{
off_t offset = 0;
ssize_t count;
-
+
count = sendfile (out_fd, in_fd, &offset, st.st_size);
if (count == -1)
{
@@ -205,7 +205,7 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
char *buf = NULL;
size_t bufsize;
size_t fsize = st.st_size;
-
+
for (bufsize = fsize; bufsize > 0 && (buf = malloc (bufsize)) == NULL;
bufsize /= 2)
;
@@ -217,7 +217,7 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
{
size_t rest;
size_t rdbytes;
-
+
rest = fsize > bufsize ? bufsize : fsize;
rdbytes = read (in_fd, buf, rest);
if (rdbytes == -1)
@@ -234,7 +234,7 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid)
dst_file, strerror (errno));
rc = copy_failed;
break;
- }
+ }
else if (rest != rdbytes)
{
logmsg (LOG_ERR, "short write on %s", dst_file);
@@ -295,7 +295,7 @@ int
tar_append_file (const char *archive, const char *file)
{
const char *argv[6];
-
+
if (debug_level)
logmsg (LOG_DEBUG, "tarring %s to %s", file, archive);
if (dry_run_mode)
@@ -344,7 +344,7 @@ backup_file (const char *dst_file, const char *dst_dir, const char *file,
int rc = 0;
char *adir;
char *file_name;
-
+
if (archive->name[0] == '/')
adir = create_directory (archive->name, reldir, uid, gid);
else
@@ -405,7 +405,7 @@ backup_file (const char *dst_file, const char *dst_dir, const char *file,
free (file_name);
free (adir);
return rc;
-}
+}
/* Select the appropriate backup type and backup a file. See backup_file
for the argument description. */
@@ -421,7 +421,7 @@ do_archive_file (const char *dst_file, const char *dst_dir, const char *file,
case archive_directory:
return backup_file (dst_file, dst_dir, file, archive, uid, gid, reldir);
-
+
case archive_tar:
if (tar_append_file (archive->name, dst_file))
return 1;
@@ -442,17 +442,17 @@ do_archive_file (const char *dst_file, const char *dst_dir, const char *file,
Do nothing if dry_run_mode is set. */
int
move_file (struct file_triplet *trp, struct directory_pair *dpair,
- enum file_type file_id, const char *reldir)
+ enum file_type file_id, const char *reldir)
{
char *dst_file;
int rc = 0;
char *dst_dir = create_directory (dpair->dest_dir, reldir,
TRIPLET_UID (trp), TRIPLET_GID (trp));
-
+
if (!dst_dir)
return 1;
dst_file = concat_dir (dst_dir, trp->file[file_id].name, NULL);
-
+
if (debug_level)
logmsg (LOG_DEBUG, "installing %s to %s", trp->file[file_id].name,
dst_dir);
@@ -461,11 +461,11 @@ move_file (struct file_triplet *trp, struct directory_pair *dpair,
rc = do_archive_file (dst_file, dst_dir, trp->file[file_id].name,
&dpair->archive,
TRIPLET_UID (trp), TRIPLET_GID (trp), reldir);
-
+
if (!dry_run_mode && rc == 0)
rc = do_move_file (trp->file[file_id].name, dst_file,
TRIPLET_UID (trp), TRIPLET_GID (trp));
-
+
free (dst_file);
free (dst_dir);
if (rc == 0)
@@ -486,7 +486,7 @@ archive_single_file (struct file_triplet *trp, struct directory_pair *dpair,
int rc = 0;
char *dst_dir = create_directory (dpair->dest_dir, reldir,
TRIPLET_UID (trp), TRIPLET_GID (trp));
-
+
if (!dst_dir)
return 1;
@@ -499,7 +499,7 @@ archive_single_file (struct file_triplet *trp, struct directory_pair *dpair,
free (dst_dir);
return 1;
}
-
+
if (access (dst_file, F_OK) == 0)
{
if (debug_level)
@@ -521,7 +521,7 @@ archive_single_file (struct file_triplet *trp, struct directory_pair *dpair,
dst_file, strerror (errno));
rc = 1;
}
-
+
free (dst_file);
free (dst_dir);
return rc;
@@ -531,7 +531,7 @@ static char *
make_signame (const char *file_name)
{
size_t len;
-
+
if (((len = strlen (file_name)) > SUF_SIG_LEN
&& memcmp (file_name + len - SUF_SIG_LEN, SUF_SIG, SUF_SIG_LEN)))
{
@@ -549,11 +549,11 @@ make_signame (const char *file_name)
*/
int
archive_file (struct file_triplet *trp, struct directory_pair *dpair,
- const char *reldir, const char *file_name)
+ const char *reldir, const char *file_name)
{
int rc;
char *signame;
-
+
rc = archive_single_file (trp, dpair, file_name, reldir, 0);
if (rc == 0 && archive_signatures && (signame = make_signame (file_name)))
{
@@ -577,7 +577,7 @@ symlink_file (struct file_triplet *trp, struct directory_pair *dpair,
char *dst_dir = create_directory (dpair->dest_dir, reldir,
TRIPLET_UID (trp), TRIPLET_GID (trp));
char *src, *dst;
-
+
if (!dst_dir)
return 1;
@@ -587,7 +587,7 @@ symlink_file (struct file_triplet *trp, struct directory_pair *dpair,
strerror (errno));
return 1;
}
-
+
src = safe_file_name_alloc (wanted_src);
if (!src || src[0] == '/')
{
@@ -606,20 +606,20 @@ symlink_file (struct file_triplet *trp, struct directory_pair *dpair,
free (dst);
return 1;
}
-
+
if (debug_level)
logmsg (LOG_DEBUG, "symlinking %s to %s in directory %s",
src, dst, dst_dir);
-
+
if (!dry_run_mode)
{
char *p = strrchr (dst, '/');
if (p > dst)
{
char *dir;
-
+
*p = 0;
- dir = create_directory (dpair->dest_dir, dst,
+ dir = create_directory (dpair->dest_dir, dst,
TRIPLET_UID (trp), TRIPLET_GID (trp));
if (!dir)
rc = 1;
@@ -627,7 +627,7 @@ symlink_file (struct file_triplet *trp, struct directory_pair *dpair,
free (dir);
*p = '/';
}
-
+
if (rc == 0)
{
if (chdir (dst_dir))
@@ -636,7 +636,7 @@ symlink_file (struct file_triplet *trp, struct directory_pair *dpair,
else
{
struct stat st;
-
+
if (lstat (dst, &st) == 0)
{
if (!S_ISLNK (st.st_mode))
@@ -694,10 +694,10 @@ static int
do_rmsymlink_file (const char *dst_file, int noentok)
{
struct stat st;
-
+
if (debug_level)
logmsg (LOG_DEBUG, "Removing symbolic link %s", dst_file);
-
+
if (stat (dst_file, &st))
{
if (errno == ENOENT)
@@ -723,7 +723,7 @@ do_rmsymlink_file (const char *dst_file, int noentok)
}
/* Remove the symbolic link DPAIR->dest_dir/RELDIR/FILE_NAME
-
+
Get ownership information from TRP.
Do nothing if dry_run_mode is set. */
@@ -757,9 +757,9 @@ rmsymlink_file (struct file_triplet *trp, struct directory_pair *dpair,
rc = do_rmsymlink_file (signame, 1);
free (signame);
}
-
+
free (dst_file);
free (dst_dir);
return rc;
}
-
+
diff --git a/src/exec.c b/src/exec.c
index 2c32956..4f4902d 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -50,7 +50,7 @@ start_prog (int argc, const char **argv, pid_t *ppid)
execvp (argv[0], (char**) argv);
logmsg (LOG_CRIT, "cannot run %s: %s", argv[0], strerror (errno));
exit (1);
-
+
case -1:
logmsg (LOG_CRIT, "cannot run `%s': fork failed: %s",
argv[0], strerror (errno));
@@ -74,7 +74,7 @@ log_output (int prio, const char *prog, FILE *fp)
{
size_t size = 0;
char *buf = NULL;
-
+
logmsg (prio, "%s output follows:", prog);
while (getline (&buf, &size, fp) > 0)
logmsg (prio, "%s", buf);
@@ -91,14 +91,14 @@ wydawca_exec (int argc, const char **argv, int *retcode)
int status;
int i;
enum exec_result res;
-
+
fp = start_prog (5, argv, &pid);
if (!fp)
{
logmsg (LOG_CRIT, "cannot start %s", argv[0]);
return exec_error;
}
-
+
for (i = 0; i < 5 && (npid = waitpid (pid, &status, WNOHANG)) == 0; i++)
sleep (1);
@@ -118,7 +118,7 @@ wydawca_exec (int argc, const char **argv, int *retcode)
kill (pid, SIGKILL);
fclose (fp);
return exec_error;
-
+
default:
break;
}
@@ -155,6 +155,6 @@ wydawca_exec (int argc, const char **argv, int *retcode)
argv[0]);
}
fclose (fp);
-
+
return res;
}
diff --git a/src/getopt.m4 b/src/getopt.m4
index d6f5580..83cc45f 100644
--- a/src/getopt.m4
+++ b/src/getopt.m4
@@ -1,6 +1,6 @@
dnl This file is part of GNU Rush.
dnl Copyright (C) 2007, 2008, 2009 Sergey Poznyakoff.
-dnl
+dnl
dnl GNU Rush is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
@@ -66,7 +66,7 @@ dnl
define([<GROUP>],[<dnl
divert(3)
{ NULL, NULL, 0, N_("prep([<$1>])") },
-divert(-1)>])
+divert(-1)>])
define([<__GATHER_OPTIONS>],[<
define([<KEY>],ifelse([<$2>],,[<OPTION_>]upcase(patsubst($1,-,_)),'$2'))
@@ -92,12 +92,12 @@ ifelse([<$2>],,,dnl
dnl OPTION(long-opt, short-opt, [arg], [descr])
dnl Introduce a command line option. Arguments:
-dnl long-opt Long option.
+dnl long-opt Long option.
dnl short-opt Short option (a single char)
dnl (At least one of long-opt or short-opt must be present)
dnl
dnl Optional arguments:
-dnl arg Option argument.
+dnl arg Option argument.
dnl descr Option description
dnl
dnl If arg is absent, the option does not take any arguments. If arg is
@@ -124,7 +124,7 @@ dnl long-opt Long option.
dnl short-opt Short option (a single char)
dnl (At least one of long-opt or short-opt must be present)
dnl An OPTION statement may be followed by any number of ALIAS statements.
-dnl
+dnl
define([<ALIAS>],[<
__GATHER_OPTIONS($1,$2)
>])
@@ -180,11 +180,11 @@ ifelse([<$#>],3,opterr = 0;)
{
default:
ifelse([<$#>],3,$3,[<exit(1)>]);
-
+
undivert(4)
}
}
- }
+ }
>])
define([<STDFUNC>],[<
@@ -196,19 +196,19 @@ const char *program_version = [<$1>];
static char doc[] = N_("[<$3>]");
static char args_doc[] = N_("[<$4>]");
const char *program_bug_address = "<" PACKAGE_BUGREPORT ">";
-
+
#define DESCRCOLUMN 30
#define RMARGIN 79
#define GROUPCOLUMN 2
#define USAGECOLUMN 13
-
+
static void
indent (size_t start, size_t col)
{
for (; start < col; start++)
putchar (' ');
}
-
+
static void
print_option_descr (const char *descr, size_t lmargin, size_t rmargin)
{
@@ -243,9 +243,9 @@ void
print_help(void)
{
unsigned i;
-
+
printf ("%s %s [%s]... %s\n", _("Usage:"), [<$2>], _("[<OPTION>]"),
- gettext (args_doc));
+ gettext (args_doc));
if (doc && doc[0])
print_option_descr(gettext (doc), 0, RMARGIN);
putchar ('\n');
@@ -294,7 +294,7 @@ print_help(void)
putchar ('\n');
}
}
-
+
putchar ('\n');
dnl **************************************************************************
dnl This string cannot be split over several lines, because this would trigger
@@ -315,13 +315,13 @@ print_usage(void)
char buf[RMARGIN+1];
#define FLUSH dnl
- do dnl
- { dnl
- buf[n] = 0; dnl
- printf ("%s\n", buf); dnl
- n = USAGECOLUMN; dnl
- memset (buf, ' ', n); dnl
- } dnl
+ do dnl
+ { dnl
+ buf[n] = 0; dnl
+ printf ("%s\n", buf); dnl
+ n = USAGECOLUMN; dnl
+ memset (buf, ' ', n); dnl
+ } dnl
while (0)
#define ADDC(c) dnl
do { if (n == RMARGIN) FLUSH; buf[n++] = c; } while (0)
@@ -352,12 +352,12 @@ print_usage(void)
if (opthelp[i].opt && opthelp[i].descr && opthelp[i].opt[1] != '-'
&& opthelp[i].arg)
{
- size_t len = 5
+ size_t len = 5
+ strlen (opthelp[i].arg)
+ (opthelp[i].is_optional ? 2 : 1);
if (n + len > RMARGIN) FLUSH;
- buf[n++] = ' ';
- buf[n++] = '[';
+ buf[n++] = ' ';
+ buf[n++] = '[';
buf[n++] = '-';
buf[n++] = opthelp[i].opt[1];
if (opthelp[i].is_optional)
@@ -396,8 +396,8 @@ print_usage(void)
+ (opthelp[i].arg ? 1 + strlen (opthelp[i].arg)
+ (opthelp[i].is_optional ? 2 : 0) : 0);
if (n + len > RMARGIN) FLUSH;
- buf[n++] = ' ';
- buf[n++] = '[';
+ buf[n++] = ' ';
+ buf[n++] = '[';
strcpy (&buf[n], longopt);
n += strlen (longopt);
if (opthelp[i].arg)
@@ -420,7 +420,7 @@ print_usage(void)
}
}
FLUSH;
-
+
}
const char version_etc_copyright[] =
@@ -444,7 +444,7 @@ void
print_version(const char *program_version, FILE *stream)
{
print_version_only(program_version, stream);
-
+
dnl **************************************************************************
dnl This string cannot be split over serveal lines, because this would trigger
dnl a bug in GNU M4 (version 1.4.9 and 1.4.10), which would insert #line
@@ -452,7 +452,7 @@ dnl directives between the lines.
dnl **************************************************************************
fputs (_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n"),
stream);
-
+
dnl /* TRANSLATORS: %s denotes an author name. */
dnl fprintf (stream, _("Written by %s.\n"), "Sergey Poznyakoff");
}
@@ -464,11 +464,11 @@ popdef([<FLUSH>])
define([<OPTIONS_BEGIN>],
[<divert(-1)
- define([<GETOPT_STYLE>],[<$1>])
+ define([<GETOPT_STYLE>],[<$1>])
ifelse([<$1>],[<gnu>],
[<STDFUNC([<$2 " (" PACKAGE_NAME ") " PACKAGE_VERSION>], [<$2>], [<$3>], [<$4>])>])
>])
-
+
define([<OPTIONS_END>],[<
ifelse(GETOPT_STYLE,[<gnu>],[<
GROUP([<Other options>])
diff --git a/src/gpg.c b/src/gpg.c
index cbeff1b..327ff77 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -112,7 +112,7 @@ rmdir_r (const char *name)
name, strerror (errno));
return 1;
}
-
+
return rc;
}
@@ -132,7 +132,7 @@ wydawca_gpg_homedir ()
{
if (homedir)
return 0;
-
+
homedir = xstrdup ("/tmp/wydawca-XXXXXX");
if (!mkdtemp (homedir))
{
@@ -162,41 +162,41 @@ gpg_sig_ok_p (gpgme_ctx_t ctx, gpgme_signature_t sig)
uid = key->uids->uid;
else
uid = sig->fpr;
-
+
switch (gpg_err_code (sig->status))
{
case GPG_ERR_NO_ERROR:
if (debug_level)
logmsg (LOG_NOTICE, "Good signature from %s", uid);
break;
-
+
case GPG_ERR_BAD_SIGNATURE:
logmsg (LOG_ERR, "BAD signature from %s", uid);
return 0;
-
+
case GPG_ERR_NO_PUBKEY:
logmsg (LOG_ERR, "No public key");
return 0;
-
+
case GPG_ERR_NO_DATA:
logmsg (LOG_ERR, "No signature");
return 0;
-
+
case GPG_ERR_SIG_EXPIRED:
logmsg (LOG_ERR, "Expired signature from %s", uid);
return 0;
-
+
case GPG_ERR_KEY_EXPIRED:
logmsg (LOG_ERR, "Key expired (%s)", uid);
return 0;
-
+
default:
logmsg (LOG_ERR, "Unknown signature error");
return 0;
}
}
return 1;
-}
+}
/* Verify the directive file from TRP using public key PUBKEY */
/* FIXME: dpair currently unused */
@@ -209,7 +209,7 @@ verify_directive_signature (struct file_triplet *trp,
off_t size;
gpgme_error_t ec;
int rc;
-
+
wydawca_gpg_homedir ();
fail_if_err (gpgme_new (&ctx));
fail_if_err (gpgme_data_new_from_mem (&key_data, pubkey, strlen (pubkey),
@@ -223,16 +223,16 @@ verify_directive_signature (struct file_triplet *trp,
if (ec == GPG_ERR_NO_ERROR)
{
gpgme_verify_result_t result;
-
+
size = gpgme_data_seek (plain, 0, SEEK_END);
gpgme_data_seek (plain, 0, SEEK_SET);
trp->blurb = xmalloc (size + 1);
gpgme_data_read (plain, trp->blurb, size);
trp->blurb[size] = 0;
gpgme_data_release (plain);
-
+
rc = directive_parse (trp);
-
+
result = gpgme_op_verify_result (ctx);
if (!gpg_sig_ok_p (ctx, result->signatures))
{
@@ -264,7 +264,7 @@ verify_detached_signature (struct file_triplet *trp,
{
gpgme_engine_info_t info;
const char *argv[5];
-
+
fail_if_err (gpgme_get_engine_info (&info));
while (info && info->protocol != GPGME_PROTOCOL_OpenPGP)
info = info->next;
@@ -275,7 +275,7 @@ verify_detached_signature (struct file_triplet *trp,
"the detached signature for %s", trp->name);
return 1;
}
-
+
wydawca_gpg_homedir ();
argv[0] = info->file_name;
argv[1] = "--verify";
@@ -300,6 +300,6 @@ verify_detached_signature (struct file_triplet *trp,
logmsg (LOG_CRIT, "cannot verify detached signature for %s", trp->name);
break;
}
-
+
return 1;
}
diff --git a/src/interval.c b/src/interval.c
index 0792123..9ca4423 100644
--- a/src/interval.c
+++ b/src/interval.c
@@ -40,7 +40,7 @@ time_multiplier (const char *str, unsigned *m, unsigned *plen)
};
struct timetab *p;
int slen;
-
+
for (slen = 0; str[slen]; slen++)
if (isspace (str[slen]))
break;
@@ -53,7 +53,7 @@ time_multiplier (const char *str, unsigned *m, unsigned *plen)
if (nlen > slen)
nlen = slen;
-
+
if (strncasecmp (p->name, str, nlen) == 0)
{
*m = p->mul;
@@ -71,13 +71,13 @@ parse_time_interval (const char *str, time_t *pint, const char **endp)
{
int rc = 0;
time_t interval = 0;
-
+
while (*str)
{
char *p;
unsigned long n;
unsigned mul, len;
-
+
while (*str && isspace (*str))
str++;
diff --git a/src/mail.c b/src/mail.c
index 196d517..37bb493 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -69,7 +69,7 @@ mail_send_message (mu_address_t rcpt, const char *text)
mu_header_set_value (hdr, "To", buf, 1);
free (buf);
-
+
if (debug_level > 1)
{
mu_debug_t debug;
@@ -92,7 +92,7 @@ mail_send_message (mu_address_t rcpt, const char *text)
}
mailer_opened = 1;
}
-
+
rc = mu_mailer_send_message (mailer, msg, from_address, rcpt);
if (rc)
logmsg (LOG_CRIT, "cannot send message: %s", mu_strerror (rc));
@@ -105,7 +105,7 @@ mail_finish ()
{
if (mailer_opened)
mu_mailer_close (mailer);
-}
+}
struct message_template
@@ -206,7 +206,7 @@ mail_stats ()
time_t t;
const char *tmpl;
char *text;
-
+
if (!admin_stat_message || !stat_mask_p (mail_admin_mask) || !mailer)
return;
@@ -215,7 +215,7 @@ mail_stats ()
logmsg (LOG_ERR, "Cannot mail statistics: admin-address not defined");
return;
}
-
+
if (debug_level)
{
size_t size;
@@ -226,7 +226,7 @@ mail_stats ()
logmsg (LOG_DEBUG, "Sending stats to %s", buf);
free (buf);
}
-
+
if (dry_run_mode)
return;
@@ -235,7 +235,7 @@ mail_stats ()
exp[0].kw = "date";
exp[0].value = exp[0].storage = xstrdup (ctime (&t));
exp[0].value [strlen (exp[0].value) - 1] = 0;
-
+
make_stat_expansion (exp + 1);
tmpl = resolve_message_template (admin_stat_message);
@@ -263,7 +263,7 @@ get_recipient (struct access_method *method, struct file_triplet *trp,
char *text;
int rc;
void *md;
-
+
if (method->type == method_none)
{
*errp = "access method is not configured";
@@ -281,7 +281,7 @@ get_recipient (struct access_method *method, struct file_triplet *trp,
meta_escape (method, md, def);
text = meta_expand_string (method->query, def, NULL);
meta_free (def);
-
+
rc = method_run (method, md, text);
free (text);
if (rc)
@@ -290,7 +290,7 @@ get_recipient (struct access_method *method, struct file_triplet *trp,
method_close (method, md);
return NULL;
}
-
+
nrows = method_num_rows (method);
ncols = method_num_cols (method);
@@ -299,7 +299,7 @@ get_recipient (struct access_method *method, struct file_triplet *trp,
*errp = "cannot obtain recipient emails";
return NULL;
}
-
+
for (i = 0; i < nrows; i++)
{
mu_address_t addr;
@@ -331,12 +331,12 @@ do_notify (struct file_triplet *trp, enum notification_event ev,
case notify_admin:
rcpt = admin_address;
break;
-
+
case notify_user:
rcpt = get_recipient (trp->dpair->access_method[user_data_method],
trp, &errp);
break;
-
+
case notify_owner:
rcpt = get_recipient (trp->dpair->access_method[project_owner_method],
trp, &errp);
@@ -375,7 +375,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev,
free (text);
}
}
-
+
mu_address_destroy (&rcpt);
}
@@ -384,7 +384,7 @@ notify (struct notification *notification_list,
struct file_triplet *trp, enum notification_event ev)
{
struct notification *p;
-
+
fill_project_name (trp);
for (p = notification_list; p; p = p->next)
if (p->ev == ev)
diff --git a/src/method.c b/src/method.c
index 7811612..8fe81fb 100644
--- a/src/method.c
+++ b/src/method.c
@@ -21,15 +21,15 @@
struct method_descr
{
const char *name;
-
+
int (*init) (struct access_method *);
int (*done) (struct access_method *);
int (*free) (struct access_method *, void *);
void *(*open) (struct access_method *);
int (*close) (struct access_method *, void *);
-
- int (*get) (struct access_method *, void *, unsigned, unsigned);
+
+ int (*get) (struct access_method *, void *, unsigned, unsigned);
int (*run) (struct access_method *, void *, const char *);
int (*quote) (struct access_method *, void *, const char *, char **, size_t *);
};
@@ -60,7 +60,7 @@ method_init (struct access_method *method)
{
struct method_descr *mp = method_tab + method->type;
int rc = 0;
-
+
if (method->init_passed++)
return 0;
if (debug_level > 1)
@@ -96,13 +96,13 @@ method_close (struct access_method *method, void *handle)
return 0;
return mp->close (method, handle);
}
-
+
int
method_done (struct access_method *method)
{
struct method_descr *mp = method_tab + method->type;
int rc = 0;
-
+
if (method->init_passed == 0)
return 0;
if (--method->init_passed)
@@ -114,7 +114,7 @@ method_done (struct access_method *method)
mp->name, SP (method->query));
for (i = 0; i < method->parmc; i++)
logmsg (LOG_DEBUG, " parmv[%d]=%s", i, method->parmv[i]);
- }
+ }
if (mp->done)
rc = mp->done (method);
free (method->result);
@@ -135,7 +135,7 @@ method_run (struct access_method *method, void *handle, const char *cmd)
else
logmsg (LOG_DEBUG, "Running method: %s", mp->name);
}
-
+
if (!method->init_passed)
{
logmsg (LOG_CRIT, "INTERNAL ERROR: Method %s \"%s\" not initialized",
@@ -211,15 +211,15 @@ method_quote_string (struct access_method *method, void *handle,
if (mp->quote)
return mp->quote (method, handle, input, poutput, psize);
-
+
size = argcv_quoted_length (input, &quote);
output = xmalloc (size + 1);
argcv_quote_copy (output, input);
output[size] = 0;
-
+
*poutput = output;
if (psize)
*psize = size;
return 0;
}
-
+
diff --git a/src/process.c b/src/process.c
index dbde217..645d987 100644
--- a/src/process.c
+++ b/src/process.c
@@ -57,10 +57,10 @@ file_type_str (enum file_type type)
{
case file_dist:
return "distributive";
-
+
case file_signature:
return "detached signature";
-
+
case file_directive:
return "signed upload directive";
}
@@ -130,7 +130,7 @@ scan_directory_pair (struct directory_pair *dpair)
{
struct stat st;
struct file_info finfo;
-
+
if (strcmp (ent->d_name, ".") == 0 || strcmp (ent->d_name, "..") == 0)
continue;
@@ -151,7 +151,7 @@ scan_directory_pair (struct directory_pair *dpair)
finfo.sb = st;
parse_file_name (ent->d_name, &finfo);
-
+
if (debug_level)
{
const char *s = file_type_str (finfo.type);
@@ -159,24 +159,24 @@ scan_directory_pair (struct directory_pair *dpair)
strchr ("aeiou", s[0]) ? "an" : "a", s,
finfo.root_len, finfo.name);
}
-
+
register_file (&finfo);
}
-
+
closedir (dir);
if (count_collected_triplets () > 0)
{
int i;
- for (i = 0; i < access_method_count; i++)
+ for (i = 0; i < access_method_count; i++)
{
if (method_init (dpair->access_method[i]))
{
logmsg (LOG_ERR, "failed to initialize access method %d", i);
return;
}
- }
+ }
enumerate_triplets (dpair);
}
}
@@ -200,4 +200,4 @@ scan_directories ()
for (dp = dlist; dp; dp = dp->next)
close_methods (&dp->pair);
}
-
+
diff --git a/src/sql.c b/src/sql.c
index 1142b17..be21a2c 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -100,7 +100,7 @@ sql_free_result (struct access_method *method, void *handle)
}
return 0;
}
-
+
/* Finish the initialized MySQL access method */
int
sql_done_method (struct access_method *method)
@@ -116,7 +116,7 @@ sql_done_method (struct access_method *method)
return 0;
}
-/* Execute QUERY using the given access METHOD. Return 0 on success. */
+/* Execute QUERY using the given access METHOD. Return 0 on success. */
int
sql_run_method (struct access_method *method, void *handle, const char *query)
{
@@ -128,14 +128,14 @@ sql_run_method (struct access_method *method, void *handle, const char *query)
logmsg (LOG_ERR, "No query supplied for method %s", "sql");
return 1;
}
-
+
if (mysql_query (mysql, query))
{
logmsg (LOG_ERR, "Query failed: %s", mysql_error (mysql));
logmsg (LOG_NOTICE, "The failed query was: %s", query);
return 1;
}
-
+
conn->result = mysql_store_result (mysql);
if (!conn->result)
{
@@ -155,7 +155,7 @@ sql_run_method (struct access_method *method, void *handle, const char *query)
return 0;
}
-
+
int
sql_get_method (struct access_method *method, void *handle,
unsigned nrow, unsigned ncol)
@@ -176,7 +176,7 @@ sql_get_method (struct access_method *method, void *handle,
method_copy_result (method, row[ncol], len);
return 0;
}
-
+
int
sql_quote (struct access_method *method, void *handle, const char *input,
char **poutput, size_t *psize)
@@ -184,7 +184,7 @@ sql_quote (struct access_method *method, void *handle, const char *input,
struct sqlconn *conn = handle;
size_t len, size;
char *output;
-
+
len = strlen (input);
size = 2 * len + 1;
output = xmalloc (size);
diff --git a/src/triplet.c b/src/triplet.c
index 59916fe..03aa4cc 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -42,7 +42,7 @@ hash_triplet_free (void *data)
{
int i;
struct file_triplet *tp = data;
-
+
for (i = 0; i < FILE_TYPE_COUNT; i++)
{
if (tp->file[i].name)
@@ -53,14 +53,14 @@ hash_triplet_free (void *data)
free (tp->blurb);
free (tp->tmp);
free (tp->user);
-
+
if (tp->user_data)
{
for (i = 0; i < NITEMS (tp->user_data); i++)
free (tp->user_data[i]);
free (tp->user_data);
}
-
+
free (tp);
}
@@ -69,13 +69,13 @@ void
register_file (struct file_info *finfo)
{
struct file_triplet *tp, *ret;
-
+
tp = xmalloc (sizeof(*tp) + finfo->root_len + 1);
memset (tp, 0, sizeof (*tp));
tp->name = (char*)(tp + 1);
memcpy (tp->name, finfo->name, finfo->root_len);
tp->name[finfo->root_len] = 0;
-
+
if (! ((triplet_table
|| (triplet_table = hash_initialize (0, 0,
hash_triplet_hasher,
@@ -99,7 +99,7 @@ triplet_expired_p (struct file_triplet *trp, time_t ttl)
if (ttl == 0)
return false;
-
+
for (i = 0; i < FILE_TYPE_COUNT; i++)
{
if (trp->file[i].name
@@ -119,7 +119,7 @@ enum triplet_state
but nothing more is required */
triplet_complete, /* A complete triplet: all three files are present
and have the same owner */
- triplet_incomplete, /* Incomplete triplet: some files are missing */
+ triplet_incomplete, /* Incomplete triplet: some files are missing */
triplet_bad, /* Bad triplet. Should be removed immediately. */
};
@@ -132,7 +132,7 @@ check_triplet_state (struct file_triplet *trp)
if (trp->file[file_directive].name)
{
- if (trp->file[file_dist].name == 0
+ if (trp->file[file_dist].name == 0
&& trp->file[file_signature].name == 0)
{
if (directive_get_value (trp, "filename", NULL))
@@ -155,7 +155,7 @@ check_triplet_state (struct file_triplet *trp)
}
}
}
-
+
return triplet_incomplete;
}
@@ -164,7 +164,7 @@ static void
remove_triplet (struct file_triplet *trp)
{
int i;
-
+
for (i = 0; i < FILE_TYPE_COUNT; i++)
{
if (trp->file[i].name)
@@ -185,7 +185,7 @@ triplet_processor (void *data, void *proc_data)
struct directory_pair *dpair = proc_data;
trp->dpair = dpair;
-
+
if (debug_level)
logmsg (LOG_DEBUG, "FILE %s, DIST=%s, SIG=%s, DIRECTIVE=%s",
trp->name,
@@ -201,7 +201,7 @@ triplet_processor (void *data, void *proc_data)
logmsg (LOG_DEBUG, "Processing triplet `%s'", trp->name);
process_directives (trp, dpair);
return true;
-
+
case triplet_incomplete:
if (debug_level)
logmsg (LOG_DEBUG, "%s: incomplete triplet", trp->name);
@@ -214,13 +214,13 @@ triplet_processor (void *data, void *proc_data)
remove_triplet (trp);
return true;
}
-
+
if (triplet_expired_p (trp, dpair->file_sweep_time))
{
UPDATE_STATS (STAT_EXPIRED_TRIPLETS);
remove_triplet (trp);
}
-
+
return true;
}
@@ -323,10 +323,10 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
char *group_name;
struct tm *tm;
char *buf;
-
+
if (!info->name)
return 1;
-
+
/* MODE OWNER GROUP SIZE MTIME FILE_NAME MD5SUM? */
modes[0] = '-'; /* Only regular files are allowed */
@@ -347,7 +347,7 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
/* Size */
sptr = umaxtostr (info->sb.st_size, sbuf);
-
+
/* Figure out padding and format the buffer */
slen = strlen (sptr);
pad = strlen (user_name) + 1 + strlen (group_name) + 1 + slen;
@@ -368,7 +368,7 @@ expand_triplet_full (struct metadef *def, void *data)
struct file_triplet *trp = data;
char *buf[FILE_TYPE_COUNT] = { NULL, NULL, NULL };
size_t size = 0;
-
+
if (format_file_data (trp, file_dist, &buf[file_dist]) == 0)
size += strlen (buf[file_dist]) + 1;
if (format_file_data (trp, file_signature, &buf[file_signature]) == 0)
@@ -425,10 +425,10 @@ expand_triplet_upload (struct metadef *def, void *data)
strcat (def->value, "\n");
}
def->value[size-1] = 0; /* Kill terminating newline */
-
+
free (buf[file_dist]);
free (buf[file_signature]);
-
+
return def->value;
}
@@ -479,7 +479,7 @@ fill_user_data (struct file_triplet *trp)
if (trp->user_data)
return;
-
+
if (method->type == method_none)
return;
@@ -494,7 +494,7 @@ fill_user_data (struct file_triplet *trp)
meta_escape (method, md, def);
text = meta_expand_string (method->query, def, NULL);
meta_free (def);
-
+
rc = method_run (method, md, text);
free (text);
if (rc)
@@ -502,7 +502,7 @@ fill_user_data (struct file_triplet *trp)
method_close (method, md);
return;
}
-
+
nrows = method_num_rows (method);
ncols = method_num_cols (method);
@@ -519,7 +519,7 @@ fill_user_data (struct file_triplet *trp)
}
method_close (method, md);
}
-
+
static const char *
expand_user_real_name (struct metadef *def, void *data)
{
diff --git a/src/verify.c b/src/verify.c
index d8fc408..cc3121c 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -87,7 +87,7 @@ make_default_meta (struct metadef def[5], const char *user,
def[3].kw = "project";
def[3].value = (char*) project;
def[4].kw = NULL;
-}
+}
/* Verify if USER has upload rights on the directory (project) requested
by TRP */
@@ -114,11 +114,11 @@ check_access_rights (struct file_triplet *trp, struct directory_pair *dpair,
return 1;
make_default_meta (def, user, trp->project);
-
+
meta_escape (method, md, def);
command = meta_expand_string (method->query, def, NULL);
meta_free (def);
-
+
rc = method_run (method, md, command);
free (command);
method_close (method, md);
@@ -138,7 +138,7 @@ check_access_rights (struct file_triplet *trp, struct directory_pair *dpair,
notify (dpair->notification, trp, ev_bad_ownership);
return 1;
}
-
+
return 0;
}
@@ -152,10 +152,10 @@ verify_directive_file (struct file_triplet *trp, struct directory_pair *dpair)
int rc;
struct metadef def[5];
void *md;
-
+
if (!trp->file[file_directive].name)
return 1;
-
+
md = method_open (method);
if (!md)
return 1;
@@ -174,8 +174,8 @@ verify_directive_file (struct file_triplet *trp, struct directory_pair *dpair)
meta_escape (method, md, def);
command = meta_expand_string (method->query, def, NULL);
meta_free (def);
-
- rc = method_run (method, md, command);
+
+ rc = method_run (method, md, command);
free (command);
if (rc)
{
@@ -183,7 +183,7 @@ verify_directive_file (struct file_triplet *trp, struct directory_pair *dpair)
method_close (method, md);
return 1;
}
-
+
pubkey = method_result (method, md, 0, 0);
if (!pubkey || pubkey[0] == 0)
{
@@ -204,9 +204,9 @@ verify_directive_file (struct file_triplet *trp, struct directory_pair *dpair)
}
else if (debug_level)
logmsg (LOG_DEBUG, "%s: directive file signature OK", trp->name);
-
+
method_close (method, md);
-
+
if (debug_level > 1)
{
int i;
diff --git a/src/wydawca.c b/src/wydawca.c
index b265ade..1d953b9 100644
--- a/src/wydawca.c
+++ b/src/wydawca.c
@@ -33,7 +33,7 @@ int enable_sendfile = 1; /* Use sendfile by default */
int archive_signatures = 1; /* Archive sig files by default */
int lint_mode = 0;
int preprocess_only = 0;
-
+
unsigned wydawca_stat[MAX_STAT];
void
@@ -86,7 +86,7 @@ syslog_printer (int prio, const char *fmt, va_list ap)
sprintf (fmtbuf, "[%s] %s", p, fmt);
fmt = fmtbuf;
}
-
+
#if HAVE_VSYSLOG
vsyslog (prio, fmt, ap);
#else
@@ -126,11 +126,11 @@ logmsg (int prio, char *fmt, ...)
case LOG_ERR:
UPDATE_STATS (STAT_ERRORS);
break;
-
+
case LOG_WARNING:
UPDATE_STATS (STAT_WARNINGS);
}
-
+
va_start (ap, fmt);
log_printer (prio, fmt, ap);
va_end (ap);
@@ -180,19 +180,19 @@ static char *stat_name[MAX_STAT] = {
};
static char *stat_kwname[MAX_STAT] = {
- "stat:errors",
- "stat:warnings",
- "stat:bad_signatures",
- "stat:access_violations",
- "stat:complete_triplets",
- "stat:incomplete_triplets",
- "stat:bad_triplets",
- "stat:expired_triplets",
- "stat:triplet_success",
- "stat:uploads",
- "stat:archives",
- "stat:symlinks",
- "stat:rmsymlinks",
+ "stat:errors",
+ "stat:warnings",
+ "stat:bad_signatures",
+ "stat:access_violations",
+ "stat:complete_triplets",
+ "stat:incomplete_triplets",
+ "stat:bad_triplets",
+ "stat:expired_triplets",
+ "stat:triplet_success",
+ "stat:uploads",
+ "stat:archives",
+ "stat:symlinks",
+ "stat:rmsymlinks",
};
int
@@ -241,7 +241,7 @@ logstats ()
if (print_stats & STAT_MASK (i))
logmsg (LOG_INFO, "%s: %u", stat_name[i], wydawca_stat[i]);
}
-
+
mail_stats ();
}
@@ -270,7 +270,7 @@ gconf_print_diag (gconf_locus_t *locus, int err, int errcode, const char *msg)
}
#include "cmdline.h"
-
+
int
main (int argc, char **argv)
{
@@ -279,15 +279,15 @@ main (int argc, char **argv)
config_init ();
parse_options (argc, argv);
-
+
if (argc != optind)
error (1, 0, "extra command line arguments");
if (preprocess_only)
exit (gconf_preproc_run (conffile, gconf_preprocessor));
-
+
gconf_parse (conffile);
-
+
if (lint_mode)
exit (0);
@@ -302,7 +302,7 @@ main (int argc, char **argv)
}
mail_init ();
-
+
logmsg (LOG_NOTICE, "wydawca (%s) started", PACKAGE_STRING);
scan_directories ();
diff --git a/src/wydawca.h b/src/wydawca.h
index b94fc5c..d990a97 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -72,7 +72,7 @@ enum access_method_id {
and real name by his uid */
access_method_count
};
-
+
enum access_method_type
{
method_none, /* Undefined or no method */
@@ -90,8 +90,8 @@ struct access_method
char **parmv; /* Parameters. The semantics differs
depending on type. For SQL:
0 - Identifier of the SQL struct
- to use; */
-
+ to use; */
+
int init_passed; /* Initialization count */
char *result; /* Result storage */
size_t result_size; /* Size of result */
@@ -143,7 +143,7 @@ enum file_type
{
file_dist, /* Something to be distributed */
file_signature, /* Detached signature (.sig) */
- file_directive, /* Directive (.directive.asc) */
+ file_directive, /* Directive (.directive.asc) */
};
#define FILE_TYPE_COUNT (file_directive+1)
@@ -152,7 +152,7 @@ struct file_info
{
enum file_type type; /* Part type */
char *name; /* File name */
- unsigned root_len; /* Length of root part in name */
+ unsigned root_len; /* Length of root part in name */
struct stat sb;
};
@@ -194,7 +194,7 @@ enum wydawca_stat
STAT_ARCHIVES,
STAT_SYMLINKS,
STAT_RMSYMLINKS,
- MAX_STAT
+ MAX_STAT
};
#define STAT_MASK(c) (1<<(c))
@@ -227,7 +227,7 @@ struct notification
};
void register_message_template (const char *name, const char *text);
-
+
void notify (struct notification *,
struct file_triplet *, enum notification_event);
@@ -254,7 +254,7 @@ void make_default_meta (struct metadef kwexp[5], const char *user,
/* Global variables */
-extern char *conffile; /* Configuration file name */
+extern char *conffile; /* Configuration file name */
extern int debug_level; /* Debugging level */
extern int dry_run_mode; /* Dry run indicator */
extern int log_to_stderr; /* Log to stderr instead of the syslog */
@@ -363,7 +363,7 @@ int process_directives (struct file_triplet *trp,
int move_file (struct file_triplet *trp, struct directory_pair *dpair,
enum file_type file_id, const char *reldir);
int archive_file (struct file_triplet *trp, struct directory_pair *dpair,
- const char *file_name, const char *reldir);
+ const char *file_name, const char *reldir);
int symlink_file (struct file_triplet *trp, struct directory_pair *dpair,
const char *reldir,
const char *wanted_src, const char *wanted_dst);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b170257..6afb799 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -55,13 +55,13 @@ $(TESTSUITE): package.m4 $(TESTSUITE_AT)
$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
mv $@.tmp $@
-atconfig: $(top_builddir)/config.status
+atconfig: $(top_builddir)/config.status
cd $(top_builddir) && ./config.status tests/$@
clean-local:
test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
-check-local: atconfig atlocal $(TESTSUITE)
+check-local: atconfig atlocal $(TESTSUITE)
$(SHELL) $(TESTSUITE)
# Run the test suite on the *installed* tree.
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 9205ae4..18aa370 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -21,7 +21,7 @@ wydawca_init_testdirs() {
else
mkdir "$dir"
fi
- done
+ done
}
wydawca_clean_testdirs() {
diff --git a/tests/mailstats.at b/tests/mailstats.at
index dc70ff4..b26c832 100644
--- a/tests/mailstats.at
+++ b/tests/mailstats.at
@@ -45,19 +45,19 @@ X-Mailer: AT_PACKAGE_TARNAME (AT_PACKAGE_NAME AT_PACKAGE_VERSION)
This is to notify you that the recent run of wydawca
caused the following results:
-errors ............................. 0
-warning ............................ 0
-bad signatures ..................... 0
-access violation attempts .......... 0
-complete triplets .................. 1
-incomplete triplets ................ 0
-bad triplets ....................... 0
-expired triplets ................... 0
-triplet successes .................. 1
-files uploaded ..................... 2
-files archived ..................... 0
-symlinks created ................... 0
-symlinks removed ................... 0
+errors ............................. 0
+warning ............................ 0
+bad signatures ..................... 0
+access violation attempts .......... 0
+complete triplets .................. 1
+incomplete triplets ................ 0
+bad triplets ....................... 0
+expired triplets ................... 0
+triplet successes .................. 1
+files uploaded ..................... 2
+files archived ..................... 0
+symlinks created ................... 0
+symlinks removed ................... 0
Regards,
Wydawca

Return to:

Send suggestions and report system problems to the System administrator.