From f338532e1ae9b79c666d2ff66cc8be33ab7e5759 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sat, 20 Jul 2019 14:55:38 +0300 Subject: Create backup storage directories. Any spool directories are actually created only if create-directories yes; appears in the configuration file. The global directory-mode and directory-owner statements provide global defaults for the directory metadata. These two keywords can also appear within a spool.archive block. * src/backup.c (split_filename): Change to extern. * src/config.c: Global directory-mode and directory-owner statements. New global statement create-directories. spool.archive.directory-mode and directory-owner statements. (cb_user,cb_supp_groups): Set wydawca_runas. (create_spool_dir): Don't mkdir unless create-directories was set. Honor wy_dry_run. Don't bail out on EPERM wheb uid is not 0. (create_spool_dirs): Compute effective metadata. Create archive directories. * src/diskio.c (create_hierarchy): Fix stack overflow if baselen==0. * src/wydawca.c (wydawca_runas): New global. (main): Intitialize wydawca_uid and wydawca_gid to current values. Run wydawca_userprivs only if wydawca_runas is set. * src/wydawca.h (archive_descr) : New member. (wydawca_runas): New extern. * tests/etc/wydawca.rcin: Add create-directories statement. * tests/upload-dry.at: Fix expected output. --- tests/etc/wydawca.rcin | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/etc') diff --git a/tests/etc/wydawca.rcin b/tests/etc/wydawca.rcin index a655537..369ddc2 100644 --- a/tests/etc/wydawca.rcin +++ b/tests/etc/wydawca.rcin @@ -63,6 +63,8 @@ dictionary project-uploader { "-----END PGP PUBLIC KEY BLOCK-----\n"); } +create-directories yes; + spool test { url ftp://wydawca.test; source "@WY_SRC@/test"; -- cgit v1.2.1