aboutsummaryrefslogtreecommitdiff
path: root/src/wydawca.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-04-15 08:36:13 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-04-15 09:15:45 +0300
commit6398c8db62d953b80fa83093a2e05f41b782f662 (patch)
tree776bc57a9e9459c52b910a3a0caa3c09b77f4c23 /src/wydawca.c
parent5b272a2b955eb426bcb6abe5be6ca4c87705f49e (diff)
downloadwydawca-6398c8db62d953b80fa83093a2e05f41b782f662.tar.gz
wydawca-6398c8db62d953b80fa83093a2e05f41b782f662.tar.bz2
When processing spool requests, handle each completed triplet in spool.
Previously wydawca used to take optional second parameter - a list of submitter UIDs. If given this list, it would process only those triplets that had been uploaded by one of these UIDs. This proved to be unnecessary. The same change is applied to the notification protocol. Only the spool name is required. The second word in the request (user name) is now silently ignored. * src/wydawca.h (struct wy_triplet): Remove const qualifier from the spool member. Remove jq_prev and jq_next pointers. (struct job_spool_id): Remove. (job_schedule_spool): Change signature. * src/job.c (struct job): Replace job_spool with a pointer to spool. (triplet_jq_unlink,jq_clear): Remove. (job_printable): Change formatting of JOB_SPOOL jobs. (job_locate): Update. (wydawca_scanner): Update. * src/net.c (handle_connection): Ignore second word in the request. * src/process.c (spool_add_new_file): Change signature. UIDs are no longer needed. Return a pointer to the affected triplet. (scan_spool): Change signature. * src/triplet.c (register_file): Return pointer to the affected triplet. (check_triplet_state): Remove the noauth parameter. (triplet_enqueue): New function. (triplet_commit): New function. (spool_commit_triplets): Remove the tplist parameter. Process all complete triplets in the spool. (link_processable_triplets): Remove. * src/verify.c (verify_directive_file): Remove the noauth parameter. * src/watcher.c (process_event): Enqueue created triplets. * src/wydawca.c (main): Don't take any UID arguments. * tests/inotify-ok.at: The version statement is printed once. Update the expected output. * tests/inotify-rmsymlink.at: Likewise. * tests/inotify-symlink.at: Likewise. * tests/inotify-unatt01.at: Likewise.
Diffstat (limited to 'src/wydawca.c')
-rw-r--r--src/wydawca.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/src/wydawca.c b/src/wydawca.c
index 5bde979..21179fb 100644
--- a/src/wydawca.c
+++ b/src/wydawca.c
@@ -270,31 +270,6 @@ grecs_print_diag(grecs_locus_t * locus, int err, int errcode,
}
}
-static int uidc;
-static uid_t *uidv;
-
-static void
-collect_uids(int argc, char **argv)
-{
- int i;
-
- uidc = argc;
- uidv = grecs_calloc(uidc, sizeof(uidv[0]));
- for (i = 0; i < argc; i++) {
- struct passwd *pw = getpwnam(argv[i]);
- if (!pw) {
- char *p;
- unsigned n = strtoul(argv[i], &p, 10);
- if (*p) {
- wy_log(LOG_ERR, _("no such user: %s"), argv[i]);
- exit(EX_NOUSER);
- }
- uidv[i] = n;
- } else
- uidv[i] = pw->pw_uid;
- }
-}
-
char **x_argv;
extern int reconfigure;
@@ -354,14 +329,10 @@ main(int argc, char **argv)
exit(EX_UNAVAILABLE);
} else
wy_debug(4, (_("using GPGME version %s"), p));
-
+
if (argc) {
- if (wy_mode == WY_MODE_DAEMON) {
- wy_log(LOG_CRIT, _("extra arguments in daemon mode"));
- exit(EX_UNAVAILABLE);
- } else {
- collect_uids(argc, argv);
- }
+ wy_log(LOG_CRIT, _("extra arguments"));
+ exit(EX_UNAVAILABLE);
}
if (preprocess_only)
@@ -432,7 +403,7 @@ main(int argc, char **argv)
wy_log(LOG_NOTICE, _("wydawca (%s) started"), PACKAGE_STRING);
- scan_all_spools(uidc, uidv);
+ scan_all_spools();
logstats();
if (wy_mode == WY_MODE_DAEMON)
wydawca_daemon();

Return to:

Send suggestions and report system problems to the System administrator.