diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-07-20 14:55:38 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-07-20 14:55:38 +0300 |
commit | f338532e1ae9b79c666d2ff66cc8be33ab7e5759 (patch) | |
tree | c67afd62dd2e7ac0eec28c95fc8d9af71bf0130c /src/backup.c | |
parent | dd9d9c1240774e21c7eb50052225ff1e4cc376ee (diff) | |
download | wydawca-f338532e1ae9b79c666d2ff66cc8be33ab7e5759.tar.gz wydawca-f338532e1ae9b79c666d2ff66cc8be33ab7e5759.tar.bz2 |
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) <metadata>: New member.
(wydawca_runas): New extern.
* tests/etc/wydawca.rcin: Add create-directories statement.
* tests/upload-dry.at: Fix expected output.
Diffstat (limited to 'src/backup.c')
-rw-r--r-- | src/backup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backup.c b/src/backup.c index 64902f7..0bf6c63 100644 --- a/src/backup.c +++ b/src/backup.c @@ -18,7 +18,7 @@ char const *simple_backup_suffix = "~"; -static const char * +const char * split_filename(char const *file, char **pdir) { const char *p = strrchr(file, '/'); |