summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/popen.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-3/+3
| | | | | | 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.
* Modernize allocation by:mmcc2015-10-161-5/+5
| | | | | | | | | * removing unneeded casts of void* return values * replacing varied and creative error messages with the allocation function's name * replacing errx() with err() so that the errno string is reported ok beck@, jung@, millert@
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-2/+2
| | | | | | | | | 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)
* use FD_CLOEXEC instead of 1; from David Hillokan2013-04-291-5/+5
| | | | ok otto
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-9/+1
| | | | | | | 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
* unused variablederaadt2004-09-151-6/+4
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-031-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* a real pid_t cleanup.mpech2002-06-121-3/+3
| | | | | | espie@ ok for make/, deraadt@ one extra eye, millert@ ok
* Revert change to Popen() to only wrap command in a shell if itmillert2001-11-231-11/+3
| | | | | | | contains meta characters since people may expect their aliases to work. Instead, just remove the "kill(lock_pid, SIGTERM);" since lockspool now does the right thing when the pipe is closed.
* o kill strcpy()millert2001-11-211-3/+6
| | | | | o check return values of malloc and friends o use strdup() when sensible
* o ANSIfymillert2001-11-211-91/+40
| | | | | | | | | 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
* In private version of popen(), only wrap a command to be run in amillert2001-11-201-4/+11
| | | | | shell if it contains meta chars. Sneaky hack to work around a ksh bug.
* Fix bogus use of snprintf return value. Since we know the maxmillert2001-09-041-5/+10
| | | | length of a username we can use that as part of the buffer size.
* More fixes from Don Beusee:millert2001-01-191-6/+7
| | | | | | | - edit and other interactive commands have no stdin (making the command completely broken). - messages with "From " line having date format with -0800 type of timezone are not recognized correctly.
* Changes from Don Beusee:millert2001-01-161-35/+80
| | | | | | | | | | | | | | o escape From line with a leading '>' when needed o only print To: address and Subject lines if actually present o new variable 'allnet' to treat user@foo and user@bar as the same "user" o folders command now takes an optional argument like ls. o new "pipe" (|) command to pipe the message through an arbitrary command o make header display format the same as SunOS 4.1.3 /usr/ucb/mail o tilde commands work regardless of interactive mode. o fix "read: Interrupted system call" error by retrying if EINTR o expanded help file Changes by me: o read the help file via the PAGER as it is now more than 24 lines long
* warnx?/errx? paranoia (use "%s" not a bare string unless it is amillert2000-06-301-3/+3
| | | | | | | | | 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).
* Use new username option to lockspool for 'mail -u'.millert1998-09-271-5/+13
|
* Fix commentsmillert1998-09-101-3/+3
|
* If a child has not been waited on via the SIGCHLD handler, wait for itmillert1998-09-101-19/+25
| | | | ourselves instead of playing games with sigsuspend. This may fix PR 588.
* repair order of signal blocking that got changed in conversion to POSIX signalsmillert1998-09-081-12/+12
|
* use lockspool for locking, not 'mail.local -H'millert1998-08-151-10/+5
|
* back out some signal changes that can cause mail to hang when quitting due to SIGCHLD blockagemillert1998-06-121-6/+2
|
* Don't call truncate() directly; have rm() do it if we get EPERM on unlink()millert1998-06-121-2/+8
| | | | In popen.c, findchild() may return NULL so catch that case.
* Never remove a mail spool, as we may not have proper prics, just truncate. Also block signals in a few critical areasmillert1998-05-041-2/+6
|
* Remove one case of malloc call from sighandlerniklas1998-02-151-10/+20
|
* NetBSD changes (mostly comsmetic):millert1997-11-141-12/+12
| | | | | | | | 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
* Kill union wait.millert1997-08-311-7/+7
|
* pull errno.h inderaadt1997-08-051-2/+3
|
* save errno in sigchld handlersderaadt1997-08-041-2/+4
|
* Don't call it a mask when it is a sigset_t (cosmetic changes only).millert1997-07-141-10/+10
|
* Convert remaining sigsetmask() -> sigprocmask() (POSIX style)millert1997-07-141-5/+7
| | | | in collect.c and fix up some signal botches elsewhere.
* NOSTR -> NULLmillert1997-07-141-7/+7
| | | | Use sigsetjmp/siglongjmp instead of sigjmp/longjmp for portability.
* bcopy() -> memcpy() and fix some casts.millert1997-07-131-16/+16
|
* Merge in NetBSD and 4.4BSD-lite2 changes as well as some of my own.millert1997-07-131-41/+43
| | | | | | | | - 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
* overflows aboundderaadt1997-05-301-3/+3
|
* Use ``mail.local -H'' to do dot locking so we can have mode 755 mailmillert1997-03-291-2/+59
| | | | | spool, change an occurrence of tempnam() to mkstemp(), change some longs and shorts to ints. Mail is now usable again.
* Accept NULL nset in prepare child (as run_editor will try to use one).dm1996-06-261-7/+9
|
* from christos;deraadt1996-06-111-19/+43
| | | | | | | | - 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.
* initial import of NetBSD treederaadt1995-10-181-0/+374