1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00
Commit Graph

36 Commits

Author SHA1 Message Date
sobrado
8ee12ed014 make usage for both mail(1) and mailx(1) fit in a 80-column display.
ok miod@ and millert@
2024-11-05 16:14:39 +00:00
deraadt
847d361875 satisfy -fno-common, by (1) copying all the variable decls from
indent_globs.h to indent.c, and (2) changing all the same decls in
indent_globs.h to be extern
ok mortimer
2021-01-26 18:21:47 +00:00
deraadt
3aaa63eb46 When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
2019-06-28 13:34:58 +00:00
deraadt
7a464f5604 missing pledge "getpw" 2015-11-24 00:08:27 +00:00
deraadt
f89c4c0c12 pledge "stdio rpath wpath cpath tmppath fattr tty flock proc exec" 2015-11-16 21:20:40 +00:00
deraadt
e9f70589b2 in getopt() blocks, stop incrementing flag variable which are supposed
to just be 0/1
ok miod florian
2015-02-08 23:40:34 +00:00
millert
9cecaae2c3 Fix getopt string; the -N flag doesn't take an argument.
From Matthew Clarke
2015-01-24 20:32:46 +00:00
millert
ba62a43212 Only allow the -r flag when sending a message; from Martin Brandenburg 2015-01-22 16:25:07 +00:00
millert
6748e6a051 Add support for the "-r fromaddr" flag now that we don't support
sendmail flags on the command line.
Also allow "from" to be set in mailrc.
Use sendmail's "-t" flag when executing sendmail instead of specifying
the list of recipients in argv.  The "-f" flag will be used to set
the from address if specified.
2015-01-20 16:59:07 +00:00
deraadt
b9fc9a728f Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
2015-01-16 06:39:28 +00:00
millert
a54069a84e Don't pass options after the to address to sendmail. The only
legitiate use of this is to set the sender name which should be
handled specifically by a different option.
2014-12-16 18:37:17 +00:00
millert
3043ae2627 The handling of the -f option is a hack. Instead of fooling around
with argv behind getopt()'s back we can just treat the remainder
of argv[] after option processing as the file name for -f.  It is
not possible to use -f in sending mode so there is no ambiguity.
OK tobias@
2014-11-24 20:03:33 +00:00
millert
b87139ef51 Remove undocumented and obsolete -T option. It was intended for
use with old netnews.  OK sobrado@ tobias@
2014-11-24 20:01:43 +00:00
deraadt
043fbe51c1 rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
2009-10-27 23:59:19 +00:00
jmc
fc693de7dd - add -d to usage
- sync -f arg name with man page synopsis
2008-10-09 06:48:11 +00:00
martynas
b40c92300e add -E flag and 'skipempty' option to skip sending messages with
empty bodies.  useful for sending mails from crontabs.
from rivo nurges <rix at estpak dot ee>, with missing 'skipempty'
documentation and usage update from me
ok millert@
2008-07-16 15:11:16 +00:00
sobrado
03cb09c0d4 the ellipsis is not an optional argument; while here, sync the usage
and synopsis of commands

lots of good ideas by jmc@

ok jmc@
2007-08-06 19:16:05 +00:00
jmc
56ee374dca - sort SYNOPSIS
- remove a load of unnecessary quoting and some groff cruft
- sort options list
- add usd doc to SEE ALSO
- sync usage()
2004-04-19 10:17:18 +00:00
millert
f75387cb26 Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.
2003-06-03 02:56:05 +00:00
millert
9a371fd3a0 Fix extern decl of version missed in previous commit. 2001-11-21 15:28:25 +00:00
millert
4a9caef215 o ANSIfy
o Style nits
o Use const to silent stupid -Wall warnings
o strnc{py,at} -> strlc{py,at}
o Use strpbrk() instead of homegrown anyof()
o Use NULL instead of #defines with 0 cast to a pointer
This still could use a proper audit
2001-11-21 15:26:39 +00:00
millert
7f56ba93ca Major signal overhaul. We no longer longjmp all over the place.
Instead, routines responsible to gathering user input (or in some
cases outputting data) catch the signals and set flags as needed.
Because of this some handlers are install without the SA_RESTART
flag so syscalls are not restarted and we can check the flag.  All
signal handlers are now safe.

This should make the flow of control a bit more grokable but the
code is still ugly.
2001-11-20 20:50:00 +00:00
millert
31510ce58e missing arg to errx 2001-10-11 20:59:46 +00:00
millert
56933c0fdd Sanity check length of -u argument to avoid truncation later on. 2001-09-07 01:19:15 +00:00
millert
b638aa9471 warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant).  These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).
2000-06-30 16:00:03 +00:00
millert
e1428dd219 Use new username option to lockspool for 'mail -u'. 1998-09-27 21:16:42 +00:00
millert
36999bed05 NetBSD changes (mostly comsmetic):
replace panic() with calls to err()/errx()
    use S_IS* instead of doing by hand with S_IF*.
    Use TIMESPEC_TO_TIMEVAL() and gettimeofday instead of time(2)
    Use _POSIX_VDISABLE, not 0
    Kill register
1997-11-14 00:23:41 +00:00
millert
41f015886d Fix one possible oflow (not exploitable) and do a wee bit of KNF.
Much more remains to be done.
1997-07-30 06:32:38 +00:00
millert
06923953c8 Convert remaining sigsetmask() -> sigprocmask() (POSIX style)
in collect.c and fix up some signal botches elsewhere.
1997-07-14 15:56:23 +00:00
millert
c318c72bec NOSTR -> NULL
Use sigsetjmp/siglongjmp instead of sigjmp/longjmp for portability.
1997-07-14 00:24:24 +00:00
millert
f0e43013ae bcopy() -> memcpy() and fix some casts. 1997-07-13 23:53:56 +00:00
millert
db59c1a606 Merge in NetBSD and 4.4BSD-lite2 changes as well as some of my own.
- handle long lines safely (from NetBSD)
 - use puts/fputs and putchar/putc when it makes sense
 - use err/errx and warn/warnx when it makes sense
 - make return() and sizeof() style consisten
 - some more buffer safety
1997-07-13 21:21:08 +00:00
millert
72799b18e5 getopt(3) returns -1 when out of args, not EOF, whee! 1997-01-15 23:40:20 +00:00
deraadt
af50a896f4 _PATH_TMP -> _PATH_TMPFILE; avoid /tmp//fooXXXX where possible too 1996-09-16 02:26:02 +00:00
deraadt
7eb34045c5 from christos;
- Fix PR/105: Implement dot locking protocol and check return value of flock.
- Fix PR/2247: Don't call unknown users "ubluit". Issue an error message.
- Fix/add prototypes.
- Fix warnings.
- Use POSIX signal mask calls.
1996-06-11 12:53:31 +00:00
deraadt
df930be708 initial import of NetBSD tree 1995-10-18 08:37:01 +00:00