diff options
-rw-r--r-- | gconf/gconf-gram.y | 20 | ||||
-rw-r--r-- | gconf/gconf.h | 5 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/cmdline.opt | 48 | ||||
-rw-r--r-- | src/config.c | 40 | ||||
-rw-r--r-- | src/directive.c | 2 | ||||
-rw-r--r-- | src/diskio.c | 14 | ||||
-rw-r--r-- | src/gpg.c | 4 | ||||
-rw-r--r-- | src/job.c | 278 | ||||
-rw-r--r-- | src/mail.c | 15 | ||||
-rw-r--r-- | src/net.c | 227 | ||||
-rw-r--r-- | src/null.c | 22 | ||||
-rw-r--r-- | src/pidfile.c | 90 | ||||
-rw-r--r-- | src/process.c | 66 | ||||
-rw-r--r-- | src/triplet.c | 18 | ||||
-rw-r--r-- | src/verify.c | 4 | ||||
-rw-r--r-- | src/vtab.c | 8 | ||||
-rw-r--r-- | src/wydawca.c | 112 | ||||
-rw-r--r-- | src/wydawca.h | 83 | ||||
-rw-r--r-- | tests/etc/wydawca.rcin | 3 | ||||
-rw-r--r-- | tests/mailstats.at | 2 | ||||
-rw-r--r-- | tests/notify-upl.at | 2 | ||||
-rw-r--r-- | tests/upload-dry.at | 10 | ||||
-rw-r--r-- | tests/upload.at | 2 |
24 files changed, 913 insertions, 166 deletions
diff --git a/gconf/gconf-gram.y b/gconf/gconf-gram.y index a1d9f2a..f7ee710 100644 --- a/gconf/gconf-gram.y +++ b/gconf/gconf-gram.y | |||
@@ -506,19 +506,23 @@ string_to_host (struct in_addr *in, const char *string) | |||
506 | } | 506 | } |
507 | 507 | ||
508 | static int | 508 | static int |
509 | string_to_sockaddr (sockaddr_union_t *s, const char *string) | 509 | string_to_sockaddr (struct gconf_sockaddr *sp, const char *string) |
510 | { | 510 | { |
511 | if (string[0] == '/') | 511 | if (string[0] == '/') |
512 | { | 512 | { |
513 | if (strlen (string) >= sizeof (s->s_un.sun_path)) | 513 | struct sockaddr_un s_un; |
514 | if (strlen (string) >= sizeof (s_un.sun_path)) | ||
514 | { | 515 | { |
515 | gconf_error (&gconf_current_locus, 0, | 516 | gconf_error (&gconf_current_locus, 0, |
516 | _("%s: UNIX socket name too long"), | 517 | _("%s: UNIX socket name too long"), |
517 | string); | 518 | string); |
518 | return 1; | 519 | return 1; |
519 | } | 520 | } |
520 | s->s_un.sun_family = AF_UNIX; | 521 | s_un.sun_family = AF_UNIX; |
521 | strcpy (s->s_un.sun_path, string); | 522 | strcpy (s_un.sun_path, string); |
523 | sp->len = sizeof (s_un); | ||
524 | sp->sa = xmalloc (sp->len); | ||
525 | memcpy (sp->sa, &s_un, sp->len); | ||
522 | } | 526 | } |
523 | else | 527 | else |
524 | { | 528 | { |
@@ -583,7 +587,9 @@ string_to_sockaddr (sockaddr_union_t *s, const char *string) | |||
583 | gconf_error (&gconf_current_locus, 0, _("missing port number")); | 587 | gconf_error (&gconf_current_locus, 0, _("missing port number")); |
584 | return 1; | 588 | return 1; |
585 | } | 589 | } |
586 | s->s_in = sa; | 590 | sp->len = sizeof (sa); |
591 | sp->sa = xmalloc (sp->len); | ||
592 | memcpy (sp->sa, &sa, sp->len); | ||
587 | } | 593 | } |
588 | return 0; | 594 | return 0; |
589 | } | 595 | } |
@@ -689,7 +695,7 @@ string_convert (void *target, enum gconf_data_type type, const char *string) | |||
689 | break; | 695 | break; |
690 | 696 | ||
691 | case gconf_type_sockaddr: | 697 | case gconf_type_sockaddr: |
692 | return string_to_sockaddr ((sockaddr_union_t*)target, string); | 698 | return string_to_sockaddr ((struct gconf_sockaddr *)target, string); |
693 | 699 | ||
694 | /* FIXME: */ | 700 | /* FIXME: */ |
695 | case gconf_type_cidr: | 701 | case gconf_type_cidr: |
@@ -720,7 +726,7 @@ size_t gconf_type_size_tab[] = { | |||
720 | sizeof (struct in_addr) /* gconf_type_ipv4 */, | 726 | sizeof (struct in_addr) /* gconf_type_ipv4 */, |
721 | 0 /* FIXME: gconf_type_cidr */, | 727 | 0 /* FIXME: gconf_type_cidr */, |
722 | sizeof (struct in_addr) /* gconf_type_host */, | 728 | sizeof (struct in_addr) /* gconf_type_host */, |
723 | sizeof (sockaddr_union_t) /* gconf_type_sockaddr */, | 729 | sizeof (struct gconf_sockaddr) /* gconf_type_sockaddr */, |
724 | 0 /* gconf_type_section */ | 730 | 0 /* gconf_type_section */ |
725 | }; | 731 | }; |
726 | #define gconf_type_size_count \ | 732 | #define gconf_type_size_count \ |
diff --git a/gconf/gconf.h b/gconf/gconf.h index f88e87a..56792a0 100644 --- a/gconf/gconf.h +++ b/gconf/gconf.h | |||
@@ -97,6 +97,11 @@ struct gconf_keyword { | |||
97 | struct gconf_keyword *kwd; | 97 | struct gconf_keyword *kwd; |
98 | }; | 98 | }; |
99 | 99 | ||
100 | struct gconf_sockaddr { | ||
101 | int len; | ||
102 | struct sockaddr *sa; | ||
103 | }; | ||
104 | |||
100 | gconf_value_t *gconf_value_dup(gconf_value_t *input); | 105 | gconf_value_t *gconf_value_dup(gconf_value_t *input); |
101 | 106 | ||
102 | extern void gconf_print_diag(gconf_locus_t *, int, int, const char*); | 107 | extern void gconf_print_diag(gconf_locus_t *, int, int, const char*); |
diff --git a/src/Makefile.am b/src/Makefile.am index 7ba9832..903b754 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -25,8 +25,11 @@ wydawca_SOURCES=\ | |||
25 | exec.c\ | 25 | exec.c\ |
26 | gpg.c\ | 26 | gpg.c\ |
27 | interval.c\ | 27 | interval.c\ |
28 | job.c\ | ||
28 | meta.c\ | 29 | meta.c\ |
29 | method.c\ | 30 | method.c\ |
31 | net.c\ | ||
32 | pidfile.c\ | ||
30 | process.c\ | 33 | process.c\ |
31 | sql.c\ | 34 | sql.c\ |
32 | sql.h\ | 35 | sql.h\ |
@@ -56,6 +59,7 @@ LDADD=../gconf/libgconf.a ../gnu/libgnu.a @SQLLIB@ @GPGMELIB@ @MAILUTILS_LIBS@ | |||
56 | INCLUDES = -I$(top_srcdir)/gconf -I$(top_srcdir)/gnu -I../gnu @MAILUTILS_INCLUDES@ | 59 | INCLUDES = -I$(top_srcdir)/gconf -I$(top_srcdir)/gnu -I../gnu @MAILUTILS_INCLUDES@ |
57 | AM_CPPFLAGS= \ | 60 | AM_CPPFLAGS= \ |
58 | -DSYSCONFDIR=\"$(sysconfdir)\"\ | 61 | -DSYSCONFDIR=\"$(sysconfdir)\"\ |
62 | -DLOCALSTATEDIR=\"$(localstatedir)\"\ | ||
59 | -DDEFAULT_VERSION_INCLUDE_DIR=\"$(incdir)\"\ | 63 | -DDEFAULT_VERSION_INCLUDE_DIR=\"$(incdir)\"\ |
60 | -DDEFAULT_INCLUDE_DIR=\"$(pkgdatadir)/include\"\ | 64 | -DDEFAULT_INCLUDE_DIR=\"$(pkgdatadir)/include\"\ |
61 | -DDEFAULT_PREPROCESSOR="$(DEFAULT_PREPROCESSOR)" | 65 | -DDEFAULT_PREPROCESSOR="$(DEFAULT_PREPROCESSOR)" |
diff --git a/src/cmdline.opt b/src/cmdline.opt index 53bdd00..b61517b 100644 --- a/src/cmdline.opt +++ b/src/cmdline.opt | |||
@@ -18,6 +18,7 @@ static struct obstack pp_cmd_stack; | |||
18 | static int pp_cmd_stack_init; | 18 | static int pp_cmd_stack_init; |
19 | 19 | ||
20 | static gl_list_t source_list; | 20 | static gl_list_t source_list; |
21 | static gl_list_t tag_list; | ||
21 | 22 | ||
22 | static bool | 23 | static bool |
23 | source_eq (const void *elt1, const void *elt2) | 24 | source_eq (const void *elt1, const void *elt2) |
@@ -28,9 +29,10 @@ source_eq (const void *elt1, const void *elt2) | |||
28 | int | 29 | int |
29 | enabled_spool_p (const struct spool *spool) | 30 | enabled_spool_p (const struct spool *spool) |
30 | { | 31 | { |
31 | if (!source_list) | 32 | if (source_list || tag_list) |
32 | return 1; | 33 | return (source_list && gl_list_search (source_list, spool->source_dir)) |
33 | return !!gl_list_search (source_list, spool->source_dir); | 34 | || (tag_list && gl_list_search (tag_list, spool->tag)); |
35 | return 1; | ||
34 | } | 36 | } |
35 | 37 | ||
36 | OPTIONS_BEGIN(gnu, "wydawca", | 38 | OPTIONS_BEGIN(gnu, "wydawca", |
@@ -61,12 +63,47 @@ BEGIN | |||
61 | dry_run_mode = 1; | 63 | dry_run_mode = 1; |
62 | END | 64 | END |
63 | 65 | ||
66 | OPTION(cron,,, | ||
67 | [<force cron mode>]) | ||
68 | BEGIN | ||
69 | cron_option = 1; | ||
70 | log_to_stderr = 0; | ||
71 | END | ||
72 | |||
73 | OPTION(force,,, | ||
74 | [<force start up even if the pid file already exists>]) | ||
75 | BEGIN | ||
76 | force_startup = 1; | ||
77 | END | ||
78 | |||
79 | OPTION(foreground,,, | ||
80 | [<foreground mode>]) | ||
81 | BEGIN | ||
82 | foreground_option = 1; | ||
83 | END | ||
84 | |||
85 | OPTION(single-process,,, | ||
86 | [<single process mode>]) | ||
87 | BEGIN | ||
88 | single_process_option = 1; | ||
89 | END | ||
90 | |||
64 | OPTION(config-file,c,FILE, | 91 | OPTION(config-file,c,FILE, |
65 | [<use FILE instead of the default configuration>]) | 92 | [<use FILE instead of the default configuration>]) |
66 | BEGIN | 93 | BEGIN |
67 | conffile = optarg; | 94 | conffile = optarg; |
68 | END | 95 | END |
69 | 96 | ||
97 | OPTION(spool,S,TAG, | ||
98 | [<process only spool with the given tag>]) | ||
99 | BEGIN | ||
100 | if (!tag_list) | ||
101 | tag_list = gl_list_create_empty (&gl_linked_list_implementation, | ||
102 | source_eq, NULL, | ||
103 | NULL, false); | ||
104 | gl_list_add_last (tag_list, optarg); | ||
105 | END | ||
106 | |||
70 | OPTION(source,s,SOURCE-DIR, | 107 | OPTION(source,s,SOURCE-DIR, |
71 | [<process only spool with the given source (may be used multiple times)>]) | 108 | [<process only spool with the given source (may be used multiple times)>]) |
72 | BEGIN | 109 | BEGIN |
@@ -79,9 +116,8 @@ END | |||
79 | 116 | ||
80 | GROUP(Logging) | 117 | GROUP(Logging) |
81 | 118 | ||
82 | OPTION(cron,,, | 119 | OPTION(syslog,,, |
83 | [<log to syslog>]) | 120 | [<log to syslog>]) |
84 | ALIAS(syslog) | ||
85 | BEGIN | 121 | BEGIN |
86 | log_to_stderr = 0; | 122 | log_to_stderr = 0; |
87 | END | 123 | END |
diff --git a/src/config.c b/src/config.c index dd444fe..94afb20 100644 --- a/src/config.c +++ b/src/config.c | |||
@@ -263,11 +263,6 @@ cb_mailer (enum gconf_callback_command cmd, | |||
263 | 263 |