From: Dan Callaghan <dan@bl2.djc.id.au>
To: sup-commits@supmua.dev
Subject: [sup.git] 07/08: clean up directory traversal in Maildir#poll
Date: Sat, 28 Nov 2026 17:13:42 +1100 [thread overview]
Message-ID: <20261128061335.EC1652D45D5@bl2.djc.id.au> (raw)
In-Reply-To: <179584641514.302139.17817016268117078700@bl2.djc.id.au>
New commit on branch develop:
https://supmua.dev/git/sup/commit/f096837ab5e6e700092784117ada2b93bc6e5033.html
commit f096837ab5e6e700092784117ada2b93bc6e5033
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Sun Nov 22 18:09:11 2026 +1100
clean up directory traversal in Maildir#poll
---
lib/sup/maildir.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
index 488698f1..ac61f577 100644
--- a/lib/sup/maildir.rb
+++ b/lib/sup/maildir.rb
@@ -130,8 +130,8 @@ class Maildir < Source
old_ids = benchmark(:maildir_read_index) { Index.instance.enum_for(:each_source_info, self.id, "#{d}/").to_a }
new_ids = benchmark(:maildir_read_dir) {
Dir.open(subdir).select {
- |f| !File.directory? f}.map {
- |x| File.join(d,File.basename(x)) }.sort }
+ |f| !File.directory? File.join(subdir, f) }.map {
+ |f| File.join(d, f) }.sort }
added += new_ids - old_ids
deleted += old_ids - new_ids
debug "#{old_ids.size} in index, #{new_ids.size} in filesystem"
next prev parent reply other threads:[~2026-11-28 6:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 6:13 [sup.git] branch develop updated (ce27c933 -> 53f07beb) Dan Callaghan
2026-11-28 6:13 ` [sup.git] 01/08: delete dead report_broken_sources method Dan Callaghan
2026-11-28 6:13 ` [sup.git] 02/08: sup-sync-back-maildir: remove broken negative short options Dan Callaghan
2026-11-28 6:13 ` [sup.git] 03/08: show both raw and encoded sizes of attachments Dan Callaghan
2026-11-28 6:13 ` [sup.git] 04/08: shell escape bounce destination addresses Dan Callaghan
2026-11-28 6:13 ` [sup.git] 05/08: call setlocale() through ncurses bindings instead of fiddle Dan Callaghan
2026-11-28 6:13 ` [sup.git] 06/08: use libmagic to detect attachment MIME types Dan Callaghan
2026-11-28 6:13 ` Dan Callaghan [this message]
2026-11-28 6:13 ` [sup.git] 08/08: bring back sup-recover-sources from the dead Dan Callaghan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261128061335.EC1652D45D5@bl2.djc.id.au \
--to=dan@bl2.djc.id.au \
--cc=djc@djc.id.au \
--cc=sup-commits@supmua.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox