Home | History | Annotate | Download | only in mail
History log of /src/usr.bin/mail/thread.c
RevisionDateAuthorComments
 1.16  23-Aug-2023  rin mail: Fix regression for recent use-after-free fix

For makemessage(), do not skip thread_fix_old_links() for
newly-allocated message as before.

Thanks jun@ for report.
 1.15  10-Aug-2023  mrg avoid various use-after-free issues.

create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns. for pdisk(), realloc() is a locally inlind malloc()
and free() pair.

for mail(1), this required a little bit more effort as the old pointer
was passed into another file for fix-ups there, and that code needed to
be adjusted for offset vs old pointer usage.

found by GCC 12.
 1.14  17-Dec-2021  kre Remove an unnecessary test for NULL (the same thing is done in the
following lines) along with an incorrect return of nothing if it is
found (the following version correctly returns NULL). Should unbreak build.
 1.13  17-Dec-2021  christos more protection from unset threads from RVP
 1.12  14-Dec-2021  christos Avoid NULL deref if there is no current thread. From RVP.
Prints "No applicable message"
 1.11  10-Sep-2021  rillig usr.bin: remove unnecessary lint comment CONSTCOND

Since 2021-01-31, lint no longer warns about 'do ... while (0)'.

No functional change.
 1.10  21-Oct-2012  christos don't check for i and use j.
 1.9  11-Apr-2009  christos branches: 1.9.6; 1.9.12;
- magic fix for short files
- knf
from Anon Ymous
 1.8  10-Apr-2009  christos From Anon Ymous:

- Remove all longjmp(3) calls from signal handlers. Instead, we post
to an internal signal queue and check that periodically. All signal
related code is now in sig.c, except for the SIGCHLD handler which
remains in popen.c as it is intimately tied to routines there.

- Handle SIGPIPE in type1() regardless of mime support, or else the
handler in execute() will prevent our error code from being returned
resulting in 'sawcom' not being set on the first command as it should.
This only affected the initial behavior of the "next" command without
mime support.

- Add the 'T' flag to many commands in cmdtab.c that should not look
like the first command. E.g., start mail on a mailbox with multiple
messages, run "set foo", then "next", and watch the second message get
displayed rather than the first as is the case without the first "set"
command.

- Add file descriptor and file handle leak detection. Enabled by
DEBUG_FILE_LEAK. This will likely disappear in the future.

- Fix a long standing (since import in 1993) longjmp() bug in
edstop(): the jmpbuf was invalid when quit() is called at the end of
main.

- Fix a long standing bug (since import in 1993) in snarf() where it
didn't strip whitespace correctly if the line consisted only of
whitespace.

- Lint cleanup.

- New Feature: "Header" command. This allows miscellaneous header
fields to be added to the header, e.g., "X-Organization:" or
"Reply-To:" fields.

- New Feature: "page-also" variable. This allows the specification of
additional commands to page. It is more flexible than "crt".

- Document the "pager-off" variable: if set, it disables paging
entirely.
 1.7  18-Jan-2009  lukem branches: 1.7.2;
fix -Wsign-compare issues
 1.6  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5  27-Apr-2008  christos Make sure the current message (dot) is set correctly when changing the
display state, i.e., hidden/exposed tags or threads. This fixes at
least two problems:

- If the current message is a duplicate that is deleted by the "deldups"
command, then the dot was invalid making all messages appear to have
been deleted. It is now set to the surviving duplicate message.

- If the current message is tagged, the "hidetags" command would leave
the dot invalid and the dislay would reset it at the top of the
current screen. It is now set the the first untagged (and
not deleted) message after the previous (tagged) dot message.

From Anon Ymous
 1.4  23-Oct-2007  christos branches: 1.4.6;
From Anon Ymous:
- Introduce date_to_tm() and hl_date_to_tm() to parse the date and
headline date a bit more efficiently.
- If 'tm_isdst' is determined, let strftime(3) handle the '%Z' and
'%z' formats. Otherwise, output "-0000" and "???", respectively, to
help preserve with alignment; strftime(3) will output an empty
string in these case.
- Change fail() to use the '-d' flag (which sets the 'debug' variable)
rather than the "debug" _environment_ variable. This is more
consistent with other warnings.
- Don't use gcc C extensions, e.g., "case LOW ... HIGH:".
- Define is_WSP() in def.h to be an inline function that for checks
whitespace (WSP = ' ' or '\t'), as defined in RFC 2822. Use it
consistently in place of isblank().
- For consistency, rename skip_blank() to skip_WSP().
- Add inline skip_space() to complement skip_blank() (now skip_WSP).
- Check all ctype(3) calls for argument range issues.
- Whitespace and comment cleanup/changes.
 1.3  05-Dec-2006  christos branches: 1.3.4;
fix a core-dump and do some more error checking via asserts. From Anon Ymous
 1.2  28-Nov-2006  christos branches: 1.2.2;
pointers should be either casted to intptr_t or even better not casted...
 1.1  28-Nov-2006  christos From Anon Ymous:

1) Statification of modules.

2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.

3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.

4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).

5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)

6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.

7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).

8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).

9) Extend paging to all commands (where relevant).

10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.

11) The manpage should follow soon!!!!
 1.2.2.1  19-Feb-2007  tron Pull up following revision(s) (requested by christos in ticket #454):
usr.bin/mail/thread.c: revision 1.3
fix a core-dump and do some more error checking via asserts. From Anon Ymous
 1.3.4.1  06-Nov-2007  matt sync with HEAD
 1.4.6.1  18-May-2008  yamt sync with head.
 1.7.2.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.9.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.6.1  30-Oct-2012  yamt sync with head

RSS XML Feed