Commit graph

177 commits

Author SHA1 Message Date
Lexi Winter 6c951b3717 mail: add volatile in grabh()
setjmp() requires that any stack variables modified between the setjmp
call and the longjmp() must be volatile.  This means that 'saveint' in
grabh() must be volatile, since it's modified after the setjmp().
Otherwise, the signal handler is not properly restored, resulting in a
crash (SIGBUS) if ^C is typed twice while composing.

PR:		276119
Reported by:	Christopher Davidson <christopher.davidson@gmail.com>
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/993
2024-01-04 21:40:53 -05:00
Warner Losh 5e3934b15a usr.bin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:01 -07:00
Warner Losh 0b8224d1cc Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by:		Netflix
2023-11-26 22:23:58 -07:00
Warner Losh bdcbfde31e usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:30 -07:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
John Baldwin d28a95513e mail: Use a C89 function pointer type for command functions.
The command function is defined to always take a void *.  Functions
which accept a pointer to an array of pointers use a local temporary
'argv' assigned from the void *arg.

Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D39527
2023-04-18 11:27:29 -07:00
Ed Maste c3dbcadca2 mail: fix build if TIOCSTI is not defined
Sponsored by:	The FreeBSD Foundation
2023-04-10 16:08:20 -04:00
John Baldwin 157436dcbf mail: Fix mismatch in array bounds for isign().
Reviewed by:	imp, emaste
Reported by:	GCC -Warray-parameter
Differential Revision:	https://reviews.freebsd.org/D36761
2022-09-28 14:05:42 -07:00
Stefan Eßer 1f474190fc Replace literal uses of /usr/local in C sources with _PATH_LOCALBASE
Literal references to /usr/local exist in a large number of files in
the FreeBSD base system. Many are in contributed software, in configuration
files, or in the documentation, but 19 uses have been identified in C
source files or headers outside the contrib and sys/contrib directories.

This commit makes it possible to set _PATH_LOCALBASE in paths.h to use
a different prefix for locally installed software.

In order to avoid changes to openssh source files, LOCALBASE is passed to
the build via Makefiles under src/secure. While _PATH_LOCALBASE could have
been used here, there is precedent in the construction of the path used to
a xauth program which depends on the LOCALBASE value passed on the compiler
command line to select a non-default directory.

This could be changed in a later commit to make the openssh build
consistently use _PATH_LOCALBASE. It is considered out-of-scope for this
commit.

Reviewed by:	imp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D26942
2020-10-27 11:29:11 +00:00
Kyle Evans a86ddfe8c7 mail/gprof/tip: tap with the ugly stick
The ugly stick here is this bit in the respective headers:

#ifndef EXTERN
#define EXTERN extern
#endif

with a follow-up #define EXTERN in a single .c file to push all of their
definitions into one spot. A pass should be made over these three later to
push these definitions into the correct files instead, but this will suffice
for now and at a more leisurely pace.

MFC after:	3 days
2020-04-06 23:28:24 +00:00
Brad Davis 22917b7e0e Move mail.rc install to usr.bin/mail.
This leverages CONFS to do the install

Approved by:	re (blanket, pkgbase), bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D17216
2018-09-18 20:47:06 +00:00
Alan Somers 47cc9ee1b1 Switch the default pager for most commands to less
Finally, a pager for the nineties.

MFC after:	Never
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D13465
Poll:		https://reviews.freebsd.org/V7
2018-08-08 19:24:20 +00:00
Xin LI a9a7c8c0a1 Replace send-mail with the more standarized sendmail, we do not create
links for send-mail in mailwrapper so it did not work anyway.

MFC after:	2 weeks
2017-12-27 06:23:50 +00:00
Xin LI 197d53b7d1 Don't initialize lastlong before assigning it.
MFC after:	2 weeks
2017-12-27 05:59:47 +00:00
Eitan Adler dae3a64fb9 userland: Fix several typos and minor errors
- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by:	imp, benno
2017-12-27 03:23:01 +00:00
Pedro F. Giffuni 8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Eitan Adler 1b3cd5ec63 mailaddr(7): wave goodbye
The information here is somewhere between ancient to obsolete.
It refers to a time in the internet's history when manual routing
was still useful, talks about UUCP as if its modern, and refers
to documents which I had trouble tracking down.

It seems unlikely that a manual page in this form would be useful, so
just remove it.

Reviewed By: imp, tsoome, bdrewery(?)
Differential Revision: https://reviews.freebsd.org/D12924
2017-11-11 07:00:40 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Baptiste Daroussin dae6dcb78a Remove useless Li macro
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:45:10 +00:00
Xin LI 1d1e1f6311 Don't reference NULL pointer.
MFC after:	2 weeks
2017-01-24 07:48:36 +00:00
Xin LI 4994a9b8e0 Always initialize 'c'.
MFC after:	2 weeks
2017-01-23 07:32:47 +00:00
Xin LI c0d0b76655 When creating record file, use umask 077 instead of the default.
MFC after:	2 weeks
2017-01-23 06:04:43 +00:00
Pedro F. Giffuni eeb341a9f3 mail(1): Minor declaration updates.
Missing from r302903.
2016-07-15 20:27:21 +00:00
Pedro F. Giffuni c433bea8c0 mail(1): Avoid closing negative file descriptors.
CID:		1008105, 1008106
MFC after:	1 week
2016-07-15 19:43:24 +00:00
Pedro F. Giffuni b948550d2f mail(1): Update more prototypes.
Also rename delete and undelete_messages to deletecmd and undeletecmd
respectively in an attempt to sync with other BSDs.

Obtained from:	OpenBSD
2016-07-15 15:37:54 +00:00
Pedro F. Giffuni 20a50e9ca9 mail(1): check for out of memory conditions when calling calloc(3).
X-MFC with:	r302771
2016-07-14 15:09:08 +00:00
Pedro F. Giffuni 92fa728bb1 mail(1): Bring some fixes from other BSDs.
Fix missing forked job changes from r302776 in wait_child().

Obtained from:	NetBSD
2016-07-14 02:25:29 +00:00
Pedro F. Giffuni b22a869924 mail(1): Bring some fixes from other BSDs.
- Use varargs properly
- Use pid_t
- Better handling of error conditions on forked jobs.
- Some prototype and warning cleanups.

Obtained from:	NetBSD (some originaly from OpenBSD)
2016-07-13 16:45:26 +00:00
Pedro F. Giffuni dde0f2bfd3 mail(1): check for out of memory conditions when calling calloc(3).
Suggested by:	oshogbo
MFC after:	3 days
2016-07-13 14:59:17 +00:00
Xin LI 56858424bb Use _PATH_DEVNULL instead of hardcoding.
MFC after:	2 weeks
2016-07-11 05:44:58 +00:00
Pedro F. Giffuni 24b797cc1a mail(1): Fix a comment.
Obtained from:	NetBSD (CVS Rev 1.29)
2016-07-11 00:03:39 +00:00
Pedro F. Giffuni d6f7a4fb17 mail(1): Invert calloc(3) argument order.
calloc(3) is documented to have first a number and then a size.

Obtained from:	OpenBSD (through NetBSD)
2016-07-10 02:46:20 +00:00
Don Lewis 090fc1c839 Always return either a dynamically allocated string or NULL from
expand().  Never return the name parameter, which could be a the buf[]
buffer which is allocated on the stack by getdeadletter() and which
would then be used after getdeadletter() has returned.

Reported by:	Coverity
CID:		1199383
MFC after:	1 week
2016-05-13 06:15:05 +00:00
Jilles Tjoelker ae7d5745cd mail: Don't truncate mtime of mailbox to microseconds. 2016-04-17 20:00:24 +00:00
Pedro F. Giffuni 0bfdca975c Fix naive use of ftell(3).
Secure coding practices, FIO19-C.
2016-02-16 21:39:19 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Baptiste Daroussin f41337c150 Add const to the copyright variable
Bump WARNS to level 2
2015-06-06 13:13:39 +00:00
Simon J. Gerraty 9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Pedro F. Giffuni 0fa46a4231 Always check the limits of array index variables before using them.
Obtained from:	DragonFlyBSD
MFC after:	1 week
2014-08-21 02:40:33 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Kevin Lo ed74b69c2d Remove unnecessary cast to pid_t. 2013-07-04 03:24:58 +00:00
Simon J. Gerraty 69e6d7b75e sync from head 2013-04-12 20:48:55 +00:00