client: accept rsync 3.4.1 --info/--debug category vocabulary

Accept the full rsync 3.4.1 --info (backup, del, flist, mount, nonreg,
progress, remove, symsafe) and --debug (acl, backup, bind, chdir, connect,
cmd, del, deltasum, dup, exit, filter, flist, fuzzy, genr, hash, hlink,
iconv, nstr, own, recv, send, time) vocabularies, plus the historical
syms/hl/owner aliases, with level suffixes.  Categories FastSync already
emits (copy/name/misc/skip/stats and io/proto/pack/util) still set their
log flags; the rest are accepted but silent.  Unknown names remain
rejected by name, matching rsync.  Update the CLI unit tests and the
rsync-parity integration tests (previously they required del/filter to be
rejected).
This commit is contained in:
2026-09-17 01:16:39 +02:00
parent 5efa0dba7c
commit 36375010d3
4 changed files with 149 additions and 46 deletions
+20 -1
View File
@@ -776,7 +776,7 @@ static void test_parse_args_debug_help() {
}
static void test_parse_args_debug_flags_validation() {
static const char* const values[] = {"", "io,", ",io", "io,,proto", "acl", "tls", "unknown"};
static const char* const values[] = {"", "io,", ",io", "io,,proto", "tls", "unknown"};
for (size_t i = 0; i < sizeof(values) / sizeof(values[0]); i++) {
Config* cfg = config_create();
char option[64];
@@ -1345,6 +1345,24 @@ static void test_parse_args_info_name_and_help() {
config_delete(cfg);
}
/* rsync 3.4.1's remaining --info/--debug categories parse successfully but
* have no FastSync output wired to them, so they must not set any log flag. */
static void test_parse_args_rsync_flag_vocabulary_accepted() {
Config* cfg = config_create();
char* argv[] = {"fastsync", "--info=backup,del,flist,mount,nonreg,progress,remove,symsafe,syms",
"--debug=acl,backup,bind,chdir,cmd,connect,del,deltasum,dup,exit,"
"filter,flist,fuzzy,genr,hash,hlink,iconv,nstr,own,recv,send,time,"
"hl,owner",
"/src", "/dst"};
int positional_args[2];
int positional_count = 0;
EXPECT_EQ_INT(parse_args(cfg, 4, argv, positional_args, &positional_count), 0);
EXPECT_EQ_INT(cfg->info_level, 0);
EXPECT_EQ_INT(cfg->debug_level, 0);
config_delete(cfg);
}
/* Test parse_args with --archive flag */
/* rsync accepts a trailing level digit on --debug/--info items (e.g. io2,
* all4); level 0 silences the item. */
@@ -4441,6 +4459,7 @@ void test_client_cli() {
test_parse_args_debug_flags();
test_parse_args_debug_help();
test_parse_args_debug_flags_validation();
test_parse_args_rsync_flag_vocabulary_accepted();
test_parse_args_debug_info_levels();
test_parse_args_modify_window();
test_parse_args_rejects_invalid_modify_window();