aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFiles
2023-05-02Add interface for closing file descriptors greater than or equal to the ↵HEADmasterSergey Poznyakoff5
given one.
2023-05-02Remove uses of obsolete and obsolescent autoconf macros.Sergey Poznyakoff1
2023-05-02Use POSIX dl* functions instead of lt_* wrappersSergey Poznyakoff2
* Makefile.am (SUBDIRS): Remove libltdl. * configure.ac: Remove LT_PREREQ et al. * include/wydawca/wydawca.h (WY_EXPORT): Rewrite for backward compatibility. * src/Makefile.am (LDADD): Use -ldl. * src/module.c: Rewrite using plain dl* calls. * tests/atlocal.in (WY_MODDIR): Change definition. * tests/check-notify.at: Use .so suffix instead of .la * tests/mailnotify.at: Likewise. * tests/mailstats.at: Likewise.
2023-03-30Enforce unique spool source directoriesSergey Poznyakoff3
* src/config.c (cb_spool): Check if spool's source directory is unique. Bail out if it is not. * src/spool.c (wydawca_find_spool_source): New function. * src/wydawca.h (spool): New fields: inode, dev, locus. (wydawca_find_spool_source): New proto. * tests/spoolsrc.at: New file. * tests/Makefile.am: Add spoolsrc.at * tests/testsuite.at: Include spoolsrc.at
2023-03-26Protect the in_processing field in triplet by a mutexSergey Poznyakoff2
2023-03-24BugfixSergey Poznyakoff3
* src/triplet.c (remove_triplet_unlocked): Set the in_processing flag. This complements 4db1e89561d. * src/verify.c (fill_project_name): Mark as static. * src/wydawca.h (fill_project_name): Remove prototype.
2022-08-21BugfixesSergey Poznyakoff2
* modules/mailutils/mod_mailutils.c (get_uploader_email): Always provide explanation when returning NULL. (t_notify): Don't attempt to send message if unable to expand template. * src/gpg.c (checksig): Emit wy_ev_bad_ownership if unable to determine uploader. * src/triplet.c: Avoid dereferencing NULL tmp->uploader. Notice that tmp->spool should never be NULL, so no special check for that is made.
2022-06-01Whitespace cleanupSergey Poznyakoff16
2022-06-01Support arbitrary order of directives in a directive fileSergey Poznyakoff5
* src/cmdline.opt: New option -l (--max-severity). * src/verify.c (fill_project_name): Check directive file format here. * src/wydawca.c (wy_log_max_severity): New global. (wy_vlog): Don't log the message if its severity is greater than wy_log_max_severity. * src/wydawca.h (wy_log_max_severity): New extern. * src/directive.c (verify_directive_format): Rewrite. Process the replace directive here. * tests/Makefile.am: Add new file. * tests/testsuite.at: Include new file. * tests/atlocal.in (wy_create_directive): New option -c: create initially empty file. * tests/dry_run01.at: Update expected text. * tests/upload01.at: Likewise. * tests/upload04.at: Test whether replace directory works no matter what its position relative to filename directive. * tests/verify.at: New file. * NEWS: Update. * grecs: Update.
2022-01-25Version 4.0.90Sergey Poznyakoff2
* NEWS: Document changes. * configure.ac: Raise patchlevel number. * src/directive.c (run_check_script): Remove improperly used static qualifier. * src/triplet.c: Fix indenting.
2022-01-13Update copyright yearsSergey Poznyakoff29
2022-01-13Upgrade to lates grecsSergey Poznyakoff4
* configure.ac (DEFAULT_INCLUDE_PATH): New variable. * grecs: Update to 95ea130c00. * src/Makefile.am (AM_CPPFLAGS): Remove DEFAULT_VERSION_INCLUDE_DIR and DEFAULT_INCLUDE_DIR, add DEFAULT_INCLUDE_PATH. * src/cmdline.opt: Include preprocessor information in help output. Change handling of the -I option: it is now appended to the preprocessor arguments, just like -D. * src/config.c (cb_supp_groups): Bugfix: used wrong variable in diagnostic message. * src/wydawca.c (config_init): Remove call to grecs_include_path_setup.
2022-01-13BugfixesSergey Poznyakoff1
* src/gpg.c (triplet_gpgme_ctx): Check if the gpgme imports field is not NULL before referencing it * tests/etc/Makefile.am (database.cf): Depend on gnupg (fixes parallel builds).
2021-04-09Run the distribution verification script in a separate temporary directory.Sergey Poznyakoff3
The temporary directory is removed when the script terminates. * src/directive.c (run_check_script): Create a separate temporary directory to run the script in. * src/gpg.c (wy_rmdir_r, wy_tempdir): New functions. * src/wydawca.h (wy_rmdir_r, wy_tempdir): New protos.
2021-01-06Version 4.0.3release-4.0.3Sergey Poznyakoff1
2021-01-06Fix archivation/removalSergey Poznyakoff1
* src/diskio.c (dir_archive_file): Use do_archive_file to remove signature. If archive_signatures is zero, remove the signature.
2021-01-06Update copyright yearsSergey Poznyakoff30
2020-10-12Version 4.0.2release-4.0.2Sergey Poznyakoff1
2020-10-12BugfixesSergey Poznyakoff2
* src/config.c (cb_spool): Don't open source_dir, as it may not exist yet. (create_spool_dirs): Open source_dir here. * src/wydawca.c (main): Initialize grecs_print_diag_fun.
2020-05-17Fix deadlock at wy_vlogSergey Poznyakoff6
* src/stat.c: New file. * src/wydawca.c (wy_log): Don't touch statistic counters. This causes deadlock when wy_v?log is called from statistic-reporting module. * src/wydawca.h (wydawca_stat_log): Remove proto. * src/gpg.c: Increase WY_STAT_ERRORS explicitly. * src/triplet.c: Likewise. * src/verify.c: Likewise. * tests/dry_run01.at: Fix expected output. * tests/upload01.at: Likewise.
2020-05-17Remove timersSergey Poznyakoff6
2020-05-17Enable automatic reconnection in mysqlSergey Poznyakoff1
* src/sql.c (sql_init_dictionary): Enable automatic reconnection (sql_open): Call mysql_ping
2020-05-16BugfixSergey Poznyakoff1
* src/triplet.c (triplet_enqueue): Create thread in detached state.
2020-05-02Fix syslog logging if print-priority is set to truerelease-4.0.1Sergey Poznyakoff1
2020-04-30Revise the triplet names. Update the docs.Sergey Poznyakoff3
2020-04-30Change replace handlingSergey Poznyakoff3
* src/wydawca.h (struct wy_triplet): New member: replace_allowed * src/directive.c (process_directives): Set trp->replace_allowed depending on the directive file version and the "replace" directive. * src/diskio.c (backup_copy): Use trp->replace_allowed * tests/Makefile.am: Add new tests. * tests/testsuite.at: Include new tests. * tests/upload03.at: New test. * tests/upload04.at: New test. * tests/upload05.at: New test.
2020-04-29Minor changes.Sergey Poznyakoff2
* src/config.c (config_init): Place the user include directory before the version-specific include directory. * src/triplet.c (expand_relative_dir): Use trp->relative_dir).
2020-04-29Skip tests if running as a privileged userSergey Poznyakoff1
2020-04-29Change the default log facility to daemonSergey Poznyakoff1
2020-04-29Improve statistic reporter scheduling.Sergey Poznyakoff6
Use crontab format specification to define the frequency of statistic report generation. * src/wydawca.h (stat_report_schedule): New variable. Replaces stat_report_interval. * configure.ac: Check for struct tm.tm_gmtoff. * src/config.c: New keyword: stat-report-schedule. * src/micron.c: New file. * src/micron.h: New file. * src/Makefile.am: Add new files. * src/timer.c (wy_thr_stat): Use micron scheduler. * doc/wydawca.texi: Document stat-report-schedule. * NEWS: Document stat-report-schedule.
2020-04-27Replace the "finish" event with "statistics".Sergey Poznyakoff4
2020-04-27Use BSD queue macros to implement queues and linked lists.Sergey Poznyakoff13
2020-04-27Minor improvementSergey Poznyakoff1
* src/directive.c (directive_parse): Optimize two sequential directives referring for filename and filename.sig
2020-04-26Support both new and legacy usage of -dSergey Poznyakoff1
2020-04-26Minor changesSergey Poznyakoff4
* doc/wydawca.texi: Fix documentation of ${timer:wydawca} * etc/wydawca.rc: Rename to etc/wydawca.conf. Edit. * src/triplet.c: The "wydawca" timer is synonymous to "spool". * src/wydawca.h (WY_TIMER_WYDAWCA): Remove.
2020-04-25Keep statistic items in global array. Use special thread for periodic reportingSergey Poznyakoff9
* src/config.c: New configuration statement stat-report-interval * src/directive.c * src/timer.c: Rewrite statistic counters and functions (wydawca_stat_log,wydawca_stat_init,wydawca_stat_update) (wydawca_stat_notify,wydawca_stat_add): New functions. (wy_thr_stat): New thread (statistics reporter. * src/triplet.c: Remove per-thread statistic counters. * src/wydawca.c (wy_main): Use new statistic calls. Force statistic logging at the end of the run. * src/wydawca.h (DEFAULT_STAT_REPORT_INTERVAL): New constant. (stat_report_interval): New extern. (wy_get_stat_array, wy_get_stat_slot) (wy_get_stat_counter): Remove. (wydawca_stat_log,wydawca_stat_init,wydawca_stat_update) (wydawca_stat_notify,wydawca_stat_add) (wydawca_stat_incr): New protos. (stat_mask_p,logstats,wydawca_stats_export) (wydawca_stats_update): Remove protos.
2020-04-25Fix string expansion.Sergey Poznyakoff2
* modules/mailutils/mod_mailutils.c (mail_stats): Handle NULL value. * src/triplet.c (try_timer_var): Don't exit on errors. Handle timer:spool:X:Y properly. (wy_expand_string): Don't exit on errors. Improve error reporting. * src/wydawca.c (wy_stat_expansion): Return after successful expansion.
2020-04-25Fix eventual simultaneous access to the triplet.Sergey Poznyakoff5
The triplet could have been modified by the triplet_remove_file function invoked from the watcher on file delete or moved_from event, triggered by the normal install procedure. * src/wydawca.h (struct wy_triplet): Replace the destroying member with in_processing. * src/triplet.c (triplet_enqueue): Set the "in_processing" member. (remove_triplet_unlocked): Remove the "destroying" flag. (triplet_remove_file): If in_processing is set, don't touch the triplet. * src/directive.c (process_directives): Remove the "destroying" flag. * src/timer.c (timer_stop): Use timer_get to ensure timing is computed. * src/watcher.c: Remove unused structure member.
2020-04-24Adjust thread namesSergey Poznyakoff2
2020-04-24Set thread names (and fix previos incomplete commit.Sergey Poznyakoff6
* Makefile.am: Restore ACLOCAL_AMFLAGS * configure.ac: Restore AC_CONFIG_MACRO_DIR. Call AC_USE_SYSTEM_EXTENSIONS and AX_THREAD_NAMES * am/ax_thread_names.m4: New file. * src/thread_name.c: New file. * src/Makefile.am: Add thread_name.c * src/wydawca.h (wy_set_cur_thread_name): New proto. * src/net.c: Set thread names. * src/triplet.c: Likewise. * src/wydawca.c: Likewise.
2020-04-24Use AX_PTHREAD to detect posix thread supportSergey Poznyakoff1
2020-04-23Remove a left-over global variableSergey Poznyakoff6
2020-04-23Rewrite the testsuite.Sergey Poznyakoff5
Use gpg2 to create the keys, and sign files as necessary. * NEWS: Update. * doc/wydawca.texi: Update. * configure.ac: Detect the presence of GPG version 2. * src/cmdline.opt (--single-process): Remove. * src/config.c: Remove the "single-process" statement. * src/triplet.c (triplet_enqueue): Fix eventual NULL dereference. (wy_triplet_wait): Update the WY_STAT_INCOMPLETE_TRIPLETS counter. * src/wydawca.c (single_process_option): Remove global. * src/wydawca.h (single_process): Remove global. * tests/.gitignore: Update. * tests/Makefile.am: Update. * tests/atlocal.in: Rewrite. * tests/chargen.c: New auxiliary tool * tests/dist/file: Remove. * tests/dist/file.directive.asc: Remove. * tests/dist/file.sig: Remove. * tests/dist/file12f.directive.asc: Remove. * tests/dist/file12t.directive.asc: Reemove. * tests/dist/rmsymlink.directive.asc: Remove. * tests/dist/symlink.directive.asc: Remove. * tests/etc/notify.cfin: Rename to tests/etc/notify.cf * tests/etc/Makefile.am: Update. * tests/etc/dbgen.sh: New file. * tests/etc/keygen.sh: New file. * tests/etc/project: New file. * tests/etc/pubring.asc: Remove. * tests/etc/secring.asc: Remove. * tests/etc/wydawca.cfin: Remove. * tests/*.at: Rewrite.
2020-04-22Avoid double-checking of the directive files. Fix triplet expiration.Sergey Poznyakoff5
* doc/wydawca.texi: Document the default value for file-sweep-time. * src/config.c (parse_single_statmask): Remove the invert pointer. (parse_statmask): Reflect the above. (config_finish): Ensure safe value for file_sweep_time. * src/triplet.c (register_file): Initialize the directive_verified member. (triplet_expired_p): No special handling for ttl==0. * src/verify.c (verify_directive_file): Cache the result in trp->directive_verified. * src/wydawca.c (file_sweep_time): Initialize to DEFAULT_FILE_SWEEP_TIME. * src/wydawca.h (DEFAULT_FILE_SWEEP_TIME): New constant. (DIRECTIVE_UNCHECKED,DIRECTIVE_GOOD) (DIRECTIVE_BAD): New constants. (struct wy_triplet): New member: directive_verified. * tests/cwdrepl.c: Fix a prematurely closed comment.
2020-04-20Add tests for legacy upload notification interfaceSergey Poznyakoff1
* src/net.c (handle_connection): Ignore user/comment. * tests/.gitignore: Add wyclt. * tests/wyclt.c: New file. * tests/Makefile.am (TESTSUITE_AT): Add new tests. * tests/unp-idle.at: New test. * tests/unp00.at: New test. * tests/unp01.at: New test. * tests/testsuite.at (AT_WYDAWCA_DAEMON): Change arguments. (AT_WYDAWCA_INOTIFY_DAEMON): New macro. Include new tests.
2020-04-20Rewrite the timer support.Sergey Poznyakoff6
Timers are kept in a thread-specific array variable. Spool timers are referenced in expansion strings by their fully qualified names, e.g. ${timer:spool:release:system}. * NEWS: Update. * doc/wydawca.texi: Document new syntax for the spool timer variables. * src/directive.c * src/wydawca.h (struct spool): New member: timer_id. * tests/upload-dry.at: Filter out certain messages, that can appear * src/process.c (spool_count): New global. (register_spool): Build spool list in the same order as listed in the configuration file. (spool_timer_id): New function. * src/timer.c: Rewrite using array of struct timer_slot, instead of the hash table. * src/triplet.c (try_timer_var): Rewrite. * src/wydawca.c (stderr_printer): Protect stderr by a mutex. in unpredictable order.
2020-04-18Modify pidfile functionsSergey Poznyakoff3
2020-04-18Fix statistics gathering. Display stats at the end of the run in cron mode.Sergey Poznyakoff5
* src/directive.c (process_directives): Raise the 'destroying' flag prior to removing the directive file, in order to avoid the removal being caught by the watcher thread. * src/timer.c (wydawca_stats_export, wydawca_stats_update): New functions. * src/triplet.c (triplet_list_lock,triplet_list_unlock): Check for NULL pointer. (remove_triplet_unlocked): Set the 'destroying' flag. (triplet_remove_file): Do nothing if the 'destroying' flag is set. (wy_thr_triplet): Call logstats only in the daemon mode. Otherwise call wydawca_stats_update. * src/wydawca.c (wy_main): Call wydawca_stats_export at the beginning. Call logstats before exiting, unless in daemon mode. * src/wydawca.h (struct wy_triplet): New member: destroying. (wydawca_stats_export,wydawca_stats_update): New protos. * tests/check-fail.at: Update. * tests/check-notify.at: Update. * tests/upl12f.at: Update.
2020-04-18Remove spool lockingSergey Poznyakoff8
* NEWS: Document changes. * doc/wydawca.texi: Document changes. * src/Makefile.am: Remove lock.c * src/lock.c: Delete. * src/config.c: Remove the locking statement. * tests/etc/wydawca.cfin: Likewise. * src/wydawca.c: Check pidfile before startup, unless in dry-run mode. * src/wydawca.h: Remove prototypes of locking functions * src/process.c (scan_spool_unlocked): Merge into scan_spool. * src/timer.c (struct timer_slot): Use reference counter instead of timer state
2020-04-18Minor fixes.Sergey Poznyakoff2
* src/timer.c (struct timer_slot): New member: state. (timer_start,timer_stop): Keep track of the timer state. * src/triplet.c: Remove unneeded function.

Return to:

Send suggestions and report system problems to the System administrator.