summaryrefslogtreecommitdiffabout
path: root/src/gpg.c
authorSergey Poznyakoff <gray@gnu.org.ua>2007-08-20 13:54:40 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2007-08-20 13:54:40 (GMT)
commit5d2f6b08d164d0106ef2377ceb01393226eeafef (patch) (side-by-side diff)
tree3939f57e0aeba6dadca64eaf400ae42873a4fd6f /src/gpg.c
parent39a9fb6ab567b48ac8c38b98143d6089e9d16709 (diff)
downloadwydawca-5d2f6b08d164d0106ef2377ceb01393226eeafef.tar.gz
wydawca-5d2f6b08d164d0106ef2377ceb01393226eeafef.tar.bz2
* jabberd/Makefile.am, cvs/Makefile.am, ckaliases/Makefile.am,
acinclude.m4, Makefile.am: Add copyright statements * wydawca/sql.c (trim_length): Move to verify.c * wydawca/verify.c (trim_length, trim) (check_access_rights): New functions (expand_param): Export (verify_triplet): Call verify_directive_format and check_access_rights * wydawca/wydawca.h (trim_length, trim, directive_parse) (directive_get_value, directive_pack_version) (directive_version_in_range_p, verify_directive_format) (directive_first, directive_next, process_directives) (create_directory, move_file): New functions (MIN_DIRECTIVE_VERSION,MAX_DIRECTIVE_VERSION) (MKDIR_PERMISSIONS,CREAT_PERMISSIONS): New defines * wydawca/gpg.c (wydawca_gpg_homedir): Return a meaningful value (verify_directive_signature): Call directive_parse * wydawca/process.c (parse_file_name): Return void * wydawca/directive.c: New file * wydawca/diskio.c: New file * wydawca/triplet.c (triplet_processor): Call process_directives (enumerate_triplets): Arg is not const * wydawca/Makefile.am: Add new sources * configure.ac: Check for sendfile git-svn-id: file:///svnroot/wydawca/trunk@281 6bb4bd81-ecc2-4fd4-a2d4-9571d19c0d33
Diffstat (limited to 'src/gpg.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gpg.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/gpg.c b/src/gpg.c
index a722b4e..a327f4c 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -126,7 +126,7 @@ int
wydawca_gpg_homedir ()
{
if (homedir)
- return;
+ return 0;
homedir = xstrdup ("/tmp/wydawca-XXXXXX");
if (!mkdtemp (homedir))
@@ -139,6 +139,7 @@ wydawca_gpg_homedir ()
if (debug_level > 1)
logmsg (LOG_DEBUG, "GNUPG home directory: %s", homedir);
setenv ("GNUPGHOME", homedir, 1);
+ return 0;
}
/* FIXME: dpair currently unused */
@@ -164,34 +165,14 @@ verify_directive_signature (struct file_register *reg,
ec = gpgme_op_verify (ctx, directive_data, NULL, plain);
if (ec == GPG_ERR_NO_ERROR)
{
- size_t dcount, i;
- char *p;
-
- rc = 0;
-
size = gpgme_data_seek (plain, 0, SEEK_END);
gpgme_data_seek (plain, 0, SEEK_SET);
reg->blurb = xmalloc (size + 1);
gpgme_data_read (plain, reg->blurb, size);
reg->blurb[size] = 0;
gpgme_data_release (plain);
-
- dcount = 1;
- for (p = reg->blurb; *p; p++)
- if (*p == '\n')
- dcount++;
-
- reg->directive = xcalloc (dcount, sizeof reg->directive[0]);
- p = reg->blurb;
- for (i = 0; i < dcount; i++)
- {
- reg->directive[i] = p;
- p = strchr (p, '\n');
- if (!p)
- break;
- *p++ = 0;
- }
- reg->directive[i] = NULL;
+
+ rc = directive_parse (reg);
}
else
{
@@ -269,7 +250,6 @@ verify_detached_signature (struct file_register *reg,
struct directory_pair *dpair)
{
gpgme_engine_info_t info;
- const char *gpg_prog;
char *argv[5];
FILE *fp;
pid_t pid, npid;
@@ -331,9 +311,6 @@ verify_detached_signature (struct file_register *reg,
rc = WEXITSTATUS (status);
if (rc)
{
- size_t size = 0;
- char *buf = NULL;
-
logmsg (LOG_ERR, "bad detached signature for %s", reg->name);
log_output (LOG_ERR, argv[0], fp);
/* FIXME: email? */

Return to:

Send suggestions and report system problems to the System administrator.