diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/directive.c | 8 | ||||
-rw-r--r-- | src/getopt.m4 | 2 | ||||
-rw-r--r-- | src/gpg.c | 12 | ||||
-rw-r--r-- | src/process.c | 2 | ||||
-rw-r--r-- | src/triplet.c | 14 | ||||
-rw-r--r-- | src/verify.c | 11 | ||||
-rw-r--r-- | src/wydawca.h | 28 |
7 files changed, 45 insertions, 32 deletions
diff --git a/src/directive.c b/src/directive.c index 401397d..93830b1 100644 --- a/src/directive.c +++ b/src/directive.c | |||
@@ -589,5 +589,5 @@ external_check (struct file_triplet *trp) | |||
589 | 589 | ||
590 | /* Process the directives from TRP, using given SPOOL */ | 590 | /* Process the directives from TRP */ |
591 | int | 591 | int |
592 | process_directives (struct file_triplet *trp, const struct spool *spool) | 592 | process_directives (struct file_triplet *trp) |
593 | { | 593 | { |
@@ -596,3 +596,5 @@ process_directives (struct file_triplet *trp, const struct spool *spool) | |||
596 | char *relative_dir; | 596 | char *relative_dir; |
597 | const struct spool *spool; | ||
597 | 598 | ||
599 | ASGN_SPOOL (spool, trp, return 1); | ||
598 | UPDATE_STATS (STAT_COMPLETE_TRIPLETS); | 600 | UPDATE_STATS (STAT_COMPLETE_TRIPLETS); |
@@ -627,3 +629,3 @@ process_directives (struct file_triplet *trp, const struct spool *spool) | |||
627 | case filename_dir: | 629 | case filename_dir: |
628 | rc = verify_detached_signature (trp, spool); | 630 | rc = verify_detached_signature (trp); |
629 | if (rc == 0) | 631 | if (rc == 0) |
diff --git a/src/getopt.m4 b/src/getopt.m4 index b615ec3..fc50ff9 100644 --- a/src/getopt.m4 +++ b/src/getopt.m4 | |||
@@ -248,3 +248,3 @@ print_help(void) | |||
248 | gettext (args_doc)); | 248 | gettext (args_doc)); |
249 | if (doc && doc[0]) | 249 | if (doc[0]) |
250 | print_option_descr(gettext (doc), 0, RMARGIN); | 250 | print_option_descr(gettext (doc), 0, RMARGIN); |
@@ -217,6 +217,4 @@ gpg_verify_signature (gpgme_ctx_t ctx, gpgme_signature_t sig, | |||
217 | /* Verify the directive file from TRP using public key PUBKEY */ | 217 | /* Verify the directive file from TRP using public key PUBKEY */ |
218 | /* FIXME: spool currently unused */ | ||
219 | int | 218 | int |
220 | verify_directive_signature (struct file_triplet *trp, | 219 | verify_directive_signature (struct file_triplet *trp) |
221 | const struct spool *spool) | ||
222 | { | 220 | { |
@@ -261,3 +259,3 @@ verify_directive_signature (struct file_triplet *trp, | |||
261 | UPDATE_STATS (STAT_BAD_SIGNATURE); | 259 | UPDATE_STATS (STAT_BAD_SIGNATURE); |
262 | notify (spool->notification, trp, ev_bad_directive_signature); | 260 | notify (trp->spool->notification, trp, ev_bad_directive_signature); |
263 | rc = 1; | 261 | rc = 1; |
@@ -285,4 +283,3 @@ verify_directive_signature (struct file_triplet *trp, | |||
285 | int | 283 | int |
286 | verify_detached_signature (struct file_triplet *trp, | 284 | verify_detached_signature (struct file_triplet *trp) |
287 | const struct spool *spool) | ||
288 | { | 285 | { |
@@ -290,2 +287,5 @@ verify_detached_signature (struct file_triplet *trp, | |||
290 | const char *argv[5]; | 287 | const char *argv[5]; |
288 | const struct spool *spool; | ||
289 | |||
290 | ASGN_SPOOL (spool, trp, return 1); | ||
291 | 291 | ||
diff --git a/src/process.c b/src/process.c index 23641cd..676e565 100644 --- a/src/process.c +++ b/src/process.c | |||
@@ -204,3 +204,3 @@ scan_spool_unlocked (const struct spool *spool, int uc, uid_t *uv) | |||
204 | 204 | ||
205 | register_file (&finfo); | 205 | register_file (&finfo, spool); |
206 | } | 206 | } |
diff --git a/src/triplet.c b/src/triplet.c index 0744daa..efe4a0b 100644 --- a/src/triplet.c +++ b/src/triplet.c | |||
@@ -62,3 +62,3 @@ hash_triplet_free (void *data) | |||
62 | void | 62 | void |
63 | register_file (struct file_info *finfo) | 63 | register_file (struct file_info *finfo, const struct spool *spool) |
64 | { | 64 | { |
@@ -71,2 +71,3 @@ register_file (struct file_info *finfo) | |||
71 | tp->name[finfo->root_len] = 0; | 71 | tp->name[finfo->root_len] = 0; |
72 | tp->spool = spool; | ||
72 | 73 | ||
@@ -125,3 +126,3 @@ check_triplet_state (struct file_triplet *trp) | |||
125 | { | 126 | { |
126 | if (verify_directive_file (trp, trp->spool)) | 127 | if (verify_directive_file (trp)) |
127 | return triplet_bad; | 128 | return triplet_bad; |
@@ -178,5 +179,2 @@ triplet_processor (void *data, void *proc_data) | |||
178 | struct file_triplet *trp = data; | 179 | struct file_triplet *trp = data; |
179 | const struct spool *spool = proc_data; | ||
180 | |||
181 | trp->spool = spool; | ||
182 | 180 | ||
@@ -195,3 +193,3 @@ triplet_processor (void *data, void *proc_data) | |||
195 | logmsg (LOG_DEBUG, _("processing triplet `%s'"), trp->name); | 193 | logmsg (LOG_DEBUG, _("processing triplet `%s'"), trp->name); |
196 | if (process_directives (trp, spool)) | 194 | if (process_directives (trp)) |
197 | remove_triplet (trp); | 195 | remove_triplet (trp); |
@@ -212,3 +210,3 @@ triplet_processor (void *data, void *proc_data) | |||
212 | 210 | ||
213 | if (triplet_expired_p (trp, spool->file_sweep_time)) | 211 | if (triplet_expired_p (trp, trp->spool->file_sweep_time)) |
214 | { | 212 | { |
@@ -230,3 +228,3 @@ enumerate_triplets (const struct spool *spool) | |||
230 | { | 228 | { |
231 | hash_do_for_each (triplet_table, triplet_processor, (void*) spool); | 229 | hash_do_for_each (triplet_table, triplet_processor, NULL); |
232 | hash_clear (triplet_table); | 230 | hash_clear (triplet_table); |
diff --git a/src/verify.c b/src/verify.c index 7520466..01c61ea 100644 --- a/src/verify.c +++ b/src/verify.c | |||
@@ -195,11 +195,14 @@ uploader_find_frp (struct uploader_info *list, const char *fpr) | |||
195 | int | 195 | int |
196 | verify_directive_file (struct file_triplet *trp, const struct spool *spool) | 196 | verify_directive_file (struct file_triplet *trp) |
197 | { | 197 | { |
198 | char *command; | 198 | char *command; |
199 | struct dictionary *dict = spool->dictionary[project_uploader_dict]; | ||
200 | int rc; | 199 | int rc; |
201 | void *md; | 200 | void *md; |
202 | |||
203 | size_t nrows, ncols, i; | 201 | size_t nrows, ncols, i; |
204 | struct uploader_info *head, *tail; | 202 | struct uploader_info *head, *tail; |
203 | const struct spool *spool; | ||
204 | struct dictionary *dict; | ||
205 | |||
206 | ASGN_SPOOL (spool, trp, return 1); | ||
207 | dict = spool->dictionary[project_uploader_dict]; | ||
205 | 208 | ||
@@ -303,3 +306,3 @@ verify_directive_file (struct file_triplet *trp, const struct spool *spool) | |||
303 | 306 | ||
304 | if (verify_directive_signature (trp, spool)) | 307 | if (verify_directive_signature (trp)) |
305 | { | 308 | { |
diff --git a/src/wydawca.h b/src/wydawca.h index 54ecf00..b44b5d7 100644 --- a/src/wydawca.h +++ b/src/wydawca.h | |||
@@ -240,2 +240,16 @@ struct spool | |||
240 | 240 | ||
241 | #define ASGN_SPOOL(spool, trp, faction) \ | ||
242 | do \ | ||
243 | { \ | ||
244 | spool = (trp)->spool; \ | ||
245 | if (!spool) \ | ||
246 | { \ | ||
247 | logmsg (LOG_CRIT, \ | ||
248 | _("INTERNAL ERROR at %s:%d: spool not defined for %s"),\ | ||
249 | __FILE__, __LINE__, (trp)->name); \ | ||
250 | faction; \ | ||
251 | } \ | ||
252 | } \ | ||
253 | while (0) | ||
254 | |||
241 | 255 | ||
@@ -403,3 +417,3 @@ void register_spool (struct spool *spool); | |||
403 | struct spool *wydawca_find_spool (const char *name); | 417 | struct spool *wydawca_find_spool (const char *name); |
404 | void register_file (struct file_info *finfo); | 418 | void register_file (struct file_info *finfo, const struct spool *spool); |
405 | void enumerate_triplets (const struct spool *); | 419 | void enumerate_triplets (const struct spool *); |
@@ -430,8 +444,5 @@ unsigned dictionary_num_cols (struct dictionary *dict); | |||
430 | /* Verification functions */ | 444 | /* Verification functions */ |
431 | int verify_directive_file (struct file_triplet *trp, | 445 | int verify_directive_file (struct file_triplet *trp); |
432 | const struct spool *spool); | 446 | int verify_directive_signature (struct file_triplet *trp); |
433 | int verify_directive_signature (struct file_triplet *trp, | 447 | int verify_detached_signature (struct file_triplet *trp); |
434 | const struct spool *spool); | ||
435 | int verify_detached_signature (struct file_triplet *trp, | ||
436 | const struct spool *spool); | ||
437 | int fill_project_name (struct file_triplet *trp); | 448 | int fill_project_name (struct file_triplet *trp); |
@@ -452,4 +463,3 @@ int directive_next (struct file_triplet *trp, int n, | |||
452 | const char **pkey, const char **pval); | 463 | const char **pkey, const char **pval); |
453 | int process_directives (struct file_triplet *trp, | 464 | int process_directives (struct file_triplet *trp); |
454 | const struct spool *spool); | ||
455 | 465 | ||