Compare commits

...
239 Commits
Author SHA1 Message Date
Colin Percival 02bbf3743b FreeBSD-SA-04:16.fetch:
MFC revision 1.75 of src/usr.bin/fetch/fetch.c
Bump newvers.sh and document in UPDATING.

Approved by:	so
2004-11-18 12:06:51 +00:00
Dag-Erling Smørgrav 4526ebb48c Merge updated patch from vendor branch (1.1.1.17)
Approved by:	so
2004-05-20 13:18:10 +00:00
Dag-Erling Smørgrav ab543a61d7 Bump and document patch level.
Approved by:	so
2004-05-19 06:40:56 +00:00
Dag-Erling Smørgrav bf2ec5c140 Merge parser fix from vendor branch (rev 1.1.1.16)
Approved by:	so
2004-05-19 06:19:57 +00:00
Jacques Vidrine 950dff4647 MFC sysv_shm.c 1.90: Correct a reference counting bug in shmat(2). 2004-02-05 18:01:26 +00:00
Jacques Vidrine 976135f9e4 Correct a remote denial-of-service attack in named(8). 2003-11-27 16:54:01 +00:00
Jacques Vidrine bcb617c756 Repair build. sys/limits.h -> machine/limits.h
This should have been committed along with kern_subr.c 1.63.2.2.

Noticed by:	Chris Grijzen <[email protected]>
2003-10-10 20:15:49 +00:00
Jacques Vidrine d3ef18af69 Correct vulnerabilities in OpenSSL ASN.1 parsing.
Obtained from:	openssl.org CVS
2003-10-03 20:24:59 +00:00
Jacques Vidrine 23df981d66 Oops, FreeBSD 5.0 needs <machine/limits.h>, not <sys/limits.h>.
Noticed by:	LOD Billing Department <[email protected]>
2003-10-03 16:57:38 +00:00
Jacques Vidrine ebdea8551c MFC procfs_dbregs.c 1.23, procfs_fpregs.c 1.29, procfs_regs.c 1.28,
pseudofs_vnops.c 1.42, kern_subr.c 1.77, uio.h 1.28:
Correct several integer underflows/overflows in procfs and linprocfs.
2003-10-03 13:02:50 +00:00
Ruslan Ermilov 94d7dea578 Fixed the update target to follow the correct CVS branch.
Approved by:	nectar
2003-09-25 17:09:34 +00:00
Jacques Vidrine fb6209c427 Bump patch level for updated arplookup fix. 2003-09-25 13:35:48 +00:00
Bruce M Simpson 9e1ddfe3c9 Fix a logic error in the check to see if arplookup() should free the route.
Noticed by:	Mike Hogsett
Reviewed by:	ru
2003-09-24 21:51:13 +00:00
Bruce M Simpson abcf474963 Fix a bug in arplookup(), whereby a hostile party on a locally
attached network could exhaust kernel memory, and cause a system
panic, by sending a flood of spoofed ARP requests.

Approved by:	security-officer, jake (mentor)
Reported by:	Apple Product Security <[email protected]>
2003-09-23 20:08:42 +00:00
Gregory Neil Shapiro 83f0aa230c MFC: sendmail address parsing bug fix
Approved by:	so (nectar)
2003-09-17 20:22:03 +00:00
Jacques Vidrine ca59393ddb MFC buffer.c 1.2, channels.c 1.16, deattack.c 1.1.1.6, misc.c 1.1.1.5,
session.c 1.41, ssh-agent.c 1.19:
Correct more cases of allocation size bookkeeping errors.
2003-09-17 14:52:43 +00:00
Jacques Vidrine a6411f70ca MFC buffer.c 1.1.1.7: Do not record expanded size before attempting to
reallocate associated memory.
2003-09-16 17:51:06 +00:00
Jacques Vidrine 9ecf1aee2d MFC buffer.c 1.1.1.7: Do not record expanded size before attempting to
reallocate associated memory.
2003-09-16 17:34:32 +00:00
Jacques Vidrine 04c9e3572e Apply sendmail.org fix for DNS map processing error. See
<URL:http://www.sendmail.org/dnsmap1.html> for details.
2003-08-25 22:33:14 +00:00
Jacques Vidrine 41b91afdc2 MFC 1.24: Validate the iBCS2 statfs(2) length parameter. 2003-08-10 23:35:21 +00:00
Jacques Vidrine ebe53c53fe MFC sys_process.c 1.113, spigot.c 1.60:
Add or correct range checking of signal numbers in system calls and
ioctls.

MFC kern_sig.c 1.257:
panic() if we try to handle an out-of-range signal number in psignal()/
tdsignal().
2003-08-10 23:17:49 +00:00
Jacques Vidrine d873fa2ebe realpath(3) bug fix: There was an off-by-one error in computing the
size of the resulting canonical path.
2003-08-03 23:47:39 +00:00
SUZUKI Shinsuke 114d479577 back out the previous patch (rev 1.11.2.1)
(sorry for my wrong commit)
2003-04-22 13:10:17 +00:00
SUZUKI Shinsuke a6f227a812 MFC rev 1.15
- fixed byte order of route lifetimes in route info options.
  - corrected wording in a log message.

Obtained from: KAME
2003-04-22 09:40:57 +00:00
Gregory Neil Shapiro 4ed8fdd9b5 Update FreeBSD Security Advisory Number
Approved by:	so (nectar)
2003-03-29 21:58:11 +00:00
Gregory Neil Shapiro a3ffaa9b79 sendmail parsing buffer overflow fix
Advisory number to be filled in later

Approved by:	so (nectar)
2003-03-29 20:13:35 +00:00
Chris D. Faulhaber f8bf448616 MFC: crypto/openssl/ssl/s3_srvr.c 1.1.1.11
Import of PKCS #1 security fix.
       http://www.openssl.org/news/secadv_20030319.txt

MFC: crypto/openssl/crypto/rsa/rsa_eay.c 1.11
     crypto/openssl/crypto/rsa/rsa_lib.c  1.9
     Enable RSA blinding by default.
       http://www.openssl.org/news/secadv_20030317.txt
2003-03-21 16:13:07 +00:00
Chris D. Faulhaber 1aa5093e0c MFC:
src/lib/libc/xdr/xdr_mem.c 1.12
  src/include/rpc/xdr.h      1.23

Clean up some signed/unsigned issues in the XDR code.
2003-03-20 13:05:28 +00:00
Gregory Neil Shapiro 175b7923ab FreeBSD-SA-03:04.sendmail: sendmail header parsing buffer overflow
Approved by:	security-officer (nectar)
2003-03-03 17:19:49 +00:00
Jacques Vidrine 81dad2e2de MFC tcp_syncache.c 1.38: Improve security and performance of syncookies. 2003-02-23 20:19:43 +00:00
Hiroki Sato 954e957f9a Merge the following from the English version:
1.9.2.3 -> 1.9.2.4	errata/article.sgml
	1.119.2.2 -> 1.119.2.3	hardware/common/dev.sgml
	1.467.2.7 -> 1.467.2.8	relnotes/common/new.sgml

Approved by:	security-officer (nectar)
2003-02-22 09:19:48 +00:00
Jacques Vidrine 75c2c9f78b Update to OpenSSL 0.9.6i. 2003-02-20 17:14:24 +00:00
Kirk McKusick 4373f1b748 Correct lines incorrectly added to the copyright message. Add missing period.
Submitted by:	Bruce Evans <[email protected]>
Sponsored by:   DARPA & NAI Labs.
2003-02-14 21:08:14 +00:00
Kirk McKusick 89f6d277b8 Correct lines incorrectly added to the copyright message.
Submitted by:	Frank van der Linden <[email protected]>
Sponsored by:   DARPA & NAI Labs.
2003-02-14 00:31:06 +00:00
Jacques Vidrine 2c3e98f60f Document a fix in xe(4) (src/sys/dev/xe/if_xe.c revision 1.32.2.1)
which was slipped in accidently.  (This is not a security fix.)
2003-02-04 20:20:31 +00:00
Jacques Vidrine 191d6519b5 Correct a double-free bug and disable a dangerous feature in
cvs.

See <URL:http://online.securityfocus.com/archive/1/72584>,
<URL:http://security.e-matters.de/advisories/012003.html>,
and the soon-to-be-released FreeBSD-SA-03:01.cvs for details.
2003-02-04 18:08:27 +00:00
Jacques Vidrine 5c0bdf492e -- Emphasize on the first line that this is a security branch (and which
branch specifically).
-- Update imp's copyright to 2003.
-- Add some boiler-plate text for security branches that was missing.
2003-01-31 12:48:07 +00:00
Joerg Wunsch 6b2449dc01 The Xircom hardware always delivers received packets with the FCS appended.
Thus, mark the M_HASFCS flag so the generic ethernet layers will account
for this.
2003-01-29 15:19:20 +00:00
cvs2svn 84506e425e This commit was manufactured by cvs2svn to create branch 'RELENG_5_0'. 2003-01-28 21:43:27 +00:00
Martin Blapp 47227ef0ef MFC: Fix memleak.
Reviewed by:	rwatson
Approved by:	re (scottl)
2003-01-16 16:56:22 +00:00
Scott Long aed3a60833 Fix 'make release' from erroring out if this is an arch without driver
floppies.

Submitted by:	nyan
Reviewed bby:	jhb
2003-01-16 16:46:02 +00:00
Martin Blapp 79d45b722e MCF: Implement nonblocking tpc-connections. rpcgen -m does still
produce backcompatible code.

Reviewed by:	rwatson
Approved by:	re (rwatson)
Obtained from:	NetBSD
2003-01-16 08:58:54 +00:00
Martin Blapp 18d292b3f5 MFC: Implement non-blocking tcp-connections
Reviewed by:	rwatson
Approved by:	re (rwatson)
Obtained from:	NetBSD
2003-01-16 08:53:59 +00:00
Scott Long fd22bdcda3 Fix yet another typo here. bah.
Submitted by:	marcel
2003-01-16 08:49:28 +00:00
David E. O'Brien f262080726 MFC: isc_dhcp_3_0_1_rc11
Approved by:	scottl(re)
2003-01-16 07:59:33 +00:00
Scott Long 437023caac Fix a spelling mistake
Submitted by:	[email protected]
Approved by	re (blanket)
2003-01-16 06:36:28 +00:00
Scott Long 324410b130 Note the home of the 5.0-release packages.
Approved by:	re (blanket)
2003-01-16 06:03:40 +00:00
Scott Long 81a2629ab4 Note 5.0-RELEASE
Approved by:	re (blanket)
2003-01-16 06:01:10 +00:00
Scott Long d70e9e371f Add FreeBSD 5.0 to the family tree.
Btw, it looks like the BSD/OS side of the chart is getting stale.

Approved by:	re (blanket)
2003-01-16 06:00:25 +00:00
Scott Long 9bb7658d3b Use the RELENG_5_0 branch for cvsup
APproved by:	re (blanket)
2003-01-16 05:59:14 +00:00
Scott Long b319e9bb13 Note 5.0-RELEASE
Approved by:	re (blanket)
2003-01-16 05:54:38 +00:00
Scott Long 62693d7940 MFC rev 1.40: add mozilla and be more intelligent about the compat packages.
Approved by:	re
2003-01-16 00:54:23 +00:00
Nate Lawson e163a73881 MFC: 1.13 - check for AIO before starting up
Approved by:	re (scottl)
2003-01-15 23:59:20 +00:00
John Baldwin 9344c6b1bb MFC: Prompt for the driver floppy when booted from floppy prior to the main
menu in sysinstall.

Approved by:	re (blanket)
2003-01-15 21:59:11 +00:00
Udo Erdelhoff a1d5b922ad Fix some typos in the acpi disabling sections
Approved by:	re@ (blanket)
2003-01-15 21:15:48 +00:00
SUZUKI Shinsuke bec33ea3a3 MFC 1.29: sync with KAME to simplify Rev 1.27.2.1
Reviewed by: fenner
Approved by: re (jhb)
Obtained from:KAME
2003-01-15 20:25:08 +00:00
John Baldwin eb88eabdbb Axe 'awi' from the boot floppies. The kernel module is broken since it
doesn't include the rc4 crypto code.  The 'awi' driver only works (for some
value of "works") with OLDCARD anyways.

Approved by:	the re@ cabal
2003-01-15 19:12:49 +00:00
Bill Fenner 7e061d8005 MFC 1.28: fix alignment problems.
Approved by:	re (rwatson)
2003-01-15 16:16:34 +00:00
Chris Costello f06eec9bf3 Bring doc-syms up to HEAD: Support for `.Lb libugidfw'.
Approved by:	re
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-15 09:02:10 +00:00
Chris Costello e1aa00c762 Bring getfmac.8 up to HEAD.
Approved by:	re
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-15 08:59:44 +00:00
Chris Costello 3e4c096bc1 Bring in getpmac.8 from HEAD.
Approved by:	re
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-15 08:57:13 +00:00
Chris Costello e857d511bb Bring in setpmac.8 from HEAD.
Approved by:	re
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-15 08:53:36 +00:00
Chris Costello c77fe6a237 Bring in mac_prepare.3 from HEAD.
Bring the MAC library documentation up to HEAD.

Approved by:	re
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-15 08:48:52 +00:00
Chris Costello 77da1dfed4 Bring in the libugidfw documentaton from HEAD.
Approved by:	re
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-15 08:39:57 +00:00
Chris Costello 0d6d19d669 Bring mac.9 up to HEAD:
o Spelling fix
o Additional reference to the developers' handbook.

Approved by:	re
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-15 08:36:48 +00:00
Chris Costello f520d6dd49 Add mac.4.
Bring the MAC policy man pages up to HEAD.

Approved by:	re
Sponsored by:	DARPA, Network Associates Laboratories
2003-01-15 08:35:10 +00:00
Udo Erdelhoff 92084877a3 MFen: Fix the instructions for disabling ACPI
Approved by:	re@ (blanket)
2003-01-15 06:54:19 +00:00
cvs2svn dd0236acfd This commit was manufactured by cvs2svn to create branch 'RELENG_5_0'. 2003-01-15 06:11:14 +00:00
Bruce A. Mah f7fb6f7ed3 Fix up ACPI-disabling hint text.
Submitted by:	[email protected],
		Steve Kargl <[email protected]>

Approved by:	re (implicitly)
2003-01-14 23:33:43 +00:00
Udo Erdelhoff 9517481705 MFen/MFC: add id attributes to sect1 tags
Approved by:	re@ (blanket)
2003-01-14 23:10:43 +00:00
Peter Pentchev aed56b6ced MFC: Add 'id' tags to all <sect1> sections to ensure a sensible naming scheme
for the generated HTML documents.

Translators: no content changes.

Approved by:	re (bmah)
2003-01-14 18:12:51 +00:00
Hiroki Sato d5af844125 MFen: add changes between 1.469->1.470 forgotten in my previous commit.
Approved by:	re (blanket)
2003-01-14 17:38:19 +00:00
Mike Makonnen b457f2f130 Backout previous commit. Wrong branch. 2003-01-14 15:37:49 +00:00
Mike Makonnen 1bde07251c Finish merging in rev. 1.124 of rc.network, so that natd can be used
withough the $natd_interface having to be explicitly specified on the
command line.

Approved by: markm (mentor)
Submitted by: Aaron D. Gifford <[email protected]>
PR: conf/47024

MFC: upon re approval
2003-01-14 15:32:49 +00:00
Warner Losh 8e6b153634 MFC: 1.61: Fix implicit -n flag.
Approved by: re@
Early MFC requested by: re@
2003-01-14 07:06:40 +00:00
Mike Makonnen f94476e5b7 MFC of rc.d/named pidfile fix.
rc.conf    ver. 1.166
	rc.d/named ver. 1.6

Approved by: re, markm (mentor)
2003-01-14 01:12:07 +00:00
Hiroki Sato 7f5c2313df Merge the following from the English version:
1.444 -> 1.467.2.7	relnotes/common/new.sgml

Approved by:	re (blanket)
2003-01-13 23:54:13 +00:00
Scott Long 9546d4a42d Partial MFC from a few days ago:
Close up a race condition in the interrupt handler and report the number
of physical ram pages to the card so it can map it's cache correctly.

Approved by:	re
2003-01-13 23:48:42 +00:00
Jun Kuriyama e331b72f54 MFC: If you don't create a /usr filesystem, / will need 200MB.
Approved by:	re (jhb)
2003-01-13 21:58:27 +00:00
John Baldwin 283c506c2c MFC: Use the type field gleaned from the GEOM dumpconf text output to set
the subtype when adding part chunks in Open_Disk().

Approved by:	re
2003-01-13 21:10:22 +00:00
John Baldwin c43e032c92 MFC: Output each partition's p_fstype in the configuration text dump
output.

Approved by:	re
2003-01-13 21:09:20 +00:00
John Baldwin 7dd9999442 MFC: Workaround the case where we do a Create_Chunk_DWIM() in a freebsd
chunk that has no child chunk.

Approved by:	re
2003-01-13 21:08:21 +00:00
Poul-Henning Kamp 89defd3f99 MFC: Allways issue ioctls as BIO_GETATTR.
This should fix the "boot0cfg/fdisk on open disks" issue.

Approved by:	re
2003-01-13 21:04:15 +00:00
David E. O'Brien 3c2bea0e49 I meant to also add the version number to the GNU tupple. 2003-01-13 06:30:20 +00:00
David E. O'Brien c6e5df378a A few people don't seem to like "undermydesk". Use something else for the
release.

Approved by:	scottl, murray(implicitly)
2003-01-13 06:20:03 +00:00
Hiroki Sato ee6a06f37b Add missing parts in the previous commit.
Approved by:	re (blanket)
2003-01-13 00:11:58 +00:00
Hiroki Sato 040e3b6595 MFC: catch up with the English version for 5.0-RELEASE.
1.6   -> 1.8.2.2	early-adopter/article.sgml
	1.9   -> 1.9.2.3	errata/article.sgml
	1.3   -> 1.5  		hardware/Makefile
	(new) -> 1.31 		hardware/alpha/proc-alpha.sgml
	1.3   -> 1.3.2.1	hardware/common/artheader.sgml
	1.115 -> 1.119.2.2	hardware/common/dev.sgml
	1.3   -> 1.4  		hardware/common/hw.ent
	1.3   -> 1.4  		hardware/i386/article.sgml
	(new) -> 1.1  		hardware/pc98/Makefile
	(new) -> 1.1  		hardware/pc98/article.sgml
	(new) -> 1.1  		hardware/pc98/proc-pc98.sgml
	1.1   -> 1.3  		hardware/sparc64/Makefile
	1.2   -> 1.3  		hardware/sparc64/article.sgml
	(new) -> 1.5  		hardware/sparc64/proc-sparc64.sgml
	1.4   -> 1.5  		relnotes/Makefile
        1.424 -> 1.454		relnotes/common/new.sgml
	1.3   -> 1.4  		relnotes/i386/article.sgml
	(new) -> 1.1  		relnotes/ia64/Makefile
	(new) -> 1.1  		relnotes/ia64/article.sgml
	1.6   -> 1.6.2.1	share/sgml/release.dsl

Approved by:	re (blanket)
2003-01-12 18:10:17 +00:00
Udo Erdelhoff 223eec4c15 Sync to en_US versions:
early-adopter/article.sgml:	1.8.2.1 -> 1.8.2.2
errata/article.sgml:		1.9.2.2 -> 1.9.2.3
share/sgml/release.dsl:		1.6     -> 1.6.2.1

Approved by:	re@ (blanket)
2003-01-12 09:41:41 +00:00
Yoshihiro Takahashi dc57b6568e - Remove the atapifd and atapist drivers from the boot floppies.
- Don't move the cd9660 support into mfsroot-small.flp.

Approved by:	re (scottl)
2003-01-12 08:33:26 +00:00
Joerg Wunsch d9450c1939 Forgot in last message:
Approved by:	re
2003-01-12 07:32:29 +00:00
Joerg Wunsch cb99a1ad27 MFC the bugfix from 1.244: access to devices like /dev/fd1h now creates
the symlink to the proper device (/dev/fd1).
2003-01-12 07:31:57 +00:00
Bruce A. Mah fcecd0304d Updates for the Early Adopter's Guide: GCC version number, update
4.8-RELEASE scheduled release date, update Perl removal text.

Approved by:	re (implicitly)
2003-01-11 23:05:39 +00:00
Bruce A. Mah 2b1928c5d2 Fill in the errata document with some known issues and unfinished
business from the 5.0 release engineering TODO list.  The content from
this file on the RELENG_5_0 branch will be merged back to HEAD, where
the errata document will be maintained post-5.0.

Approved by:	re (implicitly)
2003-01-11 23:05:05 +00:00
Bruce A. Mah 3441df89b5 RELNOTESng version number bumps for 5.0-RELEASE. 2003-01-11 23:03:51 +00:00
Udo Erdelhoff 1ef5e4d32c Synchronise with eu_US version:
early-adopter/article.sgml:		1.8   -> 1.8.2.1
errata/article.sgml:			1.9   -> 1.9.2.2
hardware/common/artheader.sgml:		1.3   -> 1.3.2.1
hardware/common/dev.sgml:		1.119 -> 1.119.2.2
installation/common/artheader.sgml:	1.3   -> 1.3.2.1
installation/common/install.sgml:	1.16  -> 1.17
installation/common/trouble.sgml:	1.8   -> 1.10
readme/article.sgml:			1.19  -> 1.19.2.1
relnotes/common/new.sgml:		1.466 -> 1.467.2.7

Approved by:	re@ (blanket)
See also:	[email protected] on -doc
2003-01-11 21:28:44 +00:00
Alfred Perlstein ce54a5b9e8 MFC: 1.4
Approved by: re
2003-01-11 02:11:35 +00:00
Bruce A. Mah 6a0d99bf1c Edit the errata document so that it will make some sense for the
release.  For the most part this consists of snipping out old
"boilerplate" text and making sure that version number bumps will make
sense (when they happen).

Approved by:	re (implicitly)
2003-01-11 01:29:18 +00:00
Scott Long f3a7906554 Bah, put the if_bge driver on floppy3. I'm not sure why this is failing now. 2003-01-10 15:42:54 +00:00
Stefan Eßer b4ab92d026 MFC: Fix handling of bzip2ed log files (r1.5).
Approved by:	re
2003-01-10 08:40:20 +00:00
Stefan Eßer d27a01d7b5 MFC: Fix handling of bzip2ed log files (r1.3).
Approved by:	re
2003-01-10 08:39:17 +00:00
Peter Wemm 290df984e5 MFC: 1.39: move the MOD_SHUTDOWN events from shutdown_post_sync to
shutdown_final so that da's SYNC CACHE command and crashdumps do not lock
up on mpt devices.

Approved by: re (scottl)
2003-01-10 07:10:27 +00:00
Scott Long 6cda28d739 Sync RELENG_5_0 with HEAD to get the PnP fix, nForce2 support, Promise
FasTrack fixes, and various other small things.

Submitted by:	sos
2003-01-10 06:56:37 +00:00
Robert Watson abe7be067e Normalize MAKEDEV permissions for raidctl device.
Approved by:	re (scottl)
2003-01-10 05:19:39 +00:00
Robert Watson 79f9eca778 Normalize devfs permissions in RELENG_5_0; MFC of earlier changes
to HEAD:

    iir_ctrl.c:1.4
    pcfclock.c:1.11
    pps.c:1.36
    tdfx_pci.c:1.22
    tga_pci.c:1.3
    kern_descrip.c:2.7
    asr.c:1.27
    aac.c:1.45
    acpi.c:1.83
    rf_freebsdkintf.c:1.4

Approved by:	re (scottl)
2003-01-10 05:18:09 +00:00
Bruce A. Mah be0cee63ce MFC: UFS1/UFS2 bootblock support, matcd(4) note rewrite.
Approved by:	re (implicitly)
2003-01-10 05:04:10 +00:00
Jake Burkholder 7e04c6cf84 MFC: Don't allow user process to set an invalid window state through sigreturn.
Approved by:	re
2003-01-10 00:58:11 +00:00
Eric Moore 32332a216d Fix for DELL PERC firmware. Driver was hanging
during load time; this attributed to the mailbox
busy byte not being set prior to issuing a
polling command.
2003-01-09 22:29:05 +00:00
Warner Losh 37b40b4061 MFC: devd.conf -> src/etc. devd-generic OBE.
Approved by: re@ (scottl and jhb)
2003-01-09 20:41:48 +00:00
Warner Losh f77b5da9f8 MFC: Install devd.conf by default, ala the other config files.
Approved by: re@ (scottl and jhb)
2003-01-09 20:40:04 +00:00
Bruce A. Mah 2a8efd9a44 MFC: Typo fixes, applied for the purposes of diff reduction with
HEAD.

Approved by:	re (implicitly)
2003-01-09 16:19:43 +00:00
Sheldon Hearn 7c1794b81c MFC rev 1.23: regen
Approved by:	re
2003-01-09 15:42:23 +00:00
Bruce A. Mah d4980ad3fb Adjust iir(4), ida(4), and ciss(4) references to use manpage entities.
Approved by:	re (implicitly)
2003-01-09 06:34:31 +00:00
cvs2svn 7e5e754428 This commit was manufactured by cvs2svn to create branch 'RELENG_5_0'. 2003-01-09 04:05:07 +00:00
Marcel Moolenaar a703141641 MFC: 1.242: libc_r on ia64
Approved: re@ (jhb)
2003-01-09 00:26:41 +00:00
Marcel Moolenaar 6b932c64d3 MFC: 1.147: libc_r on ia64
Approved: re@ (jhb)
2003-01-09 00:25:37 +00:00
Marcel Moolenaar f88fe1e93d MFC: libc_r on ia64:
1.78	pthread_private.h
	1.37	uthread_create.c
	1.44	uthread_init.c
	1.44	uthread_sig.c

Approved: re@ (jhb)
2003-01-09 00:24:25 +00:00
Tom Rhodes 1fad86d85b MFC: Add a manual page for the ciss(4) driver. 2003-01-08 19:34:34 +00:00
Tom Rhodes 15cb47f783 MFC: ida.4 && iir.4 manual pages.
Approved by:	re (bmah)
2003-01-08 18:05:14 +00:00
David E. O'Brien 539c394543 MFC: revert getbsize's headerlenp argument back to an int *.
Approved by:	re
2003-01-08 10:12:14 +00:00
Alfred Perlstein 8ecdf38d5b MFC: 1.21
Approved by: re
2003-01-08 06:32:26 +00:00
Bruce A. Mah 23f2b21b5e MFC: ida(4) and lmc(4) hardware note entries, lmc(4) release note.
(Not an exact MFC because the manpages for these devices haven't
been merged.)

Approved by:	re (implicitly)
2003-01-08 06:04:03 +00:00
John Polstra 19df117329 MFC: Avoid 16-bit accesses to device memory. Use volatile where
appropriate in referencing device memory.  Parenthesize BGE_HOSTADDR
define properly.  Add the ASIC revision to the device description
string that appears in the dmesg output.

This merges in the following revisions from -current:

    if_bge.c		1.26 and 1.27
    if_bgereg.h		1.12

Approved by:	scottl
2003-01-08 01:38:37 +00:00
Tim J. Robbins 7da16554d8 MFC: Rename UL_GETSIZE to UL_GETFSIZE and UL_SETSIZE to UL_SETFSIZE.
These are the names required by 1003.1-2001.

Approved by:	re
2003-01-08 01:23:00 +00:00
Tim J. Robbins cf9eda65db MFC rev. 1.54: Repair vnode locking in portal_lookup().
Approved by:	re
2003-01-08 00:37:26 +00:00
Greg Lehey 0adb32c5ed MFC: Back out this change: disklabel now understands vinum volumes again.
Approved by: re (rwatson), some time ago.
2003-01-07 22:59:50 +00:00
Max Khon 90dbfae419 MFC: pthread_attr_get_np now takes 'pthread_t' (not 'pthread_t *')
to be more consistent with other pthread_XXX functions

Approved by:	re, deischen
2003-01-07 21:53:40 +00:00
Thomas Quinot 4b4771f2e4 MFC rev 1.19:
In cgetmatch(3), return -1 if a NULL or 0-length name parameter is used.
This prevents lpd from hanging at boot with certain (legal) printcap entries.

Approved by:	re (jhb)
2003-01-07 21:49:20 +00:00
Sam Leffler 46bbb47ba2 MFC: fixup statistics
turn of batching by default
     add max aggregation tunable and set it to 1 to minimize latency
     memory allocation fixes
     enable public key support
2003-01-07 21:46:54 +00:00
Sam Leffler 8228174916 MFC: crypto timing support
crypto statistics
     purge usercrypto sysctl
     manage kernel threads properly
     correct malloc flags in crypto_getreq
2003-01-07 21:45:24 +00:00
Poul-Henning Kamp 5771c65cbe MFC: Optimize the request size to the underlying disk.
Approved by:	re
2003-01-07 18:21:39 +00:00
Bruce A. Mah a766cc23d1 MFC: SA-02:44.
Approved by:	re (implicitly)
2003-01-07 17:35:44 +00:00
Bruce A. Mah 55f85f29b3 MFC: compat4x update, fwcontrol(8), awk 20021129 update, note
MFC of cvs 1.11.2.1 20021201 snapshot.

Approved by:	re (implicitly)
2003-01-07 16:50:58 +00:00
Scott Long 739acab266 MFC: teach sysinstall about rpcbind.
Approved by:	re (jhb)
2003-01-07 16:30:17 +00:00
Hidetoshi Shimokawa 8af2bba4f5 MFC: Sync FireWire drvier/utility with -current.
- Support multiple LUNs in SBP-II.
- Suspend/resume support .
- Phy probe improvement.
- SBP-II device probe improvement.

Approved by: re (jhb)
2003-01-07 13:43:50 +00:00
Chris Costello 04ad4f79cc MFC revision 1.10:
Log:
  A refused connection will return ECONNREFUSED rather than ECONNRESET.

  PR:             docs/46654
  Submitted by:   Christian S.J. Peron <[email protected]>

Approved by:	re (jhb)
2003-01-07 09:28:01 +00:00
Warner Losh 13188342ca MFC: change the default permission from 644 to 600 on devctl until
such time as devctl is a cloneable device.  Also MFC the grammar
change to a comment.

Approved by: re@ (rwatson)
2003-01-07 05:24:03 +00:00
Warner Losh fe6e1a8d67 MFC: make devd work and tweak the docs a bit. 2003-01-07 04:50:14 +00:00
Warner Losh bf804df44d Update copyright to 2003. People have made changes on this branch
this year.

Approved by: re@ (scottl)
2003-01-07 04:25:57 +00:00
Thomas Moestl 624a20b9bc MFC r1.241: build pppctl on sparc64, now that we have libc_r.
Approved by:	re
2003-01-06 22:56:41 +00:00
Thomas Moestl a2ddb52669 MFC r1.146: enable building libc_r on sparc64.
Approved by:	re
2003-01-06 22:55:48 +00:00
Thomas Moestl 6159064f20 MFC _atomic_lock.S r1.1, pthread_private.h r1.77: libc_r support for
sparc64.

Reviewed by:	jake
Approved by:	re
2003-01-06 22:54:08 +00:00
Thomas Moestl 4d1f402422 MFC _setjmp.S r1.5, setjmp.S r1.4, sigsetjmp.S r1.5: make longjmp() and
_longjmp() usable to switch stacks, add weak aliases as libc_r requires
them.

Reviewed by:	jake
Approved by:	re
2003-01-06 22:51:35 +00:00
Peter Wemm 967e3e21e0 MFC: slightly adjust SYSINIT order so that timecounters are always
initialized after cpu_initclocks has been called rather than sometimes
before, sometimes after.  Same for ntp_init().

Approved by:	re
2003-01-06 22:47:16 +00:00
Bruce A. Mah 2a8fae3a02 Update release documentation copyright dates.
Approved by:	re (implicitly)
2003-01-06 22:25:04 +00:00
Jacques Vidrine 3624b178df MFC kern_descrip.c 1.178, vfs_syscalls.c 1.303:
Correct file descriptor leaks in lseek and do_dup.

Approved by:	re (jhb, rwatson)
2003-01-06 21:20:54 +00:00
Hajimu UMEMOTO 214881131f MFC 1.21: gifconfig(8) was depricated.
Approved by:	re
2003-01-06 20:07:51 +00:00
Bruce A. Mah 6fe2f22cd5 Put snapshot release documentation in the right directory.
Approved by:	re (implicitly)
2003-01-06 17:05:14 +00:00
Jeffrey Hsu 700d7701b1 Merge rev 1.33 from current to RELENG_5_0: Validate inp before
de-referencing it.

Approved by:	re
2003-01-06 08:32:13 +00:00
cvs2svn 8165ef981d This commit was manufactured by cvs2svn to create branch 'RELENG_5_0'. 2003-01-06 04:51:22 +00:00
Marcel Moolenaar bf1f67af46 MFC 1.15
Approved: re@ (blanket)
2003-01-05 22:59:45 +00:00
Marcel Moolenaar 8acc78086a MFC 1.7
Approved: re@ (blanket)
2003-01-05 22:57:12 +00:00
Thomas Moestl 61f90fd666 MFC of r1.30: reenable building in share/mklocale on sparc64.
Approved by:	re
2003-01-05 19:37:58 +00:00
Hidetoshi Shimokawa d41601c813 MFC: Introduce FireWire userland utility.
- Install header files.
- Make device nodes.

Approved by:	re (rwatson)
2003-01-05 08:52:43 +00:00
Marcel Moolenaar 9d65f158fa MFC 1.46
Approved: re (blanket)
2003-01-05 03:39:34 +00:00
Nate Lawson 016d3502d1 MFC 1.100 - Return an error on attempts to r/w devices that don't support it 2003-01-04 22:55:30 +00:00
cvs2svn 162a81637c This commit was manufactured by cvs2svn to create branch 'RELENG_5_0'. 2003-01-04 16:03:51 +00:00
Bernd Walter 14a12e05b1 MFC rev 1.3
Don't write crashdumps outside partition boundaries.

Approved by:    re (jhb)
		gallatin (mentor)
2003-01-04 01:05:16 +00:00
Marcel Moolenaar 8cb4999ffc MFC r1.9
Approved: re (blanket)
2003-01-03 23:57:45 +00:00
Scott Long b68297fa98 As per the 5.0 TODO list, make malloc default to 'aj' instead of 'AJ'.
This matches the default for the 4.x releases, and is only going into
the RELENG_5_0 branch for now.  Making similar chages to HEAD is up
for debate as always.

Approved by:	re (rwatson)
2003-01-03 22:36:35 +00:00
Jeffrey Hsu d1d99d8616 Merge to RELENG_5_0: validate inp to prevent a use after free.
Approved by:	re
2003-01-03 20:35:59 +00:00
Poul-Henning Kamp b45f4c1bd9 MFC: Use sector0 ioctl support to modify active MBRs
Approved by:	re@
2003-01-02 20:18:15 +00:00
Poul-Henning Kamp 1118f8a560 MFC: ioctl support for writing sector zero of a MBR.
Approved by:	re@
2003-01-02 20:16:17 +00:00
Poul-Henning Kamp 31f7cca7a3 MFC: Fix chip identification for Dlink DL10050 chip.
Approved by:	re@
2003-01-02 20:02:44 +00:00
Poul-Henning Kamp 9daa5377cb MFC: Remove unnecessary giant locking.
Approved by:	re@
2003-01-02 20:00:59 +00:00
Poul-Henning Kamp a289a8f0da MFC:
Add some mtx_asserts() mostly for documentation reasons.
      Hide sysctl kern.geom.conf* from sysctl -a.

Approved by:	re@
2003-01-02 19:59:57 +00:00
Poul-Henning Kamp f2e01533ff MFC: Conditionalize 16 bytes of struct mutex on MUTEX_PROFILING
Approved by:	re@
2003-01-02 19:58:03 +00:00
Poul-Henning Kamp 7965b9f938 MFC: Enforce upper limit on number of vnodes.
Approved by:	re@
2003-01-02 19:56:45 +00:00
Poul-Henning Kamp a9550f8238 Initialize si_bsize_phys during open processing.
Approved by:	re@
2003-01-02 19:52:23 +00:00
Poul-Henning Kamp 7975a3066c MFC: Put a one-second timeout (And a XXX: comment) on a tsleep which
under certain not understood circumstances hangs sendmail during
boot.

Approved by:	re@
2003-01-02 19:51:07 +00:00
Yoshihiro Takahashi 78d18610c0 MFC: Return an error if the size of the sector is zero.
Approved by:	re (jhb)
2003-01-02 03:13:13 +00:00
Mike Barcroft 96376e110b MFC rev 1.39 & 1.40:
sa_handler is in the POSIX namespace.

Approved by:	re
2002-12-31 19:35:41 +00:00
Mike Barcroft 4e62a22554 MFC rev 1.66 (partial):
Fix a bug in typedef for uid_t.

Approved by:	re
2002-12-31 19:34:55 +00:00
Maxim Konovalov 3375f90bf3 MFC rev. 1.25: fix usbd.conf parsing: fgetln(3) returns a string
without terminating NUL character so do not expect it.

Approved by:	re (rwatson)
2002-12-31 09:01:07 +00:00
Yoshihiro Takahashi 7e213158d1 MFC: Change 'mfsroot' filename in mfsroot-small floppies from 'mfsroot-small'
to 'mfsroot'.

Approved by:	re (jhb)
2002-12-31 07:01:29 +00:00
Hidetoshi Shimokawa 3f62057b18 Sync with FireWire driver in -current.
- Fix permission of device node.
- Fix for VIA6306.
- Minor fix in sbp.c.
- s/Firewire/FireWire/.

Approved by:	re (rwatson)
2002-12-31 06:59:15 +00:00
Scott Long 47651c8d3f MFC: Put the if_bge driver on floppy 2
Approved by:	re (rwatson)
2002-12-31 05:38:04 +00:00
Scott Long 95a5855916 MFC: add the if_bge driver
Approved by:	re (rwatson)
2002-12-31 05:35:45 +00:00
Scott Long 2c2f985768 MFC: Use more appropriate values for defining the dma tags so that these
drivers can work with sparc64.

Approved by:	re (rwatson)
2002-12-31 05:33:38 +00:00
Robert Watson 7ed9881d0e MFC mac_bsdextended.c:1.10:
Map VAPPEND to VWRITE since the ugidfw rule syntax doesn't specifically
  address the append access mode.

  Reported by:    "Daniel C. Sobral" <[email protected]>
  Obtained from:  TrustedBSD Project
  Sponsored by:   DARPA, Network Associates Laboratories
2002-12-31 05:21:33 +00:00
Robert Watson da52b5a854 MFC label.c:1.135:
Since our default boot block now supports UFS1 and UFS2 even on
  i386, remove the seatbelt preventing users from setting the UFS2 flag
  on the root file system on i386.  This seatbelt did not exist on
  other platforms.

Approved by:	re (scottl)
2002-12-31 05:19:15 +00:00
Jeffrey Hsu fa7125615d Merge revs 1.29 and 1.31-1.32 from current to RELENG_5_0: use the
protocol lock instead of the inp lock.

Approved by: re
2002-12-31 01:47:15 +00:00
Poul-Henning Kamp d95d90eaf9 MFC: Use UMA for allocationg FFS inodes and dinodes.
Approved by:	rwatson
2002-12-29 14:54:20 +00:00
Julian Elischer e9fbc636b2 Make Makefile up-to-date
Submitted by: Hiten Pandya <[email protected]>
Approved by: re@ (Robert)
2002-12-27 20:19:42 +00:00
Julian Elischer d5bb058973 MFC of pathces to allow ng_fec.c to compile after Sam's bof rationalisations
and cleanups.

Submitted by:	Hiten Pandya <[email protected]>
Approved by:	re@ (robert)
2002-12-27 20:16:59 +00:00
Julian Elischer 6fb0f92a97 MFC the check that a dump will fit into the dump partition
Approved by:	re@ (Robert)
2002-12-27 20:11:08 +00:00
David Malone 1cfb9c2ad1 MFC: Add a new ftp mirror in Ireland which offers a service over IPv6.
Approved by:	re (murray)
2002-12-25 12:40:19 +00:00
Tom Rhodes 299fa84985 MFC: Make newsyslog(8) print the correct date when logs are turned over
PR:		46395
Submitted by:	maxim
2002-12-24 18:27:25 +00:00
Matthew Dillon 5227a62176 MFC 1.129, fix a double-free that occurs if an attempt to mount the root
filesystem via bootp fails.

Approved by:	re (murray)
2002-12-24 02:21:39 +00:00
Marcel Moolenaar 87c0ee0655 MFC 1.16: Fix DeMorgan bug.
Approved by: re (murray)
2002-12-24 02:09:47 +00:00
Warner Losh 6c644fd482 MFC: All the changes to the boot blocks that allow UFS1 and UFS2 to
fit into 8k.

Requested by: re (scottl)
2002-12-23 01:02:45 +00:00
Poul-Henning Kamp c68d136000 For reasons I have no clue to, the previous attempt at MFC'ing ignored
a bunch of files.

MFC:    GEOM and gbde changes.

1: fix serious bugs in gbde.
2: add alignment checks to avoid panic(8) implementations.
3: sync API with -current for forwards compatibility.

Approved by:	re
Take:		2
2002-12-22 18:00:18 +00:00
Kris Kennaway 9488f399ee MFC: Enforce correct ordering of filedesc structure and pipe mutex.
Approved by:	re@
2002-12-22 16:33:39 +00:00
Alexander Kabaev c3e6538507 MFC: a note about GCC ABI breakage.
Submitted by:	juli
Approved by:	re (rwatson)
2002-12-22 07:06:28 +00:00
Alexander Kabaev 4a60485476 MFC: 1.15: Restore traditional calling convention for FreeBSD/i386.
Approved by:	re (rwatson)
Reviewev by:	obrien
2002-12-22 06:06:04 +00:00
Matthew Dillon e76efebf7f MFC to 5.0 refcount race fix for the vmspace structure.
kern/kern_exit.c 1.188, vm/vm_map.c 1.275, vm/vm_map.h 1.93.
2002-12-22 03:30:34 +00:00
David E. O'Brien 75576f2747 MFC: 4.7's libs.
Approved by:	re(rwatson)
2002-12-21 09:43:19 +00:00
Kirk McKusick 90c9740639 MFC of revision 1.57 of sys/ufs/ffs/ffs_snapshot.c. This update
corrects a sign-post error introduced in revision 1.56. The effect
was to put an additional (incorrect) block into the lookup list for
each metablock in the snapshot. The extra incorrect block causes
background fsck to panic the kernel with "freeing free block".
For large filesystems, the large number of extra blocks can overrun
the area malloc'ed to hold the lookup list resulting in corruption
of the malloc arena.

Reported by:	Aurelien Nephtali <[email protected]>
Sponsored by:   DARPA & NAI Labs.
Approved by:	re
2002-12-21 03:07:24 +00:00
Poul-Henning Kamp 58d80b808e MFC: GEOM and gbde changes.
1: fix serious bugs in gbde.
2: add alignment checks to avoid panic(8) implementations.
3: sync API with -current for forwards compatibility.

Approved by:	re
2002-12-20 21:52:03 +00:00
David E. O'Brien 8b3b79d41e Properly set all the locales.
Approved by:	re
Submitted by:	ru
2002-12-19 17:00:27 +00:00
Johan Karlsson e6497bb9f9 MFC error report part of rev 1.3 and rev 1.4
Approved by:	re (rwatson)
2002-12-19 13:12:53 +00:00
Alfred Perlstein aae80a515c MFC: SCARGS and syscallargs removal.
Approved by: re@ (rwatson)
2002-12-19 09:40:13 +00:00
Maxim Konovalov 8bd7926344 MFC rev. 1.6: getsockopt(2) 'level' argument should be 0, not SOCK_STREAM.
Approved by:	re (rwatson)
2002-12-19 08:33:38 +00:00
Martin Blapp ba49cd32cf MFC: Change the name for the local unix-socket based protocol
from "unix" back to "local".  Add some compat stuff so both
ways work for some time.

Reviewed by:	phk
Approved by:	Re (rwatson)
2002-12-19 07:20:59 +00:00
Tim J. Robbins 162b3c2c36 MFC revision 1.64: Avoid spurious warning messages for broken symbolic links
on filesystems with ACLs enabled.

Approved by:	re
2002-12-19 06:13:18 +00:00
Robert Watson 7b43ea3ba2 MFC ls.c:1.72:
Improve handling of symlink targets when listing MAC labels: don't
  do the wrong thing when the symlink doesn't have a target, by
  considering !f_label in the construction of ch_options.

  Obtained from:  TrustedBSD Project
  Sponsored by:   DARPA, Network Associates Laboratories

Approved by:	re (jhb)
2002-12-19 05:07:31 +00:00
Giorgos Keramidas fd265063ba MFC: 1.48: typo fix.
Approved by:	re (rwatson)
2002-12-19 02:14:05 +00:00
Tom Rhodes 58faebbb91 MFC: Several of my recent manual page commits:
mac_biba.4: 	rev1.6: Spelling: S/ingrity/integrity.

make.conf.5: 	rev1.64: Document NO_CPU_CFLAGS && NO_CPU_COPTFLAGS.

pciconf.8:	rev1.23: Markup fixes and document more correctly.

atacontrol.8:	rev1.21: Add a list of currently supported modes && an EXAMPLES
		section.

Approved by:	re (murray)
2002-12-18 22:43:57 +00:00
SUZUKI Shinsuke 881fe6c7b1 MFC: 1.17
fixed a bug that IPv6 multicast packet is not forwarded if its packet
  size is equal to the outgoing interface's MTU

Approved by: re (rwatson)
Obtained from: KAME
2002-12-18 21:39:40 +00:00
Robert Watson 96220312f4 MFC if_loop.c:1.74:
Under some circumstances, the loopback interface will allocate a new
  mbuf for a packet looping back to provide alignment guarantees for
  KAME.  Unfortunately, this code performs a direct copy of the header
  rather than using a header copying primitive (largely because we have
  sucky header copying primitives).  This results in a multiple free
  of the MAC label in the header when the same label data is freed
  twice when the two mbufs with that header are freed.  As a temporary
  work-around, clear the initialized flag on the label to prevent the
  duplicate free, which prevents panics on large unaligned loopback
  IP and IPv6 data.  The real fix is to improve and make use of proper
  packet header copying routines here.

  Obtained from:  TrustedBSD Project
  Sponsored by:   DARPA, Network Associates Laboratories

Approved by:	re (jhb)
2002-12-18 21:03:41 +00:00
Nate Lawson b29039f9b4 MFC camcontrol.c:1.48 and camcontrol.8:1.36
Add PERIPH and XPT debug options.

Approved by:	re (murray)
2002-12-18 20:30:05 +00:00
cvs2svn 02a397014e This commit was manufactured by cvs2svn to create branch 'RELENG_5_0'. 2002-12-18 18:05:08 +00:00
Scott Long 1025424b6d Move the agp driver to the third floppy to un-spill mfsroot
Approved by:	re (jhb)
2002-12-18 16:13:25 +00:00
Scott Long b704eed9e7 Per the RC2 schedule, remove INVARIANTS, WITNESS, and DEBUG options from the
RELENG_5_0 kernels.
2002-12-18 08:11:25 +00:00
Tim J. Robbins 41d8aae2a1 MFC revision 1.170: Acquire Giant around calls to malloc() and free()
in fdalloc() to avoid a failed assertion when the file descriptor table
becomes larger than KMEM_ZMAX bytes in dup() and dup2().

Approved by:	re
2002-12-18 08:08:10 +00:00
Poul-Henning Kamp e53e5a3acd MFC: Untwist twisted logic which gcc/ia64 chokes on.
Approved by:	scottl
2002-12-18 07:26:51 +00:00
Warner Losh 500e6e618e MFC: latest devd code
Approved by: re (blanket)
2002-12-18 07:23:18 +00:00
Kirk McKusick 3bfcb5e4e4 Correctly apply the patch to ffs_snapshot.c approved earlier today.
Some day I will learn to extract things from CVS properly.

Sponsored by:   DARPA & NAI Labs.
Approved by:	re
2002-12-18 07:11:42 +00:00
Kirk McKusick dac257bde8 Only the most recent snapshot contains the complete list of blocks
that were copied in all of the earlier snapshots, thus its precomputed
list must be used in the copyonwrite test. Using incomplete lists may
lead to deadlock. Also do not include the blocks used for the indirect
pointers in the indirect pointers as this may lead to inconsistent
snapshots.

Reviewed by:    Ian Dowse <[email protected]>
Sponsored by:   DARPA & NAI Labs.
Approved by:    re
MFC from:	src/sys/sys/conf.h 1.151
MFC from:	src/sys/ufs/ufs/inode.h 1.42 & 1.43
MFC from:	src/sys/ufs/ffs/ffs_snapshot.c 1.54 & 1.55
2002-12-17 22:36:33 +00:00
Kirk McKusick e987334db4 The buffer daemon cannot skip over buffers owned by locked inodes as
they may be the only viable ones to flush. Thus it will now wait for
an inode lock if the other alternatives will result in rollbacks (and
immediate redirtying of the buffer). If only buffers with rollbacks
are available, one will be flushed, but then the buffer daemon will
wait briefly before proceeding. Failing to wait briefly effectively
deadlocks a uniprocessor since every other process writing to that
filesystem will wait for the buffer daemon to clean up which takes
close enough to forever to feel like a deadlock.

Reported by:    Archie Cobbs <[email protected]>
Sponsored by:   DARPA & NAI Labs.
Approved by:    re
MFC from:	sys/kern/vfs_bio.c 1.343
2002-12-17 22:20:42 +00:00
Søren Schmidt 46739d293f Fix the problem that burncd blank does not return.
Approved by: re@
2002-12-17 20:49:17 +00:00
Søren Schmidt 18b8177666 Fix the geometry problmes on PC98
Approved by re@
2002-12-17 20:46:56 +00:00
Poul-Henning Kamp a1d4fa3b47 Don't do PC98 geometry magic here, the ata driver will do it.
Approved by:	re
2002-12-17 20:46:17 +00:00
Tony Finch 35d4c61a1e Document trap EXIT and trap SIGNAME.
Approved by:	re (murray)
2002-12-17 17:37:06 +00:00
Matthew Dillon 90c2d988df MFC 1.183 to the 5.0 release, fix ack-on-ack bug in TCP
Approved by:	re (rwatson)
2002-12-17 00:23:47 +00:00
Dag-Erling Smørgrav 856dee1564 MFC: (1.52) do not attach to IEEE1284 interfaces.
Approved by:	re (jhb)
2002-12-17 00:05:25 +00:00
Olivier Houchard 9ae603343e MFC rev 1.3:
Fix the panic that occurs when kldunloading trm by using the correct prototype
for trm_detach and freeing all resources.
Rework a bit the way error are handled in trm_attach.
Remove the PCI_BASE_ADDR0 definition, since we now use PCIR_MAPS.

Approved by:	re
2002-12-16 19:23:34 +00:00
Doug Barton f1a97ac65b MFC 1.2, which brings in /etc/rc.devfs.
Approved by:	re (murray)
2002-12-15 23:20:51 +00:00
Maxim Konovalov 82f43bb6fc MFC rev. 1.20: fix byte order logging issue: sa.sin_port is already
in host byte order.

Approved by:	re (rwatson)
2002-12-15 13:57:43 +00:00
Maxim Konovalov d610afcd3b MFC rev. 1.44: clear a high bit of ipc_perm.seq so msgget(3) never
returns a negative message queue id.

Approved by:	re (rwatson)
2002-12-15 13:54:55 +00:00
Maxim Konovalov 60e4ee643a MFC rev. 1.5: fix bogus getsockopt(2) call: swap SOCK_STREAM and
LOCAL_PEERCRED.

Approved by:	re (rwatson)
2002-12-15 13:52:39 +00:00
Jun Kuriyama bdc25cd63c MFC: Update ROOT_MIN_SIZE for i386 to 118MB (and other ROOT_*_SIZE).
Approved by:	re (murray)
2002-12-15 12:20:53 +00:00
Alan Cox de1e262021 Add page locking to pmap_mincore().
Approved by:		re (rwatson)
Submitted (in part) by: tjr
2002-12-14 21:08:30 +00:00
Poul-Henning Kamp 444aa2b3ac MFC: Don't look for hotspots relative to the child devices but relative
to the parent device.

Approved by:	re
2002-12-14 20:59:30 +00:00
Warner Losh 55b07c02f6 MFC: don't assume that an up loopback device is configured when it is up.
Approved by: re (rwatson)
2002-12-14 05:29:45 +00:00
Bill Fenner b7d513c629 Pass the procedure number enum as u_int, not u_long, so that a pointer
to it can be cast to (enum_t *) without losing information.

This fixes certain amd maps on FreeBSD/sparc64.  Note that this is
not being committed to HEAD, in the hopes that this fix will come
from the vendor in the next release so these files don't have to
leave the vendor branch.

Approved by:	re (rwatson), maintainer (obrien)
2002-12-13 22:20:07 +00:00
Tom Rhodes d60cb4530b Merge my recent mount(8) commit into RELENG_5_0. This removes incorrect
documentation about dump(8) not working with snapshots correctly.

Approved by:	re (murray, rwatson)
2002-12-13 19:49:25 +00:00
Eric Moore 5f514a505e Problem: Hang while bootup on Perc2/SC.
Fix: Error handling wasn't implemented
in newly implemented polling code for quartz
controllers.

Approved by: re@
2002-12-13 17:34:00 +00:00
Bill Fenner 91ce9b18bd Renumber divert.
Forgotten by:   fenner
Approved by:    re (murray)
2002-12-13 09:18:34 +00:00
cvs2svn d2f155c07e This commit was manufactured by cvs2svn to create branch 'RELENG_5_0'. 2002-12-13 06:54:34 +00:00
1856 changed files with 32582 additions and 399679 deletions

No files matched your search

+1 -1
View File
@@ -555,7 +555,7 @@ update:
@echo "--------------------------------------------------------------"
@echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; ${CVS} -q update -A -P -d
cd ${.CURDIR}; ${CVS} -q update -rRELENG_5_0 -P -d
.endif
#
+109 -14
View File
@@ -1,21 +1,116 @@
Updating Information for FreeBSD current users
Updating Information for FreeBSD 5.0 Security Branch (RELENG_5_0) users.
This file is maintained and copyrighted by M. Warner Losh
<[email protected]>. See end of file for further details. For commonly
done items, please see the COMMON ITEMS: section later in the file.
NOTE TO PEOPLE WHO THINK THAT 5.0-CURRENT IS SLOW:
FreeBSD 5.0-CURRENT has many debugging features turned on, in
both the kernel and userland. These features attempt to detect
incorrect use of system primitives, and encourage loud failure
through extra sanity checking and fail stop semantics. They
also substantially impact system performance. If you want to
do performance measurement, benchmarking, and optimization,
you'll want to turn them off. This includes various WITNESS-
related kernel options, INVARIANTS, malloc debugging flags
in userland, and various verbose features in the kernel. Many
developers choose to disable these features on build machines
to maximize performance.
A reverse chronology since 5.0 was released is included, followed by
the common items quick how-tos, followed by entries for versions of
-current prior to 5.0 Release.
This is for the 5.0 release branch. All entries since 5.0 are an
itemized list of commits to this branch, numbered from the beginning.
The security advisories related to various patches contain information
on how to build/install a minimal set of binaries and start/stop a
minimal number of processes, if possible, for that patch. For those
updates that don't have an advisory, or to be safe, you can do a full
build and install as described in the COMMON ITEMS section.
20041118: p22 FreeBSD-SA-04:16.fetch
Correct a buffer overflow in fetch(1) which could allow a
mallicious server to execute arbitrary code on the client.
20040519: p21 FreeBSD-SA-04:10.cvs
Correct a heap overflow in cvs's pserver protocol parser.
20040205: p20 FreeBSD-SA-04:02.shmat
Correct a reference counting bug in shmat(2).
20031126: p19 FreeBSD-SA-03:19.bind
Corrected remote denial-of-service vulnerability in named(8).
20031003: p18 FreeBSD-SA-03:18.openssl
Corrected vulnerabilities in OpenSSL ASN.1 parsing.
20031003: p17 FreeBSD-SA-03:17.procfs
Correct integer underflows/overflows in procfs(5) and linprocfs(5).
20030924: p16 FreeBSD-SA-03:14.arp
Updated fix for arplookup bug.
20030923: p15 FreeBSD-SA-03:14.arp
Fix a bug in arplookup(), whereby a hostile party on a locally
attached network could exhaust kernel memory, and cause a system
panic, by sending a flood of spoofed ARP requests.
20030917: p14 FreeBSD-SA-03:13.sendmail
Fix another address parsing buffer overflow.
20030916: p13 FreeBSD-SA-03:12.openssh
Follow-up fixes for OpenSSH oversized packet buffer handling.
20030916: p12 FreeBSD-SA-03:12.openssh
OpenSSH oversized packet buffer handling corrected.
20030825: p11 FreeBSD-SA-03:11.sendmail
Sendmail DNS map problem corrected.
20030810: p10 FreeBSD-SA-03:10.iBCS2
iBCS2 system call translator for statfs leaked information.
20030810: p9 FreeBSD-SA-03:09.signal
Repair range-checking errors in signal handling.
20030804: p8 FreeBSD-SA-03:08.realpath
Correct a single byte buffer overflow in realpath(3).
20030329: p7 FreeBSD-SA-03:07.sendmail
sendmail address parsing buffer overflow.
20030321: p6 FreeBSD-SA-03:06.openssl
enable RSA blinding by default
fix PKCS #1 v1.5 padding vulnerability
20030320: p5 FreeBSD-SA-03:05.xdr
integer overflow errors in the Sun XDR library.
20030303: p4 FreeBSD-SA-03:04.sendmail
sendmail header parsing buffer overflow, ident parsing bug.
20030223: p3 FreeBSD-SA-03:03.syncookies
Make brute force attacks on syncookies much more difficult.
20030220: p2 FreeBSD-SA-03:02.openssl
Update to OpenSSL 0.9.6i in order to correct `Timing-based
attacks on SSL/TLS with CBC encryption' vulnerability.
20030204: p1 FreeBSD-SA-03:01.cvs
Correct a double-free bug and disable a dangerous feature in
cvs.
20030129:
Correct a bug where the xe(4) driver would discard a full-sized
(1500-byte) Ethernet frame.
20030117:
FreeBSD 5.0-RELEASE
20021222:
For a period after the GCC 3.2.1 import (from 12/04 to 12/22), GCC
used an incompatible form of ABI for returning structures and unions
which FreeBSD's GCC maintainers were not aware of relative to previous
versions of FreeBSD. We have gone back to the ABI for now, and any
code compiled which is required to interoperate with other code (not
built at the same time) returning structs or unions should be
rebuilt.
20021216:
A name change in /etc/netconfig has been reverted to stay
compatible with with suns TIRPC and also with NetBSD. You need
to run mergemaster after make world. A new libc does still work
with a outdated /etc/netconfig for some time, but you'll get
a warning. This warning will be removed in 20030301.
20021202:
The recent binutils upgrade marks a kernel flag day on
@@ -1131,7 +1226,7 @@ previous releases if your system is older than this.
Copyright information:
Copyright 1998, 2002 M. Warner Losh. All Rights Reserved.
Copyright 1998-2003 M. Warner Losh. All Rights Reserved.
Redistribution, publication, translation and use, with or without
modification, in full or in part, in any form or format of this
-10
View File
@@ -1,10 +0,0 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
PROG= chflags
SRCS= chflags.c
BINDIR= /bin
NOSHARED?=yes
.include <bsd.prog.mk>
-151
View File
@@ -1,151 +0,0 @@
.\" Copyright (c) 1989, 1990, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)chflags.1 8.4 (Berkeley) 5/2/95
.\" $FreeBSD$
.\"
.Dd May 2, 1995
.Dt CHFLAGS 1
.Os
.Sh NAME
.Nm chflags
.Nd change file flags
.Sh SYNOPSIS
.Nm
.Oo
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
.Ar flags
.Ar
.Sh DESCRIPTION
The
.Nm
utility modifies the file flags of the listed files
as specified by the
.Ar flags
operand.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl H
If the
.Fl R
option is specified, symbolic links on the command line are followed.
(Symbolic links encountered in the tree traversal are not followed.)
.It Fl L
If the
.Fl R
option is specified, all symbolic links are followed.
.It Fl P
If the
.Fl R
option is specified, no symbolic links are followed.
This is the default.
.It Fl R
Change the file flags for the file hierarchies rooted
in the files instead of just the files themselves.
.El
.Pp
The flags are specified as an octal number or a comma separated list
of keywords.
The following keywords are currently defined:
.Pp
.Bl -tag -offset indent -width "opaque" -compact
.It Ar arch
set the archived flag (super-user only)
.It Ar opaque
set the opaque flag (owner or super-user only)
.It Ar nodump
set the nodump flag (owner or super-user only)
.It Ar sappnd
set the system append-only flag (super-user only)
.It Ar schg
set the system immutable flag (super-user only)
.It Ar sunlnk
set the system undeletable flag (super-user only)
.It Ar uappnd
set the user append-only flag (owner or super-user only)
.It Ar uchg
set the user immutable flag (owner or super-user only)
.It Ar uunlnk
set the user undeletable flag (owner or super-user only)
.It Ar archived , sappend , schange , Xo
.Ar simmutable , uappend , uchange , uimmutable ,
.Ar sunlink , uunlink
.Xc
aliases for the above
.El
.Pp
Putting the letters
.Dq Ar no
before an option causes the flag to be turned off.
For example:
.Bl -tag -offset indent -width "nouchg"
.It Ar nouchg
the immutable bit should be cleared
.El
.Pp
Symbolic links do not have flags, so unless the
.Fl H
or
.Fl L
option is set,
.Nm
on a symbolic link always succeeds and has no effect.
The
.Fl H ,
.Fl L
and
.Fl P
options are ignored unless the
.Fl R
option is specified.
In addition, these options override each other and the
command's actions are determined by the last one specified.
.Pp
You can use "ls -lo" to see the flags of existing files.
.Sh DIAGNOSTICS
.Ex -std
.Sh SEE ALSO
.Xr ls 1 ,
.Xr chflags 2 ,
.Xr stat 2 ,
.Xr fts 3 ,
.Xr symlink 7
.Sh HISTORY
The
.Nm
command first appeared in
.Bx 4.4 .
-183
View File
@@ -1,183 +0,0 @@
/*
* Copyright (c) 1992, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1992, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif
#if 0
#ifndef lint
static char sccsid[] = "@(#)chflags.c 8.5 (Berkeley) 4/1/94";
#endif
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
#include <err.h>
#include <errno.h>
#include <fts.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
void usage(void);
int
main(int argc, char *argv[])
{
FTS *ftsp;
FTSENT *p;
u_long clear, set;
long val;
int Hflag, Lflag, Pflag, Rflag, ch, fts_options, oct, rval;
char *flags, *ep;
Hflag = Lflag = Pflag = Rflag = 0;
while ((ch = getopt(argc, argv, "HLPR")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
Lflag = Pflag = 0;
break;
case 'L':
Lflag = 1;
Hflag = Pflag = 0;
break;
case 'P':
Pflag = 1;
Hflag = Lflag = 0;
break;
case 'R':
Rflag = 1;
break;
case '?':
default:
usage();
}
argv += optind;
argc -= optind;
if (argc < 2)
usage();
if (Rflag) {
fts_options = FTS_PHYSICAL;
if (Hflag)
fts_options |= FTS_COMFOLLOW;
if (Lflag) {
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
}
} else
fts_options = FTS_LOGICAL;
flags = *argv;
if (*flags >= '0' && *flags <= '7') {
errno = 0;
val = strtol(flags, &ep, 8);
if (val < 0)
errno = ERANGE;
if (errno)
err(1, "invalid flags: %s", flags);
if (*ep)
errx(1, "invalid flags: %s", flags);
set = val;
oct = 1;
} else {
if (strtofflags(&flags, &set, &clear))
errx(1, "invalid flag: %s", flags);
clear = ~clear;
oct = 0;
}
if ((ftsp = fts_open(++argv, fts_options , 0)) == NULL)
err(1, NULL);
for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
switch (p->fts_info) {
case FTS_D:
if (Rflag) /* Change it at FTS_DP. */
continue;
fts_set(ftsp, p, FTS_SKIP);
break;
case FTS_DNR: /* Warn, chflag, continue. */
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
case FTS_ERR: /* Warn, continue. */
case FTS_NS:
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
continue;
case FTS_SL: /* Ignore. */
case FTS_SLNONE:
/*
* The only symlinks that end up here are ones that
* don't point to anything and ones that we found
* doing a physical walk.
*/
continue;
default:
break;
}
if (oct) {
if (!chflags(p->fts_accpath, set))
continue;
} else {
p->fts_statp->st_flags |= set;
p->fts_statp->st_flags &= clear;
if (!chflags(p->fts_accpath, (u_long)p->fts_statp->st_flags))
continue;
}
warn("%s", p->fts_path);
rval = 1;
}
if (errno)
err(1, "fts_read");
exit(rval);
}
void
usage(void)
{
(void)fprintf(stderr,
"usage: chflags [-R [-H | -L | -P]] flags file ...\n");
exit(1);
}
-161
View File
@@ -1,161 +0,0 @@
/* config.h. Generated automatically by configure. */
/*
* config.h -- configure various defines for tcsh
*
* All source files should #include this FIRST.
*
* Edit this to match your system type.
*/
/* $FreeBSD$ */
#ifndef _h_config
#define _h_config
/****************** System dependant compilation flags ****************/
/*
* POSIX This system supports IEEE Std 1003.1-1988 (POSIX).
*/
#define POSIX
/*
* POSIXJOBS This system supports the optional IEEE Std 1003.1-1988 (POSIX)
* job control facilities.
*/
#define POSIXJOBS
/*
* POSIXSIGS Use the POSIX signal facilities to emulate BSD signals.
*/
/* #undef POSIXSIGS */
/*
* VFORK This machine has a vfork().
* It used to be that for job control to work, this define
* was mandatory. This is not the case any more.
* If you think you still need it, but you don't have vfork,
* define this anyway and then do #define vfork fork.
* I do this anyway on a Sun because of yellow pages brain damage,
* [should not be needed under 4.1]
* and on the iris4d cause SGI's fork is sufficiently "virtual"
* that vfork isn't necessary. (Besides, SGI's vfork is weird).
* Note that some machines eg. rs6000 have a vfork, but not
* with the berkeley semantics, so we cannot use it there either.
*/
#define VFORK
/*
* BSDJOBS You have BSD-style job control (both process groups and
* a tty that deals correctly
*/
#define BSDJOBS
/*
* BSDSIGS You have 4.2-style signals, rather than USG style.
* Note: POSIX systems should not define this unless they
* have sigvec() and friends (ie: 4.3BSD-RENO, HP-UX).
*/
#define BSDSIGS
/*
* BSDTIMES You have BSD-style process time stuff (like rusage)
* This may or may not be true. For example, Apple Unix
* (OREO) has BSDJOBS and BSDSIGS but not BSDTIMES.
*/
#define BSDTIMES
/*
* BSDLIMIT You have BSD-style resource limit stuff (getrlimit/setrlimit)
*/
#define BSDLIMIT
/*
* BSDNICE Your system uses setpriority() instead of nice, to
* change a processes scheduling priority
*/
#define BSDNICE
/*
* TERMIO You have struct termio instead of struct sgttyb.
* This is usually the case for SYSV systems, where
* BSD uses sgttyb. POSIX systems should define this
* anyway, even though they use struct termios.
*/
#define TERMIO
/*
* SYSVREL Your machine is SYSV based (HPUX, A/UX)
* NOTE: don't do this if you are on a Pyramid -- tcsh is
* built in a BSD universe.
* Set SYSVREL to 1, 2, 3, or 4, depending the version of System V
* you are running. Or set it to 0 if you are not SYSV based
*/
#define SYSVREL 0
/*
* YPBUGS Work around Sun YP bugs that cause expansion of ~username
* to send command output to /dev/null
*/
/* #undef YPBUGS */
/*
* SIGVOID Define this if your signal handlers return void. On older
* systems, signal returns int, but on newer ones, it returns void.
*/
#define SIGVOID
/*
* HAVEDUP2 Define this if your system supports dup2().
*/
#define HAVEDUP2
/*
* UTHOST Does the utmp file have a host field?
*/
#define UTHOST
/*
* DIRENT Your system has <dirent.h> instead of <sys/dir.h>
*/
#define DIRENT
/****************** local defines *********************/
/****************** configurable hacks ****************/
#include <stdlib.h>
/* have been moved to config_f.h */
#include "config_f.h"
#if defined(__FreeBSD__)
#define NLS_BUGS
/* we want to use the system malloc when we install as /bin/csh */
#define SYSMALLOC
#define BSD_STYLE_COLORLS
#endif
#if defined(__bsdi__)
/*
* _PATH_TCSHELL if you've change the installation location (vix)
*/
# if _BSDI_VERSION >= 199701
# define _PATH_TCSHELL "/bin/tcsh"
/* # undef SYSMALLOC */
# define SYSMALLOC
# else
# define _PATH_TCSHELL "/usr/contrib/bin/tcsh"
# endif
# undef NLS
# undef NLS_CATALOGS
#elif defined(__APPLE__)
# define SYSMALLOC
#else
# define NLS_CATALOGS
#endif
#define KANJI
#define DSPMBYTE
#endif /* _h_config */
/* config.h.in. Generated automatically from configure.in by autoheader. */
+3 -4
View File
@@ -381,8 +381,7 @@ static void
prtstat(struct statfs *sfsp, struct maxwidths *mwp)
{
static long blocksize;
static int timesthrough;
static size_t headerlen;
static int headerlen, timesthrough;
static const char *header;
long used, availblks, inodes;
@@ -393,7 +392,7 @@ prtstat(struct statfs *sfsp, struct maxwidths *mwp)
mwp->total = mwp->used = mwp->avail = strlen(header);
} else {
header = getbsize(&headerlen, &blocksize);
mwp->total = imax(mwp->total, (int)headerlen);
mwp->total = imax(mwp->total, headerlen);
}
mwp->used = imax(mwp->used, strlen("Used"));
mwp->avail = imax(mwp->avail, strlen("Avail"));
@@ -442,7 +441,7 @@ static void
update_maxwidths(struct maxwidths *mwp, struct statfs *sfsp)
{
static long blocksize;
size_t dummy;
int dummy;
if (blocksize == 0)
getbsize(&dummy, &blocksize);
+13 -6
View File
@@ -448,7 +448,8 @@ traverse(int argc, char *argv[], int options)
* If not recursing down this tree and don't need stat info, just get
* the names.
*/
ch_options = !f_recursive && options & FTS_NOSTAT ? FTS_NAMEONLY : 0;
ch_options = !f_recursive && !f_label &&
options & FTS_NOSTAT ? FTS_NAMEONLY : 0;
while ((p = fts_read(ftsp)) != NULL)
switch (p->fts_info) {
@@ -691,7 +692,9 @@ display(FTSENT *p, FTSENT *list, int options)
error = mac_prepare_file_label(&label);
if (error == -1) {
warn("%s", cur->fts_name);
warn("MAC label for %s/%s",
cur->fts_parent->fts_path,
cur->fts_name);
goto label_out;
}
@@ -700,8 +703,8 @@ display(FTSENT *p, FTSENT *list, int options)
"%s", cur->fts_name);
else
snprintf(name, sizeof(name),
"%s/%s", cur->fts_parent->fts_accpath,
cur->fts_name);
"%s/%s", cur->fts_parent->
fts_accpath, cur->fts_name);
if (options & FTS_LOGICAL)
error = mac_get_file(name,
@@ -710,7 +713,9 @@ display(FTSENT *p, FTSENT *list, int options)
error = mac_get_link(name,
label);
if (error == -1) {
warn("%s", cur->fts_name);
warn("MAC label for %s/%s",
cur->fts_parent->fts_path,
cur->fts_name);
mac_free(label);
goto label_out;
}
@@ -718,7 +723,9 @@ display(FTSENT *p, FTSENT *list, int options)
error = mac_to_text(label,
&labelstr);
if (error == -1) {
warn("%s", cur->fts_name);
warn("MAC label for %s/%s",
cur->fts_parent->fts_path,
cur->fts_name);
mac_free(label);
goto label_out;
}
+8
View File
@@ -674,6 +674,14 @@ aclmode(char *buf, FTSENT *p, int *haveacls)
else
snprintf(name, sizeof(name), "%s/%s",
p->fts_parent->fts_accpath, p->fts_name);
/*
* We have no way to tell whether a symbolic link has an ACL since
* pathconf() and acl_get_file() both follow them.
*/
if (S_ISLNK(p->fts_statp->st_mode)) {
*haveacls = 1;
return;
}
if ((ret = pathconf(name, _PC_ACL_EXTENDED)) <= 0) {
if (ret < 0 && errno != EINVAL)
warn("%s", name);
+3 -6
View File
@@ -49,12 +49,9 @@ main(int argc, char *argv[])
char buf[PATH_MAX];
char *p;
if (argc == 1) {
if ((p = getcwd(NULL, 0)) == NULL)
err(1, "getcwd()");
} else if (argc == 2) {
if (argc == 2) {
if ((p = realpath(argv[1], buf)) == NULL)
err(1, "%s", argv[1]);
err(1, "%s", buf);
} else
usage();
(void)printf("%s\n", p);
@@ -65,6 +62,6 @@ static void
usage(void)
{
(void)fprintf(stderr, "usage: realpath [path]\n");
(void)fprintf(stderr, "usage: realpath path\n");
exit(1);
}
+4 -1
View File
@@ -1790,7 +1790,10 @@ Cause the shell to parse and execute
when any specified
.Ar signal
is received.
The signals are specified by signal number.
The signals are specified by name or number.
In addition, the pseudo-signal
.Ic EXIT
may be used to specify an action that is performed when the shell terminates.
The
.Ar action
may be null or omitted;
-6
View File
@@ -1,6 +0,0 @@
# $FreeBSD$
PROG= uuidgen
WARNS?= 4
.include <bsd.prog.mk>
-74
View File
@@ -1,74 +0,0 @@
.\" Copyright (c) 2002 Marcel Moolenaar
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd May 23, 2002
.Dt UUIDGEN 1
.Os
.Sh NAME
.Nm uuidgen
.Nd generate universally unique identifiers
.Sh SYNOPSIS
.Nm
.Op Fl 1
.Op Fl n Ar count
.Sh DESCRIPTION
The
.Nm
utility by default generates a single universally unique identifier (UUID),
also known as a globally unique identifier (GUID).
The UUID is written to stdout.
The following options can be used to change the number of identifiers
and the method used:
.Bl -tag -width indent
.It Fl 1
This option only has effect if multiple identifiers are to be generated and
instructs
.Nm
to not generate them in batch, but one at a time.
.It Fl n
This option controls the number of identifiers generated.
By default, multiple
identifiers are generated in batch.
.El
.Pp
Batched generation yields a dense set of identifiers in such a way that there
is no identifier that is larger than the smallest identifier in the set and
smaller than the largest identifier in the set and that is not already in the
set.
.Pp
When generating the identifiers one at a time, the identifiers will be close
to each other, but operating system latency and processing time will be
reflected in the distance between two successive identifiers.
.Sh DIAGNOSTICS
.Ex -std
.Sh SEE ALSO
.Xr uuidgen 2 ,
.Xr uuid 3
.Sh HISTORY
The
.Nm
command first appeared in
.Fx 5.0 .
-102
View File
@@ -1,102 +0,0 @@
/*
* Copyright (c) 2002 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <uuid.h>
static void
usage(void)
{
(void)fprintf(stderr, "usage: uuidgen [-1] [-n count]\n");
exit(1);
}
int
main(int argc, char *argv[])
{
uuid_t *store, *uuid;
char *p;
int ch, count, i, iterate;
count = -1; /* no count yet */
iterate = 0; /* not one at a time */
while ((ch = getopt(argc, argv, "1n:")) != -1)
switch (ch) {
case '1':
iterate = 1;
break;
case 'n':
if (count > 0)
usage();
count = strtol(optarg, &p, 10);
if (*p != 0 || count < 1)
usage();
break;
default:
usage();
}
argv += optind;
argc -= optind;
if (argc)
usage();
if (count == -1)
count = 1;
store = (uuid_t*)malloc(sizeof(uuid_t) * count);
if (store == NULL)
err(1, "malloc()");
if (!iterate) {
/* Get them all in a single batch */
if (uuidgen(store, count) != 0)
err(1, "uuidgen()");
} else {
uuid = store;
for (i = 0; i < count; i++) {
if (uuidgen(uuid++, 1) != 0)
err(1, "uuidgen()");
}
}
uuid = store;
while (count--) {
uuid_to_string(uuid++, &p, NULL);
printf("%s\n", p);
free(p);
}
free(store);
return (0);
}
+1 -1
View File
@@ -580,7 +580,7 @@ extern char *haseq(char *);
extern int is_network_member(const char *net);
extern int islocalnet(u_long);
extern int make_nfs_auth(void);
extern int make_rpc_packet(char *, int, u_long, struct rpc_msg *, voidp, XDRPROC_T_TYPE, AUTH *);
extern int make_rpc_packet(char *, int, u_int, struct rpc_msg *, voidp, XDRPROC_T_TYPE, AUTH *);
extern int mapc_keyiter(mnt_map *, void(*)(char *, voidp), voidp);
extern int mapc_search(mnt_map *, char *, char **);
extern int mapc_type_exists(const char *type);
+1 -1
View File
@@ -123,7 +123,7 @@ drop:
int
make_rpc_packet(char *buf, int buflen, u_long proc, struct rpc_msg *mp, voidp arg, XDRPROC_T_TYPE arg_xdr, AUTH *auth)
make_rpc_packet(char *buf, int buflen, u_int proc, struct rpc_msg *mp, voidp arg, XDRPROC_T_TYPE arg_xdr, AUTH *auth)
{
XDR msg_xdr;
int len;
+1 -1
View File
@@ -1 +1 @@
8.3.3-REL
8.3.3-REL-p1
+9 -3
View File
@@ -272,7 +272,7 @@ ns_resp(u_char *msg, int msglen, struct sockaddr_in from, struct qstream *qsp)
u_int qtype, qclass;
int restart; /* flag for processing cname response */
int validanswer, dbflags;
int cname, lastwascname, externalcname;
int cname, lastwascname, externalcname, cachenegative;
int count, founddata, foundname;
int buflen;
int newmsglen;
@@ -912,6 +912,7 @@ tcp_retry:
cname = 0;
lastwascname = 0;
externalcname = 0;
cachenegative = 1;
strcpy(aname, qname);
if (count) {
@@ -981,6 +982,7 @@ tcp_retry:
name);
db_detach(&dp);
validanswer = 0;
cachenegative = 0;
continue;
}
if (type == T_CNAME &&
@@ -1011,6 +1013,7 @@ tcp_retry:
"last was cname, ignoring auth. and add.");
db_detach(&dp);
validanswer = 0;
cachenegative = 0;
break;
}
if (i < arfirst) {
@@ -1026,6 +1029,7 @@ tcp_retry:
sin_ntoa(from));
db_detach(&dp);
validanswer = 0;
cachenegative = 0;
continue;
} else if (!ns_samedomain(name,
qp->q_domain)) {
@@ -1039,6 +1043,7 @@ tcp_retry:
sin_ntoa(from));
db_detach(&dp);
validanswer = 0;
cachenegative = 0;
continue;
}
if (type == T_NS) {
@@ -1231,8 +1236,9 @@ tcp_retry:
)
)
{
cache_n_resp(msg, msglen, from, qp->q_name,
qp->q_class, qp->q_type);
if (cachenegative)
cache_n_resp(msg, msglen, from, qp->q_name,
qp->q_class, qp->q_type);
if (!qp->q_cmsglen && validanswer) {
ns_debug(ns_log_default, 3,
+47 -9
View File
@@ -978,9 +978,6 @@ dirswitch (dir, repos)
return;
}
if (dir_name != NULL)
free (dir_name);
dir_len = strlen (dir);
/* Check for a trailing '/'. This is not ISDIRSEP because \ in the
@@ -996,6 +993,9 @@ dirswitch (dir, repos)
return;
}
if (dir_name != NULL)
free (dir_name);
dir_name = malloc (strlen (server_temp_dir) + dir_len + 40);
if (dir_name == NULL)
{
@@ -1648,8 +1648,18 @@ serve_unchanged (arg)
&& strncmp (arg, name, cp - name) == 0)
{
timefield = strchr (cp + 1, '/') + 1;
if (*timefield != '=')
/* If the time field is not currently empty, then one of
* serve_modified, serve_is_modified, & serve_unchanged were
* already called for this file. We would like to ignore the
* reinvocation silently or, better yet, exit with an error
* message, but we just avoid the copy-forward and overwrite the
* value from the last invocation instead. See the comment below
* for more.
*/
if (*timefield == '/')
{
/* Copy forward one character. Space was allocated for this
* already in serve_entry(). */
cp = timefield + strlen (timefield);
cp[1] = '\0';
while (cp > timefield)
@@ -1657,8 +1667,17 @@ serve_unchanged (arg)
*cp = cp[-1];
--cp;
}
*timefield = '=';
}
/* If *TIMEFIELD wasn't "/", we assume that it was because of
* multiple calls to Is-Modified & Unchanged by the client and
* just overwrite the value from the last call. Technically, we
* should probably either ignore calls after the first or send the
* client an error, since the client/server protocol specification
* specifies that only one call to either Is-Modified or Unchanged
* is allowed, but broken versions of WinCVS & TortoiseCVS rely on
* this behavior.
*/
*timefield = '=';
break;
}
}
@@ -1692,8 +1711,18 @@ serve_is_modified (arg)
&& strncmp (arg, name, cp - name) == 0)
{
timefield = strchr (cp + 1, '/') + 1;
if (!(timefield[0] == 'M' && timefield[1] == '/'))
/* If the time field is not currently empty, then one of
* serve_modified, serve_is_modified, & serve_unchanged were
* already called for this file. We would like to ignore the
* reinvocation silently or, better yet, exit with an error
* message, but we just avoid the copy-forward and overwrite the
* value from the last invocation instead. See the comment below
* for more.
*/
if (*timefield == '/')
{
/* Copy forward one character. Space was allocated for this
* already in serve_entry(). */
cp = timefield + strlen (timefield);
cp[1] = '\0';
while (cp > timefield)
@@ -1701,8 +1730,17 @@ serve_is_modified (arg)
*cp = cp[-1];
--cp;
}
*timefield = 'M';
}
/* If *TIMEFIELD wasn't "/", we assume that it was because of
* multiple calls to Is-Modified & Unchanged by the client and
* just overwrite the value from the last call. Technically, we
* should probably either ignore calls after the first or send the
* client an error, since the client/server protocol specification
* specifies that only one call to either Is-Modified or Unchanged
* is allowed, but broken versions of WinCVS & TortoiseCVS rely on
* this behavior.
*/
*timefield = 'M';
if (kopt != NULL)
{
if (alloc_pending (strlen (name) + 80))
@@ -4752,8 +4790,8 @@ struct request requests[] =
REQ_LINE("Max-dotdot", serve_max_dotdot, 0),
REQ_LINE("Static-directory", serve_static_directory, 0),
REQ_LINE("Sticky", serve_sticky, 0),
REQ_LINE("Checkin-prog", serve_checkin_prog, 0),
REQ_LINE("Update-prog", serve_update_prog, 0),
REQ_LINE("Checkin-prog", serve_noop, 0),
REQ_LINE("Update-prog", serve_noop, 0),
REQ_LINE("Entry", serve_entry, RQ_ESSENTIAL),
REQ_LINE("Kopt", serve_kopt, 0),
REQ_LINE("Checkin-time", serve_checkin_time, 0),
-1
View File
@@ -1244,7 +1244,6 @@ optimization_options (level, size)
specifying them, we will set the defaults in override_options. */
if (optimize >= 1)
flag_omit_frame_pointer = 2;
flag_pcc_struct_return = 2;
flag_asynchronous_unwind_tables = 2;
}
+1
View File
@@ -688,6 +688,7 @@
.ds doc-str-Lb-libposix \*[Px] Compatibility Library (libposix, \-lposix)
.ds doc-str-Lb-libresolv DNS Resolver Library (libresolv, \-lresolv)
.ds doc-str-Lb-libtermcap Termcap Access Library (libtermcap, \-ltermcap)
.ds doc-str-Lb-libugidfw File System Firewall Interface Library (libugidfw, \-lugidfw)
.ds doc-str-Lb-libutil System Utilities Library (libutil, \-lutil)
.ds doc-str-Lb-libz Compression Library (libz, \-lz)
.
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996-1999 Internet Software Consortium.
* Copyright (c) 1996-2003 Internet Software Consortium.
* Use is subject to license terms which appear in the file named
* ISC-LICENSE that should have accompanied this file when you
* received it. If a file named ISC-LICENSE did not accompany this
+6 -6
View File
@@ -1,7 +1,7 @@
# ex:ts=8
$FreeBSD$
ISC DHCP client 3.0.1rc8
ISC DHCP client 3.0.1rc11
originals can be found at: ftp://ftp.isc.org/isc/dhcp/
@@ -14,7 +14,7 @@ For the import of ISC-dhclient the following files were removed:
nextstep solaris openbsd
contrib/
dhcp.spec solaris.init
dhcp.spec solaris.init ms2isc/
include/cf/
aix.h alphaosf.h bsdos.h
@@ -24,12 +24,12 @@ For the import of ISC-dhclient the following files were removed:
sample.h sco.h sunos4.h
sunos5-5.h ultrix.h
`find . -name '.cvsignore'`
`find . -name '.cvsignore' -delete`
Imported by:
cvs import -m 'Import ISC DHCP 3.0.1 RC8 client.' \
src/contrib/isc-dhcp ISC isc_dhcp_3_0_1_rc8
cvs import -m 'Import ISC DHCP 3.0.1 RC11 client.' \
src/contrib/isc-dhcp ISC isc_dhcp_3_0_1_rc11
To make local changes to isc-dhcp, simply patch and commit to the main
@@ -60,4 +60,4 @@ Local Changes:
[email protected]
[email protected]
01-Apr-2002
15-Jan-2003
+1 -1
View File
@@ -1,6 +1,6 @@
# Makefile
#
# Copyright (c) 2000 Internet Software Consortium.
# Copyright (c) 2002 Internet Software Consortium.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
+1 -1
View File
@@ -1,6 +1,6 @@
# Makefile.conf
#
# Copyright (c) 1996-2000 Internet Software Consortium.
# Copyright (c) 1996-2002 Internet Software Consortium.
# Use is subject to license terms which appear in the file named
# ISC-LICENSE that should have accompanied this file when you
# received it. If a file named ISC-LICENSE did not accompany this
+1 -1
View File
@@ -1,6 +1,6 @@
# Makefile.dist
#
# Copyright (c) 1996-1999 Internet Software Consortium.
# Copyright (c) 1996-2002 Internet Software Consortium.
# Use is subject to license terms which appear in the file named
# ISC-LICENSE that should have accompanied this file when you
# received it. If a file named ISC-LICENSE did not accompany this
+3 -13
View File
@@ -97,7 +97,7 @@ system.
RELEASE STATUS
This is the ninth release candidate of version 3.0.1 of the ISC DHCP
This is the tenth release candidate of version 3.0.1 of the ISC DHCP
Distribution. Development of this release is approaching the point at
which it will be frozen, and no significant new features will be
added.
@@ -143,14 +143,14 @@ information. On Digital Unix, type ``man pfilt''.
To build the DHCP Distribution, unpack the compressed tar file using
the tar utility and the gzip command - type something like:
zcat dhcp-3.0.1rc9.tar.gz |tar xvf -
zcat dhcp-3.0.1rc11.tar.gz |tar xvf -
On BSD/OS, you have to type gzcat, not zcat, and you may run into
similar problems on other operating systems.
CONFIGURING IT
Now, cd to the dhcp-3.0.1rc9 subdirectory that you've just
Now, cd to the dhcp-3.0.1rc11 subdirectory that you've just
created and configure the source tree by typing:
./configure
@@ -244,16 +244,6 @@ network interface. There are also two potential compilation/runtime
problems for Linux 2.1/2.2: the "SO_ATTACH_FILTER undeclared" problem
and the "protocol not configured" problem.
LINUX: IF_TR.H NOT FOUND
When you compile the distribution on Linux, you may get an error
message indicating that the include file if_tr.h could not be found.
If this happens, go into includes/cf/linux.h and delete the line that
defined HAVE_TR_SUPPORT, or look into installing a new version of libc
that includes the if_tr.h file. We will be working on removing this
problem in the future, but for now, if you run into it, this should be
a viable workaround.
LINUX: SO_ATTACH_FILTER UNDECLARED
In addition, there is a minor issue that we will mention here because
+68 -2
View File
@@ -1,7 +1,7 @@
Internet Software Consortium DHCP Distribution
Version 3.0.1
Release Candidate 9
April 30, 2002
Release Candidate 10
June, 2002
Release Notes
@@ -46,6 +46,72 @@ Murrell at BC Tel Advanced Communications. I'd like to express my
thanks to all of these good people here, both for working on the code
and for prodding me into improving it.
Changes since 3.0.1rc10
- Potential buffer overflows in minires repaired.
- A change to the linux client script to use /bin/bash, since /bin/sh may
not be bash.
- Some missing va_end cleanups thanks to a patch from Thomas Klausner.
- A correction of boolean parsing syntax validation - some illegal syntaxes
that worked before are now detected and produce errs, some legal syntaxes
that errored before will now work properly.
- Some search-and-replace errors that caused some options to change their
names was repaired.
- Shu-min Chang of the Intel corporation has contributed a perl script and
module that converts the MS NT4 DHCP configuration to a ISC DHCP3
configuration file.
- Applied the remainder of the dhcpctl memory leak patch provided by Bill
Squier at ReefEdge, Inc. ([email protected]).
- Missing non-optional failover peer configurations will now result in a soft
error rather than a null dereference.
Changes since 3.0.1rc9
- A format string was corrected to fix compiler warnings.
- A number of spelling corrections were made in the man pages.
- The dhclient.conf.5 man page was changed to refer to do-forward-updates
rather than a configuration option that doesn't exist.
- A FreeBSD-specific bug in the interface removal handling was fixed.
- A Linux-specific Token Ring detection problem was fixed.
- Hashes removed from as-yet-unknown agent options, having those options
appear in reality before we know about them will no longer produce
self-corrupting lease databases.
- dhclient will use the proper port numbers now when using the -g option.
- A order-of-operations bug with 2 match clauses in 1 class statement is
fixed thanks to a patch from Andrew Matheson.
- Compilation problems on Solaris were fixed.
- Compilation problems when built with DEBUG or DEBUG_PACKET were repaired.
- A fix to the dhcp ack process which makes certain group options will be
included in the first DHCPOFFER message was made thanks to a patch from
Ling Gou.
- A few memory leaks were repaired thanks to patches from Bill Squier at
ReefEdge, Inc. ([email protected]).
- A fix for shared-networks that sometimes give clients options for the
wrong subnets (in particular, 'option routers') was applied, thanks to
Ted Lemon for the patch.
- Omshell's handling of dotted octets as values was changed such that dots
one after the other produce zero values in the integer string.
Changes since 3.0.1rc8
- Fix a format string vulnerability in the server that could lead to a
+1 -1
View File
@@ -1,6 +1,6 @@
# Makefile.dist
#
# Copyright (c) 1996-1999 Internet Software Consortium.
# Copyright (c) 1996-2002 Internet Software Consortium.
# Use is subject to license terms which appear in the file named
# ISC-LICENSE that should have accompanied this file when you
# received it. If a file named ISC-LICENSE did not accompany this
+1 -1
View File
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: clparse.c,v 1.62.2.2 2002/02/09 03:13:17 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n"
"$Id: clparse.c,v 1.62.2.3 2002/11/17 02:25:43 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n"
"$FreeBSD$\n";
#endif /* not lint */
+2 -1
View File
@@ -1,6 +1,6 @@
.\" dhclient-script.8
.\"
.\" Copyright (c) 1996-2001 Internet Software Consortium.
.\" Copyright (c) 1996-2002 Internet Software Consortium.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -35,6 +35,7 @@
.\" see ``http://www.vix.com''. To learn more about Nominum, Inc., see
.\" ``http://www.nominum.com''.
.\"
.\" $Id: dhclient-script.8,v 1.8.2.4 2002/11/17 02:25:43 dhankins Exp $
.\" $FreeBSD$
.\"
.TH dhclient-script 8
+4 -2
View File
@@ -1,6 +1,6 @@
.\" dhclient.8
.\"
.\" Copyright (c) 1996-1999 Internet Software Consortium.
.\" Copyright (c) 1996-2002 Internet Software Consortium.
.\" Use is subject to license terms which appear in the file named
.\" ISC-LICENSE that should have accompanied this file when you
.\" received it. If a file named ISC-LICENSE did not accompany this
@@ -16,6 +16,8 @@
.\" Support and other services are available for ISC products - see
.\" http://www.isc.org for more information.
.\"
.\" $Id: dhclient.8,v 1.12.2.7 2002/11/17 02:25:43 dhankins Exp $
.\"
.\" Portions copyright (c) 2000 David E. O'Brien.
.\" All rights reserved.
.\" $FreeBSD$
@@ -143,7 +145,7 @@ than cycling through the list of old leases.
The names of the network interfaces that dhclient should attempt to
configure may be specified on the command line. If no interface names
are specified on the command line dhclient will normally identify all
network interfaces, elimininating non-broadcast interfaces if
network interfaces, eliminating non-broadcast interfaces if
possible, and attempt to configure each interface.
.PP
It is also possible to specify interfaces by name in the
+15 -15
View File
@@ -41,7 +41,7 @@
#ifndef lint
static char ocopyright[] =
"$Id: dhclient.c,v 1.129.2.10 2002/04/26 23:33:05 murray Exp $ Copyright (c) 1995-2001 Internet Software Consortium. All rights reserved.\n"
"$Id: dhclient.c,v 1.129.2.12 2002/11/07 23:26:38 dhankins Exp $ Copyright (c) 1995-2002 Internet Software Consortium. All rights reserved.\n"
"$FreeBSD$\n";
#endif /* not lint */
@@ -72,20 +72,19 @@ struct in_addr giaddr;
assert (state_is == state_shouldbe). */
#define ASSERT_STATE(state_is, state_shouldbe) {}
static char copyright[] = "Copyright 1995-2001 Internet Software Consortium.";
static char copyright[] = "Copyright 1995-2002 Internet Software Consortium.";
static char arr [] = "All rights reserved.";
static char message [] = "Internet Software Consortium DHCP Client";
static char url [] = "For info, please visit http://www.isc.org/products/DHCP";
u_int16_t local_port;
u_int16_t remote_port;
int no_daemon;
int save_scripts;
struct string_list *client_env;
int client_env_count;
int onetry;
int quiet = 1;
int nowait;
u_int16_t local_port=0;
u_int16_t remote_port=0;
int no_daemon=0;
struct string_list *client_env=NULL;
int client_env_count=0;
int onetry=0;
int quiet=1;
int nowait=0;
static void usage PROTO ((void));
@@ -291,8 +290,10 @@ int main (argc, argv, envp)
/* Default to the DHCP/BOOTP port. */
if (!local_port) {
/* If we're faking a relay agent, and we're not using loopback,
use the server port, not the client port. */
if (relay && giaddr.s_addr != htonl (INADDR_LOOPBACK)) {
local_port = htons (67);
local_port = htons(67);
} else {
ent = getservbyname ("dhcpc", "udp");
if (!ent)
@@ -306,13 +307,12 @@ int main (argc, argv, envp)
}
/* If we're faking a relay agent, and we're not using loopback,
use the server port, not the client port. */
we're using the server port, not the client port. */
if (relay && giaddr.s_addr != htonl (INADDR_LOOPBACK)) {
local_port = htons (ntohs (local_port) - 1);
remote_port = local_port;
} else
remote_port = htons (ntohs (local_port) - 1); /* XXX */
/* Get the current time... */
GET_TIME (&cur_time);
+7 -6
View File
@@ -1,6 +1,6 @@
.\" dhclient.conf.5
.\"
.\" Copyright (c) 1996-2001 Internet Software Consortium.
.\" Copyright (c) 1996-2002 Internet Software Consortium.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -35,6 +35,7 @@
.\" see ``http://www.vix.com''. To learn more about Nominum, Inc., see
.\" ``http://www.nominum.com''.
.\"
.\" $Id: dhclient.conf.5,v 1.12.2.8 2002/11/17 02:25:43 dhankins Exp $
.\" $FreeBSD$
.\"
.TH dhclient.conf 5
@@ -252,19 +253,19 @@ updated. The \fIfqdn.encoded\fR option may need to be set to
\fIon\fR or \fIoff\fR, depending on the DHCP server you are using.
.PP
.I The
.B no-client-updates
.B do-forward-updates
.I statement
.PP
\fBno-client-updates [ \fIflag\fR ] \fB;\fR
\fBdo-forward-updates [ \fIflag\fR ] \fB;\fR
.PP
If you want to do DNS updates in the DHCP client
script (see \fBdhclient-script(8)\fR) rather than having the
DHCP client do the update directly (for example, if you want to
use SIG(0) authentication, which is not supported directly by the
DHCP client, you can instruct the client not to do the update using
the \fBno-client-updates\fR statement. \fIFlag\fR should be \fBtrue\fR
if you don't want the DHCP client to do the update, and \fBfalse\fR if
you want the DHCP client to do the update. By default, the DHCP
the \fBdo-forward-updates\fR statement. \fIFlag\fR should be \fBtrue\fR
if you want the DHCP client to do the update, and \fBfalse\fR if
you don't want the DHCP client to do the update. By default, the DHCP
client will do the DNS update.
.SH OPTION MODIFIERS
In some cases, a client may receive option data from the server which
+2 -1
View File
@@ -1,6 +1,6 @@
.\" dhclient.conf.5
.\"
.\" Copyright (c) 1997 The Internet Software Consortium.
.\" Copyright (c) 1997-2002 The Internet Software Consortium.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,7 @@
.\" see ``http://www.isc.org/isc''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''.
.\"
.\" $Id: dhclient.leases.5,v 1.2.4.3 2002/11/17 02:25:44 dhankins Exp $
.\" $FreeBSD$
.\"
.TH dhclient.leases 5
+9 -3
View File
@@ -1,5 +1,7 @@
#!/bin/sh
#
# $Id: freebsd,v 1.13.2.4 2002/06/09 22:37:55 murray Exp $
#
# $FreeBSD$
if [ -x /usr/bin/logger ]; then
@@ -9,8 +11,12 @@ else
fi
make_resolv_conf() {
if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
echo search $new_domain_name >/etc/resolv.conf
if [ x"$new_domain_name_servers" != x ]; then
if [ "x$new_domain_name" != x ]; then
echo search $new_domain_name >/etc/resolv.conf
else
rm /etc/resolv.conf
fi
for nameserver in $new_domain_name_servers; do
echo nameserver $nameserver >>/etc/resolv.conf
done
+2 -2
View File
@@ -3,7 +3,7 @@
Memory allocation... */
/*
* Copyright (c) 1996-2001 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: alloc.c,v 1.53.2.8 2001/10/18 20:30:02 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: alloc.c,v 1.53.2.9 2002/11/17 02:26:56 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+6 -2
View File
@@ -3,7 +3,7 @@
BPF socket interface code, originally contributed by Archie Cobbs. */
/*
* Copyright (c) 1996-2000 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
#ifndef lint
static char copyright[] =
"$Id: bpf.c,v 1.48.2.1 2002/04/30 05:12:53 murray Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: bpf.c,v 1.48.2.3 2002/11/17 02:26:56 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -423,7 +423,11 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
interface -> rbuf,
(size_t)interface -> rbuf_max);
if (length <= 0) {
#ifdef __FreeBSD__
if (errno == ENXIO) {
#else
if (errno == EIO) {
#endif
dhcp_interface_remove
((omapi_object_t *)interface,
(omapi_object_t *)0);
+2 -2
View File
@@ -3,7 +3,7 @@
OMAPI object interfaces for the DHCP server. */
/*
* Copyright (c) 1999-2001 Internet Software Consortium.
* Copyright (c) 1999-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@
#ifndef lint
static char copyright[] =
"$Id: comapi.c,v 1.9.2.5 2001/10/18 20:09:59 mellon Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: comapi.c,v 1.9.2.6 2002/11/17 02:26:56 dhankins Exp $ Copyright (c) 1999-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+1 -1
View File
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: conflex.c,v 1.92.2.5 2002/02/09 03:15:17 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: conflex.c,v 1.92.2.6 2002/11/17 02:26:56 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+1 -1
View File
@@ -3,7 +3,7 @@
Subroutines that support dhcp tracing... */
/*
* Copyright (c) 2001 Internet Software Consortium.
* Copyright (c) 2001-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
+1 -1
View File
@@ -1,6 +1,6 @@
.\" dhcp-eval.5
.\"
.\" Copyright (c) 1996-2001 Internet Software Consortium.
.\" Copyright (c) 1996-2002 Internet Software Consortium.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
+4 -3
View File
@@ -1,6 +1,6 @@
.\" dhcp-options.5
.\"
.\" Copyright (c) 1996-2001 Internet Software Consortium.
.\" Copyright (c) 1996-2002 Internet Software Consortium.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -35,6 +35,7 @@
.\" see ``http://www.vix.com''. To learn more about Nominum, Inc., see
.\" ``http://www.nominum.com''.
.\"
.\" $Id: dhcp-options.5,v 1.19.2.9 2002/11/17 02:26:57 dhankins Exp $
.\" $FreeBSD$
.\"
.TH dhcpd-options 5
@@ -247,7 +248,7 @@ server reply (DHCPOFFER), a DHCP server uses this option to specify
the lease time it is willing to offer.
.PP
This option is not directly user configurable in the server; refer to the
\fImax-lease-time\fR and \fidefault-lease-time\fR server options in
\fImax-lease-time\fR and \fIdefault-lease-time\fR server options in
.B dhcpd.conf(5).
.RE
.PP
@@ -519,7 +520,7 @@ respond.
.RS 0.25i
.PP
This option specifies the maximum size datagram that the client
should be prepared to reassemble. The minimum value legal value is
should be prepared to reassemble. The minimum legal value is
576.
.RE
.PP
+7 -3
View File
@@ -3,7 +3,7 @@
Network input dispatcher... */
/*
* Copyright (c) 1995-2001 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: discover.c,v 1.42.2.9 2002/03/12 06:46:17 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: discover.c,v 1.42.2.13 2002/11/17 02:26:57 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -540,8 +540,12 @@ void discover_interfaces (state)
if (tmp -> next)
interface_reference (&next, tmp -> next, MDL);
/* skip interfaces that are running already */
if (tmp -> flags & INTERFACE_RUNNING)
if (tmp -> flags & INTERFACE_RUNNING) {
interface_dereference(&tmp, MDL);
if(next)
interface_reference(&tmp, next, MDL);
continue;
}
if ((tmp -> flags & INTERFACE_AUTOMATIC) &&
state == DISCOVER_REQUESTED)
tmp -> flags &= ~(INTERFACE_AUTOMATIC |
+2 -2
View File
@@ -3,7 +3,7 @@
Network input dispatcher... */
/*
* Copyright (c) 1995-2001 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: dispatch.c,v 1.63.2.2 2001/06/21 16:47:15 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: dispatch.c,v 1.63.2.3 2002/11/17 02:26:57 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Data Link Provider Interface (DLPI) network interface code. */
/*
* Copyright (c) 1996-2001 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -88,7 +88,7 @@
#ifndef lint
static char copyright[] =
"$Id: dlpi.c,v 1.28 2001/04/05 20:53:01 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: dlpi.c,v 1.28.2.1 2002/11/17 02:26:57 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Domain Name Service subroutines. */
/*
* Copyright (c) 2001 Internet Software Consortium.
* Copyright (c) 2001-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
"$Id: dns.c,v 1.35.2.12 2002/02/20 22:28:17 mellon Exp $ Copyright (c) 2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: dns.c,v 1.35.2.13 2002/11/17 02:26:57 dhankins Exp $ Copyright (c) 2001-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Packet assembly code, originally contributed by Archie Cobbs. */
/*
* Copyright (c) 1996-2000 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: ethernet.c,v 1.6.2.1 2001/06/14 19:15:27 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: ethernet.c,v 1.6.2.2 2002/11/17 02:26:57 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Support for executable statements. */
/*
* Copyright (c) 1998-2001 Internet Software Consortium.
* Copyright (c) 1998-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: execute.c,v 1.44.2.8 2001/10/18 20:10:58 mellon Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: execute.c,v 1.44.2.9 2002/11/17 02:26:58 dhankins Exp $ Copyright (c) 1998-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Packet assembly code, originally contributed by Archie Cobbs. */
/*
* Copyright (c) 1996-2000 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: fddi.c,v 1.3 2000/04/18 23:02:09 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: fddi.c,v 1.3.2.1 2002/11/17 02:26:58 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+3 -2
View File
@@ -4,7 +4,7 @@
responses. */
/*
* Copyright (c) 1996-2001 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,7 @@
#ifndef lint
static char copyright[] =
"$Id: icmp.c,v 1.30.2.3 2001/10/18 20:11:24 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: icmp.c,v 1.30.2.5 2002/11/17 02:26:58 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -164,6 +164,7 @@ int icmp_echorequest (addr)
if (!icmp_state)
log_fatal ("ICMP protocol used before initialization.");
memset (&to, 0, sizeof(to));
#ifdef HAVE_SA_LEN
to.sin_len = sizeof to;
#endif
+2 -2
View File
@@ -4,7 +4,7 @@
way... */
/*
* Copyright (c) 1995-2001 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,7 @@
#ifndef lint
static char copyright[] =
"$Id: inet.c,v 1.8.2.3 2001/06/21 16:59:00 mellon Exp $ Copyright (c) 1995-1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: inet.c,v 1.8.2.4 2002/11/17 02:26:58 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -4,7 +4,7 @@
Support Services in Vancouver, B.C. */
/*
* Copyright (c) 1996-2000 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,7 +37,7 @@
#ifndef lint
static char copyright[] =
"$Id: lpf.c,v 1.29 2001/04/24 00:36:00 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: lpf.c,v 1.29.2.1 2002/11/17 02:26:58 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Memory-resident database... */
/*
* Copyright (c) 1995-2001 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: memory.c,v 1.66.2.3 2001/10/17 03:25:10 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: memory.c,v 1.66.2.4 2002/11/17 02:26:58 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -4,7 +4,7 @@
with one crucial tidbit of help from Stu Grossmen. */
/*
* Copyright (c) 1996-2000 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,7 @@
#ifndef lint
static char copyright[] =
"$Id: nit.c,v 1.34 2001/02/17 21:17:25 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: nit.c,v 1.34.2.1 2002/11/17 02:26:58 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+1 -1
View File
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: options.c,v 1.85.2.8 2002/02/19 20:36:52 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: options.c,v 1.85.2.9 2002/11/17 02:26:58 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#define DHCP_OPTION_DATA
+2 -2
View File
@@ -3,7 +3,7 @@
Packet assembly code, originally contributed by Archie Cobbs. */
/*
* Copyright (c) 1996-2001 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
"$Id: packet.c,v 1.40.2.1 2001/05/31 19:28:51 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: packet.c,v 1.40.2.2 2002/11/17 02:26:59 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+60 -35
View File
@@ -3,7 +3,7 @@
Common parser code for dhcpd and dhclient. */
/*
* Copyright (c) 1995-2001 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: parse.c,v 1.104.2.9 2002/04/27 05:30:02 murray Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: parse.c,v 1.104.2.12 2002/11/17 02:58:34 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -329,7 +329,7 @@ int parse_ip_addr (cfile, addr)
/*
* hardware-parameter :== HARDWARE hardware-type colon-seperated-hex-list SEMI
* hardware-type :== ETHERNET | TOKEN_RING
* hardware-type :== ETHERNET | TOKEN_RING | FDDI
*/
void parse_hardware_param (cfile, hardware)
@@ -3973,83 +3973,51 @@ int parse_expression (expr, cfile, lose, context, plhs, binop)
case AND:
next_op = expr_and;
context = expression_context (rhs);
if (context != context_boolean) {
needbool:
parse_warn (cfile, "expecting boolean expressions");
skip_to_semi (cfile);
expression_dereference (&rhs, MDL);
*lose = 1;
return 0;
}
break;
case OR:
next_op = expr_or;
context = expression_context (rhs);
if (context != context_boolean)
goto needbool;
break;
case PLUS:
next_op = expr_add;
context = expression_context (rhs);
if (context != context_numeric) {
neednum:
parse_warn (cfile, "expecting numeric expressions");
skip_to_semi (cfile);
expression_dereference (&rhs, MDL);
*lose = 1;
return 0;
}
break;
case MINUS:
next_op = expr_subtract;
context = expression_context (rhs);
if (context != context_numeric)
goto neednum;
break;
case SLASH:
next_op = expr_divide;
context = expression_context (rhs);
if (context != context_numeric)
goto neednum;
break;
case ASTERISK:
next_op = expr_multiply;
context = expression_context (rhs);
if (context != context_numeric)
goto neednum;
break;
case PERCENT:
next_op = expr_remainder;
context = expression_context (rhs);
if (context != context_numeric)
goto neednum;
break;
case AMPERSAND:
next_op = expr_binary_and;
context = expression_context (rhs);
if (context != context_numeric)
goto neednum;
break;
case PIPE:
next_op = expr_binary_or;
context = expression_context (rhs);
if (context != context_numeric)
goto neednum;
break;
case CARET:
next_op = expr_binary_xor;
context = expression_context (rhs);
if (context != context_numeric)
goto neednum;
break;
default:
@@ -4071,6 +4039,63 @@ int parse_expression (expr, cfile, lose, context, plhs, binop)
goto new_rhs;
}
if (binop != expr_none) {
if (expression_context (rhs) != expression_context (lhs)) {
parse_warn (cfile, "illegal expression relating different types");
skip_to_semi (cfile);
expression_dereference (&rhs, MDL);
expression_dereference (&lhs, MDL);
*lose = 1;
return 0;
}
switch(binop) {
case expr_not_equal:
case expr_equal:
if ((expression_context(rhs) != context_data_or_numeric) &&
(expression_context(rhs) != context_data) &&
(expression_context(rhs) != context_numeric)) {
parse_warn (cfile, "expecting data/numeric expression");
skip_to_semi (cfile);
expression_dereference (&rhs, MDL);
*lose = 1;
return 0;
}
break;
case expr_and:
case expr_or:
if (expression_context(rhs) != context_boolean) {
parse_warn (cfile, "expecting boolean expressions");
skip_to_semi (cfile);
expression_dereference (&rhs, MDL);
*lose = 1;
return 0;
}
break;
case expr_add:
case expr_subtract:
case expr_divide:
case expr_multiply:
case expr_remainder:
case expr_binary_and:
case expr_binary_or:
case expr_binary_xor:
if (expression_context(rhs) != context_numeric) {
parse_warn (cfile, "expecting numeric expressions");
skip_to_semi (cfile);
expression_dereference (&rhs, MDL);
*lose = 1;
return 0;
}
break;
default:
break;
}
}
/* Now, if we didn't find a binary operator, we're done parsing
this subexpression, so combine it with the preceding binary
operator and return the result. */
+2 -2
View File
@@ -3,7 +3,7 @@
Turn data structures into printable text. */
/*
* Copyright (c) 1995-2001 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: print.c,v 1.53.2.6 2002/04/26 20:17:06 murray Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: print.c,v 1.53.2.7 2002/11/17 02:26:59 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -16,7 +16,7 @@
Sigh. */
/*
* Copyright (c) 1995-2000 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,7 @@
#ifndef lint
static char copyright[] =
"$Id: raw.c,v 1.17 2000/03/17 03:59:01 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: raw.c,v 1.17.2.1 2002/11/17 02:26:59 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Parser for /etc/resolv.conf file. */
/*
* Copyright (c) 1996-2001 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: resolv.c,v 1.16 2001/05/02 06:39:43 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: resolv.c,v 1.16.2.1 2002/11/17 02:26:59 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+3 -3
View File
@@ -3,7 +3,7 @@
BSD socket interface code... */
/*
* Copyright (c) 1995-2000 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,7 +51,7 @@
#ifndef lint
static char copyright[] =
"$Id: socket.c,v 1.55.2.1 2002/01/17 19:42:55 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: socket.c,v 1.55.2.3 2002/11/17 02:26:59 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -114,11 +114,11 @@ int if_register_socket (info)
once = 1;
#endif
memset (&name, 0, sizeof (name));
/* Set up the address we're going to bind to. */
name.sin_family = AF_INET;
name.sin_port = local_port;
name.sin_addr = local_address;
memset (name.sin_zero, 0, sizeof (name.sin_zero));
/* Make a socket... */
if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+2 -3
View File
@@ -3,7 +3,7 @@
Tables of information... */
/*
* Copyright (c) 1995-2001 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,8 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: tables.c,v 1.51.2.5 2002/02/09 03:23:54 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n"
"$FreeBSD$\n";
"$Id: tables.c,v 1.51.2.6 2002/11/17 02:26:59 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -4,7 +4,7 @@
Contributed in May of 1999 by Andrew Chittenden */
/*
* Copyright (c) 1996-2000 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,7 +37,7 @@
#ifndef lint
static char copyright[] =
"$Id: tr.c,v 1.7 2001/04/27 22:23:02 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: tr.c,v 1.7.2.1 2002/11/17 02:27:00 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Routines for manipulating parse trees... */
/*
* Copyright (c) 1995-2001 Internet Software Consortium.
* Copyright (c) 1995-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: tree.c,v 1.101.2.6 2001/10/18 20:12:16 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: tree.c,v 1.101.2.7 2002/11/17 02:27:00 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+2 -2
View File
@@ -3,7 +3,7 @@
Ultrix PacketFilter interface code. */
/*
* Copyright (c) 1996-2000 Internet Software Consortium.
* Copyright (c) 1996-2002 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: upf.c,v 1.21 2000/09/01 23:03:39 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: upf.c,v 1.21.2.1 2002/11/17 02:27:00 dhankins Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
+1 -1
View File
@@ -1,6 +1,6 @@
# Makefile.dist
#
# Copyright (c) 1996-2000 Internet Software Consortium.
# Copyright (c) 1996-2002 Internet Software Consortium.
# Use is subject to license terms which appear in the file named
# ISC-LICENSE that should have accompanied this file when you
# received it. If a file named ISC-LICENSE did not accompany this
+1 -1
View File
@@ -1,5 +1,5 @@
#ifndef LINT
static const char rcsid[] = "$Header: /proj/cvs/isc/DHCP/dst/dst_api.c,v 1.1 2001/02/22 07:22:08 mellon Exp $";
static const char rcsid[] = "$Header: /rc0/proj/cvs/isc/DHCP/dst/dst_api.c,v 1.1 2001/02/22 07:22:08 mellon Exp $";
#endif
/*
+1 -1
View File
@@ -1,4 +1,4 @@
static const char rcsid[] = "$Header: /proj/cvs/isc/DHCP/dst/dst_support.c,v 1.1 2001/02/22 07:22:08 mellon Exp $";
static const char rcsid[] = "$Header: /rc0/proj/cvs/isc/DHCP/dst/dst_support.c,v 1.1 2001/02/22 07:22:08 mellon Exp $";
/*
+1 -1
View File
@@ -1,6 +1,6 @@
#ifdef HMAC_MD5
#ifndef LINT
static const char rcsid[] = "$Header: /proj/cvs/isc/DHCP/dst/hmac_link.c,v 1.1 2001/02/22 07:22:08 mellon Exp $";
static const char rcsid[] = "$Header: /rc0/proj/cvs/isc/DHCP/dst/hmac_link.c,v 1.1 2001/02/22 07:22:08 mellon Exp $";
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
+1 -1
View File
@@ -1,5 +1,5 @@
#ifndef LINT
static const char rcsid[] = "$Header: /proj/cvs/isc/DHCP/dst/prandom.c,v 1.1 2001/02/22 07:22:09 mellon Exp $";
static const char rcsid[] = "$Header: /rc0/proj/cvs/isc/DHCP/dst/prandom.c,v 1.1 2001/02/22 07:22:09 mellon Exp $";
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
+4 -2
View File
@@ -271,7 +271,7 @@ typedef enum {
FTS_RELEASED = 4,
FTS_ABANDONED = 5,
FTS_RESET = 6,
FTS_BACKUP = 7,
FTS_BACKUP = 7
} binding_state_t;
/* FTS_LAST is the highest value that is valid for a lease binding state. */
@@ -648,7 +648,7 @@ struct client_lease {
struct auth_key *key; /* Key used in basic DHCP authentication. */
unsigned int is_static : 1; /* If set, lease is from config file. */
unsigned int is_bootp: 1; /* If set, lease was aquired with BOOTP. */
unsigned int is_bootp: 1; /* If set, lease was acquired with BOOTP. */
struct option_state *options; /* Options supplied with lease. */
};
@@ -903,6 +903,8 @@ typedef unsigned char option_mask [16];
#define _PATH_DHCPD_CONF "dhcpd.conf"
#undef _PATH_DHCPD_DB
#define _PATH_DHCPD_DB "dhcpd.leases"
#undef _PATH_DHCPD_PID
#define _PATH_DHCPD_PID "dhcpd.pid"
#else
#ifndef _PATH_DHCPD_CONF
#define _PATH_DHCPD_CONF "/etc/dhcpd.conf"
+4
View File
@@ -276,6 +276,10 @@
# define HAVE_ARPHRD_IEEE802
#endif
#if defined (ARPHRD_IEEE802_TR) && !defined (HAVE_ARPHRD_IEEE802_TR)
# define HAVE_ARPHRD_IEEE802_TR
#endif
#if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
# define HAVE_ARPHRD_FDDI
#endif
+1 -1
View File
@@ -1,3 +1,3 @@
/* Current version of ISC DHCP Distribution. */
#define DHCP_VERSION "V3.0.1rc9"
#define DHCP_VERSION "V3.0.1rc11"
+6 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996,1999 by Internet Software Consortium.
* Copyright (c) 1996,1999-2003 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -16,7 +16,7 @@
*/
#ifndef lint
static const char rcsid[] = "$Id: ns_name.c,v 1.1 2000/02/02 07:28:14 mellon Exp $";
static const char rcsid[] = "$Id: ns_name.c,v 1.1.2.4 2003/01/14 23:15:06 dhankins Exp $";
#endif
#include <sys/types.h>
@@ -255,6 +255,10 @@ ns_name_ntol(const u_char *src, u_char *dst, size_t dstsiz) {
dn = dst;
eom = dst + dstsiz;
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
while ((n = *cp++) != 0) {
if ((n & NS_CMPRSFLGS) != 0) {
/* Some kind of compression pointer. */
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995,1999 by Internet Software Consortium.
* Copyright (c) 1995,1999-2003 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -16,7 +16,7 @@
*/
#ifndef lint
static const char rcsid[] = "$Id: ns_samedomain.c,v 1.3 2001/01/16 22:33:09 mellon Exp $";
static const char rcsid[] = "$Id: ns_samedomain.c,v 1.3.2.3 2003/01/14 23:15:06 dhankins Exp $";
#endif
#include <sys/types.h>
@@ -168,7 +168,7 @@ ns_makecanon(const char *src, char *dst, size_t dstsize) {
size_t n = strlen(src);
if (n + sizeof "." > dstsize) {
ISC_R_NOSPACE;
return ISC_R_NOSPACE;
}
strcpy(dst, src);
while (n > 0 && dst[n - 1] == '.') /* Ends in "." */
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2001 by Internet Software Consortium, Inc.
* Copyright (c) 1999-2003 by Internet Software Consortium, Inc.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -16,7 +16,7 @@
*/
#ifndef lint
static const char rcsid[] = "$Id: ns_sign.c,v 1.4.2.1 2001/05/17 20:47:33 mellon Exp $";
static const char rcsid[] = "$Id: ns_sign.c,v 1.4.2.3 2003/01/14 23:15:06 dhankins Exp $";
#endif
#if defined (TRACING)
@@ -87,7 +87,7 @@ ns_sign(u_char *msg, unsigned *msglen, unsigned msgsize, int error, void *k,
dst_init();
if (msg == NULL || msglen == NULL || sig == NULL || siglen == NULL)
ISC_R_INVALIDARG;
return ISC_R_INVALIDARG;
/* Name. */
if (key != NULL && error != ns_r_badsig && error != ns_r_badkey)
@@ -118,7 +118,7 @@ ns_sign(u_char *msg, unsigned *msglen, unsigned msgsize, int error, void *k,
else
n = dn_comp("", cp, (unsigned)(eob - cp), NULL, NULL);
if (n < 0)
ISC_R_NOSPACE;
return ISC_R_NOSPACE;
alg = cp;
cp += n;
@@ -190,7 +190,7 @@ ns_sign(u_char *msg, unsigned *msglen, unsigned msgsize, int error, void *k,
n = dst_sign_data(SIG_MODE_FINAL, key, &ctx, NULL, 0,
sig, *siglen);
if (n < 0)
ISC_R_BADKEY;
return ISC_R_BADKEY;
*siglen = n;
} else
*siglen = 0;
+3 -3
View File
@@ -1,9 +1,9 @@
#if !defined(lint) && !defined(SABER)
static const char rcsid[] = "$Id: res_findzonecut.c,v 1.14.2.1 2001/05/17 20:47:35 mellon Exp $";
static const char rcsid[] = "$Id: res_findzonecut.c,v 1.14.2.3 2003/01/14 23:15:06 dhankins Exp $";
#endif /* not lint */
/*
* Copyright (c) 1999 by Internet Software Consortium.
* Copyright (c) 1999-2003 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -355,7 +355,7 @@ get_soa(res_state statp, const char *dname, ns_class class,
while (*dname != '.') {
if (*dname == '\\')
if (*++dname == '\0') {
ISC_R_NOSPACE;
return ISC_R_NOSPACE;
}
dname++;
}
+2 -2
View File
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
static const char rcsid[] = "$Id: res_send.c,v 1.7 2001/02/22 07:28:25 mellon Exp $";
static const char rcsid[] = "$Id: res_send.c,v 1.7.2.1 2002/11/03 04:34:24 dhankins Exp $";
#endif /* LIBC_SCCS and not lint */
/* Rename the I/O functions in case we're tracing. */
@@ -600,7 +600,7 @@ res_nsend(res_state statp,
(unsigned)len);
}
Dprint(statp->options & RES_DEBUG,
(stdout, ";; new DG socket\n"))
(stdout, ";; new DG socket\n"));
#endif /* CAN_RECONNECT */
statp->_flags &= ~RES_F_CONN;
errno = 0;
+3 -1
View File
@@ -4,7 +4,7 @@
protocol... */
/*
* Copyright (c) 1999-2001 Internet Software Consortium.
* Copyright (c) 1999-2003 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -820,8 +820,10 @@ isc_result_t omapi_typed_data_new (const char *file, int line,
obj = va_arg (l, omapi_object_t *);
break;
default:
va_end (l);
return ISC_R_INVALIDARG;
}
va_end (l);
new = dmalloc (len, file, line);
if (!new)
+11 -2
View File
@@ -3,7 +3,7 @@
Subroutines for dealing with message objects. */
/*
* Copyright (c) 1999-2000 Internet Software Consortium.
* Copyright (c) 1999-2003 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -327,6 +327,7 @@ isc_result_t omapi_message_unregister (omapi_object_t *mo)
omapi_object_reference ((omapi_object_t **)&n,
(omapi_object_t *)m -> next, MDL);
omapi_object_dereference ((omapi_object_t **)&m -> next, MDL);
omapi_object_dereference ((omapi_object_t **)&n -> prev, MDL);
}
if (m -> prev) {
omapi_message_object_t *tmp = (omapi_message_object_t *)0;
@@ -707,10 +708,15 @@ omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po)
status = omapi_protocol_send_status
(po, message -> id_object, ISC_R_SUCCESS,
message -> id, (char *)0);
if (m)
if (m) {
omapi_signal ((omapi_object_t *)m,
"status", ISC_R_SUCCESS,
(omapi_typed_data_t *)0);
omapi_message_unregister ((omapi_object_t *)m);
}
omapi_object_dereference (&object, MDL);
return status;
case OMAPI_OP_NOTIFY:
@@ -740,6 +746,9 @@ omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po)
omapi_signal ((omapi_object_t *)m, "status", waitstatus, tv);
if (status == ISC_R_SUCCESS)
omapi_value_dereference (&tv, MDL);
omapi_message_unregister((omapi_object_t *)m);
return ISC_R_SUCCESS;
case OMAPI_OP_DELETE:
+3
View File
@@ -56,6 +56,9 @@ int main(int argc, char *argv[])
const char *fs = NULL;
setlocale(LC_ALL, "");
setlocale(LC_COLLATE, "");
setlocale(LC_CTYPE, "");
setlocale(LC_MESSAGES, "");
cmdname = argv[0];
if (argc == 1) {
fprintf(stderr, "Usage: %s [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]\n", cmdname);
+2
View File
@@ -332,6 +332,8 @@ setdefaults(e)
DontProbeInterfaces = DPI_PROBEALL;
DoubleBounceAddr = "postmaster";
MaxHeadersLength = MAXHDRSLEN;
MaxMimeHeaderLength = MAXLINE;
MaxMimeFieldLength = MaxMimeHeaderLength / 2;
MaxForwardEntries = 0;
FastSplit = 1;
#if SASL
+1 -1
View File
@@ -3508,7 +3508,7 @@ getauthinfo(fd, may_be_forged)
if (i < 0 || p == &ibuf[0])
goto noident;
if (*--p == '\n' && *--p == '\r')
if (p >= &ibuf[2] && *--p == '\n' && *--p == '\r')
p--;
*++p = '\0';
+129 -84
View File
@@ -678,8 +678,8 @@ eatheader(e, full, log)
if (buf[0] != '\0')
{
if (bitset(H_FROM, h->h_flags))
expand(crackaddr(buf), buf, sizeof buf,
e);
expand(crackaddr(buf, e),
buf, sizeof buf, e);
h->h_value = sm_rpool_strdup_x(e->e_rpool, buf);
h->h_flags &= ~H_DEFAULT;
}
@@ -1000,7 +1000,11 @@ priencode(p)
** it and replaces it with "$g". The parse is totally ad hoc
** and isn't even guaranteed to leave something syntactically
** identical to what it started with. However, it does leave
** something semantically identical.
** something semantically identical if possible, else at least
** syntactically correct.
**
** For example, it changes "Real Name <[email protected]> (Comment)"
** to "Real Name <$g> (Comment)".
**
** This algorithm has been cleaned up to handle a wider range
** of cases -- notably quoted and backslash escaped strings.
@@ -1009,6 +1013,7 @@ priencode(p)
**
** Parameters:
** addr -- the address to be cracked.
** e -- the current envelope.
**
** Returns:
** a pointer to the new version.
@@ -1021,28 +1026,50 @@ priencode(p)
** be copied if it is to be reused.
*/
#define SM_HAVE_ROOM ((bp < buflim) && (buflim <= bufend))
/*
** Append a character to bp if we have room.
** If not, punt and return $g.
*/
#define SM_APPEND_CHAR(c) \
do \
{ \
if (SM_HAVE_ROOM) \
*bp++ = (c); \
else \
goto returng; \
} while (0)
#if MAXNAME < 10
ERROR MAXNAME must be at least 10
#endif /* MAXNAME < 10 */
char *
crackaddr(addr)
crackaddr(addr, e)
register char *addr;
ENVELOPE *e;
{
register char *p;
register char c;
int cmtlev;
int realcmtlev;
int anglelev, realanglelev;
int copylev;
int bracklev;
bool qmode;
bool realqmode;
bool skipping;
bool putgmac = false;
bool quoteit = false;
bool gotangle = false;
bool gotcolon = false;
int cmtlev; /* comment level in input string */
int realcmtlev; /* comment level in output string */
int anglelev; /* angle level in input string */
int copylev; /* 0 == in address, >0 copying */
int bracklev; /* bracket level for IPv6 addr check */
bool addangle; /* put closing angle in output */
bool qmode; /* quoting in original string? */
bool realqmode; /* quoting in output string? */
bool putgmac = false; /* already wrote $g */
bool quoteit = false; /* need to quote next character */
bool gotangle = false; /* found first '<' */
bool gotcolon = false; /* found a ':' */
register char *bp;
char *buflim;
char *bufhead;
char *addrhead;
char *bufend;
static char buf[MAXNAME + 1];
if (tTd(33, 1))
@@ -1057,25 +1084,22 @@ crackaddr(addr)
** adjusted later if we find them.
*/
buflim = bufend = &buf[sizeof(buf) - 1];
bp = bufhead = buf;
buflim = &buf[sizeof buf - 7];
p = addrhead = addr;
copylev = anglelev = realanglelev = cmtlev = realcmtlev = 0;
copylev = anglelev = cmtlev = realcmtlev = 0;
bracklev = 0;
qmode = realqmode = false;
qmode = realqmode = addangle = false;
while ((c = *p++) != '\0')
{
/*
** If the buffer is overful, go into a special "skipping"
** mode that tries to keep legal syntax but doesn't actually
** output things.
** Try to keep legal syntax using spare buffer space
** (maintained by buflim).
*/
skipping = bp >= buflim;
if (copylev > 0 && !skipping)
*bp++ = c;
if (copylev > 0)
SM_APPEND_CHAR(c);
/* check for backslash escapes */
if (c == '\\')
@@ -1090,8 +1114,8 @@ crackaddr(addr)
p--;
goto putg;
}
if (copylev > 0 && !skipping)
*bp++ = c;
if (copylev > 0)
SM_APPEND_CHAR(c);
goto putg;
}
@@ -1099,8 +1123,14 @@ crackaddr(addr)
if (c == '"' && cmtlev <= 0)
{
qmode = !qmode;
if (copylev > 0 && !skipping)
if (copylev > 0 && SM_HAVE_ROOM)
{
if (realqmode)
buflim--;
else
buflim++;
realqmode = !realqmode;
}
continue;
}
if (qmode)
@@ -1112,15 +1142,15 @@ crackaddr(addr)
cmtlev++;
/* allow space for closing paren */
if (!skipping)
if (SM_HAVE_ROOM)
{
buflim--;
realcmtlev++;
if (copylev++ <= 0)
{
if (bp != bufhead)
*bp++ = ' ';
*bp++ = c;
SM_APPEND_CHAR(' ');
SM_APPEND_CHAR(c);
}
}
}
@@ -1130,7 +1160,7 @@ crackaddr(addr)
{
cmtlev--;
copylev--;
if (!skipping)
if (SM_HAVE_ROOM)
{
realcmtlev--;
buflim++;
@@ -1141,7 +1171,7 @@ crackaddr(addr)
else if (c == ')')
{
/* syntax error: unmatched ) */
if (copylev > 0 && !skipping)
if (copylev > 0 && SM_HAVE_ROOM)
bp--;
}
@@ -1159,7 +1189,7 @@ crackaddr(addr)
/*
** Check for DECnet phase IV ``::'' (host::user)
** or ** DECnet phase V ``:.'' syntaxes. The latter
** or DECnet phase V ``:.'' syntaxes. The latter
** covers ``user@DEC:.tay.myhost'' and
** ``DEC:.tay.myhost::user'' syntaxes (bletch).
*/
@@ -1168,10 +1198,10 @@ crackaddr(addr)
{
if (cmtlev <= 0 && !qmode)
quoteit = true;
if (copylev > 0 && !skipping)
if (copylev > 0)
{
*bp++ = c;
*bp++ = *p;
SM_APPEND_CHAR(c);
SM_APPEND_CHAR(*p);
}
p++;
goto putg;
@@ -1182,41 +1212,43 @@ crackaddr(addr)
bp = bufhead;
if (quoteit)
{
*bp++ = '"';
SM_APPEND_CHAR('"');
/* back up over the ':' and any spaces */
--p;
while (isascii(*--p) && isspace(*p))
while (p > addr &&
isascii(*--p) && isspace(*p))
continue;
p++;
}
for (q = addrhead; q < p; )
{
c = *q++;
if (bp < buflim)
if (quoteit && c == '"')
{
if (quoteit && c == '"')
*bp++ = '\\';
*bp++ = c;
SM_APPEND_CHAR('\\');
SM_APPEND_CHAR(c);
}
else
SM_APPEND_CHAR(c);
}
if (quoteit)
{
if (bp == &bufhead[1])
bp--;
else
*bp++ = '"';
SM_APPEND_CHAR('"');
while ((c = *p++) != ':')
{
if (bp < buflim)
*bp++ = c;
}
*bp++ = c;
SM_APPEND_CHAR(c);
SM_APPEND_CHAR(c);
}
/* any trailing white space is part of group: */
while (isascii(*p) && isspace(*p) && bp < buflim)
*bp++ = *p++;
while (isascii(*p) && isspace(*p))
{
SM_APPEND_CHAR(*p);
p++;
}
copylev = 0;
putgmac = quoteit = false;
bufhead = bp;
@@ -1225,10 +1257,7 @@ crackaddr(addr)
}
if (c == ';' && copylev <= 0 && !ColonOkInAddr)
{
if (bp < buflim)
*bp++ = c;
}
SM_APPEND_CHAR(c);
/* check for characters that may have to be quoted */
if (strchr(MustQuoteChars, c) != NULL)
@@ -1256,42 +1285,45 @@ crackaddr(addr)
/* oops -- have to change our mind */
anglelev = 1;
if (!skipping)
realanglelev = 1;
if (SM_HAVE_ROOM)
{
if (!addangle)
buflim--;
addangle = true;
}
bp = bufhead;
if (quoteit)
{
*bp++ = '"';
SM_APPEND_CHAR('"');
/* back up over the '<' and any spaces */
--p;
while (isascii(*--p) && isspace(*p))
while (p > addr &&
isascii(*--p) && isspace(*p))
continue;
p++;
}
for (q = addrhead; q < p; )
{
c = *q++;
if (bp < buflim)
if (quoteit && c == '"')
{
if (quoteit && c == '"')
*bp++ = '\\';
*bp++ = c;
SM_APPEND_CHAR('\\');
SM_APPEND_CHAR(c);
}
else
SM_APPEND_CHAR(c);
}
if (quoteit)
{
if (bp == &buf[1])
bp--;
else
*bp++ = '"';
SM_APPEND_CHAR('"');
while ((c = *p++) != '<')
{
if (bp < buflim)
*bp++ = c;
}
*bp++ = c;
SM_APPEND_CHAR(c);
SM_APPEND_CHAR(c);
}
copylev = 0;
putgmac = quoteit = false;
@@ -1303,13 +1335,14 @@ crackaddr(addr)
if (anglelev > 0)
{
anglelev--;
if (!skipping)
if (SM_HAVE_ROOM)
{
realanglelev--;
buflim++;
if (addangle)
buflim++;
addangle = false;
}
}
else if (!skipping)
else if (SM_HAVE_ROOM)
{
/* syntax error: unmatched > */
if (copylev > 0)
@@ -1318,7 +1351,7 @@ crackaddr(addr)
continue;
}
if (copylev++ <= 0)
*bp++ = c;
SM_APPEND_CHAR(c);
continue;
}
@@ -1326,30 +1359,42 @@ crackaddr(addr)
putg:
if (copylev <= 0 && !putgmac)
{
if (bp > bufhead && bp[-1] == ')')
*bp++ = ' ';
*bp++ = MACROEXPAND;
*bp++ = 'g';
if (bp > buf && bp[-1] == ')')
SM_APPEND_CHAR(' ');
SM_APPEND_CHAR(MACROEXPAND);
SM_APPEND_CHAR('g');
putgmac = true;
}
}
/* repair any syntactic damage */
if (realqmode)
if (realqmode && bp < bufend)
*bp++ = '"';
while (realcmtlev-- > 0)
while (realcmtlev-- > 0 && bp < bufend)
*bp++ = ')';
while (realanglelev-- > 0)
if (addangle && bp < bufend)
*bp++ = '>';
*bp++ = '\0';
*bp = '\0';
if (bp < bufend)
goto success;
returng:
/* String too long, punt */
buf[0] = '<';
buf[1] = MACROEXPAND;
buf[2]= 'g';
buf[3] = '>';
buf[4]= '\0';
sm_syslog(LOG_ALERT, e->e_id,
"Dropped invalid comments from header address");
success:
if (tTd(33, 1))
{
sm_dprintf("crackaddr=>`");
xputs(buf);
sm_dprintf("'\n");
}
return buf;
}
/*
+1 -1
View File
@@ -4227,7 +4227,7 @@ testmodeline(line, e)
"Usage: /parse address\n");
return;
}
q = crackaddr(p);
q = crackaddr(p, e);
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
"Cracked address = ");
xputs(q);
+18 -3
View File
@@ -608,7 +608,7 @@ unsigned char TokTypeNoC[256] =
};
#define NOCHAR -1 /* signal nothing in lookahead token */
#define NOCHAR (-1) /* signal nothing in lookahead token */
char **
prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
@@ -694,22 +694,31 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
/* see if there is room */
if (q >= &pvpbuf[pvpbsize - 5])
{
addrtoolong:
usrerr("553 5.1.1 Address too long");
if (strlen(addr) > MAXNAME)
addr[MAXNAME] = '\0';
returnnull:
if (delimptr != NULL)
{
if (p > addr)
p--;
*delimptr = p;
}
CurEnv->e_to = saveto;
return NULL;
}
/* squirrel it away */
#if !ALLOW_255
if ((char) c == (char) -1 && !tTd(82, 101))
c &= 0x7f;
#endif /* !ALLOW_255 */
*q++ = c;
}
/* read a new input character */
c = *p++;
c = (*p++) & 0x00ff;
if (c == '\0')
{
/* diagnose and patch up bad syntax */
@@ -764,6 +773,9 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
}
else if (c != '!' || state == QST)
{
/* see if there is room */
if (q >= &pvpbuf[pvpbsize - 5])
goto addrtoolong;
*q++ = '\\';
continue;
}
@@ -849,6 +861,9 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
/* new token */
if (tok != q)
{
/* see if there is room */
if (q >= &pvpbuf[pvpbsize - 5])
goto addrtoolong;
*q++ = '\0';
if (tTd(22, 36))
{
@@ -2508,7 +2523,7 @@ remotename(name, m, flags, pstat, e)
if (bitset(RF_CANONICAL, flags) || bitnset(M_NOCOMMENT, m->m_flags))
fancy = "\201g";
else
fancy = crackaddr(name);
fancy = crackaddr(name, e);
/*
** Turn the name into canonical form.
+1 -1
View File
@@ -325,7 +325,7 @@ extern ADDRESS NullAddress; /* a null (template) address [main.c] */
/* functions */
extern void cataddr __P((char **, char **, char *, int, int));
extern char *crackaddr __P((char *));
extern char *crackaddr __P((char *, ENVELOPE *));
extern bool emptyaddr __P((ADDRESS *));
extern ADDRESS *getctladdr __P((ADDRESS *));
extern int include __P((char *, bool, ADDRESS *, ADDRESS **, int, ENVELOPE *));
+1
View File
@@ -233,6 +233,7 @@ parse_dns_reply(data, len)
dns_free_data(r);
return NULL;
}
memset(*rr, 0, sizeof(**rr));
(*rr)->rr_domain = sm_strdup(host);
if ((*rr)->rr_domain == NULL)
{
+1 -1
View File
@@ -15,4 +15,4 @@
SM_RCSID("@(#)$Id: version.c,v 8.104.2.5 2002/08/24 16:27:21 ca Exp $")
char Version[] = "8.12.6";
char Version[] = "8.12.6p3";
-342
View File
@@ -1,342 +0,0 @@
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)telnet.h 8.2 (Berkeley) 12/15/93
* $FreeBSD$
*/
#ifndef _ARPA_TELNET_H_
#define _ARPA_TELNET_H_
/*
* Definitions for the TELNET protocol.
*/
#define IAC 255 /* interpret as command: */
#define DONT 254 /* you are not to use option */
#define DO 253 /* please, you use option */
#define WONT 252 /* I won't use option */
#define WILL 251 /* I will use option */
#define SB 250 /* interpret as subnegotiation */
#define GA 249 /* you may reverse the line */
#define EL 248 /* erase the current line */
#define EC 247 /* erase the current character */
#define AYT 246 /* are you there */
#define AO 245 /* abort output--but let prog finish */
#define IP 244 /* interrupt process--permanently */
#define BREAK 243 /* break */
#define DM 242 /* data mark--for connect. cleaning */
#define NOP 241 /* nop */
#define SE 240 /* end sub negotiation */
#define EOR 239 /* end of record (transparent mode) */
#define ABORT 238 /* Abort process */
#define SUSP 237 /* Suspend process */
#define xEOF 236 /* End of file: EOF is already used... */
#define SYNCH 242 /* for telfunc calls */
#ifdef TELCMDS
const char *telcmds[] = {
"EOF", "SUSP", "ABORT", "EOR",
"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
"EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC",
0
};
#else
extern char *telcmds[];
#endif
#define TELCMD_FIRST xEOF
#define TELCMD_LAST IAC
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
(unsigned int)(x) >= TELCMD_FIRST)
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
/* telnet options */
#define TELOPT_BINARY 0 /* 8-bit data path */
#define TELOPT_ECHO 1 /* echo */
#define TELOPT_RCP 2 /* prepare to reconnect */
#define TELOPT_SGA 3 /* suppress go ahead */
#define TELOPT_NAMS 4 /* approximate message size */
#define TELOPT_STATUS 5 /* give status */
#define TELOPT_TM 6 /* timing mark */
#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
#define TELOPT_NAOL 8 /* negotiate about output line width */
#define TELOPT_NAOP 9 /* negotiate about output page size */
#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
#define TELOPT_XASCII 17 /* extended ascic character set */
#define TELOPT_LOGOUT 18 /* force logout */
#define TELOPT_BM 19 /* byte macro */
#define TELOPT_DET 20 /* data entry terminal */
#define TELOPT_SUPDUP 21 /* supdup protocol */
#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
#define TELOPT_SNDLOC 23 /* send location */
#define TELOPT_TTYPE 24 /* terminal type */
#define TELOPT_EOR 25 /* end or record */
#define TELOPT_TUID 26 /* TACACS user identification */
#define TELOPT_OUTMRK 27 /* output marking */
#define TELOPT_TTYLOC 28 /* terminal location number */
#define TELOPT_3270REGIME 29 /* 3270 regime */
#define TELOPT_X3PAD 30 /* X.3 PAD */
#define TELOPT_NAWS 31 /* window size */
#define TELOPT_TSPEED 32 /* terminal speed */
#define TELOPT_LFLOW 33 /* remote flow control */
#define TELOPT_LINEMODE 34 /* Linemode option */
#define TELOPT_XDISPLOC 35 /* X Display Location */
#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
#define TELOPT_AUTHENTICATION 37/* Authenticate */
#define TELOPT_ENCRYPT 38 /* Encryption option */
#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
#define TELOPT_EXOPL 255 /* extended-options-list */
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
#ifdef TELOPTS
const char *telopts[NTELOPTS+1] = {
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
"ENCRYPT", "NEW-ENVIRON",
0
};
#define TELOPT_FIRST TELOPT_BINARY
#define TELOPT_LAST TELOPT_NEW_ENVIRON
#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
#endif
/* sub-option qualifiers */
#define TELQUAL_IS 0 /* option is... */
#define TELQUAL_SEND 1 /* send option */
#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
#define LFLOW_OFF 0 /* Disable remote flow control */
#define LFLOW_ON 1 /* Enable remote flow control */
#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
/*
* LINEMODE suboptions
*/
#define LM_MODE 1
#define LM_FORWARDMASK 2
#define LM_SLC 3
#define MODE_EDIT 0x01
#define MODE_TRAPSIG 0x02
#define MODE_ACK 0x04
#define MODE_SOFT_TAB 0x08
#define MODE_LIT_ECHO 0x10
#define MODE_MASK 0x1f
/* Not part of protocol, but needed to simplify things... */
#define MODE_FLOW 0x0100
#define MODE_ECHO 0x0200
#define MODE_INBIN 0x0400
#define MODE_OUTBIN 0x0800
#define MODE_FORCE 0x1000
#define SLC_SYNCH 1
#define SLC_BRK 2
#define SLC_IP 3
#define SLC_AO 4
#define SLC_AYT 5
#define SLC_EOR 6
#define SLC_ABORT 7
#define SLC_EOF 8
#define SLC_SUSP 9
#define SLC_EC 10
#define SLC_EL 11
#define SLC_EW 12
#define SLC_RP 13
#define SLC_LNEXT 14
#define SLC_XON 15
#define SLC_XOFF 16
#define SLC_FORW1 17
#define SLC_FORW2 18
#define SLC_MCL 19
#define SLC_MCR 20
#define SLC_MCWL 21
#define SLC_MCWR 22
#define SLC_MCBOL 23
#define SLC_MCEOL 24
#define SLC_INSRT 25
#define SLC_OVER 26
#define SLC_ECR 27
#define SLC_EWR 28
#define SLC_EBOL 29
#define SLC_EEOL 30
#define NSLC 30
/*
* For backwards compatibility, we define SLC_NAMES to be the
* list of names if SLC_NAMES is not defined.
*/
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
"LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
"MCL", "MCR", "MCWL", "MCWR", "MCBOL", \
"MCEOL", "INSRT", "OVER", "ECR", "EWR", \
"EBOL", "EEOL", \
0
#ifdef SLC_NAMES
const char *slc_names[] = {
SLC_NAMELIST
};
#else
extern char *slc_names[];
#define SLC_NAMES SLC_NAMELIST
#endif
#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
#define SLC_NAME(x) slc_names[x]
#define SLC_NOSUPPORT 0
#define SLC_CANTCHANGE 1
#define SLC_VARIABLE 2
#define SLC_DEFAULT 3
#define SLC_LEVELBITS 0x03
#define SLC_FUNC 0
#define SLC_FLAGS 1
#define SLC_VALUE 2
#define SLC_ACK 0x80
#define SLC_FLUSHIN 0x40
#define SLC_FLUSHOUT 0x20
#define OLD_ENV_VAR 1
#define OLD_ENV_VALUE 0
#define NEW_ENV_VAR 0
#define NEW_ENV_VALUE 1
#define ENV_ESC 2
#define ENV_USERVAR 3
/*
* AUTHENTICATION suboptions
*/
/*
* Who is authenticating who ...
*/
#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
#define AUTH_WHO_SERVER 1 /* Server authenticating client */
#define AUTH_WHO_MASK 1
/*
* amount of authentication done
*/
#define AUTH_HOW_ONE_WAY 0
#define AUTH_HOW_MUTUAL 2
#define AUTH_HOW_MASK 2
#define AUTHTYPE_NULL 0
#define AUTHTYPE_KERBEROS_V4 1
#define AUTHTYPE_KERBEROS_V5 2
#define AUTHTYPE_SPX 3
#define AUTHTYPE_MINK 4
#define AUTHTYPE_SRA 6
#define AUTHTYPE_CNT 7
#define AUTHTYPE_TEST 99
#ifdef AUTH_NAMES
const char *authtype_names[] = {
"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", NULL, "SRA",
0
};
#else
extern char *authtype_names[];
#endif
#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
#define AUTHTYPE_NAME(x) authtype_names[x]
/*
* ENCRYPTion suboptions
*/
#define ENCRYPT_IS 0 /* I pick encryption type ... */
#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
#define ENCRYPT_REPLY 2 /* Initial setup response */
#define ENCRYPT_START 3 /* Am starting to send encrypted */
#define ENCRYPT_END 4 /* Am ending encrypted */
#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
#define ENCRYPT_REQEND 6 /* Request you end encrypting */
#define ENCRYPT_ENC_KEYID 7
#define ENCRYPT_DEC_KEYID 8
#define ENCRYPT_CNT 9
#define ENCTYPE_ANY 0
#define ENCTYPE_DES_CFB64 1
#define ENCTYPE_DES_OFB64 2
#define ENCTYPE_CNT 3
#ifdef ENCRYPT_NAMES
const char *encrypt_names[] = {
"IS", "SUPPORT", "REPLY", "START", "END",
"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
0
};
const char *enctype_names[] = {
"ANY", "DES_CFB64", "DES_OFB64",
0
};
#else
extern char *encrypt_names[];
extern char *enctype_names[];
#endif
#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
#define ENCRYPT_NAME(x) encrypt_names[x]
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
#define ENCTYPE_NAME(x) enctype_names[x]
#endif /* !_TELNET_H_ */
-111
View File
@@ -1,111 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)auth-proto.h 8.1 (Berkeley) 6/4/93
* $FreeBSD$
*/
/*
* Copyright (C) 1990 by the Massachusetts Institute of Technology
*
* Export of this software from the United States of America is assumed
* to require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#ifdef AUTHENTICATION
Authenticator *findauthenticator(int, int);
void auth_init(const char *, int);
int auth_cmd(int, char **);
void auth_request(void);
void auth_send(unsigned char *, int);
void auth_send_retry(void);
void auth_is(unsigned char *, int);
void auth_reply(unsigned char *, int);
void auth_finished(Authenticator *, int);
int auth_wait(char *);
void auth_disable_name(char *);
void auth_gen_printsub(unsigned char *, int, unsigned char *, int);
void auth_name(unsigned char *, int);
void auth_printsub(unsigned char *, int, unsigned char *, int);
int auth_sendname(unsigned char *, int);
void auth_encrypt_user(char *);
int auth_disable(char *);
int auth_enable(char *);
int auth_togdebug(int);
int auth_status(void);
int getauthmask(char *, int *);
#ifdef KRB4
int kerberos4_init(Authenticator *, int);
int kerberos4_send(Authenticator *);
void kerberos4_is(Authenticator *, unsigned char *, int);
void kerberos4_reply(Authenticator *, unsigned char *, int);
int kerberos4_status(Authenticator *, char *, int);
void kerberos4_printsub(unsigned char *, int, unsigned char *, int);
#endif
#ifdef KRB5
int kerberos5_init(Authenticator *, int);
int kerberos5_send_mutual(Authenticator *);
int kerberos5_send_oneway(Authenticator *);
void kerberos5_is(Authenticator *, unsigned char *, int);
void kerberos5_reply(Authenticator *, unsigned char *, int);
int kerberos5_status(Authenticator *, char *, int level);
void kerberos5_printsub(unsigned char *, int, unsigned char *, int);
#endif
#ifdef SRA
int sra_init(Authenticator *, int);
int sra_send(Authenticator *);
void sra_is(Authenticator *, unsigned char *, int);
void sra_reply(Authenticator *, unsigned char *, int);
int sra_status(Authenticator *, char *, int);
void sra_printsub(unsigned char *, int, unsigned char *, int);
#endif
#endif
-623
View File
@@ -1,623 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
static const char sccsid[] = "@(#)auth.c 8.3 (Berkeley) 5/30/95";
#endif /* not lint */
/*
* Copyright (C) 1990 by the Massachusetts Institute of Technology
*
* Export of this software from the United States of America is assumed
* to require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#ifdef AUTHENTICATION
#define AUTH_NAMES
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/telnet.h>
#include "encrypt.h"
#include "auth.h"
#include "misc-proto.h"
#include "auth-proto.h"
#define typemask(x) ((x) > 0 ? 1 << ((x)-1) : 0)
#ifdef KRB4_ENCPWD
extern krb4encpwd_init();
extern krb4encpwd_send();
extern krb4encpwd_is();
extern krb4encpwd_reply();
extern krb4encpwd_status();
extern krb4encpwd_printsub();
#endif
#ifdef RSA_ENCPWD
extern rsaencpwd_init();
extern rsaencpwd_send();
extern rsaencpwd_is();
extern rsaencpwd_reply();
extern rsaencpwd_status();
extern rsaencpwd_printsub();
#endif
int auth_debug_mode = 0;
static const char *Name = "Noname";
static int Server = 0;
static Authenticator *authenticated = 0;
static int authenticating = 0;
static int validuser = 0;
static unsigned char _auth_send_data[256];
static unsigned char *auth_send_data;
static int auth_send_cnt = 0;
int auth_onoff(char *type, int on);
void auth_encrypt_user(char *name);
/*
* Authentication types supported. Plese note that these are stored
* in priority order, i.e. try the first one first.
*/
Authenticator authenticators[] = {
#ifdef KRB5
# ifdef ENCRYPTION
{ AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL,
kerberos5_init,
kerberos5_send_mutual,
kerberos5_is,
kerberos5_reply,
kerberos5_status,
kerberos5_printsub },
# endif /* ENCRYPTION */
{ AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
kerberos5_init,
kerberos5_send_oneway,
kerberos5_is,
kerberos5_reply,
kerberos5_status,
kerberos5_printsub },
#endif
#ifdef KRB4
# ifdef ENCRYPTION
{ AUTHTYPE_KERBEROS_V4, AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL,
kerberos4_init,
kerberos4_send,
kerberos4_is,
kerberos4_reply,
kerberos4_status,
kerberos4_printsub },
# endif /* ENCRYPTION */
{ AUTHTYPE_KERBEROS_V4, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
kerberos4_init,
kerberos4_send,
kerberos4_is,
kerberos4_reply,
kerberos4_status,
kerberos4_printsub },
#endif
#ifdef KRB4_ENCPWD
{ AUTHTYPE_KRB4_ENCPWD, AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL,
krb4encpwd_init,
krb4encpwd_send,
krb4encpwd_is,
krb4encpwd_reply,
krb4encpwd_status,
krb4encpwd_printsub },
#endif
#ifdef RSA_ENCPWD
{ AUTHTYPE_RSA_ENCPWD, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
rsaencpwd_init,
rsaencpwd_send,
rsaencpwd_is,
rsaencpwd_reply,
rsaencpwd_status,
rsaencpwd_printsub },
#endif
#ifdef SRA
{ AUTHTYPE_SRA, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
sra_init,
sra_send,
sra_is,
sra_reply,
sra_status,
sra_printsub },
#endif
{ 0, 0, 0, 0, 0, 0, 0, 0 },
};
static Authenticator NoAuth = { 0, 0, 0, 0, 0, 0, 0, 0 };
static int i_support = 0;
static int i_wont_support = 0;
Authenticator *
findauthenticator(int type, int way)
{
Authenticator *ap = authenticators;
while (ap->type && (ap->type != type || ap->way != way))
++ap;
return(ap->type ? ap : 0);
}
void
auth_init(const char *name, int server)
{
Authenticator *ap = authenticators;
Server = server;
Name = name;
i_support = 0;
authenticated = 0;
authenticating = 0;
while (ap->type) {
if (!ap->init || (*ap->init)(ap, server)) {
i_support |= typemask(ap->type);
if (auth_debug_mode)
printf(">>>%s: I support auth type %d %d\r\n",
Name,
ap->type, ap->way);
}
else if (auth_debug_mode)
printf(">>>%s: Init failed: auth type %d %d\r\n",
Name, ap->type, ap->way);
++ap;
}
}
void
auth_disable_name(char *name)
{
int x;
for (x = 0; x < AUTHTYPE_CNT; ++x) {
if (AUTHTYPE_NAME(x) && !strcasecmp(name, AUTHTYPE_NAME(x))) {
i_wont_support |= typemask(x);
break;
}
}
}
int
getauthmask(char *type, int *maskp)
{
int x;
if (AUTHTYPE_NAME(0) && !strcasecmp(type, AUTHTYPE_NAME(0))) {
*maskp = -1;
return(1);
}
for (x = 1; x < AUTHTYPE_CNT; ++x) {
if (AUTHTYPE_NAME(x) && !strcasecmp(type, AUTHTYPE_NAME(x))) {
*maskp = typemask(x);
return(1);
}
}
return(0);
}
int
auth_enable(char *type)
{
return(auth_onoff(type, 1));
}
int
auth_disable(char *type)
{
return(auth_onoff(type, 0));
}
int
auth_onoff(char *type, int on)
{
int i, mask = -1;
Authenticator *ap;
if (!strcasecmp(type, "?") || !strcasecmp(type, "help")) {
printf("auth %s 'type'\n", on ? "enable" : "disable");
printf("Where 'type' is one of:\n");
printf("\t%s\n", AUTHTYPE_NAME(0));
mask = 0;
for (ap = authenticators; ap->type; ap++) {
if ((mask & (i = typemask(ap->type))) != 0)
continue;
mask |= i;
printf("\t%s\n", AUTHTYPE_NAME(ap->type));
}
return(0);
}
if (!getauthmask(type, &mask)) {
printf("%s: invalid authentication type\n", type);
return(0);
}
if (on)
i_wont_support &= ~mask;
else
i_wont_support |= mask;
return(1);
}
int
auth_togdebug(int on)
{
if (on < 0)
auth_debug_mode ^= 1;
else
auth_debug_mode = on;
printf("auth debugging %s\n", auth_debug_mode ? "enabled" : "disabled");
return(1);
}
int
auth_status(void)
{
Authenticator *ap;
int i, mask;
if (i_wont_support == -1)
printf("Authentication disabled\n");
else
printf("Authentication enabled\n");
mask = 0;
for (ap = authenticators; ap->type; ap++) {
if ((mask & (i = typemask(ap->type))) != 0)
continue;
mask |= i;
printf("%s: %s\n", AUTHTYPE_NAME(ap->type),
(i_wont_support & typemask(ap->type)) ?
"disabled" : "enabled");
}
return(1);
}
/*
* This routine is called by the server to start authentication
* negotiation.
*/
void
auth_request(void)
{
static unsigned char str_request[64] = { IAC, SB,
TELOPT_AUTHENTICATION,
TELQUAL_SEND, };
Authenticator *ap = authenticators;
unsigned char *e = str_request + 4;
if (!authenticating) {
authenticating = 1;
while (ap->type) {
if (i_support & ~i_wont_support & typemask(ap->type)) {
if (auth_debug_mode) {
printf(">>>%s: Sending type %d %d\r\n",
Name, ap->type, ap->way);
}
*e++ = ap->type;
*e++ = ap->way;
}
++ap;
}
*e++ = IAC;
*e++ = SE;
net_write(str_request, e - str_request);
printsub('>', &str_request[2], e - str_request - 2);
}
}
/*
* This is called when an AUTH SEND is received.
* It should never arrive on the server side (as only the server can
* send an AUTH SEND).
* You should probably respond to it if you can...
*
* If you want to respond to the types out of order (i.e. even
* if he sends LOGIN KERBEROS and you support both, you respond
* with KERBEROS instead of LOGIN (which is against what the
* protocol says)) you will have to hack this code...
*/
void
auth_send(unsigned char *data, int cnt)
{
Authenticator *ap;
static unsigned char str_none[] = { IAC, SB, TELOPT_AUTHENTICATION,
TELQUAL_IS, AUTHTYPE_NULL, 0,
IAC, SE };
if (Server) {
if (auth_debug_mode) {
printf(">>>%s: auth_send called!\r\n", Name);
}
return;
}
if (auth_debug_mode) {
printf(">>>%s: auth_send got:", Name);
printd(data, cnt); printf("\r\n");
}
/*
* Save the data, if it is new, so that we can continue looking
* at it if the authorization we try doesn't work
*/
if (data < _auth_send_data ||
data > _auth_send_data + sizeof(_auth_send_data)) {
auth_send_cnt = (size_t)cnt > sizeof(_auth_send_data)
? sizeof(_auth_send_data)
: cnt;
memmove((void *)_auth_send_data, (void *)data, auth_send_cnt);
auth_send_data = _auth_send_data;
} else {
/*
* This is probably a no-op, but we just make sure
*/
auth_send_data = data;
auth_send_cnt = cnt;
}
while ((auth_send_cnt -= 2) >= 0) {
if (auth_debug_mode)
printf(">>>%s: He supports %d\r\n",
Name, *auth_send_data);
if ((i_support & ~i_wont_support) & typemask(*auth_send_data)) {
ap = findauthenticator(auth_send_data[0],
auth_send_data[1]);
if (ap && ap->send) {
if (auth_debug_mode)
printf(">>>%s: Trying %d %d\r\n",
Name, auth_send_data[0],
auth_send_data[1]);
if ((*ap->send)(ap)) {
/*
* Okay, we found one we like
* and did it.
* we can go home now.
*/
if (auth_debug_mode)
printf(">>>%s: Using type %d\r\n",
Name, *auth_send_data);
auth_send_data += 2;
return;
}
}
/* else
* just continue on and look for the
* next one if we didn't do anything.
*/
}
auth_send_data += 2;
}
net_write(str_none, sizeof(str_none));
printsub('>', &str_none[2], sizeof(str_none) - 2);
if (auth_debug_mode)
printf(">>>%s: Sent failure message\r\n", Name);
auth_finished(0, AUTH_REJECT);
}
void
auth_send_retry(void)
{
/*
* if auth_send_cnt <= 0 then auth_send will end up rejecting
* the authentication and informing the other side of this.
*/
auth_send(auth_send_data, auth_send_cnt);
}
void
auth_is(unsigned char *data, int cnt)
{
Authenticator *ap;
if (cnt < 2)
return;
if (data[0] == AUTHTYPE_NULL) {
auth_finished(0, AUTH_REJECT);
return;
}
if ((ap = findauthenticator(data[0], data[1]))) {
if (ap->is)
(*ap->is)(ap, data+2, cnt-2);
} else if (auth_debug_mode)
printf(">>>%s: Invalid authentication in IS: %d\r\n",
Name, *data);
}
void
auth_reply(unsigned char *data, int cnt)
{
Authenticator *ap;
if (cnt < 2)
return;
if ((ap = findauthenticator(data[0], data[1]))) {
if (ap->reply)
(*ap->reply)(ap, data+2, cnt-2);
} else if (auth_debug_mode)
printf(">>>%s: Invalid authentication in SEND: %d\r\n",
Name, *data);
}
void
auth_name(unsigned char *data, int cnt)
{
unsigned char savename[256];
if (cnt < 1) {
if (auth_debug_mode)
printf(">>>%s: Empty name in NAME\r\n", Name);
return;
}
if ((size_t)cnt > sizeof(savename) - 1) {
if (auth_debug_mode)
printf(">>>%s: Name in NAME (%d) exceeds %d length\r\n",
Name, cnt, (u_int)sizeof(savename)-1);
return;
}
memmove((void *)savename, (void *)data, cnt);
savename[cnt] = '\0'; /* Null terminate */
if (auth_debug_mode)
printf(">>>%s: Got NAME [%s]\r\n", Name, savename);
auth_encrypt_user(savename);
}
int
auth_sendname(unsigned char *cp, int len)
{
static unsigned char str_request[256+6]
= { IAC, SB, TELOPT_AUTHENTICATION, TELQUAL_NAME, };
unsigned char *e = str_request + 4;
unsigned char *ee = &str_request[sizeof(str_request)-2];
while (--len >= 0) {
if ((*e++ = *cp++) == IAC)
*e++ = IAC;
if (e >= ee)
return(0);
}
*e++ = IAC;
*e++ = SE;
net_write(str_request, e - str_request);
printsub('>', &str_request[2], e - &str_request[2]);
return(1);
}
void
auth_finished(Authenticator *ap, int result)
{
if (!(authenticated = ap))
authenticated = &NoAuth;
validuser = result;
}
/* ARGSUSED */
static void
auth_intr(int sig __unused)
{
auth_finished(0, AUTH_REJECT);
}
int
auth_wait(char *name)
{
if (auth_debug_mode)
printf(">>>%s: in auth_wait.\r\n", Name);
if (Server && !authenticating)
return(0);
(void) signal(SIGALRM, auth_intr);
alarm(30);
while (!authenticated)
if (telnet_spin())
break;
alarm(0);
(void) signal(SIGALRM, SIG_DFL);
/*
* Now check to see if the user is valid or not
*/
if (!authenticated || authenticated == &NoAuth)
return(AUTH_REJECT);
if (validuser == AUTH_VALID)
validuser = AUTH_USER;
if (authenticated->status)
validuser = (*authenticated->status)(authenticated,
name, validuser);
return(validuser);
}
void
auth_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
{
Authenticator *ap;
if ((ap = findauthenticator(data[1], data[2])) && ap->printsub)
(*ap->printsub)(data, cnt, buf, buflen);
else
auth_gen_printsub(data, cnt, buf, buflen);
}
void
auth_gen_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
{
unsigned char *cp;
unsigned char tbuf[16];
cnt -= 3;
data += 3;
buf[buflen-1] = '\0';
buf[buflen-2] = '*';
buflen -= 2;
for (; cnt > 0; cnt--, data++) {
sprintf((char *)tbuf, " %d", *data);
for (cp = tbuf; *cp && buflen > 0; --buflen)
*buf++ = *cp++;
if (buflen <= 0)
return;
}
*buf = '\0';
}
#endif
-80
View File
@@ -1,80 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)auth.h 8.1 (Berkeley) 6/4/93
* $FreeBSD$
*/
/*
* Copyright (C) 1990 by the Massachusetts Institute of Technology
*
* Export of this software from the United States of America is assumed
* to require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#ifndef __AUTH__
#define __AUTH__
#define AUTH_REJECT 0 /* Rejected */
#define AUTH_UNKNOWN 1 /* We don't know who he is, but he's okay */
#define AUTH_OTHER 2 /* We know him, but not his name */
#define AUTH_USER 3 /* We know he name */
#define AUTH_VALID 4 /* We know him, and he needs no password */
typedef struct XauthP {
int type;
int way;
int (*init)(struct XauthP *, int);
int (*send)(struct XauthP *);
void (*is)(struct XauthP *, unsigned char *, int);
void (*reply)(struct XauthP *, unsigned char *, int);
int (*status)(struct XauthP *, char *, int);
void (*printsub)(unsigned char *, int, unsigned char *, int);
} Authenticator;
#include "auth-proto.h"
extern int auth_debug_mode;
#endif
-126
View File
@@ -1,126 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)enc-proto.h 8.1 (Berkeley) 6/4/93
* $FreeBSD$
*/
/*
* Copyright (C) 1990 by the Massachusetts Institute of Technology
*
* Export of this software from the United States of America is assumed
* to require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#ifdef ENCRYPTION
void encrypt_init(const char *, int);
Encryptions *findencryption(int);
void encrypt_send_supprt(void);
void encrypt_auto(int);
void decrypt_auto(int);
void encrypt_is(unsigned char *, int);
void encrypt_reply(unsigned char *, int);
void encrypt_start_input(int);
void encrypt_session_key(Session_Key *, int);
void encrypt_end_input(void);
void encrypt_start_output(int);
void encrypt_end_output(void);
void encrypt_send_request_start(void);
void encrypt_send_request_end(void);
void encrypt_send_end(void);
void encrypt_wait(void);
void encrypt_send_support(void);
void encrypt_send_keyid(int, const char *, int, int);
void encrypt_start(unsigned char *, int);
void encrypt_end(void);
void encrypt_support(unsigned char *, int);
void encrypt_request_start(unsigned char *, int);
void encrypt_request_end(void);
void encrypt_enc_keyid(unsigned char *, int);
void encrypt_dec_keyid(unsigned char *, int);
void encrypt_printsub(unsigned char *, int, unsigned char *, int);
void encrypt_gen_printsub(unsigned char *, int, unsigned char *, int);
void encrypt_display(void);
void fb64_printsub(unsigned char *, int, unsigned char *, int, const char *);
int EncryptEnable(char *, char *);
int EncryptDisable(char *, char *);
int EncryptStatus(void);
int EncryptDebug(int);
int EncryptVerbose(int);
int EncryptAutoEnc(int);
int EncryptAutoDec(int);
void krbdes_encrypt(unsigned char *, int);
int krbdes_decrypt(int);
int krbdes_is(unsigned char *, int);
int krbdes_reply(unsigned char *, int);
void krbdes_init(int);
int krbdes_start(int, int);
void krbdes_session(Session_Key *, int);
void krbdes_printsub(unsigned char *, int, unsigned char *, int);
void cfb64_encrypt(unsigned char *, int);
int cfb64_decrypt(int);
void cfb64_init(int);
int cfb64_start(int, int);
int cfb64_is(unsigned char *, int);
int cfb64_reply(unsigned char *, int);
void cfb64_session(Session_Key *, int);
int cfb64_keyid(int, unsigned char *, int *);
void cfb64_printsub(unsigned char *, int, unsigned char *, int);
void ofb64_encrypt(unsigned char *, int);
int ofb64_decrypt(int);
void ofb64_init(int);
int ofb64_start(int, int);
int ofb64_is(unsigned char *, int);
int ofb64_reply(unsigned char *, int);
void ofb64_session(Session_Key *, int);
int ofb64_keyid(int, unsigned char *, int *);
void ofb64_printsub(unsigned char *, int, unsigned char *, int);
#endif /* ENCRYPTION */
-670
View File
@@ -1,670 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
static const char sccsid[] = "@(#)enc_des.c 8.3 (Berkeley) 5/30/95";
#endif /* not lint */
#ifdef ENCRYPTION
# ifdef AUTHENTICATION
#include <arpa/telnet.h>
#include <openssl/des.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "encrypt.h"
#include "key-proto.h"
#include "misc-proto.h"
extern int encrypt_debug_mode;
void des_set_random_generator_seed(des_cblock *); /* XXX */
#define CFB 0
#define OFB 1
#define NO_SEND_IV 1
#define NO_RECV_IV 2
#define NO_KEYID 4
#define IN_PROGRESS (NO_SEND_IV|NO_RECV_IV|NO_KEYID)
#define SUCCESS 0
#define FAILED -1
struct fb {
Block krbdes_key;
Schedule krbdes_sched;
Block temp_feed;
unsigned char fb_feed[64];
int need_start;
int state[2];
int keyid[2];
int once;
struct stinfo {
Block str_output;
Block str_feed;
Block str_iv;
Block str_ikey;
Schedule str_sched;
int str_index;
int str_flagshift;
} streams[2];
};
static struct fb fb[2];
struct keyidlist {
const char *keyid;
int keyidlen;
char *key;
int keylen;
int flags;
} keyidlist [] = {
{ "\0", 1, 0, 0, 0 }, /* default key of zero */
{ 0, 0, 0, 0, 0 }
};
#define KEYFLAG_MASK 03
#define KEYFLAG_NOINIT 00
#define KEYFLAG_INIT 01
#define KEYFLAG_OK 02
#define KEYFLAG_BAD 03
#define KEYFLAG_SHIFT 2
#define SHIFT_VAL(a,b) (KEYFLAG_SHIFT*((a)+((b)*2)))
#define FB64_IV 1
#define FB64_IV_OK 2
#define FB64_IV_BAD 3
void fb64_stream_iv(Block, struct stinfo *);
void fb64_init(struct fb *);
static int fb64_start(struct fb *, int, int);
int fb64_is(unsigned char *, int, struct fb *);
int fb64_reply(unsigned char *, int, struct fb *);
static void fb64_session(Session_Key *, int, struct fb *);
void fb64_stream_key(Block, struct stinfo *);
int fb64_keyid(int, unsigned char *, int *, struct fb *);
void
cfb64_init(int server __unused)
{
fb64_init(&fb[CFB]);
fb[CFB].fb_feed[4] = ENCTYPE_DES_CFB64;
fb[CFB].streams[0].str_flagshift = SHIFT_VAL(0, CFB);
fb[CFB].streams[1].str_flagshift = SHIFT_VAL(1, CFB);
}
void
ofb64_init(int server __unused)
{
fb64_init(&fb[OFB]);
fb[OFB].fb_feed[4] = ENCTYPE_DES_OFB64;
fb[CFB].streams[0].str_flagshift = SHIFT_VAL(0, OFB);
fb[CFB].streams[1].str_flagshift = SHIFT_VAL(1, OFB);
}
void
fb64_init(struct fb *fbp)
{
memset((void *)fbp, 0, sizeof(*fbp));
fbp->state[0] = fbp->state[1] = FAILED;
fbp->fb_feed[0] = IAC;
fbp->fb_feed[1] = SB;
fbp->fb_feed[2] = TELOPT_ENCRYPT;
fbp->fb_feed[3] = ENCRYPT_IS;
}
/*
* Returns:
* -1: some error. Negotiation is done, encryption not ready.
* 0: Successful, initial negotiation all done.
* 1: successful, negotiation not done yet.
* 2: Not yet. Other things (like getting the key from
* Kerberos) have to happen before we can continue.
*/
int
cfb64_start(int dir, int server)
{
return(fb64_start(&fb[CFB], dir, server));
}
int
ofb64_start(int dir, int server)
{
return(fb64_start(&fb[OFB], dir, server));
}
static int
fb64_start(struct fb *fbp, int dir, int server __unused)
{
size_t x;
unsigned char *p;
int state;
switch (dir) {
case DIR_DECRYPT:
/*
* This is simply a request to have the other side
* start output (our input). He will negotiate an
* IV so we need not look for it.
*/
state = fbp->state[dir-1];
if (state == FAILED)
state = IN_PROGRESS;
break;
case DIR_ENCRYPT:
state = fbp->state[dir-1];
if (state == FAILED)
state = IN_PROGRESS;
else if ((state & NO_SEND_IV) == 0)
break;
if (!VALIDKEY(fbp->krbdes_key)) {
fbp->need_start = 1;
break;
}
state &= ~NO_SEND_IV;
state |= NO_RECV_IV;
if (encrypt_debug_mode)
printf("Creating new feed\r\n");
/*
* Create a random feed and send it over.
*/
des_new_random_key((Block *)fbp->temp_feed);
des_ecb_encrypt((Block *)fbp->temp_feed, (Block *)fbp->temp_feed,
fbp->krbdes_sched, 1);
p = fbp->fb_feed + 3;
*p++ = ENCRYPT_IS;
p++;
*p++ = FB64_IV;
for (x = 0; x < sizeof(Block); ++x) {
if ((*p++ = fbp->temp_feed[x]) == IAC)
*p++ = IAC;
}
*p++ = IAC;
*p++ = SE;
printsub('>', &fbp->fb_feed[2], p - &fbp->fb_feed[2]);
net_write(fbp->fb_feed, p - fbp->fb_feed);
break;
default:
return(FAILED);
}
return(fbp->state[dir-1] = state);
}
/*
* Returns:
* -1: some error. Negotiation is done, encryption not ready.
* 0: Successful, initial negotiation all done.
* 1: successful, negotiation not done yet.
*/
int
cfb64_is(unsigned char *data, int cnt)
{
return(fb64_is(data, cnt, &fb[CFB]));
}
int
ofb64_is(unsigned char *data, int cnt)
{
return(fb64_is(data, cnt, &fb[OFB]));
}
int
fb64_is(unsigned char *data, int cnt, struct fb *fbp)
{
unsigned char *p;
int state = fbp->state[DIR_DECRYPT-1];
if (cnt-- < 1)
goto failure;
switch (*data++) {
case FB64_IV:
if (cnt != sizeof(Block)) {
if (encrypt_debug_mode)
printf("CFB64: initial vector failed on size\r\n");
state = FAILED;
goto failure;
}
if (encrypt_debug_mode)
printf("CFB64: initial vector received\r\n");
if (encrypt_debug_mode)
printf("Initializing Decrypt stream\r\n");
fb64_stream_iv((void *)data, &fbp->streams[DIR_DECRYPT-1]);
p = fbp->fb_feed + 3;
*p++ = ENCRYPT_REPLY;
p++;
*p++ = FB64_IV_OK;
*p++ = IAC;
*p++ = SE;
printsub('>', &fbp->fb_feed[2], p - &fbp->fb_feed[2]);
net_write(fbp->fb_feed, p - fbp->fb_feed);
state = fbp->state[DIR_DECRYPT-1] = IN_PROGRESS;
break;
default:
if (encrypt_debug_mode) {
printf("Unknown option type: %d\r\n", *(data-1));
printd(data, cnt);
printf("\r\n");
}
/* FALL THROUGH */
failure:
/*
* We failed. Send an FB64_IV_BAD option
* to the other side so it will know that
* things failed.
*/
p = fbp->fb_feed + 3;
*p++ = ENCRYPT_REPLY;
p++;
*p++ = FB64_IV_BAD;
*p++ = IAC;
*p++ = SE;
printsub('>', &fbp->fb_feed[2], p - &fbp->fb_feed[2]);
net_write(fbp->fb_feed, p - fbp->fb_feed);
break;
}
return(fbp->state[DIR_DECRYPT-1] = state);
}
/*
* Returns:
* -1: some error. Negotiation is done, encryption not ready.
* 0: Successful, initial negotiation all done.
* 1: successful, negotiation not done yet.
*/
int
cfb64_reply(unsigned char *data, int cnt)
{
return(fb64_reply(data, cnt, &fb[CFB]));
}
int
ofb64_reply(unsigned char *data, int cnt)
{
return(fb64_reply(data, cnt, &fb[OFB]));
}
int
fb64_reply(unsigned char *data, int cnt, struct fb *fbp)
{
int state = fbp->state[DIR_ENCRYPT-1];
if (cnt-- < 1)
goto failure;
switch (*data++) {
case FB64_IV_OK:
fb64_stream_iv(fbp->temp_feed, &fbp->streams[DIR_ENCRYPT-1]);
if (state == FAILED)
state = IN_PROGRESS;
state &= ~NO_RECV_IV;
encrypt_send_keyid(DIR_ENCRYPT, "\0", 1, 1);
break;
case FB64_IV_BAD:
memset(fbp->temp_feed, 0, sizeof(Block));
fb64_stream_iv(fbp->temp_feed, &fbp->streams[DIR_ENCRYPT-1]);
state = FAILED;
break;
default:
if (encrypt_debug_mode) {
printf("Unknown option type: %d\r\n", data[-1]);
printd(data, cnt);
printf("\r\n");
}
/* FALL THROUGH */
failure:
state = FAILED;
break;
}
return(fbp->state[DIR_ENCRYPT-1] = state);
}
void
cfb64_session(Session_Key *key, int server)
{
fb64_session(key, server, &fb[CFB]);
}
void
ofb64_session(Session_Key *key, int server)
{
fb64_session(key, server, &fb[OFB]);
}
static void
fb64_session(Session_Key *key, int server, struct fb *fbp)
{
if (!key || key->type != SK_DES) {
if (encrypt_debug_mode)
printf("Can't set krbdes's session key (%d != %d)\r\n",
key ? key->type : -1, SK_DES);
return;
}
memmove((void *)fbp->krbdes_key, (void *)key->data, sizeof(Block));
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_ENCRYPT-1]);
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]);
if (fbp->once == 0) {
des_set_random_generator_seed((Block *)fbp->krbdes_key);
fbp->once = 1;
}
des_key_sched((Block *)fbp->krbdes_key, fbp->krbdes_sched);
/*
* Now look to see if krbdes_start() was was waiting for
* the key to show up. If so, go ahead an call it now
* that we have the key.
*/
if (fbp->need_start) {
fbp->need_start = 0;
fb64_start(fbp, DIR_ENCRYPT, server);
}
}
/*
* We only accept a keyid of 0. If we get a keyid of
* 0, then mark the state as SUCCESS.
*/
int
cfb64_keyid(int dir, unsigned char *kp, int *lenp)
{
return(fb64_keyid(dir, kp, lenp, &fb[CFB]));
}
int
ofb64_keyid(int dir, unsigned char *kp, int *lenp)
{
return(fb64_keyid(dir, kp, lenp, &fb[OFB]));
}
int
fb64_keyid(int dir, unsigned char *kp, int *lenp, struct fb *fbp)
{
int state = fbp->state[dir-1];
if (*lenp != 1 || (*kp != '\0')) {
*lenp = 0;
return(state);
}
if (state == FAILED)
state = IN_PROGRESS;
state &= ~NO_KEYID;
return(fbp->state[dir-1] = state);
}
void
fb64_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen, const char *type)
{
char lbuf[32];
int i;
char *cp;
buf[buflen-1] = '\0'; /* make sure it's NULL terminated */
buflen -= 1;
switch(data[2]) {
case FB64_IV:
sprintf(lbuf, "%s_IV", type);
cp = lbuf;
goto common;
case FB64_IV_OK:
sprintf(lbuf, "%s_IV_OK", type);
cp = lbuf;
goto common;
case FB64_IV_BAD:
sprintf(lbuf, "%s_IV_BAD", type);
cp = lbuf;
goto common;
default:
sprintf(lbuf, " %d (unknown)", data[2]);
cp = lbuf;
common:
for (; (buflen > 0) && (*buf = *cp++); buf++)
buflen--;
for (i = 3; i < cnt; i++) {
sprintf(lbuf, " %d", data[i]);
for (cp = lbuf; (buflen > 0) && (*buf = *cp++); buf++)
buflen--;
}
break;
}
}
void
cfb64_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
{
fb64_printsub(data, cnt, buf, buflen, "CFB64");
}
void
ofb64_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
{
fb64_printsub(data, cnt, buf, buflen, "OFB64");
}
void
fb64_stream_iv(Block seed, struct stinfo *stp)
{
memmove((void *)stp->str_iv, (void *)seed, sizeof(Block));
memmove((void *)stp->str_output, (void *)seed, sizeof(Block));
des_key_sched((Block *)stp->str_ikey, stp->str_sched);
stp->str_index = sizeof(Block);
}
void
fb64_stream_key(Block key, struct stinfo *stp)
{
memmove((void *)stp->str_ikey, (void *)key, sizeof(Block));
des_key_sched((Block *)key, stp->str_sched);
memmove((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block));
stp->str_index = sizeof(Block);
}
/*
* DES 64 bit Cipher Feedback
*
* key --->+-----+
* +->| DES |--+
* | +-----+ |
* | v
* INPUT --(--------->(+)+---> DATA
* | |
* +-------------+
*
*
* Given:
* iV: Initial vector, 64 bits (8 bytes) long.
* Dn: the nth chunk of 64 bits (8 bytes) of data to encrypt (decrypt).
* On: the nth chunk of 64 bits (8 bytes) of encrypted (decrypted) output.
*
* V0 = DES(iV, key)
* On = Dn ^ Vn
* V(n+1) = DES(On, key)
*/
void
cfb64_encrypt(unsigned char *s, int c)
{
struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1];
int idx;
idx = stp->str_index;
while (c-- > 0) {
if (idx == sizeof(Block)) {
Block b;
des_ecb_encrypt((Block *)stp->str_output, (Block *)b, stp->str_sched, 1);
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
idx = 0;
}
/* On encryption, we store (feed ^ data) which is cypher */
*s = stp->str_output[idx] = (stp->str_feed[idx] ^ *s);
s++;
idx++;
}
stp->str_index = idx;
}
int
cfb64_decrypt(int data)
{
struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1];
int idx;
if (data == -1) {
/*
* Back up one byte. It is assumed that we will
* never back up more than one byte. If we do, this
* may or may not work.
*/
if (stp->str_index)
--stp->str_index;
return(0);
}
idx = stp->str_index++;
if (idx == sizeof(Block)) {
Block b;
des_ecb_encrypt((Block *)stp->str_output, (Block *)b, stp->str_sched, 1);
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
stp->str_index = 1; /* Next time will be 1 */
idx = 0; /* But now use 0 */
}
/* On decryption we store (data) which is cypher. */
stp->str_output[idx] = data;
return(data ^ stp->str_feed[idx]);
}
/*
* DES 64 bit Output Feedback
*
* key --->+-----+
* +->| DES |--+
* | +-----+ |
* +-----------+
* v
* INPUT -------->(+) ----> DATA
*
* Given:
* iV: Initial vector, 64 bits (8 bytes) long.
* Dn: the nth chunk of 64 bits (8 bytes) of data to encrypt (decrypt).
* On: the nth chunk of 64 bits (8 bytes) of encrypted (decrypted) output.
*
* V0 = DES(iV, key)
* V(n+1) = DES(Vn, key)
* On = Dn ^ Vn
*/
void
ofb64_encrypt(unsigned char *s, int c)
{
struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1];
int idx;
idx = stp->str_index;
while (c-- > 0) {
if (idx == sizeof(Block)) {
Block b;
des_ecb_encrypt((Block *)stp->str_feed, (Block *)b, stp->str_sched, 1);
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
idx = 0;
}
*s++ ^= stp->str_feed[idx];
idx++;
}
stp->str_index = idx;
}
int
ofb64_decrypt(int data)
{
struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1];
int idx;
if (data == -1) {
/*
* Back up one byte. It is assumed that we will
* never back up more than one byte. If we do, this
* may or may not work.
*/
if (stp->str_index)
--stp->str_index;
return(0);
}
idx = stp->str_index++;
if (idx == sizeof(Block)) {
Block b;
des_ecb_encrypt((Block *)stp->str_feed, (Block *)b, stp->str_sched, 1);
memmove((void *)stp->str_feed, (void *)b, sizeof(Block));
stp->str_index = 1; /* Next time will be 1 */
idx = 0; /* But now use 0 */
}
return(data ^ stp->str_feed[idx]);
}
# endif /* AUTHENTICATION */
#endif /* ENCRYPTION */
-953
View File
@@ -1,953 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static const char sccsid[] = "@(#)encrypt.c 8.2 (Berkeley) 5/30/95";
#endif
#endif /* not lint */
/*
* Copyright (C) 1990 by the Massachusetts Institute of Technology
*
* Export of this software from the United States of America is assumed
* to require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#ifdef ENCRYPTION
#include <sys/types.h>
#define ENCRYPT_NAMES
#include <arpa/telnet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "encrypt.h"
#include "misc.h"
/*
* These functions pointers point to the current routines
* for encrypting and decrypting data.
*/
void (*encrypt_output)(unsigned char *, int);
int (*decrypt_input)(int);
int EncryptType(char *type, char *mode);
int EncryptStart(char *mode);
int EncryptStop(char *mode);
int EncryptStartInput(void);
int EncryptStartOutput(void);
int EncryptStopInput(void);
int EncryptStopOutput(void);
int encrypt_debug_mode = 0;
static int decrypt_mode = 0;
static int encrypt_mode = 0;
static int encrypt_verbose = 0;
static int autoencrypt = 0;
static int autodecrypt = 0;
static int havesessionkey = 0;
static int Server = 0;
static const char *Name = "Noname";
#define typemask(x) ((x) > 0 ? 1 << ((x)-1) : 0)
static u_long i_support_encrypt = 0
| typemask(ENCTYPE_DES_CFB64) | typemask(ENCTYPE_DES_OFB64)
|0;
static u_long i_support_decrypt = 0
| typemask(ENCTYPE_DES_CFB64) | typemask(ENCTYPE_DES_OFB64)
|0;
static u_long i_wont_support_encrypt = 0;
static u_long i_wont_support_decrypt = 0;
#define I_SUPPORT_ENCRYPT (i_support_encrypt & ~i_wont_support_encrypt)
#define I_SUPPORT_DECRYPT (i_support_decrypt & ~i_wont_support_decrypt)
static u_long remote_supports_encrypt = 0;
static u_long remote_supports_decrypt = 0;
static Encryptions encryptions[] = {
{ "DES_CFB64", ENCTYPE_DES_CFB64,
cfb64_encrypt,
cfb64_decrypt,
cfb64_init,
cfb64_start,
cfb64_is,
cfb64_reply,
cfb64_session,
cfb64_keyid,
cfb64_printsub },
{ "DES_OFB64", ENCTYPE_DES_OFB64,
ofb64_encrypt,
ofb64_decrypt,
ofb64_init,
ofb64_start,
ofb64_is,
ofb64_reply,
ofb64_session,
ofb64_keyid,
ofb64_printsub },
{ NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
};
static unsigned char str_send[64] = { IAC, SB, TELOPT_ENCRYPT,
ENCRYPT_SUPPORT };
static unsigned char str_suplen = 0;
static unsigned char str_start[72] = { IAC, SB, TELOPT_ENCRYPT };
static unsigned char str_end[] = { IAC, SB, TELOPT_ENCRYPT, 0, IAC, SE };
Encryptions *
findencryption(int type)
{
Encryptions *ep = encryptions;
if (!(I_SUPPORT_ENCRYPT & remote_supports_decrypt & (unsigned)typemask(type)))
return(0);
while (ep->type && ep->type != type)
++ep;
return(ep->type ? ep : 0);
}
static Encryptions *
finddecryption(int type)
{
Encryptions *ep = encryptions;
if (!(I_SUPPORT_DECRYPT & remote_supports_encrypt & (unsigned)typemask(type)))
return(0);
while (ep->type && ep->type != type)
++ep;
return(ep->type ? ep : 0);
}
#define MAXKEYLEN 64
static struct key_info {
unsigned char keyid[MAXKEYLEN];
int keylen;
int dir;
int *modep;
Encryptions *(*getcrypt)(int);
} ki[2] = {
{ { 0 }, 0, DIR_ENCRYPT, &encrypt_mode, findencryption },
{ { 0 }, 0, DIR_DECRYPT, &decrypt_mode, finddecryption },
};
static void encrypt_keyid(struct key_info *kp, unsigned char *keyid, int len);
void
encrypt_init(const char *name, int server)
{
Encryptions *ep = encryptions;
Name = name;
Server = server;
i_support_encrypt = i_support_decrypt = 0;
remote_supports_encrypt = remote_supports_decrypt = 0;
encrypt_mode = 0;
decrypt_mode = 0;
encrypt_output = 0;
decrypt_input = 0;
str_suplen = 4;
while (ep->type) {
if (encrypt_debug_mode)
printf(">>>%s: I will support %s\r\n",
Name, ENCTYPE_NAME(ep->type));
i_support_encrypt |= typemask(ep->type);
i_support_decrypt |= typemask(ep->type);
if ((i_wont_support_decrypt & typemask(ep->type)) == 0)
if ((str_send[str_suplen++] = ep->type) == IAC)
str_send[str_suplen++] = IAC;
if (ep->init)
(*ep->init)(Server);
++ep;
}
str_send[str_suplen++] = IAC;
str_send[str_suplen++] = SE;
}
static void
encrypt_list_types(void)
{
Encryptions *ep = encryptions;
printf("Valid encryption types:\n");
while (ep->type) {
printf("\t%s (%d)\r\n", ENCTYPE_NAME(ep->type), ep->type);
++ep;
}
}
int
EncryptEnable(char *type, char *mode)
{
if (isprefix(type, "help") || isprefix(type, "?")) {
printf("Usage: encrypt enable <type> [input|output]\n");
encrypt_list_types();
return(0);
}
if (EncryptType(type, mode))
return(EncryptStart(mode));
return(0);
}
int
EncryptDisable(char *type, char *mode)
{
Encryptions *ep;
int ret = 0;
if (isprefix(type, "help") || isprefix(type, "?")) {
printf("Usage: encrypt disable <type> [input|output]\n");
encrypt_list_types();
} else if ((ep = (Encryptions *)genget(type, (char **)encryptions,
sizeof(Encryptions))) == 0) {
printf("%s: invalid encryption type\n", type);
} else if (Ambiguous((char **)ep)) {
printf("Ambiguous type '%s'\n", type);
} else {
if ((mode == 0) || (isprefix(mode, "input") ? 1 : 0)) {
if (decrypt_mode == ep->type)
EncryptStopInput();
i_wont_support_decrypt |= typemask(ep->type);
ret = 1;
}
if ((mode == 0) || (isprefix(mode, "output"))) {
if (encrypt_mode == ep->type)
EncryptStopOutput();
i_wont_support_encrypt |= typemask(ep->type);
ret = 1;
}
if (ret == 0)
printf("%s: invalid encryption mode\n", mode);
}
return(ret);
}
int
EncryptType(char *type, char *mode)
{
Encryptions *ep;
int ret = 0;
if (isprefix(type, "help") || isprefix(type, "?")) {
printf("Usage: encrypt type <type> [input|output]\n");
encrypt_list_types();
} else if ((ep = (Encryptions *)genget(type, (char **)encryptions,
sizeof(Encryptions))) == 0) {
printf("%s: invalid encryption type\n", type);
} else if (Ambiguous((char **)ep)) {
printf("Ambiguous type '%s'\n", type);
} else {
if ((mode == 0) || isprefix(mode, "input")) {
decrypt_mode = ep->type;
i_wont_support_decrypt &= ~typemask(ep->type);
ret = 1;
}
if ((mode == 0) || isprefix(mode, "output")) {
encrypt_mode = ep->type;
i_wont_support_encrypt &= ~typemask(ep->type);
ret = 1;
}
if (ret == 0)
printf("%s: invalid encryption mode\n", mode);
}
return(ret);
}
int
EncryptStart(char *mode)
{
int ret = 0;
if (mode) {
if (isprefix(mode, "input"))
return(EncryptStartInput());
if (isprefix(mode, "output"))
return(EncryptStartOutput());
if (isprefix(mode, "help") || isprefix(mode, "?")) {
printf("Usage: encrypt start [input|output]\n");
return(0);
}
printf("%s: invalid encryption mode 'encrypt start ?' for help\n", mode);
return(0);
}
ret += EncryptStartInput();
ret += EncryptStartOutput();
return(ret);
}
int
EncryptStartInput(void)
{
if (decrypt_mode) {
encrypt_send_request_start();
return(1);
}
printf("No previous decryption mode, decryption not enabled\r\n");
return(0);
}
int
EncryptStartOutput(void)
{
if (encrypt_mode) {
encrypt_start_output(encrypt_mode);
return(1);
}
printf("No previous encryption mode, encryption not enabled\r\n");
return(0);
}
int
EncryptStop(char *mode)
{
int ret = 0;
if (mode) {
if (isprefix(mode, "input"))
return(EncryptStopInput());
if (isprefix(mode, "output"))
return(EncryptStopOutput());
if (isprefix(mode, "help") || isprefix(mode, "?")) {
printf("Usage: encrypt stop [input|output]\n");
return(0);
}
printf("%s: invalid encryption mode 'encrypt stop ?' for help\n", mode);
return(0);
}
ret += EncryptStopInput();
ret += EncryptStopOutput();
return(ret);
}
int
EncryptStopInput(void)
{
encrypt_send_request_end();
return(1);
}
int
EncryptStopOutput(void)
{
encrypt_send_end();
return(1);
}
void
encrypt_display(void)
{
if (encrypt_output)
printf("Currently encrypting output with %s\r\n",
ENCTYPE_NAME(encrypt_mode));
if (decrypt_input)
printf("Currently decrypting input with %s\r\n",
ENCTYPE_NAME(decrypt_mode));
}
int
EncryptStatus(void)
{
if (encrypt_output)
printf("Currently encrypting output with %s\r\n",
ENCTYPE_NAME(encrypt_mode));
else if (encrypt_mode) {
printf("Currently output is clear text.\r\n");
printf("Last encryption mode was %s\r\n",
ENCTYPE_NAME(encrypt_mode));
}
if (decrypt_input) {
printf("Currently decrypting input with %s\r\n",
ENCTYPE_NAME(decrypt_mode));
} else if (decrypt_mode) {
printf("Currently input is clear text.\r\n");
printf("Last decryption mode was %s\r\n",
ENCTYPE_NAME(decrypt_mode));
}
return 1;
}
void
encrypt_send_support(void)
{
if (str_suplen) {
/*
* If the user has requested that decryption start
* immediatly, then send a "REQUEST START" before
* we negotiate the type.
*/
if (!Server && autodecrypt)
encrypt_send_request_start();
net_write(str_send, str_suplen);
printsub('>', &str_send[2], str_suplen - 2);
str_suplen = 0;
}
}
int
EncryptDebug(int on)
{
if (on < 0)
encrypt_debug_mode ^= 1;
else
encrypt_debug_mode = on;
printf("Encryption debugging %s\r\n",
encrypt_debug_mode ? "enabled" : "disabled");
return(1);
}
int
EncryptVerbose(int on)
{
if (on < 0)
encrypt_verbose ^= 1;
else
encrypt_verbose = on;
printf("Encryption %s verbose\r\n",
encrypt_verbose ? "is" : "is not");
return(1);
}
int
EncryptAutoEnc(int on)
{
encrypt_auto(on);
printf("Automatic encryption of output is %s\r\n",
autoencrypt ? "enabled" : "disabled");
return(1);
}
int
EncryptAutoDec(int on)
{
decrypt_auto(on);
printf("Automatic decryption of input is %s\r\n",
autodecrypt ? "enabled" : "disabled");
return(1);
}
/*
* Called when ENCRYPT SUPPORT is received.
*/
void
encrypt_support(unsigned char *typelist, int cnt)
{
int type, use_type = 0;
Encryptions *ep;
/*
* Forget anything the other side has previously told us.
*/
remote_supports_decrypt = 0;
while (cnt-- > 0) {
type = *typelist++;
if (encrypt_debug_mode)
printf(">>>%s: He is supporting %s (%d)\r\n",
Name,
ENCTYPE_NAME(type), type);
if ((type < ENCTYPE_CNT) &&
(I_SUPPORT_ENCRYPT & typemask(type))) {
remote_supports_decrypt |= typemask(type);
if (use_type == 0)
use_type = type;
}
}
if (use_type) {
ep = findencryption(use_type);
if (!ep)
return;
type = ep->start ? (*ep->start)(DIR_ENCRYPT, Server) : 0;
if (encrypt_debug_mode)
printf(">>>%s: (*ep->start)() returned %d\r\n",
Name, type);
if (type < 0)
return;
encrypt_mode = use_type;
if (type == 0)
encrypt_start_output(use_type);
}
}
void
encrypt_is(unsigned char *data, int cnt)
{
Encryptions *ep;
int type, ret;
if (--cnt < 0)
return;
type = *data++;
if (type < ENCTYPE_CNT)
remote_supports_encrypt |= typemask(type);
if (!(ep = finddecryption(type))) {
if (encrypt_debug_mode)
printf(">>>%s: Can't find type %s (%d) for initial negotiation\r\n",
Name,
ENCTYPE_NAME_OK(type)
? ENCTYPE_NAME(type) : "(unknown)",
type);
return;
}
if (!ep->is) {
if (encrypt_debug_mode)
printf(">>>%s: No initial negotiation needed for type %s (%d)\r\n",
Name,
ENCTYPE_NAME_OK(type)
? ENCTYPE_NAME(type) : "(unknown)",
type);
ret = 0;
} else {
ret = (*ep->is)(data, cnt);
if (encrypt_debug_mode)
printf("(*ep->is)(%p, %d) returned %s(%d)\n", data, cnt,
(ret < 0) ? "FAIL " :
(ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret);
}
if (ret < 0) {
autodecrypt = 0;
} else {
decrypt_mode = type;
if (ret == 0 && autodecrypt)
encrypt_send_request_start();
}
}
void
encrypt_reply(unsigned char *data, int cnt)
{
Encryptions *ep;
int ret, type;
if (--cnt < 0)
return;
type = *data++;
if (!(ep = findencryption(type))) {
if (encrypt_debug_mode)
printf(">>>%s: Can't find type %s (%d) for initial negotiation\r\n",
Name,
ENCTYPE_NAME_OK(type)
? ENCTYPE_NAME(type) : "(unknown)",
type);
return;
}
if (!ep->reply) {
if (encrypt_debug_mode)
printf(">>>%s: No initial negotiation needed for type %s (%d)\r\n",
Name,
ENCTYPE_NAME_OK(type)
? ENCTYPE_NAME(type) : "(unknown)",
type);
ret = 0;
} else {
ret = (*ep->reply)(data, cnt);
if (encrypt_debug_mode)
printf("(*ep->reply)(%p, %d) returned %s(%d)\n",
data, cnt,
(ret < 0) ? "FAIL " :
(ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret);
}
if (encrypt_debug_mode)
printf(">>>%s: encrypt_reply returned %d\n", Name, ret);
if (ret < 0) {
autoencrypt = 0;
} else {
encrypt_mode = type;
if (ret == 0 && autoencrypt)
encrypt_start_output(type);
}
}
/*
* Called when a ENCRYPT START command is received.
*/
void
encrypt_start(unsigned char *data __unused, int cnt __unused)
{
Encryptions *ep;
if (!decrypt_mode) {
/*
* Something is wrong. We should not get a START
* command without having already picked our
* decryption scheme. Send a REQUEST-END to
* attempt to clear the channel...
*/
printf("%s: Warning, Cannot decrypt input stream!!!\r\n", Name);
encrypt_send_request_end();
return;
}
if ((ep = finddecryption(decrypt_mode))) {
decrypt_input = ep->input;
if (encrypt_verbose)
printf("[ Input is now decrypted with type %s ]\r\n",
ENCTYPE_NAME(decrypt_mode));
if (encrypt_debug_mode)
printf(">>>%s: Start to decrypt input with type %s\r\n",
Name, ENCTYPE_NAME(decrypt_mode));
} else {
printf("%s: Warning, Cannot decrypt type %s (%d)!!!\r\n",
Name,
ENCTYPE_NAME_OK(decrypt_mode)
? ENCTYPE_NAME(decrypt_mode)
: "(unknown)",
decrypt_mode);
encrypt_send_request_end();
}
}
void
encrypt_session_key( Session_Key *key, int server)
{
Encryptions *ep = encryptions;
havesessionkey = 1;
while (ep->type) {
if (ep->session)
(*ep->session)(key, server);
++ep;
}
}
/*
* Called when ENCRYPT END is received.
*/
void
encrypt_end(void)
{
decrypt_input = 0;
if (encrypt_debug_mode)
printf(">>>%s: Input is back to clear text\r\n", Name);
if (encrypt_verbose)
printf("[ Input is now clear text ]\r\n");
}
/*
* Called when ENCRYPT REQUEST-END is received.
*/
void
encrypt_request_end(void)
{
encrypt_send_end();
}
/*
* Called when ENCRYPT REQUEST-START is received. If we receive
* this before a type is picked, then that indicates that the
* other side wants us to start encrypting data as soon as we
* can.
*/
void
encrypt_request_start(unsigned char *data __unused, int cnt __unused)
{
if (encrypt_mode == 0) {
if (Server)
autoencrypt = 1;
return;
}
encrypt_start_output(encrypt_mode);
}
static unsigned char str_keyid[(MAXKEYLEN*2)+5] = { IAC, SB, TELOPT_ENCRYPT };
void
encrypt_enc_keyid(unsigned char *keyid, int len)
{
encrypt_keyid(&ki[1], keyid, len);
}
void
encrypt_dec_keyid(unsigned char *keyid, int len)
{
encrypt_keyid(&ki[0], keyid, len);
}
void
encrypt_keyid(struct key_info *kp, unsigned char *keyid, int len)
{
Encryptions *ep;
int dir = kp->dir;
int ret = 0;
if (!(ep = (*kp->getcrypt)(*kp->modep))) {
if (len == 0)
return;
kp->keylen = 0;
} else if (len == 0) {
/*
* Empty option, indicates a failure.
*/
if (kp->keylen == 0)
return;
kp->keylen = 0;
if (ep->keyid)
(void)(*ep->keyid)(dir, kp->keyid, &kp->keylen);
} else if ((len != kp->keylen) ||
(memcmp(keyid, kp->keyid, len) != 0)) {
/*
* Length or contents are different
*/
kp->keylen = len;
memmove(kp->keyid, keyid, len);
if (ep->keyid)
(void)(*ep->keyid)(dir, kp->keyid, &kp->keylen);
} else {
if (ep->keyid)
ret = (*ep->keyid)(dir, kp->keyid, &kp->keylen);
if ((ret == 0) && (dir == DIR_ENCRYPT) && autoencrypt)
encrypt_start_output(*kp->modep);
return;
}
encrypt_send_keyid(dir, kp->keyid, kp->keylen, 0);
}
void
encrypt_send_keyid(int dir, const char *keyid, int keylen, int saveit)
{
unsigned char *strp;
str_keyid[3] = (dir == DIR_ENCRYPT)
? ENCRYPT_ENC_KEYID : ENCRYPT_DEC_KEYID;
if (saveit) {
struct key_info *kp = &ki[(dir == DIR_ENCRYPT) ? 0 : 1];
memmove(kp->keyid, keyid, keylen);
kp->keylen = keylen;
}
for (strp = &str_keyid[4]; keylen > 0; --keylen) {
if ((*strp++ = *keyid++) == IAC)
*strp++ = IAC;
}
*strp++ = IAC;
*strp++ = SE;
net_write(str_keyid, strp - str_keyid);
printsub('>', &str_keyid[2], strp - str_keyid - 2);
}
void
encrypt_auto(int on)
{
if (on < 0)
autoencrypt ^= 1;
else
autoencrypt = on ? 1 : 0;
}
void
decrypt_auto(int on)
{
if (on < 0)
autodecrypt ^= 1;
else
autodecrypt = on ? 1 : 0;
}
void
encrypt_start_output(int type)
{
Encryptions *ep;
unsigned char *p;
int i;
if (!(ep = findencryption(type))) {
if (encrypt_debug_mode) {
printf(">>>%s: Can't encrypt with type %s (%d)\r\n",
Name,
ENCTYPE_NAME_OK(type)
? ENCTYPE_NAME(type) : "(unknown)",
type);
}
return;
}
if (ep->start) {
i = (*ep->start)(DIR_ENCRYPT, Server);
if (encrypt_debug_mode) {
printf(">>>%s: Encrypt start: %s (%d) %s\r\n",
Name,
(i < 0) ? "failed" :
"initial negotiation in progress",
i, ENCTYPE_NAME(type));
}
if (i)
return;
}
p = str_start + 3;
*p++ = ENCRYPT_START;
for (i = 0; i < ki[0].keylen; ++i) {
if ((*p++ = ki[0].keyid[i]) == IAC)
*p++ = IAC;
}
*p++ = IAC;
*p++ = SE;
net_write(str_start, p - str_start);
net_encrypt();
printsub('>', &str_start[2], p - &str_start[2]);
/*
* If we are already encrypting in some mode, then
* encrypt the ring (which includes our request) in
* the old mode, mark it all as "clear text" and then
* switch to the new mode.
*/
encrypt_output = ep->output;
encrypt_mode = type;
if (encrypt_debug_mode)
printf(">>>%s: Started to encrypt output with type %s\r\n",
Name, ENCTYPE_NAME(type));
if (encrypt_verbose)
printf("[ Output is now encrypted with type %s ]\r\n",
ENCTYPE_NAME(type));
}
void
encrypt_send_end(void)
{
if (!encrypt_output)
return;
str_end[3] = ENCRYPT_END;
net_write(str_end, sizeof(str_end));
net_encrypt();
printsub('>', &str_end[2], sizeof(str_end) - 2);
/*
* Encrypt the output buffer now because it will not be done by
* netflush...
*/
encrypt_output = 0;
if (encrypt_debug_mode)
printf(">>>%s: Output is back to clear text\r\n", Name);
if (encrypt_verbose)
printf("[ Output is now clear text ]\r\n");
}
void
encrypt_send_request_start(void)
{
unsigned char *p;
int i;
p = &str_start[3];
*p++ = ENCRYPT_REQSTART;
for (i = 0; i < ki[1].keylen; ++i) {
if ((*p++ = ki[1].keyid[i]) == IAC)
*p++ = IAC;
}
*p++ = IAC;
*p++ = SE;
net_write(str_start, p - str_start);
printsub('>', &str_start[2], p - &str_start[2]);
if (encrypt_debug_mode)
printf(">>>%s: Request input to be encrypted\r\n", Name);
}
void
encrypt_send_request_end(void)
{
str_end[3] = ENCRYPT_REQEND;
net_write(str_end, sizeof(str_end));
printsub('>', &str_end[2], sizeof(str_end) - 2);
if (encrypt_debug_mode)
printf(">>>%s: Request input to be clear text\r\n", Name);
}
void
encrypt_wait(void)
{
if (encrypt_debug_mode)
printf(">>>%s: in encrypt_wait\r\n", Name);
if (!havesessionkey || !(I_SUPPORT_ENCRYPT & remote_supports_decrypt))
return;
while (autoencrypt && !encrypt_output)
if (telnet_spin())
return;
}
void
encrypt_gen_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
{
char tbuf[16], *cp;
cnt -= 2;
data += 2;
buf[buflen-1] = '\0';
buf[buflen-2] = '*';
buflen -= 2;;
for (; cnt > 0; cnt--, data++) {
sprintf(tbuf, " %d", *data);
for (cp = tbuf; *cp && buflen > 0; --buflen)
*buf++ = *cp++;
if (buflen <= 0)
return;
}
*buf = '\0';
}
void
encrypt_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen)
{
Encryptions *ep;
int type = data[1];
for (ep = encryptions; ep->type && ep->type != type; ep++)
;
if (ep->printsub)
(*ep->printsub)(data, cnt, buf, buflen);
else
encrypt_gen_printsub(data, cnt, buf, buflen);
}
#endif /* ENCRYPTION */
-106
View File
@@ -1,106 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)encrypt.h 8.1 (Berkeley) 6/4/93
* $FreeBSD$
*/
/*
* Copyright (C) 1990 by the Massachusetts Institute of Technology
*
* Export of this software from the United States of America is assumed
* to require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#ifdef ENCRYPTION
# ifndef __ENCRYPTION__
# define __ENCRYPTION__
#define DIR_DECRYPT 1
#define DIR_ENCRYPT 2
#include <openssl/des.h>
typedef unsigned char Block[8];
typedef unsigned char *BlockT;
#if 0
typedef struct { Block __; } Schedule[16];
#else
#define Schedule des_key_schedule
#endif
#define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \
key[4] | key[5] | key[6] | key[7])
#define SAMEKEY(k1, k2) (!bcmp((void *)k1, (void *)k2, sizeof(Block)))
typedef struct {
short type;
int length;
unsigned char *data;
} Session_Key;
typedef struct {
const char *name;
int type;
void (*output)(unsigned char *, int);
int (*input)(int);
void (*init)(int);
int (*start)(int, int);
int (*is)(unsigned char *, int);
int (*reply)(unsigned char *, int);
void (*session)(Session_Key *, int);
int (*keyid)(int, unsigned char *, int *);
void (*printsub)(unsigned char *, int, unsigned char *, int);
} Encryptions;
#define SK_DES 1 /* Matched Kerberos v5 KEYTYPE_DES */
#include "enc-proto.h"
extern int encrypt_debug_mode;
extern int (*decrypt_input)(int);
extern void (*encrypt_output)(unsigned char *, int);
# endif /* __ENCRYPTION__ */
#endif /* ENCRYPTION */
-107
View File
@@ -1,107 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static const char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95";
#endif
#endif /* not lint */
#include <ctype.h>
#include "misc-proto.h"
#define LOWER(x) (isupper(x) ? tolower(x) : (x))
/*
* The prefix function returns 0 if *s1 is not a prefix
* of *s2. If *s1 exactly matches *s2, the negative of
* the length is returned. If *s1 is a prefix of *s2,
* the length of *s1 is returned.
*/
int
isprefix(char *s1, const char *s2)
{
char *os1;
char c1, c2;
if (*s1 == '\0')
return(-1);
os1 = s1;
c1 = *s1;
c2 = *s2;
while (LOWER(c1) == LOWER(c2)) {
if (c1 == '\0')
break;
c1 = *++s1;
c2 = *++s2;
}
return(*s1 ? 0 : (*s2 ? (s1 - os1) : (os1 - s1)));
}
static char *ambiguous; /* special return value for command routines */
char **
genget(char *name, char **table, int stlen)
{
char **c, **found;
int n;
if (name == 0)
return 0;
found = 0;
for (c = table; *c != 0; c = (char **)((char *)c + stlen)) {
if ((n = isprefix(name, *c)) == 0)
continue;
if (n < 0) /* exact match */
return(c);
if (found)
return(&ambiguous);
found = c;
}
return(found);
}
/*
* Function call version of Ambiguous()
*/
int
Ambiguous(char **s)
{
return(s == &ambiguous);
}
-76
View File
@@ -1,76 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93";
#endif
#endif /* not lint */
#include <stdlib.h>
#include <string.h>
#include "misc-proto.h"
static char *area;
static char gettytab[] = "/etc/gettytab";
/*ARGSUSED*/
int
getent(char *cp __unused, const char *name)
{
int retval;
char *tempnam, *dba[2] = { gettytab, NULL };
tempnam = strdup(name);
retval = cgetent(&area, dba, tempnam) == 0 ? 1 : 0;
free(tempnam);
return(retval);
}
/*ARGSUSED*/
char *
Getstr(const char *id, char **cpp __unused)
{
int retval;
char *answer, *tempid;
tempid = strdup(id);
retval = cgetstr(area, tempid, &answer);
free(tempid);
return((retval > 0) ? answer : NULL);
}
Loaded 100 of 1856 files, more files were not shown because too many files have changed in this diff. Show more