Commit Graph

61 Commits

Author SHA1 Message Date
vangyzen
1925dfb9c6 logger: fix memory leak and use-after-free
This one call to getaddrinfo() did not adhere to the common idiom
of storing the result into a second res0 variable, which is later freed.

Reported by:	Coverity
CID:		1368069 1368071
Sponsored by:	Dell EMC
2018-05-28 02:40:06 +00:00
glebius
d03569547d Fix crash with a dotless hostname. 2017-12-06 17:50:10 +00:00
glebius
cdf206486c Generate fully RFC3164 compliant messages, with timestamp and hostname.
Allow to set hostname to any string with -H.

MFC after:	2 months
2017-12-05 19:55:53 +00:00
pfg
872b698bd4 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
bdrewery
a598c4b809 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
imp
7e6cabd06e 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
hrs
aa8b8e4861 Fix gcc build.
Spotted by:	lidl
2016-12-24 22:51:02 +00:00
hrs
1b7809b1ef mdoc fixes. 2016-12-23 04:38:27 +00:00
hrs
96d0f372b9 - Add -S option to specify the source address/port for UDP communication.
- Document -S option.
- Document that -h option supports AF_LOCAL.
- Split preparation of UDP sockets in logmessage() into socksetup().
2016-12-22 23:39:11 +00:00
sjg
008d7c831f 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
sjg
75a137820d dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
sjg
65145fa4c8 Merge sync of head 2015-05-27 01:19:58 +00:00
wblock
41e81c759a Describe the behavior when both -f and a message are given. Pointed out by
Raphael Abreu <raphael.lorenzeto@gmail.com> on freebsd-doc.

MFC after:	1 week
2015-03-22 01:25:57 +00:00
sjg
5860f0d106 Updated dependencies 2014-05-16 14:09:51 +00:00
sjg
1a7e48acf1 Updated dependencies 2014-05-10 05:16:28 +00:00
sjg
ed3fc70bf5 Merge from head 2014-05-08 23:54:15 +00:00
imp
2118f42afd Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
sjg
5e568154a0 Merge head 2014-04-28 07:50:45 +00:00
brd
5b95a6dc63 - Clarify usage of the -f option.
Reviewed by:	gjb@, dru@, and Allan Jude
2014-03-05 02:10:10 +00:00
sjg
6d37b86f2b Updated dependencies 2013-03-11 17:21:52 +00:00
sjg
0ee5295509 Updated dependencies 2013-02-16 01:23:54 +00:00
sjg
778e93c51a Sync from head 2012-11-04 02:52:03 +00:00
ed
b146225385 Add missing const keywords. 2012-10-19 14:29:03 +00:00
marcel
9dd41e3647 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
ed
b3e1c421c6 Add missing static keywords to logger(1) 2011-11-06 08:15:53 +00:00
edwin
a01908291f When specifying the -t option (send tag in front of message), this tag
should also be forwarded to the remote logging host, not only when the
logging is done locally.

PR:		bin/154324
Submitted by:	Callum Gibson <callumgibson@optusnet.com.au>
MFC after:	1 week
2011-04-08 12:33:07 +00:00
joel
29af67e52c 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
2010-12-11 08:32:16 +00:00
ed
9b380e30d4 Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
mckusick
1f53d34702 When reading input from a file or device (via -f option) set the
input to be in non-buffering mode so that input lines are logged
as they occur rather than being saved up until a buffer's worth of
input has been logged.
2009-10-30 21:54:53 +00:00
obrien
6ccddb5af5 Minor style(9) nit. 2008-02-05 17:34:44 +00:00
dwmalone
42e798271c Make logmsg take const char * arguments.
Set WARNS to 6.
2007-05-07 11:28:01 +00:00
ru
33e34aeeb5 Markup fixes. 2006-09-29 15:20:48 +00:00
bms
ed29850fa0 Update document date.
Noticed by:	ru
2006-08-03 20:43:51 +00:00
bms
14416210a8 Add a new command-line option, -P, which allows the user to specify
an arbitrary port to which syslog messages are to be sent.

PR:		bin/54026
Submitted by:	Oliver Fromme
MFC after:	10 days
2006-08-02 13:21:44 +00:00
yar
982c62305a Obey MK_INET6_SUPPORT. 2006-07-27 14:20:14 +00:00
charnier
6cd34f4d90 Reduce compiler warning: variable might be used uninitialized, by giving
an initial value.
2005-05-29 16:04:46 +00:00
ru
6cc4b6c220 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
ru
ee5b7e52fa Deal with double whitespace. 2004-07-03 00:24:45 +00:00
brueffer
1566e448bd Clarify the describtion of the -A switch
PR:		51187
Submitted by:	Jeff Ito <jeffi@rcn.com>
Approved by:	re (jhb)
MFC after:	3 days
2003-05-21 15:00:47 +00:00
dwmalone
b4339b74ad 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
2002-09-04 23:29:10 +00:00
obrien
bc61fc95d8 Consistently use FBSDID 2002-06-30 05:25:07 +00:00
charnier
6e73b69f34 .Nm is not required at the begining of this sentence. 2002-04-20 21:33:10 +00:00
charnier
ad8a79e6a5 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
dwmalone
0ea0f91492 1) Use FBSDID for vendor string.
2) Change an int for a size_t, as that's what it is mainly used for.
3) Add some braces to keep gcc happy.
2002-04-01 11:06:00 +00:00
imp
74d826c7a6 remove __P 2002-03-22 01:22:50 +00:00
fenner
70babecdeb Improve error reporting - report error message when there is one, or
report a short read if that's what we're reporting.
2002-02-27 22:38:59 +00:00
ru
4a40801948 The default for -p was ``kern.notice'' in the -h case.
Make it ``user.notice'', as per manpage.

(The syslog(3) function defaults to LOG_USER facility
if none is specified, but we don't use syslog() in the
-h case.)

PR:		docs/30374
Noticed by:	SUGIMURA Takashi <sugimura@jp.FreeBSD.org>
2001-09-06 12:48:44 +00:00
dd
91ffaa180c Use CFLAGS, not COPTS, in the Makefile. bsd.prog.mk conveniently adds
COPTS towards the end of final CFLAGS so that it can be used to
override Makefile and other defaults.  Using it in Makefiles risks
having options set using it clobbered when somebody uses it on the
command line.

Approved by:	bde
2001-09-05 20:10:59 +00:00
ru
bde8ec1b70 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
dd
911ca14c87 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00