Commit Graph

316 Commits

Author SHA1 Message Date
mrg 684b182f81 compare pointers with NULL not '\0'. 2019-02-01 08:29:03 +00:00
christos 2357fc5dd5 use SUBDIR.roff suggested by uwe@ 2018-06-10 17:55:11 +00:00
christos 45c59656f1 Remove Mail 2018-05-23 01:03:46 +00:00
mrg aa20739e7d fixes for GCC 6.4:
mail's execute() needs a volatile for setjmp().

telnet has a missing {} issue.

isdnd's print_config() has a missing/wrong {} issue, and
its p_q931bc() has inconsistent indentation (but not any
actual problem.)

map-mbone's accept_neighbors2() compares a vs. a instead
of a vs. b.

sysinst's pm_cgd_check() has missing {} issue.

timed's main() has missing {} issue.
2018-02-04 09:01:12 +00:00
christos 4fe1ef32f3 Only open regular files. 2017-11-09 20:27:50 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
christos 3cc72f8888 reset signal handler before returning. 2017-05-02 03:29:14 +00:00
abhinav 5abd78da99 Fix spelling: s/overritten/overwritten 2017-01-23 10:05:25 +00:00
sevan 39bbc68a3b Drop main() prototype. 2016-09-05 00:40:28 +00:00
christos cdc14da57c PR/50746: David Binderman: Check bounds before dereferencing. 2016-02-03 05:18:58 +00:00
christos 1ef9a127cf PR/50360: Thomas Klausner: Fix MKREPRO issue 2015-11-25 01:12:03 +00:00
christos da9061f1c7 fix infinite loop 2015-07-04 22:45:08 +00:00
christos eeda512b55 If we fail 5 times in a row, fail correctly (Steffen Nurpmeso). 2015-07-04 15:09:49 +00:00
christos 7d718eded8 one more stray \n 2015-06-17 00:03:42 +00:00
christos e8283fa6b1 fix wordexp result handling 2015-01-10 17:16:01 +00:00
christos ef0ab4422a fix incorrect arg size computation 2015-01-10 17:16:00 +00:00
christos 2a8765d5a2 Fix various security related issues:
0001. Do not recognize paths, mail folders, and pipes in mail addresses
    by default.  That avoids a direct command injection with syntactically
    valid email addresses starting with |.

    Such addresses can be specified both on the command line, the mail
    headers (with -t) or in address lines copied over from previous
    while replying.

    This was assigned CVE-2014-7844 for some versions of BSD mailx.  It is
    documented behavior for Heirloom mailx, and was mentioned in an old
    technical report about BSD mailx (which does not usually make its way
    into operating system installations).  The patch switches off this
    processing and updates the documentation.

Added expandaddr option to explicitly enable this behavior.

    0002. When invoking sendmail, prevent option processing for email
    address arguments.  This prevents changing e.g. the Postfix
    configuration file in unexpected ways.  This behavior was documented for
    BSD mailx (sort of), but not for Heirloom mailx.  We did not assign a
    CVE to this because it is more of a missing feature, and code invoking
    mailx needs adjustment in the caller as well.

Fixed.

    0003. Make wordexp support mandatory.  (No functional change.)

Fixed (replaced explicit shell pipe implementation).

    0004. Prevent command execution in the expand function, which is IMHO
    unexpected.  (Not really required with patch 1, and there is still
    information disclosure/DoS potential if this expansion occurs.)  This is
    a historic vulnerability already fixed in the Debian package,
    retroactively assigned CVE-2004-2771:

Fixed (as part of the pipe replacement with wordexp).
2014-12-16 19:30:24 +00:00
snj f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
christos dbe2f0f9f0 put back ua will fix differently. 2014-10-01 23:41:41 +00:00
christos 24c423bbde There is no \(ua in roff, you really mean \(ha (Circumflex-Accent) aka ^ 2014-09-30 20:54:11 +00:00
dholland b7b7574d3b Reorg docs, part 1:
Move all the reference manuals to subdirs of /usr/share/doc/reference.
We have subdirs ref1-ref9, corresponding to man page sections 1-9.

Everything that's the reference manual for a program (sections 1, 6,
8), C interface (sections 2, 3), driver or file system (section 4),
format or configuration (section 5), or kernel internal interface
(section 9) belongs in here.

Section 7 is a little less clear: some things that might go in section
7 if they were a man page aren't really reference manuals. So I'm only
putting things in reference section 7 that are (to me) clearly
reference material, rather than e.g. tutorials, guides, FAQs, etc.
This obviously leaves some room for debate, especially without first
editing the docs with this distinction in mind, but if people hate
what I've done things can always be moved again.

Note also that while roff macro man pages traditionally go in section
7, I have put all the roff documentation (macros, tools, etc.) in one
place in reference/ref1/roff. This will make it easier to find and
also easier to edit it into some kind of coherent form.
2014-07-05 19:22:41 +00:00
dholland c3ab26950f Rework /usr/share/doc.
Update the <bsd.doc.mk> infrastructure, and update the docs to match
the new infrastructure.

- Build and install text, ps, pdf, and/or html, not roff sources.

- Don't wire the chapter numbers into the build system, or use them in
the installed pathnames. This didn't matter much when the docs were a
museum, but now that we're theoretically going to start maintaining
them again, we're going to add and remove documents periodically and
having the chapter numbers baked in creates a lot of thrashing for no
purpose.

- Specify the document name explicitly, rather than implicitly in a
path. Use this name (instead of other random strings) as the name
of the installed files.

- Specify the document section, which is the subdirectory of
/usr/share/doc to install into.

- Allow multiple subdocuments. (That is, multiple documents in one
output directory.)

- Enumerate the .png files groff emits along with html so they can be
installed.

- Remove assorted hand-rolled rules for running roff and roff widgetry
and add enough variable settings to make these unnecessary. This
includes support for
   - explicit use of soelim
   - refer
   - tbl
   - pic
   - eqn

- Forcibly apply at least minimal amounts of sanity to certain
autogenerated roff files.

- Don't exclude USD.doc, SMM.doc, and PSD.doc directories from the
build, as they now actually do stuff.

Note: currently we can't generate pdf. This turns out to be a
nontrivial problem with no immediate solution forthcoming. So for now,
as a workaround, install compressed .ps as the printable form.
2014-07-05 19:22:02 +00:00
christos 6e28978d84 fix unused variable warnings 2013-10-18 20:47:06 +00:00
christos f49cbbddb9 avoid longjmp clobber. 2013-10-18 20:17:59 +00:00
christos 8e33b891d8 prevent re-entry race and crash 2013-06-28 17:36:18 +00:00
christos d8eb8720ff Document more environment settings. 2013-03-09 19:43:20 +00:00
christos 4b1752e245 undo previous; mail never expanded $ variables in folder. 2013-03-09 19:43:07 +00:00
christos b209824667 since we are calling realpath() earlier now, we need to expand the name
of the folder in case it contained variables like $HOME.
2013-03-06 20:49:20 +00:00
christos 3157acd0cf PR/47577: Steffen "Daode" Nurpmeso: Refinement to previous to keep always
keep track of the folder when it is updated.
2013-02-20 14:38:13 +00:00
christos b078433469 PR/47577: Steffen "Daode" Nurpmeso: Keep a resolved folder name together
with a display name in order to keep track of current state when the directory
is changed.
2013-02-19 17:43:32 +00:00
christos ba2b5111fb PR/47657: Steffen "Daode" Nurpmeso: quoted printable CTE exceeds RFC limit.
- Encapsulated all the content-transfer-encoding stuff in mime_codecs.c
- Replaced calls of strtol(3) with a handcrafted version that allows simple
  error checking by testing the return value. This allows to easily add
  special code to handle illegal QP sequences.
2013-02-14 18:23:45 +00:00
christos 39fb5ccbf5 From: Steffen "Daode" Nurpmeso:
Amend the previous commit to support zone-style RFC 822 dates.
RFC 5322 marks this zone-style as obsolete (obs-zone), but still supports it.
But then, even if you don't wanna support military style single-letter zones,
the UT zone exists and will not be supported by this commit.

The changes here are not strictly correct (since not all possible
single-letter zones are assigned, and only *UT* has two letters),
but which will match all thre possible *obs-zone* forms.
Compiled and tested on a single MBOX.
2013-01-16 15:21:42 +00:00
christos 8fe0b6ad43 PR/47453: Martin Branderburg: Mail (mail, mailx) does not recognize messages
which have RFC 822 format dates.
XXX: Pullup 6
2013-01-15 17:25:42 +00:00
christos fed1477544 PR/47396: Steffen: mail(1) may falsely use quoted-printable for files with
embedded NULs
2013-01-04 01:54:55 +00:00
christos ec0bd15985 PR/47395: Steffen: mail(1) unnecessarily uses base64 if a CR without a LF is seen 2013-01-04 01:43:59 +00:00
mbalmer e3f283b63f Fix misspelling: accommodate is a long enough word to have room for two 'c's
and two 'm's.
2012-12-01 11:41:49 +00:00
christos 79abd5ecae PR/47237: Steffen Nurpmeso: Detect more than 2 pad characters and mark as bad. 2012-11-24 21:40:02 +00:00
christos de5e815cfc don't check for i and use j. 2012-10-21 22:18:16 +00:00
christos 1db8a1b54a PR/47098: Steffen "Daode" Nurpmeso: mail(1): SEGV with bad globbed file argument 2012-10-21 01:11:23 +00:00
christos 0575918243 consistently use warn 2012-10-21 01:10:22 +00:00
christos a7879b44e9 make sure that signal handlers are always initialized. 2012-06-12 19:03:26 +00:00
christos 5942983d76 set close on exec for all opened files. 2012-04-29 23:50:22 +00:00
joerg cdaeb35ee5 Mark sasprintf as using a printf-like format. Fix format string to use
all arguments by telling the user what file would be overwritten.
2012-02-28 22:30:44 +00:00
christos 7f5fd4a5cd PR/45842: Henning Petersen: compare fgets with NULL not 0 2012-01-16 17:38:16 +00:00
joerg 6818646ac8 Use __dead 2011-09-16 15:39:25 +00:00
christos abf73dc18d document non-literal format string 2011-08-16 11:49:17 +00:00
joerg a5bcf1850f Use proper format strings. 2011-05-24 12:33:22 +00:00
dyoung c45c4e89a1 Rename sigqueue to sigq to avoid clashing with sigqueue(2). Now this
builds again.
2011-01-10 17:14:38 +00:00
njoly 1adf1b7dc0 Fix sub-section reference. 2010-12-23 20:11:00 +00:00
christos 02bc858973 - fix format print issue. from anon ymous 2010-06-21 19:49:31 +00:00