History log of /freebsd-10-stable/usr.bin/msgs/msgs.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 300266 20-May-2016 truckman

MFC r299525

Use strlcpy() instead of strncpy() when copying date and subj
to ensure that these are properly NUL terminated since they
are passed to printf().

Reported by: Coverity
CID: 974770


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 241848 22-Oct-2012 eadler

Check the return error of set[e][ug]id. While this can never fail in the
current version of FreeBSD, this isn't guarenteed by the API.
Custom security modules, or future implementations of the setuid and
setgid may fail.

Submitted by: Erik Cederstrand
Approved by: cperciva
MFC after: 3 days


# 241737 19-Oct-2012 ed

More -Wmissing-variable-declarations fixes.

In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.


# 216370 11-Dec-2010 joel

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# 173169 30-Oct-2007 kevlo

Never use getenv("HOME") without checking for NULL and non-zero

Obtained from: OpenBSD


# 140389 17-Jan-2005 delphij

Cleanup:
- Change signedness of nxtfld() to make msgs(1) WARNS=6 clean
- Add several static's


# 126838 11-Mar-2004 bde

Fixed misspellings of '\0' as NULL.


# 110478 06-Feb-2003 mike

Fix singular/plural confusion in a printf.

PR: 47953
Submitted by: Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
MFC after: 3 days


# 102944 04-Sep-2002 dwmalone

ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by: md5


# 102084 19-Aug-2002 jmallett

Remove local prototypes for main().


# 94992 18-Apr-2002 bde

Fixed some style bugs:
- ifdefs around vendor sccsid were left reversed after switching to
__FBSDID().
- vertical whitespace after some of the non-FALLTHROUGH cases was lost.
- too much vertical whitespace before prototypes.


# 94991 18-Apr-2002 bde

Backed out the style bugs in rev.1.17:
- don't use unusual indentation for 39 lines of declarations when only 2
of the lines benefit from it.
- don't use __DECONST(). This was the one use of it in the tree, and it
was just wrong. It was used to hide the warning about tgetnum() having
the wrong prototype (missing a `const') due to libncurses being
misconfigured. libncurses has been fixed, so the original code now
compiles cleanly with WARNS=4.


# 94504 12-Apr-2002 charnier

Document that only superuser can use -c option. Add FBSDID. Make use of uid_t
to silent lint. fprintf -> err conversion. Add some FALLTHROUGH and NOTREACHED
comment to silent lint.


# 92921 21-Mar-2002 imp

remove __P


# 82846 03-Sep-2001 ache

File positions are off_t nowdays, not long, so:
fseek -> fseeko
ftell -> ftello
fseek(x, 0L, 0) -> rewind(x)

NOTE: that fseek/ftell not works for >long offsets per POSIX:

[EOVERFLOW] For fseek( ), the resulting file offset would be a value which
cannot be represented correctly in an object of type long.

[EOVERFLOW] For ftell ( ), the current file offset cannot be represented
correctly in an object of type long.


# 77245 26-May-2001 kris

Fix WARNS=2 warnings on alpha and i386 and clamp it down


# 62726 06-Jul-2000 kris

MFS: Don't allow printf directives in PAGER

Obtained from: OpenBSD


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49061 24-Jul-1999 mjacob

Apply suggested patch- seems reasonable.
PR: 12020
Submitted by: Matthew D. Fuller <fullermd@futuresouth.com>


# 37645 14-Jul-1998 ghelmer

Revert "POSIX saved uids change". seteuid(2) is not POSIX, and
FreeBSD does not have _POSIX_SAVED_IDS enabled. Thanks to Warner Losh
and Ollivier Robert for pointing this out, and Bruce Evans for explaining
the role of _POSIX_SAVED_IDS.


# 37534 09-Jul-1998 ghelmer

Security and minor functionality changes based on OpenBSD msgs.c:
tmp file (mktemp changed to mkstemp), saved POSIX uids, buffer overflow,
and use PAGER environment variable if set.
Obtained from: OpenBSD


# 37478 07-Jul-1998 jkh

Previous fix didn't make it past the Bruce filter. Clean up
non-KNF indentation and use err() properly.


# 37476 07-Jul-1998 jkh

msgs -p (and maybe other flags, too) gives misleading error messages,
especially on a new install, where /var/msgs/bounds doesn't exist. I
moved my bounds file out of the way to create this before and after
on a quick 'n' dirty hack, which is probably the 23rd best way to do it,
but it works:

PR: 6963
Submitted by: Matthew Fuller <fullermd@mortis.futuresouth.com>


# 27751 29-Jul-1997 charnier

Use err(3).
sprintf -> snprintf from OpenBSD.
Add usage(), prototypes.
Use MAXPATHLEN instead of 128 from OpenBSD.
Obtained from: OpenBSD


# 18485 24-Sep-1996 bde

Eliminated includes of the "temporary" backwards compatibility header
<sys/dir.h> in applications. Maintained existing (inadequate) ifdefs
for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any
new ones.


# 12809 13-Dec-1995 ache

Localize it


# 12646 06-Dec-1995 dg

Initialize some uninitialized variables to fix a bug that sometimes
resulted in msgs doing strange things, including getting stuck in an
infinite loop.


# 12390 19-Nov-1995 ache

Default file creation mask was 666 (allow othres write anything
to msgs directory), change it to 644


# 8874 30-May-1995 rgrimes

Remove trailing whitespace.


# 8382 09-May-1995 rgrimes

Fix nested comments for -Wcomment warnings.


# 6591 21-Feb-1995 wollman

Use tcflush(), eliminate libcompat.


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources