* [committed] libstdc++: Reset filesystem::recursive_directory_iterator on error
@ 2022-02-01 21:59 Jonathan Wakely
2022-02-02 0:09 ` Jonathan Wakely
2022-02-02 20:47 ` Jonathan Wakely
0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Wakely @ 2022-02-01 21:59 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested powerpc64le-linux, pushed to trunk.
The standard requires directory iterators to become equal to the end
iterator value if they report an error. Some members functions of
filesystem::recursive_directory_iterator fail to do that.
libstdc++-v3/ChangeLog:
* src/c++17/fs_dir.cc (recursive_directory_iterator::increment):
Reset state to past-the-end iterator on error.
(fs::recursive_directory_iterator::pop(error_code&)): Likewise.
(fs::recursive_directory_iterator::pop()): Check _M_dirs before
it might get reset.
* src/filesystem/dir.cc (recursive_directory_iterator): Likewise,
for the TS implementation.
* testsuite/27_io/filesystem/iterators/error_reporting.cc: New test.
* testsuite/experimental/filesystem/iterators/error_reporting.cc: New test.
---
libstdc++-v3/src/c++17/fs_dir.cc | 12 +-
libstdc++-v3/src/filesystem/dir.cc | 12 +-
.../filesystem/iterators/error_reporting.cc | 135 +++++++++++++++++
.../filesystem/iterators/error_reporting.cc | 136 ++++++++++++++++++
4 files changed, 291 insertions(+), 4 deletions(-)
create mode 100644 libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
create mode 100644 libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
diff --git a/libstdc++-v3/src/c++17/fs_dir.cc b/libstdc++-v3/src/c++17/fs_dir.cc
index e050304c19a..149a8b0740c 100644
--- a/libstdc++-v3/src/c++17/fs_dir.cc
+++ b/libstdc++-v3/src/c++17/fs_dir.cc
@@ -311,6 +311,10 @@ fs::recursive_directory_iterator::increment(error_code& ec)
return *this;
}
}
+
+ if (ec)
+ _M_dirs.reset();
+
return *this;
}
@@ -334,16 +338,20 @@ fs::recursive_directory_iterator::pop(error_code& ec)
ec.clear();
return;
}
- } while (!_M_dirs->top().advance(skip_permission_denied, ec));
+ } while (!_M_dirs->top().advance(skip_permission_denied, ec) && !ec);
+
+ if (ec)
+ _M_dirs.reset();
}
void
fs::recursive_directory_iterator::pop()
{
+ const bool dereferenceable = _M_dirs != nullptr;
error_code ec;
pop(ec);
if (ec)
- _GLIBCXX_THROW_OR_ABORT(filesystem_error(_M_dirs
+ _GLIBCXX_THROW_OR_ABORT(filesystem_error(dereferenceable
? "recursive directory iterator cannot pop"
: "non-dereferenceable recursive directory iterator cannot pop",
ec));
diff --git a/libstdc++-v3/src/filesystem/dir.cc b/libstdc++-v3/src/filesystem/dir.cc
index d5b11f25297..ac9e70da516 100644
--- a/libstdc++-v3/src/filesystem/dir.cc
+++ b/libstdc++-v3/src/filesystem/dir.cc
@@ -298,6 +298,10 @@ fs::recursive_directory_iterator::increment(error_code& ec) noexcept
return *this;
}
}
+
+ if (ec)
+ _M_dirs.reset();
+
return *this;
}
@@ -321,16 +325,20 @@ fs::recursive_directory_iterator::pop(error_code& ec)
ec.clear();
return;
}
- } while (!_M_dirs->top().advance(skip_permission_denied, ec));
+ } while (!_M_dirs->top().advance(skip_permission_denied, ec) && !ec);
+
+ if (ec)
+ _M_dirs.reset();
}
void
fs::recursive_directory_iterator::pop()
{
+ const bool dereferenceable = _M_dirs != nullptr;
error_code ec;
pop(ec);
if (ec)
- _GLIBCXX_THROW_OR_ABORT(filesystem_error(_M_dirs
+ _GLIBCXX_THROW_OR_ABORT(filesystem_error(dereferenceable
? "recursive directory iterator cannot pop"
: "non-dereferenceable recursive directory iterator cannot pop",
ec));
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc b/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
new file mode 100644
index 00000000000..81ef1069367
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
@@ -0,0 +1,135 @@
+// Copyright (C) 2020-2022 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do run { target { c++17 } } }
+// { dg-require-filesystem-ts "" }
+
+#include <filesystem>
+#include <cerrno>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+int choice;
+
+struct dirent global_dirent;
+
+extern "C" struct dirent* readdir(DIR*)
+{
+ switch (choice)
+ {
+ case 1:
+ global_dirent.d_ino = 999;
+ global_dirent.d_type = DT_REG;
+ global_dirent.d_reclen = 0;
+ std::char_traits<char>::copy(global_dirent.d_name, "file", 5);
+ choice = 0;
+ return &global_dirent;
+ case 2:
+ global_dirent.d_ino = 111;
+ global_dirent.d_type = DT_DIR;
+ global_dirent.d_reclen = 60;
+ std::char_traits<char>::copy(global_dirent.d_name, "subdir", 7);
+ choice = 1;
+ return &global_dirent;
+ default:
+ errno = EIO;
+ return nullptr;
+ }
+ return &global_dirent;
+}
+
+void
+test01()
+{
+ namespace fs = std::filesystem;
+ std::error_code ec;
+ choice = 1;
+ fs::recursive_directory_iterator it(".", ec);
+ if (choice == 0) // custom readdir was called
+ {
+ it.increment(ec);
+ VERIFY( ec.value() == EIO );
+ VERIFY( it == end(it) );
+ }
+ else
+ {
+ puts("Custom readdir not used, cannot test error handling");
+ exit(0);
+ }
+
+#if __cpp_exceptions
+ choice = 1;
+ fs::recursive_directory_iterator it2(".", ec);
+ if (choice == 0)
+ {
+ try {
+ ++it2;
+ VERIFY( false );
+ } catch (const fs::filesystem_error& e) {
+ VERIFY( e.code().value() == EIO );
+ VERIFY( it2 == end(it2) );
+ }
+ }
+#endif
+}
+
+void
+test02()
+{
+ namespace fs = std::filesystem;
+ auto dir = __gnu_test::nonexistent_path();
+ fs::create_directories(dir/"subdir");
+
+ std::error_code ec;
+ choice = 2;
+ fs::recursive_directory_iterator it(dir, ec);
+ if (choice == 1)
+ {
+ ++it;
+ it.pop(ec);
+ VERIFY( ec.value() == EIO );
+ VERIFY( it == end(it) );
+ }
+
+#if __cpp_exceptions
+ choice = 2;
+ fs::recursive_directory_iterator it2(dir, ec);
+ if (choice == 1)
+ {
+ ++it2;
+ try {
+ it2.pop();
+ VERIFY( false );
+ } catch (const fs::filesystem_error& e) {
+ VERIFY( e.code().value() == EIO );
+ VERIFY( it2 == end(it2) );
+ }
+ }
+#endif
+
+ fs::remove_all(dir, ec);
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc b/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
new file mode 100644
index 00000000000..ade62732028
--- /dev/null
+++ b/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
@@ -0,0 +1,136 @@
+// Copyright (C) 2020-2022 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-DUSE_FILESYSTEM_TS -lstdc++fs" }
+// { dg-do run { target { c++11 } } }
+// { dg-require-filesystem-ts "" }
+
+#include <experimental/filesystem>
+#include <cerrno>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <testsuite_hooks.h>
+#include <testsuite_fs.h>
+
+int choice;
+
+struct dirent global_dirent;
+
+extern "C" struct dirent* readdir(DIR*)
+{
+ switch (choice)
+ {
+ case 1:
+ global_dirent.d_ino = 999;
+ global_dirent.d_type = DT_REG;
+ global_dirent.d_reclen = 0;
+ std::char_traits<char>::copy(global_dirent.d_name, "file", 5);
+ choice = 0;
+ return &global_dirent;
+ case 2:
+ global_dirent.d_ino = 111;
+ global_dirent.d_type = DT_DIR;
+ global_dirent.d_reclen = 60;
+ std::char_traits<char>::copy(global_dirent.d_name, "subdir", 7);
+ choice = 1;
+ return &global_dirent;
+ default:
+ errno = EIO;
+ return nullptr;
+ }
+ return &global_dirent;
+}
+
+void
+test01()
+{
+ namespace fs = std::experimental::filesystem;
+ std::error_code ec;
+ choice = 1;
+ fs::recursive_directory_iterator it(".", ec);
+ if (choice == 0) // custom readdir was called
+ {
+ it.increment(ec);
+ VERIFY( ec.value() == EIO );
+ VERIFY( it == end(it) );
+ }
+ else
+ {
+ puts("Custom readdir not used, cannot test error handling");
+ exit(0);
+ }
+
+#if __cpp_exceptions
+ choice = 1;
+ fs::recursive_directory_iterator it2(".", ec);
+ if (choice == 0) // custom readdir was called
+ {
+ try {
+ ++it2;
+ VERIFY( false );
+ } catch (const fs::filesystem_error& e) {
+ VERIFY( e.code().value() == EIO );
+ VERIFY( it2 == end(it2) );
+ }
+ }
+#endif
+}
+
+void
+test02()
+{
+ namespace fs = std::experimental::filesystem;
+ auto dir = __gnu_test::nonexistent_path();
+ fs::create_directories(dir/"subdir");
+
+ std::error_code ec;
+ choice = 2;
+ fs::recursive_directory_iterator it(dir, ec);
+ if (choice == 1)
+ {
+ ++it;
+ it.pop(ec);
+ VERIFY( ec.value() == EIO );
+ VERIFY( it == end(it) );
+ }
+
+#if __cpp_exceptions
+ choice = 2;
+ fs::recursive_directory_iterator it2(dir, ec);
+ if (choice == 1)
+ {
+ ++it2;
+ try {
+ it2.pop();
+ VERIFY( false );
+ } catch (const fs::filesystem_error& e) {
+ VERIFY( e.code().value() == EIO );
+ VERIFY( it2 == end(it2) );
+ }
+ }
+#endif
+
+ fs::remove_all(dir, ec);
+}
+
+int
+main()
+{
+ test01();
+ test02();
+}
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [committed] libstdc++: Reset filesystem::recursive_directory_iterator on error
2022-02-01 21:59 [committed] libstdc++: Reset filesystem::recursive_directory_iterator on error Jonathan Wakely
@ 2022-02-02 0:09 ` Jonathan Wakely
2022-02-02 20:47 ` Jonathan Wakely
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2022-02-02 0:09 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: libstdc++, gcc Patches
[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]
On Tue, 1 Feb 2022 at 22:00, Jonathan Wakely via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> The standard requires directory iterators to become equal to the end
> iterator value if they report an error. Some members functions of
> filesystem::recursive_directory_iterator fail to do that.
>
> libstdc++-v3/ChangeLog:
>
> * src/c++17/fs_dir.cc (recursive_directory_iterator::increment):
> Reset state to past-the-end iterator on error.
> (fs::recursive_directory_iterator::pop(error_code&)): Likewise.
> (fs::recursive_directory_iterator::pop()): Check _M_dirs before
> it might get reset.
> * src/filesystem/dir.cc (recursive_directory_iterator): Likewise,
> for the TS implementation.
> * testsuite/27_io/filesystem/iterators/error_reporting.cc: New test.
> * testsuite/experimental/filesystem/iterators/error_reporting.cc: New test.
> ---
> libstdc++-v3/src/c++17/fs_dir.cc | 12 +-
> libstdc++-v3/src/filesystem/dir.cc | 12 +-
> .../filesystem/iterators/error_reporting.cc | 135 +++++++++++++++++
> .../filesystem/iterators/error_reporting.cc | 136 ++++++++++++++++++
> 4 files changed, 291 insertions(+), 4 deletions(-)
> create mode 100644 libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
> create mode 100644 libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
>
[...]
> +
> +extern "C" struct dirent* readdir(DIR*)
> +{
> + switch (choice)
> + {
> + case 1:
> + global_dirent.d_ino = 999;
> + global_dirent.d_type = DT_REG;
These new tests should not use the d_type member unless it's actually
present on the OS. Fixed by the attached patch.
Tested x86_64-linux and mingw-w64, pushed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2548 bytes --]
commit d98668eb06f532b2dbe0c721fa1b9ed6e643df27
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Feb 1 23:58:08 2022
libstdc++: Do not use dirent::d_type unconditionally
These new tests should not use the d_type member unless it's actually
present on the OS.
libstdc++-v3/ChangeLog:
* testsuite/27_io/filesystem/iterators/error_reporting.cc: Use
autoconf macro to check whether d_type is present.
* testsuite/experimental/filesystem/iterators/error_reporting.cc:
Likewise.
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc b/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
index 81ef1069367..1f297a731a3 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
@@ -36,14 +36,18 @@ extern "C" struct dirent* readdir(DIR*)
{
case 1:
global_dirent.d_ino = 999;
+#if defined _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE && defined DT_REG
global_dirent.d_type = DT_REG;
+#endif
global_dirent.d_reclen = 0;
std::char_traits<char>::copy(global_dirent.d_name, "file", 5);
choice = 0;
return &global_dirent;
case 2:
global_dirent.d_ino = 111;
+#if defined _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE && defined DT_DIR
global_dirent.d_type = DT_DIR;
+#endif
global_dirent.d_reclen = 60;
std::char_traits<char>::copy(global_dirent.d_name, "subdir", 7);
choice = 1;
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc b/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
index ade62732028..806c511ebef 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
@@ -37,14 +37,18 @@ extern "C" struct dirent* readdir(DIR*)
{
case 1:
global_dirent.d_ino = 999;
+#if defined _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE && defined DT_REG
global_dirent.d_type = DT_REG;
+#endif
global_dirent.d_reclen = 0;
std::char_traits<char>::copy(global_dirent.d_name, "file", 5);
choice = 0;
return &global_dirent;
case 2:
global_dirent.d_ino = 111;
+#if defined _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE && defined DT_DIR
global_dirent.d_type = DT_DIR;
+#endif
global_dirent.d_reclen = 60;
std::char_traits<char>::copy(global_dirent.d_name, "subdir", 7);
choice = 1;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [committed] libstdc++: Reset filesystem::recursive_directory_iterator on error
2022-02-01 21:59 [committed] libstdc++: Reset filesystem::recursive_directory_iterator on error Jonathan Wakely
2022-02-02 0:09 ` Jonathan Wakely
@ 2022-02-02 20:47 ` Jonathan Wakely
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2022-02-02 20:47 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: libstdc++, gcc Patches
[-- Attachment #1: Type: text/plain, Size: 2747 bytes --]
On Tue, 1 Feb 2022 at 22:00, Jonathan Wakely via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Tested powerpc64le-linux, pushed to trunk.
>
>
> The standard requires directory iterators to become equal to the end
> iterator value if they report an error. Some members functions of
> filesystem::recursive_directory_iterator fail to do that.
>
> libstdc++-v3/ChangeLog:
>
> * src/c++17/fs_dir.cc (recursive_directory_iterator::increment):
> Reset state to past-the-end iterator on error.
> (fs::recursive_directory_iterator::pop(error_code&)): Likewise.
> (fs::recursive_directory_iterator::pop()): Check _M_dirs before
> it might get reset.
> * src/filesystem/dir.cc (recursive_directory_iterator): Likewise,
> for the TS implementation.
> * testsuite/27_io/filesystem/iterators/error_reporting.cc: New test.
> * testsuite/experimental/filesystem/iterators/error_reporting.cc: New test.
> ---
> libstdc++-v3/src/c++17/fs_dir.cc | 12 +-
> libstdc++-v3/src/filesystem/dir.cc | 12 +-
> .../filesystem/iterators/error_reporting.cc | 135 +++++++++++++++++
> .../filesystem/iterators/error_reporting.cc | 136 ++++++++++++++++++
> 4 files changed, 291 insertions(+), 4 deletions(-)
> create mode 100644 libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
> create mode 100644 libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
>
> diff --git a/libstdc++-v3/src/c++17/fs_dir.cc b/libstdc++-v3/src/c++17/fs_dir.cc
> index e050304c19a..149a8b0740c 100644
> --- a/libstdc++-v3/src/c++17/fs_dir.cc
> +++ b/libstdc++-v3/src/c++17/fs_dir.cc
> @@ -311,6 +311,10 @@ fs::recursive_directory_iterator::increment(error_code& ec)
> return *this;
> }
> }
> +
> + if (ec)
> + _M_dirs.reset();
> +
> return *this;
> }
>
> @@ -334,16 +338,20 @@ fs::recursive_directory_iterator::pop(error_code& ec)
> ec.clear();
> return;
> }
> - } while (!_M_dirs->top().advance(skip_permission_denied, ec));
> + } while (!_M_dirs->top().advance(skip_permission_denied, ec) && !ec);
> +
> + if (ec)
> + _M_dirs.reset();
> }
>
> void
> fs::recursive_directory_iterator::pop()
> {
> + const bool dereferenceable = _M_dirs != nullptr;
> error_code ec;
> pop(ec);
> if (ec)
> - _GLIBCXX_THROW_OR_ABORT(filesystem_error(_M_dirs
> + _GLIBCXX_THROW_OR_ABORT(filesystem_error(dereferenceable
> ? "recursive directory iterator cannot pop"
> : "non-dereferenceable recursive directory iterator cannot pop",
> ec));
This gives -Wunused warnings when libstdc++ is built with exceptions disabled.
Fixed by the attached, pushed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1655 bytes --]
commit 2905e1af94519b7ba3c43a57af8a7d5e10815950
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Feb 2 11:40:28 2022
libstdc++: Fix -Wunused-variable warning for -fno-exceptions build
If _GLIBCXX_THROW_OR_ABORT expands to just __builtin_abort() then the
bool variable used in the filesystem_error constructor is unused. Mark
it as maybe_unused to there's no warning for -fno-exceptions builds.
libstdc++-v3/ChangeLog:
* src/c++17/fs_dir.cc (fs::recursive_directory_iterator::pop):
Add [[maybe_unused]] attribute.
* src/filesystem/dir.cc (fs::recursive_directory_iterator::pop):
Likewise.
diff --git a/libstdc++-v3/src/c++17/fs_dir.cc b/libstdc++-v3/src/c++17/fs_dir.cc
index 149a8b0740c..a77aabb6dcc 100644
--- a/libstdc++-v3/src/c++17/fs_dir.cc
+++ b/libstdc++-v3/src/c++17/fs_dir.cc
@@ -347,7 +347,7 @@ fs::recursive_directory_iterator::pop(error_code& ec)
void
fs::recursive_directory_iterator::pop()
{
- const bool dereferenceable = _M_dirs != nullptr;
+ [[maybe_unused]] const bool dereferenceable = _M_dirs != nullptr;
error_code ec;
pop(ec);
if (ec)
diff --git a/libstdc++-v3/src/filesystem/dir.cc b/libstdc++-v3/src/filesystem/dir.cc
index ac9e70da516..7cf8e62b5e6 100644
--- a/libstdc++-v3/src/filesystem/dir.cc
+++ b/libstdc++-v3/src/filesystem/dir.cc
@@ -334,7 +334,7 @@ fs::recursive_directory_iterator::pop(error_code& ec)
void
fs::recursive_directory_iterator::pop()
{
- const bool dereferenceable = _M_dirs != nullptr;
+ [[maybe_unused]] const bool dereferenceable = _M_dirs != nullptr;
error_code ec;
pop(ec);
if (ec)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-02 20:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01 21:59 [committed] libstdc++: Reset filesystem::recursive_directory_iterator on error Jonathan Wakely
2022-02-02 0:09 ` Jonathan Wakely
2022-02-02 20:47 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).