path: root/src/gpg.c
authorSergey Poznyakoff <>2010-01-02 11:15:46 (GMT)
committer Sergey Poznyakoff <>2010-01-02 11:15:46 (GMT)
commitc8b326ef70fbfc06483ae249219a1d4ab09c8bfe (patch) (side-by-side diff)
treea2d9e70949e357426e7c3088e1aa258b3a5dc45a /src/gpg.c
parente9ac07640150f7aac1805d1447e6b712464d1b48 (diff)
Implement distribution tarball checking.
* src/config.c (event_args): New event "check-failure" (event_types): New event type ev_check_fail. (spool_kw,wydawca_kw): New keyword check-script. * src/directive.c (save_script) (stderr_redirector,run_check_script): New functions. (external_check): New function. (process_directives): Call external_check before actually moving the files. * src/gpg.c (homedir): Rename to temp_homedir, now global. * src/net.c (trim_crlf): Remove static qualifier. * src/triplet.c (hash_triplet_free): Free check_diag. (expand_triplet_full,expand_triplet_upload) (expand_triplet_sig,expand_triplet_directive): Rename to expand_triplet_ls_full,expand_triplet_ls_upload, expand_triplet_ls_sig,expand_triplet_ls_directive, correspondigly. (expand_check_diagn,expand_check_result) (expand_triplet_dist,expand_triplet_sig) (expand_triplet_dir): New functions. (triplet_meta): Renames: triplet:full => triplet:ls:full triplet:upload => triplet:ls:upload triplet:dist => triplet:ls:dist triplet:sig => triplet:ls:sig triplet:dir => triplet:ls:dir New keywords: triplet:dist, triplet:sig, triplet:dir, check:result, check:diagn. * src/wydawca.c (default_check_script): New global. (stat_name): New statistics counter "check failures". * src/wydawca.h (struct file_triplet): New members check_result, check_diag. (struct spool): New member check_script. (wydawca_stat): New value STAT_CHECK_FAIL. (notification_event): New value ev_check_fail. (default_check_script, temp_homedir): New externs. (concat_dir, copy_file, trim_crlf): New protos. * doc/wydawca.texi: Update. *, NEWS: Version 2.0.90
Diffstat (limited to 'src/gpg.c') (more/less context) (ignore whitespace changes)
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gpg.c b/src/gpg.c
index f833142..cca5048 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -33,7 +33,7 @@
} \
while (0)
-static char *homedir;
+char *temp_homedir;
static int rmdir_r (const char *name);
@@ -122,29 +122,29 @@ static void
remove_homedir ()
if (debug_level > 1)
- logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), homedir);
- if (rmdir_r (homedir))
- logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), homedir);
+ logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), temp_homedir);
+ if (rmdir_r (temp_homedir))
+ logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), temp_homedir);
/* Create a temporary GPG home directory */
static int
create_gpg_homedir ()
- if (homedir)
+ if (temp_homedir)
return 0;
- homedir = xstrdup ("/tmp/wydawca-XXXXXX");
- if (!mkdtemp (homedir))
+ temp_homedir = xstrdup ("/tmp/wydawca-XXXXXX");
+ if (!mkdtemp (temp_homedir))
logmsg (LOG_CRIT, _("cannot create GPG home directory (%s): %s"),
- homedir, strerror (errno));
+ temp_homedir, strerror (errno));
return 1;
atexit (remove_homedir);
if (debug_level > 1)
- logmsg (LOG_DEBUG, _("GNUPG home directory: %s"), homedir);
- setenv ("GNUPGHOME", homedir, 1);
+ logmsg (LOG_DEBUG, _("GNUPG home directory: %s"), temp_homedir);
+ setenv ("GNUPGHOME", temp_homedir, 1);
return 0;

Return to:

Send suggestions and report system problems to the System administrator.