Commit Graph

278 Commits

Author SHA1 Message Date
rin 03675fcefd Revert CC_WNO_USE_AFTER_FREE from Makefile's (thanks uwe@) 2023-08-03 14:56:36 +00:00
rin 91f8ac6d30 Sprinkle CC_WNO_USE_AFTER_FREE for GCC 12
All of them are blamed for idiom equivalent to:
	newbuf = realloc(buf, size);
	p = newbuf + (p - buf);
2023-08-03 13:36:08 +00:00
mrg f386908b27 convert explicit length check before unchecked snprintf() with just a
overflow checked snprintf().  for res_debug.c and res_query.c, convert
from sprintf() to snprintf().

tested scp and rcp fail properly with too-long paths.
tested getaddrinfo fails as expected for too-long domains.
tested dig and ping for similar (res_debug.c/res_query.c).
created a temporary fs with quotas to test edquota with a long EDITOR.
did not test ypserv directly, but it's the same pattern.

avoids GCC 12 snprintf() warnings, and reduces total code size.
2023-08-01 08:47:24 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
andvar 2e0bf311b3 fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected. 2021-08-17 22:00:26 +00:00
andvar 7991f5a7b8 Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
2021-07-24 21:31:31 +00:00
christos d54a6e0c5d Add blocklist support to libwrap which enables all programs using libwrap
to block access from hosts we deny. (libwrap support from Greg A. Woods)
2021-03-07 15:09:12 +00:00
kamil b221147bfb Convert the CIRCLEQ (from sys/queue.h) usage to TAILQ
The CIRCLEQ API from sys/queue.h is deprecated since NetBSD 7 and is
already gone from FreeBSD and OpenBSD.
2020-10-13 13:56:34 +00:00
fox d56b4ad409 usr.sbin/ypserv: Suppress -Werror=format-truncation= error.
Add GCC_NO_FORMAT_TRUNCATION makedbm.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-09 15:52:48 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
kamil cb47fa61ba Avoid symbol clashes in usr.sbin/ypserv/ypserv under MKSANITIZER
Remove symbol conflicts for: gethostbyname2
2019-08-15 08:30:19 +00:00
wiz 1e55f34803 New sentence, new line. Use An/Mt. 2018-09-25 09:53:40 +00:00
kre 40b03336a1 Switch from getopt to getopts - and as part of that, update the usage,
and the man page, to reflect modern usage rather than some ancient style
that getopt[s] does not support (options, and their args when they exist)
always come before non-option agrs.

While here, update uses of test(1) to avoid obsolescent forms (and
even when still defined, prefer sh structures over test when possible).
2018-09-23 02:15:25 +00:00
kre 3ef826f570 PR bin/53458
Bring this script a little up to date - make it work with modern /bin/sh
(avoid HOSTNAME as a random variable) clean up trailing spaces on lines,
use $( ) instead of `` ...
2018-07-20 13:11:01 +00:00
christos 2966117648 PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
XXX: pullup-6,7,8
2018-01-17 03:16:10 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
sevan f7a3540ecf Drop main() prototype. 2017-05-04 16:26:09 +00:00
christos 9009c648c6 need <sys/stat.h> 2017-01-10 21:04:06 +00:00
christos cb4eacf0ac PR/50057: Wolfgang Stukenbrock: yp-map transfer removes SECURE-flag 2015-07-17 15:58:01 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
christos 0a77b69ab6 fix unused variable warnings. 2013-10-19 17:16:37 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
hauke 64a4eb64c6 Commit the patches in Wolfgang Stukenbrock's PR bin/41896.
(1) Do not serve UIDs below MINUID in master.passwd.* maps,
just like in passwd.* maps.

(2) Since stdethers(8) and stdhosts(8) strip comments, we do
not have to do it here, much less inconsistently.
2013-07-19 11:44:51 +00:00
wiz 1ac719d147 Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
2012-04-08 22:00:37 +00:00
joerg 66dd2755f5 Add __printflike attribution to use vprintf and friends with an argument
as format string.
2012-03-15 02:02:20 +00:00
joerg 8583b49ce0 static + __dead 2011-08-30 21:03:31 +00:00
plunky 87d4f6076b Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
2011-08-30 17:06:20 +00:00
joerg 7293bf2d37 Replace malloc + incorrect memset with calloc. 2011-07-01 03:09:29 +00:00
wiz 5989309eef Add -f to usage, and make it match man page. 2011-04-25 22:54:05 +00:00
wiz 819b5392dd New sentence, new line. Use more markup. 2011-04-25 22:53:09 +00:00
wiz 933a549c56 Make usage match manpage. 2011-04-25 22:51:26 +00:00
wiz 9ebf684514 Remove unimplemented -b option. From YOMURA Masanori. 2011-04-25 22:49:06 +00:00
chuck f46c12c85c remove no-longer-valid wustl email address for me.
no functional change with this commit.
2011-02-01 21:00:25 +00:00
chuck e2bf3ae6ea udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.

no functional change with this commit.
2011-02-01 20:58:15 +00:00
joerg 4f69f7fc94 No trailing whitespace 2010-04-05 19:36:29 +00:00
chuck a8036503d8 rev 1.18 un-covered some bugs:
1. add_interdomain and add_secure are optional... not all maps use these
    keys.  if we are unable to add them due to a YPERR_KEY (meaning they
    are not being used), then we should not flag this as a general error.

 2. if we have a failure (status <= 0) we unlink_db() the temp database
    as part of error handling.   but we should not overwrite our error
    status code with the return value from unlink_db() because if the
    unlink_db() works (likely true) than that success will wipe out our
    error code and the calling yppush will think we worked.
2009-11-05 21:26:25 +00:00
chuck fd40ef4f59 yppush RPC is supposed to return yppush_status error/status codes
(e.g. YPPUSH_SUCC, YPPUSH_NOMAP, etc.).

Functions like yp_master, yp_order_host, yp_master_host, and
yp_match_host return YPERR-style error codes.  YPERR-style error
codes do not directly correspond to yppush_status codes, so it
is a bad idea to just directly YPERR codes into the yppush return
status value (it causes failing yppush runs to print confusing
error messages).

Change ypxfr.c to convert the YPERR codes to YPPUSH codes.
2009-11-05 15:23:55 +00:00
christos ffd8793875 no need for YY_NO here. 2009-10-29 14:41:02 +00:00
snj 1a868936e6 Remove 3rd and 4th clauses. Approved by Mats O Jansson (copyright holder). 2009-10-21 00:01:56 +00:00
snj 07ce40632e Follow upstream's lead and remove third and fourth clauses (except on
from usr.sbin/mopd/common/pf.c, where only the ad clause is removed,
because it has a shared UCB copyright) on Mats O Jansson's files.

thorpej OK'd usr.sbin/rpc.yppasswdd/yppasswdd_mkpw.c, where he shares
copyright.
2009-10-20 00:51:13 +00:00
snj 0e24aa0d20 Remove third and fourth clauses, as was done upstream in revision 1.25. 2009-10-19 23:25:43 +00:00
lukem d3d3aa621a Fix WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare) 2009-04-19 06:06:39 +00:00
chuck 77b3637f18 Disable hostname lookup for ypserv(8) libwrap access control,
as they can cause performance problems while ypserv is blocked
waiting for the DNS to respond.  initially discussed here:

	http://mail-index.netbsd.org/tech-userlevel/2006/11/01/0014.html

This diff is from Doug Needham who found an easy way to get
the desired behavior without having to change libwrap.
2008-05-16 16:41:42 +00:00
lukem 66176dfdff Rename MKPRIVATELIB to LIBISPRIVATE, to make it clearer that this is
a variable that is used by in-tree Makefiles to control behaviour.
(MKsomevar variables are generally intended to be controlled by the end-user)
2008-05-03 14:48:30 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
lukem cea4b7cdfd Simplify ypdb_open() API and just use it for opening the DB for reading.
Provide a separate ypdb_mktemp() API to open a temporary file read-write.
Use mkstemp() instead of mktemp().

NOTE: makedbm & mkalias tested ok.  I couldn't test ypxfer.
2008-02-29 03:00:47 +00:00
lukem 3a5ea89a68 Correct the argument order to ypdb_open(). 2008-02-27 01:27:35 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos 1a9cb96f06 PR/36820: Geoff C. Wing: ypserv maplist functionality broken due to off-by-one
error
2007-08-22 16:49:17 +00:00