Commit Graph

170 Commits

Author SHA1 Message Date
lukem 275da9fc4d because the ypserv struct datum and the db(3) struct DBT are not exactly
the same (datum is { char *, int }, DBT is { void *, size_t /* u_int */ }),
copy info to appropriate temporary variables before calling underlying
db(3) operations.
1999-07-25 09:33:37 +00:00
lukem 811d7dca54 fix up lossage WRT free()ing invalid pointers.
noted in [bin/8064]
1999-07-25 09:01:04 +00:00
lukem 96c7d69308 fix up lossage WRT free()ing invalid pointers.
noted in [bin/8064]
1999-07-25 07:59:48 +00:00
agc 42de521154 Correct typo in synopsis. 1999-07-05 10:59:08 +00:00
mrg b734ec4664 note that the calls to mktemp() are OK. 1999-06-07 03:06:08 +00:00
thorpej 653c3855f5 Use pidfile(3). 1999-06-06 02:38:00 +00:00
lukem 04833e78b6 split line 1999-04-25 06:28:10 +00:00
lukem a3b1d07c9b set MKLINT=no. noted by NAKAJIMA Yoshihiro <nakayosh@kcn.ne.jp> 1999-03-13 23:16:55 +00:00
mycroft d77575d3c8 Clean up SYNOPSIS formatting. 1999-03-07 11:58:22 +00:00
abs e88f10c5f0 Replace compile time RPC_SVC_FG with -f option to run in the foreground. 1999-02-18 06:03:47 +00:00
lukem dcab0210a0 convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +00:00
mrg 69dfc0e846 KNF nit. 1999-01-31 10:14:02 +00:00
thorpej 56a0200695 Fix some debugging printf formats. 1999-01-23 01:08:55 +00:00
thorpej dd2ecab580 Use syslog(3) to log debugging info, and only if we're compiled with
-DDEBUG.
1999-01-22 02:38:05 +00:00
thorpej 002a1e7cb7 Remove old access control list definitions, and remove the home-grown
logging code.
1999-01-22 02:37:00 +00:00
thorpej c87c1f135c Throw out the old ypserv access control list code. Instead, use libwrap
for access control.  Add a -l option, to enable logging of all requests.
Also, just use syslog(3) for all logging, not home-grown logging code.
1999-01-22 02:36:12 +00:00
lukem c6e56aa78a don't bother with nsdispatch(); just link in the relevant bits of
libc's gethostby*() and getnetby*() directly (with -UYP).
1999-01-19 03:53:27 +00:00
lukem 67ae78f9e1 fix error message 1999-01-18 23:42:38 +00:00
lukem ab8486e250 * don't print out entries that couldn't be parsed
* don't look for comments; fparseln strips them
1999-01-17 07:01:26 +00:00
lukem bb490684f2 don't bother looking for comments; fparseln() removes them 1999-01-17 06:56:51 +00:00
lukem 5921d0348f convert from tweaking _res.lookups[] to calling nsdispatch(3) directly
for gethostby{name,addr}() (without methods for the yp lookups).
ypserv will now match names for the `hosts:' entry (ignoring `nis' if
specified).
1999-01-17 06:54:14 +00:00
kleink 3ed4fcf61e In userland, pull in <errno.h> instead of <sys/errno.h> for the declaration
of errno.
1999-01-11 22:39:59 +00:00
ross b1934d6034 {} fixes from Erik Bertelsen <erik@erik-be.uni-c.dk> (PR 6047) to shut up egcs. 1998-08-27 20:31:00 +00:00
tv 767b9acc8e "featch" -> "fetched" 1998-08-19 12:29:00 +00:00
mrg 32f519716b - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
kleink 1f491461e0 Need <time.h> for time(). 1998-06-24 10:26:08 +00:00
kleink 41dc2c91bd Fix LP64 botches introduced in last commit. 1998-06-11 14:50:46 +00:00
kleink 8bced1141c Fix an LP64 botch introduced in last commit; reported by Tim Rightnour. 1998-06-10 21:15:41 +00:00
lukem 211a72a8dc convert from in-house read_line to fparseln() 1998-06-08 06:53:47 +00:00
lukem d595bfe79d add ypinit -c (setup yp client) 1998-06-08 06:29:25 +00:00
lukem 3ed28f5cc1 disable INSECURE=yes now that libc support master.passwd YP maps 1998-06-08 03:44:34 +00:00
kleink e6be56ae0b Need <stdlib.h> for mktemp() prototype. 1998-06-01 14:05:35 +00:00
fair 1628920950 Fix man to mdoc conversion mistakes, mostly of the form ^\.[A-Z][A-Z] 1998-04-28 07:19:28 +00:00
kleink 70ae83a7e1 Use <sys/param.h> instead of <sys/types.h>: <netdb.h> and MAXHOSTNAMELEN are
not related to each other, and it should not be assumed that inclusion of the
former makes visible the latter.
1998-04-23 19:32:40 +00:00
tv 482063559a .y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.
1998-04-09 00:32:31 +00:00
perry 75a6e03535 change includes to fix compiler warning 1998-02-03 04:55:59 +00:00
thorpej 1679a04502 Change a couple of exit()s to _exit(), to make it safe for vfork(). 1997-12-31 06:59:54 +00:00
thorpej e07f4ba47c Need <string.h> for prototypes. 1997-11-18 22:58:00 +00:00
lukem 8e4ac5fee0 use warn("%s", func()) instead of warn(func()) 1997-11-18 07:01:50 +00:00
lukem e91c20c007 overhaul code, provide saner error messages, etc 1997-11-18 00:44:19 +00:00
lukem a2a60bf6a6 note that INSECURE=no isn't yet supported for netbsd clients 1997-11-18 00:37:23 +00:00
lukem 48b4356758 rewritten yppush from Chuck Cranor. 1997-11-18 00:32:57 +00:00
thorpej ade3ce9789 Fix int vs. size_t lossage. 1997-11-13 18:35:57 +00:00
lukem 4cda73731b more fixes for OPTIMIZE_DB (seems like this code was an unfinished idea;
i've fixed a lot of bugs in it):
* implement yp_close_map(struct opt_map *), to close a specific map,
  using the guts of yp_close_last()
* simplify yp_close_last() to use yp_close_map()
* ypdb_open_db(): add the st_dev, st_ino, and st_mtime of each map to
  the cached info, and check if changes if the db is cached; if so, close
  the map and reopen it fresh. also uncache entries if the domain or
  file disappear
1997-11-08 15:36:09 +00:00
lukem 721843cf7a use ".Tn YP" instead of "YP", fix up some .Nd entries, use .Pa for mapnames 1997-11-08 15:03:21 +00:00
lukem 71d53f5fd6 use in-house localhostname instead of gethostname - returns FQDN 1997-11-04 11:43:49 +00:00
lukem 1140eceb13 add { } in the right place; indentation alone isn't sufficient for
if (test1)
		if (test2)
			error()
	else {
		...
	}
this happened when i changed test2 from a void statement to actually
checking its return value.

the effect of this? a YP_MASTER_KEY value wasn't being added to the
generated databases, which was Not Good.
1997-11-04 11:28:46 +00:00
lukem a8b7ec8d99 ensure sizeof hostname buf for ether_(ntohost|line) is >= MAXHOSTNAMELEN + 1 1997-11-02 14:25:25 +00:00
lukem f4fb444bd9 * rewrite read_line(), partially based on get_line in netgroup_mkdb.c:
- use fgetln() instead of fgets()
	- store info in internal buffer
	- fix \\ support
	- count line numbers internally, so \\ lines don't mess up count
* ypdb_store():
	- ensure that the length of key or val doesn't exceed YPMAXRECORD
* makedbm, mknetid, revnetgroup, stdethers, stdhosts:
	- improve error handling
	- take advantage of rewritten read_line(), and cleanup line parsing
	- don't print trailing ` ' for key/val pairs with an empty val
* Makefile.yp:
	- fix up building of ypservers (from Chuck Cranor)
* ypinit.sh:
	- remove leading spaces in variable assignment (from Chuck Cranor)
1997-11-01 14:24:50 +00:00
lukem ad4916f857 fix spellos and incorrect man page references 1997-10-25 10:18:36 +00:00
lukem 0a94f4f077 use CPPFLAGS instead of CFLAGS 1997-10-25 06:57:53 +00:00
mycroft 6af5bbb01a Use S_IS*(), not S_IF*. 1997-10-19 19:53:54 +00:00
lukem 9f6ff4ad6f use string.h instead of strings.h 1997-10-18 07:05:31 +00:00
mikel bee22c9c19 xref ypbind(8), not nonexistent ypbind(1) 1997-10-18 06:50:50 +00:00
lukem f5bf267d90 enable WARNS=1 by default, but disable in unclean 3rd party code 1997-10-18 06:42:25 +00:00
lukem 29689d8440 clean up previous 1997-10-16 05:22:37 +00:00
lukem 4d10189f4c fix race condition when building libcommon with make -j 1997-10-16 05:10:14 +00:00
lukem 7cb9d0d79c database routines:
- rename OPTDB to OPTIMIZE_DB
- if OPTIMIZE_DB, in ypdb_open(), close a database if the open failed
  with ENFILE or EMFILE [from openbsd].
- because of the above, don't bother checking first if any FDs are
  available (with open("/", RDONLY) - it's a superfluous check.
- ensure that *map_info is set if a database was a cached open -
  without this fix OPTIMIZE_DB didn't work too well...
- enable OPTIMIZE_DB by default - should speed up lookups

secure map support:
- add ypdb_secure(), which returns non-zero if the map has the YP_SECURE
  private key set (which makedbm(8) -s adds) [from openbsd]
- modify various functions to check if a map is secure, and if so,
  refuse to serve information to clients not requesting from an
  IPPORT_RESERVED port [from openbsd]
- ensure that domainnames and map names are valid (don't contain
  "/"'s, aren't too long, etc) [idea from openbsd, but using our
  _yp_invalid_domain() et al, which does more checking.]

misc:
- add rcsid's
- implement _yp_invalid_map() (complements _yp_invalid_domain() in
  libc - eventually _yp_invalid_map() may move to libc...)
- use %#x instead of 0x%x in debug log messages
1997-10-15 05:01:07 +00:00
lukem b252d2a436 - major cleanup of Makefile.yp to use modern make(1) variables, and
follow our formatting convetions.
- add support for aliases, amd.home, master.passwd and netgroup maps
  [initially from openbsd, reworked as above]
- if INSECURE != "yes" then the passwd.by* maps will not contain the
  encrypted version of the passwd - privileged clients will request
  info from the master.passwd.by* maps.
  FreeBSD originally implemented this, and & OpenBSD supports it too.
  [from openbsd].

  By default, passwd maps are INSECURE, but in a *BSD-only environment,
  this could be disabled to allow for a [slightly] higher degree of
  security from non-root users...
1997-10-15 03:01:57 +00:00
lukem ec79495f83 add rcsid 1997-10-13 07:44:01 +00:00
lukem 16199f1de9 don't use home-grown ether_ntoa() - ether_toa(3) in libc works fine... 1997-10-13 07:41:48 +00:00
lukem 88b87b1582 add rcsid 1997-10-13 07:38:09 +00:00
lukem 7eaa3f736a add rcsid 1997-10-13 04:00:27 +00:00
lukem 2a43cbe64c add rcsid 1997-10-13 03:51:58 +00:00
lukem 9e8a6cf527 s/LINT/lint 1997-10-13 03:48:49 +00:00
lukem 21504c46eb - ignore trailing NUL in database key/value pairs (which sendmail's
aliases.db has)
- add rcsid
1997-10-13 03:47:07 +00:00
lukem 652dc94093 - hack ypdb_open() to try the standard hash (for sendmail's aliases.db)
if the initial open fails with EFTYPE. if a different database
  format is found to be more efficient, just add the code to open it
  prior to that of the other formats; this maintains backward
  compatibility with older databases whilst providing new functionality...
- add rcsid's
1997-10-13 03:42:27 +00:00
lukem 64718e58ff add rcsid 1997-10-13 03:15:30 +00:00
mycroft ccacc504e5 Make this work again, and add ethers to the list of recursive targets. 1997-10-12 11:53:11 +00:00
mycroft 26a3dbe1c4 GC some garbage variables. 1997-10-11 20:26:58 +00:00
veego e288b27b29 Don't install this libraries, we only this during the build. 1997-10-11 19:42:34 +00:00
lukem f5eefd0a1d - set the umask to 077, to protect the created directory
- clean up a couple of the messages
1997-10-08 14:09:19 +00:00
lukem 7b926dd1c9 - print a message and exit if the port returned by clnt(udp|tcp)_create isn't
a reserved port
- don't define optarg/optind - it comes from <unistd.h>
- deprecate register
1997-10-08 13:45:21 +00:00
lukem 91b6547967 fix cutnpasto 1997-10-08 00:11:51 +00:00
lukem 87ca3b181a minor KNFify 1997-10-07 15:00:35 +00:00
lukem 93c1ffe13c use err instead of errx, so the user has some idea why the file wasn't opened 1997-10-07 14:59:37 +00:00
lukem 5f88ebd1a3 fix & simplify test for skippable lines 1997-10-07 14:56:11 +00:00
lukem 6ea62c3327 simplify test for skippable lines 1997-10-07 14:46:48 +00:00
lukem 0d2bc0fdb6 use err instead of errx, so the user has some idea why the file wasn't opened 1997-10-07 14:45:18 +00:00
lukem 618db68108 grabage collect this 1997-10-07 14:43:44 +00:00
lukem 55d8f20490 use err instead of errx, so the user has some idea why the file wasn't opened 1997-10-07 14:42:32 +00:00
lukem c0495ebb45 nuke register & unnecessary extern's, factor out common code 1997-10-07 14:39:06 +00:00
lukem dc497bdd46 cleanup typos, grammaros, thinkos, and misuse of mdoc macros 1997-10-07 14:23:50 +00:00
lukem 07e169df74 add mkalias & revnetgroup 1997-10-06 06:55:50 +00:00
lukem 7307c9a9a5 KNF & WARNSify 1997-10-06 06:54:09 +00:00
lukem 6a8388c539 - KNFify
- cleanup for WARNS
- cleanup man page
1997-10-06 06:10:15 +00:00
lukem 42f1aa0434 revnetgroup - generate extra netgroup maps for YP 1997-10-06 05:01:30 +00:00
lukem 56b7c4c7c7 mkalias - generate YP version of sendmail aliases 1997-10-06 04:59:13 +00:00
lukem ac64718550 - build common/* once, into a library, rather than recompiling each of
the files multiple times in the other subdirectories (saves about
  10% on compilation time)
- clean up the manual pages
1997-10-02 14:16:12 +00:00
mikel f13c41584f add missing newline in usage(); from Hubert Feyrer in PR bin/4064 1997-09-08 03:18:19 +00:00
jtc 87f4ccd45f Fix files using old TNF copyright notice 1997-07-30 22:53:50 +00:00
mikel a86b9a7361 pushed ethers, not hosts 1997-07-29 05:56:48 +00:00
thorpej 3d8138fc0e Fix compiler warnings (and an awful lot of annoying little bugs). 1997-07-18 21:57:00 +00:00
gwr 10e180cc49 Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
1997-05-08 21:11:01 +00:00
gwr 012e528f2e Use .PATH.c: ... 1997-05-06 20:44:56 +00:00
christos 32b4ce594c PR/3504: Brian Baird:
- Do what the manual page says; don't create the log file if it does not exist.
- Limited support for ypserv v1; apparently sunos4 clients use it and sunos5
  server provides the same.
1997-04-17 17:46:16 +00:00
christos 0aad9d4378 Makefile cleanups 1997-03-24 22:02:40 +00:00
lukem 789002a23e use O_EXCL with O_CREAT when making the temporary db files 1997-03-22 03:32:36 +00:00
is 00cef679df New ARP system, supports IPv4 over any hardware link.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
1997-03-15 18:37:27 +00:00
mikel c4ecd9537c don't write the PID file until after calling daemon(3); from Enami
Tsugutomo in PR bin/3280.
fix a typo in the error message while I'm here.
1997-03-05 07:19:52 +00:00