A test is added to verify this check.
next;
}
+ # Do not allow directories to be implied with overlength names.
+ if (grep length > MAX_FILE_NAME_LEN, @dirs) {
+ push @errors, "directory name too long, in $val";
+ push @trace, [' ^--', 'a component of this name is too long'];
+ next;
+ }
+
# Only let them specify one directory directive.
if (defined $header{directory}) {
push @errors,
# Tests for processing standalone directives
-# Copyright (C) 2021, 2022 Jacob Bachmeyer
+# Copyright (C) 2021, 2022, 2023 Jacob Bachmeyer
#
# This file is part of a testsuite for the GNU FTP upload system.
#
ftp-upload-script@gnu.org ftp-upload-report@gnu.org
}
+check_loose_directive "bogus: signed with wrong key and too long" [list \
+ directive [subst {
+ version 1.2
+ directory foo/[string repeat long 100]/bar
+ no-op ""
+ comment "do nothing"
+ }] dsig { good 01 1001 }] file-tree {
+ { inbox stage pub archive } empty {}
+ { scratch } files { .foo.directive.asc }
+} log {
+ validate,bad-directory-length "excessively long directory name rejected"
+} email-to {
+ ftp-upload-script@gnu.org ftp-upload-report@gnu.org
+}
+
check_loose_directive "bogus: signed for bogus package" {
directive {
version 1.2
# DejaGnu tool init file for GNU FTP upload handler tests
-# Copyright (C) 2021, 2022 Jacob Bachmeyer
+# Copyright (C) 2021, 2022, 2023 Jacob Bachmeyer
#
# This file is part of a testsuite for the GNU FTP upload system.
#
set A(validate,bad-directory-depth,$expect_out(1,string)) 1
exp_continue
}
+ -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\
+ directory name too long, in [^\r\n]+} {
+ # from interpret_directive, when a name is too long
+ set A(validate,bad-directory-length) 1
+ exp_continue
+ }
-re {^gatekeeper\[[0-9]+\]: \(Test\) \[PS\]\
Only one directory directive is allowed per [^\r\n]+} {
# from parse_directory_line, if directory repeated