Compare commits

...
876 Commits
Author SHA1 Message Date
Ken Smith 3d215489fe MFC v1.7
> date: 2005/11/03 00:23:13;  author: kensmith;  state: Exp;  lines: +1 -6
> It had been noticed disc2 was overflowing earlier but committing the
> fix slipped through a crack.  Remove the apache and php packages under
> the assumption someone installing a Web server has network access and
> doesn't *need* the packages on disc2.

Approved by:	re (scottl)
2005-11-03 00:35:25 +00:00
Scott Long da2cd746e7 Welcome to 6.0-RELEASE.
Approved by: re
2005-11-02 02:00:46 +00:00
Scott Long 52b835344d MFC: FreeBSD 6.0
Approved by: re
2005-11-02 00:01:08 +00:00
Scott Long ffdda74401 Grrr, Nov = 11
Approved by:	re
2005-11-01 23:43:49 +00:00
Scott Long d78cc8da72 Note that 6.0-RELEASE is about to happen.
Approved by:	re
2005-11-01 23:40:38 +00:00
Scott Long 957f5ead91 MFC: Tell gcc about FreeBSD 6.
Approved by: re
2005-11-01 23:10:08 +00:00
SUZUKI Shinsuke c0a7104606 MFC 1.59
statically configured IPv6 address is properly added/deleted now

Approved by: re(scottl)
2005-11-01 22:42:05 +00:00
John Baldwin 3d888e5914 MF6: Add a deprecation warning.
Approved by:	re (scottl)
2005-10-31 20:17:14 +00:00
Yoshihiro Takahashi 35738380af MFC: Enable beastie.4th.
Approved by:	re (scottl)
2005-10-30 16:36:00 +00:00
Scott Long e658bb489d MFC
Approved by: re
2005-10-30 14:40:40 +00:00
cvs2svn 21f0307211 This commit was manufactured by cvs2svn to create branch 'RELENG_6_0'. 2005-10-30 05:41:44 +00:00
Kirill Ponomarev 887d355270 MFC: perform.c:1.14 test-pkg_version.sh:1.6
date: 2005/10/10 12:35:30;  author: krion;  state: Exp;  lines: +9 -4
  * pkg_version(1) exits if INDEX files is not found and -I is not
    specified.  The result is that the package will be listed with a '?'
    as if it was not found within the INDEX file, so fix this behaviour.
  * Remove trailing spaces.

  PR:             bin/87136
  Submitted by:   Sean Farley <sean-freebsd at farley dot org>

Approved by:	re
2005-10-29 15:49:01 +00:00
Kirill Ponomarev 6636f48868 MFC: delete/main.c:1.27 info/main.c:1.48
Fix pkg_info(1) and pkg_delete(1) to handle properly packages which
  names start with a digit.

  PR:             bin/76858
  Submitted by:   Matthew D. Fuller <fullermd@over-yonder dot net>

Approved by:	re
2005-10-29 15:27:12 +00:00
Scott Long 66308c6270 MFC rev 1.113
Submitted by delphij
Approved by: re
2005-10-29 15:13:07 +00:00
Scott Long 087ac34ec2 Sync RELENG_6_0 with all of the FFS fixes from Tor.
Submitted by:	tegge
Approved by:	re
2005-10-29 07:00:45 +00:00
Tai-hwa Liang ede84755f3 MFC: (1.16) Fixing a name collision in module declaration by renaming
"firewire" to "if_firewire."  According to the PR originator and Cai's
testing result, this bug prevents a RELENG_6 GENERIC kernel from loading
if_fwip.ko and will panic the kernel if users compile "device fwip" into
their GENERIC kernel.

Approved by:	re (scottl)
2005-10-28 22:52:31 +00:00
Pawel Jakub Dawidek c5e3056011 Fix possible live-lock under heavy load where we can't allocate more
memory for request.
I was sure graid3 should handle such situations well, but green@ reported
it is not and we want to fix it before 6.0.

Submitted by:	green
Approved by:	re (scottl)
2005-10-28 20:27:53 +00:00
John Baldwin abf809c118 MF6: Sync with HEAD updating examples for 6.x.
Approved by:	re (scottl)
2005-10-28 19:24:41 +00:00
John Baldwin 96fb3ac3fc MF6: Add DEFAULTS files for amd64, i386, and pc98.
Approved by:	re (scottl)
2005-10-28 19:22:41 +00:00
John Baldwin 17fc0cbcdb MF6: config -V and support for DEFAULTS.
Approved by:	re (scottl)
2005-10-28 19:20:53 +00:00
John Baldwin 01b1c3795a MF6: Add COMPAT_FREEBSD5.
Approved by:	re (scottl)
2005-10-28 19:20:00 +00:00
Martin Cracauer 95dfc0a1cc Fix this:
kern/87959      cracauer        ext2fs: no cp(1) possible, mmap returns EINVAL

ext2fs was missing vnode_create_vobject.

(Reisefs probably has the same problem but I want to get this in quick
for 6-release)

releng-6 branches commits approved by Scott Long.

Approved by: re
2005-10-28 18:44:26 +00:00
Scott Long 5e4677ca87 MFC: Fix regression in Dell PERC/ROMB systems.
Approved by: re
2005-10-28 16:31:34 +00:00
cvs2svn 218f2e0ec5 This commit was manufactured by cvs2svn to create branch 'RELENG_6_0'. 2005-10-28 15:30:53 +00:00
SUZUKI Shinsuke 527ef1908a MFC Rev 1.60
perform NUD on an IPv6-aware point-to-point interface

Approved by: re(scottl)
2005-10-28 14:38:56 +00:00
Ade Lovett b7217bb7d0 MFC:
Specifically panic() in the case where pmap_insert_entry() fails to
get a new pv under high system load where the available pv entries
have been exhausted before the pagedaemon has a chance to wake up
to reclaim some.

Approved by:	re (scottl)
2005-10-28 06:49:49 +00:00
Xin LI 628f5eef34 MFRELENG_6 1.416.2.4: Some changes to reflect 6.0-STABLE/RELEASE.
Approved by:	re (scottl)
2005-10-28 02:59:51 +00:00
Peter Grehan e6d8fd44a4 MF RELENG_6 r1.34.2.1
> The BCM5401 dspcode load on media changes also applies
  > to the 100/1000 BCM5400 phy. This fixes the problem with
  > the GEM port not syncing up on Sawtooth G4's.
  >
  > Obtained from:  NetBSD
  > Reported by:    Ben Rosengart <ben + freebsd org at narcissus net>

Approved by:    re (scottl)
2005-10-28 01:07:54 +00:00
Stephan Uphoff 5f37fe5bda MFC vfs_cluster.c Revision 1.168
Only set B_RAM (Read ahead mark) on an incore buffers if we can lock it.
This fixes a race condition caused by the unlocked write access to the
b_flags field.

Approved by:    re (scottl)
2005-10-28 01:03:26 +00:00
Ken Smith 18d2ca12a1 MFC of Rev. 1.6.2.1:
> Temporary hack to get the hme network interface on Sun E250 servers to
> work.  The code comment describes the issue, basically an as yet not
> totally understood interrupt routing problem.  This hack is being done
> to RELENG_6 so that the hme interface works on E250's for the release,
> but is not being done in HEAD so more work on the interrupt routing
> issue can be done.
>
> Requested by:	marius

Approved by:	re (scottl)
2005-10-27 20:58:50 +00:00
Joel Dahl 8cb3b5729f MFC r1.59:
Add support for ATI IXP[234]00.

Requested by:	delphij
Approved by:	re (scottl)
2005-10-27 20:47:03 +00:00
Joel Dahl e8d38e80bb MFC r1.1334:
snd_ess needs snd_sbc, so add a note about that.

Requested by:	delphij
Approved by:	re (scottl)
2005-10-27 20:39:37 +00:00
Andrew Thompson 905dbf6afa MFC if_bridge r1.30
> If we have been called from ether_ifdetach() then do not try and clear the
> promisc flag from the member interface, this is a no-op anyway since the
> interface is disappearing. The driver may have already released
> its resources such as miibus and this is likely to panic the kernel.

Approved by:    re (scottl)
2005-10-27 19:43:07 +00:00
Scott Long 71c60dd1de MFC: Sync the mpt driver to pick up license refinement and INVARIANTS error.
Approved by: re
2005-10-27 18:58:37 +00:00
Murray Stokely d26e5dee60 MFC: Use packages-6-release directory for packages, as appropriate.
Approved by:	re
2005-10-27 18:38:48 +00:00
Gleb Smirnoff 020ec29a79 MFC:
- Fix leak of struct nlminfo on process exit.
  - Fix malloc type collision, that made the above problem
    difficult to understand.

  Reported by:	Vladimir Sharun <sharun ukr.net>

Approved by:	re (scottl)
2005-10-27 18:35:19 +00:00
Xin LI 5dd20217a6 MFRELENG_6 1.5.2.3: Update to sync up with latest RELENG_6 documentation.
Approved by:	re (scottl)
2005-10-27 17:54:31 +00:00
Bill Paul d2854f8b92 MFC: add the driver_ndis support files to the wpa_supplicant distribution
for -D ndis support with the NDISulator

Approved by:	re
2005-10-27 17:15:47 +00:00
Bill Paul 0dbb2e0f34 MFC: synchronize the NDISulator with the head and RELENG_5 branches,
add -D ndis support to wpa_supplicant

Approved by:	re
2005-10-27 17:08:57 +00:00
Bill Paul fd47f7362f MFC: add 1 microsecond delay to pci_add_children() bus enumeration loop
Approved by:	re
2005-10-27 16:44:06 +00:00
Søren Schmidt b75aec04ff MFC:
Enclose the delayed attach in Giant so we dont loose the race with other
	drivers trying to attach ATA devices like pccard.
	Dont clear the delayed flag before we are acutally finished.

Approved by: re@ (scottl)
2005-10-27 16:41:39 +00:00
Jung-uk Kim 99c293401c MFRELENG_6: Fix 'grep -Fw' for encodings other than UTF-8 (RH bug #161700).
PR:		87969
Approved by:	re (scottl)
Obtained from:	Fedora (Tim Waugh)
2005-10-27 16:29:02 +00:00
SUZUKI Shinsuke fe1746fb90 MFC rev 1.34
fixed a kernel crash when IPv6 PIM-SM routing is enabled and a PIM register message is received

Approved by: re(scottl)
2005-10-27 14:04:03 +00:00
Peter Wemm 2e2bc37c17 MFC: 1.2: don't set segment registers yet.
Approved by:  re
2005-10-26 22:07:03 +00:00
Christian S.J. Peron 3b30fd6060 MFC notes about ucred based rules and debug.mpsafenet requirements.
Approved by:	re (scottl)
2005-10-26 21:58:42 +00:00
Ariff Abdullah 22ff0d37be Virtual channel default speed should be based on soundcard
capabilities. This solve various mysterious slowdown especially
for fixed-rate ac97 soundcards.

Approved by:	re (scottl), netchild (mentor)
Reviewed by:	andreas
2005-10-26 21:18:41 +00:00
Ariff Abdullah f66ce35e97 Rearrange sound unregister procedure to detect mixer busy
state and destroy it before anything else. This solve panic issue
during sound module unloading if the sound / mixer device being
held by external processes.

Approved by:	re (scottl), netchild (mentor)
Reviewed by:	andreas
2005-10-26 21:18:09 +00:00
Ariff Abdullah ff7bd1bebf Track every mixer device closing for proper refcount calculation.
This solve device busy and panic issues during sound module
unloading.

Approved by:	re (scottl), netchild (mentor)
Reviewed by:	andreas
2005-10-26 21:17:40 +00:00
Jung-uk Kim 3aafcdb5aa MFRELENG_6: Fix a longstanding buglet in bz-prefixed grep(1).
PR:		gnu/72200
Approved by:	re
2005-10-26 21:15:51 +00:00
Xin LI 0fcef6909b MFRELENG_6 (by alc) changesets that addresses several race conditions that
can cause a kernel compiled with ZERO_COPY_SOCKETS to panic under certain
circumstances:
	sys/kern/uipc_cow.c:	1.24 - 1.26
	sys/vm/vm_object.c:	1.351

Approved by:	re (scottl)
2005-10-26 20:22:00 +00:00
Pawel Jakub Dawidek b79874b1ac Call if_clone_detach() after vlan_clone_destroy() loop, as if_clone_detach()
is freeing ifc_units field, which is used in
vlan_clone_destroy()->ifc_free_unit().

This fixes panic: ifc_free_unit: bit is already cleared

The fix introduces a small race in that a new interface could be created
between the vlan_clone_destroy() loop and the call to if_clone_detach().
The race is probably too hard to trigger to be worry about it.

This is not an MFC, because better fix was committed to HEAD.
We decided to use this fix, as it is a low-risk fix, which fits just fine
for 6.0 at this stage.

Discussed with:	brooks, thompsa
Approved by:	re (scottl)
2005-10-26 19:57:04 +00:00
Peter Wemm 9a8c805f4e MFC: Fix fencepost error that made libkvm fail to read crashdumps.
Approved by: re
2005-10-26 00:07:25 +00:00
Nate Lawson ae4c6d68b3 MFC rev 1.11.2.1: set to 100% on boot
Approved by:	re (scottl)
2005-10-25 20:53:22 +00:00
Nate Lawson 75609203af MFC rev 1.214.2.1: Don't disable PCI link devices even when they're !enabled
Approved by:	re (scottl)
2005-10-25 20:51:58 +00:00
Kris Kennaway 9792749811 MFC r1.650:
Default to mpsafevfs=1 on sparc64

Approved by:    re (scottl)
2005-10-25 20:43:25 +00:00
Kris Kennaway a42a37b2b1 MFC 1.73:
Reflect mpsafety of the underlying filesystem in the nullfs image.

Approved by:    re (scottl)
2005-10-25 20:33:59 +00:00
John Baldwin a09f52b5b4 MF6: Don't panic if a spin lock is initialized that isn't in our static
order list.  Just warn about it instead.

Approved by:	re (scottl)
2005-10-25 20:17:11 +00:00
John Baldwin 12abcec092 MF6: Rename 'traceall' to 'alltrace' and add a 'bt' alias for 'trace'.
Approved by:	re (scottl)
2005-10-25 20:11:58 +00:00
Nate Lawson c46ee19798 MFC: powerd.c rev 1.6.2.3, powerd.8 rev 1.5.2.1
Approved by:	re (scottl)
2005-10-25 20:07:51 +00:00
Warner Losh a21bfc1306 MFC: 1.26
Approved by: re@ (scottl)
2005-10-25 20:07:47 +00:00
cvs2svn cfb0cdce75 This commit was manufactured by cvs2svn to create branch 'RELENG_6_0'. 2005-10-24 05:35:42 +00:00
Warner Losh 3e0b8fb346 MF RELENG_6: (1.2) reduce the memory page size to 1k. 2005-10-23 18:23:27 +00:00
Xin LI 1d64cdbb8b MFR6: Remove the "6.x is slow" note to reflect reality.
Approved by:	re (scottl)
2005-10-23 03:36:03 +00:00
Andrew Thompson 92ad66505c MFC ng_ether support for if_bridge and cleanup of bridge hooks.
bridgestp.c; r1.8
 if_bridge.c; r1.25, 1.27
 if_bridgevar.h; r1.5
 if_ethersubr.c; r1.201, 1.202, 1.206
 ng_ether.c; r1.52 - 1.54

Approved by:    re (scottl)
2005-10-23 02:37:28 +00:00
Gleb Smirnoff 38104e8617 Sync with HEAD. Revisions merged:
- rev. 1.76. Removed FreeBSD 4.x code.
  - rev. 1.77, 1.79. Together with rev. 1.71 (already merged) this
    fixes problems when some code is executed in driver when
    em_process_receive_interrupts() drops lock. This can occur
    at runtime, when polling(4) mode is changed to interrupt driver
    or vise versa, but more likely this can happen when administrator
    issues some ifconfig commands.
  - rev. 1.78. In em_process_receive_interrupts(), call bus_dmamap_sync()
    for the descriptors set each time we modify one descriptor, instead
    of doing it only at the function exit.
  - rev. 1.80. Loop in em_intr() until interrupt cause register is clear,
    don't mask overrun interrupt.
  - rev. 1.81. Several locking and other fixes.

See particular revision logs for more detailed information.

Approved by:	re
2005-10-22 22:07:20 +00:00
Yaroslav Tykhiy 34ffcac9fd MFC notes on ifconfig(8): -tunnel, -vlandev.
Approved by:    re (hrs)
2005-10-21 16:01:46 +00:00
SUZUKI Shinsuke a851385207 MFC 1.56 (added a missing unlock)
Approved by: re(scottl)
2005-10-21 11:10:46 +00:00
Stephan Uphoff fdd3ac39c8 MFC vm_machdep.c 1.261-1.263
Rev: 1.261

  Ensure that a thread stays on same CPU when calculating per CPU
  TLB shootdown requirements. Otherwise a CPU may not get the needed
  TLB invalidation.

  The PTE valid and access flags can not be used here to avoid TLB
  shootdowns unless sf->cpumask == all_cpus.
  ( Otherwise some CPUs may still hold an even older entry in the TLB)
  Since sf_buf_alloc mappings are normally always used this is
  also not really useful and presetting accessed and modified
  allows the CPU to speculatively load the entry into the TLB.

  Both bugs can cause random data corruption.

Rev: 1.262

  Restore optimizations to reduce TLB shootdowns.
  Alan Cox pointed out that they are really useful for
  sendfile().

Rev: 1.263
  Restore the UP optimization to reduce the number of TLB
  invalidations.  The
  previous revision only restored the MP optimization.

  Describe the optimization strategy for TLB invalidations in a comment.

Approved by:	re@ (scottl)
2005-10-20 01:03:23 +00:00
Poul-Henning Kamp 2ca115c41b MFC:
Use correct criteria to determine if dirent can be removed
        right away.

Approved by:	re@ (scottl)
2005-10-19 21:26:02 +00:00
Andrew Thompson 1101e1b905 MFC: if_bridge.c r1.26, if_ethersubr.c r1.205
>   Use bridge_ifdetach() to notify the bridge that a member has been detached.
>   The bridge can then remove it from its interface list and not try to send
>   out via a dead pointer.

Approved by:	re (scottl)
2005-10-19 20:46:16 +00:00
Don Lewis 063395a5a5 MFC ufs_lookup.c 1.78 and 1.79.
Original commit messages:
  Modified files:
    sys/ufs/ufs          ufs_lookup.c
  Log:
  Close a race in the ufs_lookup() code that handles the ISDOTDOT
  case by saving the value of dp->i_ino before unlocking the vnode
  for the current directory and passing the saved value to VFS_VGET().

  Without this change, another thread can overwrite dp->i_ino after
  the current directory is unlocked, causing  ufs_lookup() to lock
  and return the wrong vnode in place of the vnode for its parent
  directory.  A deadlock can occur if dp->i_ino was changed to a
  subdirectory of the current directory because the root to leaf vnode
  lock ordering will be violated.  A vnode lock can be leaked if
  dp->i_ino was changed to point to the current directory, which
  causes the current vnode lock for the current directory to be
  recursed, which confuses lookup() into calling vrele() when it
  should be calling vput().

  The probability of this bug being triggered seems to be quite low
  unless the sysctl variable debug.vfscache is set to 0.

  Reviewed by:    jhb
  MFC after:      2 weeks

  Revision  Changes    Path
  1.78      +3 -1      src/sys/ufs/ufs/ufs_lookup.c

  Modified files:
    sys/ufs/ufs          ufs_lookup.c
  Log:
  Correct the type of the temporary variable used by ufs_lookup.c:1.78
  to fix the race condition in the ufs_lookup() ISDOTDOT code.

  Noticed by:     bde
  MFC after:      12 days

  Revision  Changes    Path
  1.79      +1 -1      src/sys/ufs/ufs/ufs_lookup.c

Approved by:	re (scottl)
2005-10-19 20:31:45 +00:00
Don Lewis 1b3663cbaa MFC nwfs_lookup.c 1.42
Original commit message:
  Modified files:
    sys/fs/nwfs          nwfs_vnops.c
  Log:
  Update nwfs_lookup() to match the current cache_lookup() API.
  cache_lookup() has returned a ref'ed and locked vnode since
  vfs_cache.c:1.96, dated Tue Mar 29 12:59:06 2005 UTC.  This change
  is similar to the change made to smbfs_lookup() in smbfs_vnops.c:1.58.

  Tested by:      "Antony Mawer" ant AT mawer.org
  MFC after:      2 weeks

  Revision  Changes    Path
  1.42      +11 -26    src/sys/fs/nwfs/nwfs_vnops.c

Approved by:	re (scottl)
2005-10-19 20:20:42 +00:00
John Baldwin ede7fe23cb MF6: Update critical(9) with recently reality.
Approved by:	re (kensmith)
2005-10-17 18:52:50 +00:00
Poul-Henning Kamp daab09ff7d MF6: nanobsd.sh fixes
Approved by:	re@ (scottl)
2005-10-17 07:58:05 +00:00
Warner Losh 385a4b0a41 MF-RELENG_6: rtl8029 and qemu fixes.
>   1.2       +6 -5      src/sys/dev/ed/if_ed_rtl80x9.c
>   1.48      +9 -2      src/sys/dev/ed/if_ed_pci.c
Approved by: re@ (kensmith)
2005-10-17 02:25:26 +00:00
Kris Kennaway 191bfb282f MFC r1.20:
Add a default value for VM_BCACHE_SIZE_MAX of 400MB.  This is copied from
amd64, and is a factor of 3 less than the value previously auto-sized on
a 12GB machine, which would cause an overflow in calculations involving the
maxbcache int, causing bufinit() to loop forever at boot.

Approved by:	re (kensmith)
2005-10-17 00:19:30 +00:00
Kris Kennaway 5a02e2d3f6 MFC r1.72: Partially revert r1.67 which changed maxbcache and maxswzone
from int to long without updating the <sys/buf.h> version.  This broke the
corresponding tunables on sparc.

Approved by:    re (kensmith)
2005-10-17 00:17:22 +00:00
Robert Watson 3d0f46b8df Merge in.c:1.89,1.90 from HEAD to RELENG_6_0:
Acquire Giant conditionally in in_addmulti() and in_delmulti() based on
  whether the interface being accessed is IFF_NEEDSGIANT or not.  This
  avoids lock order reversals when calling into the interface ioctl
  handler, which could potentially lead to deadlock.

  The long term solution is to eliminate non-MPSAFE network drivers.

  Discussed with: jhb

  Unlock Giant symmetrically with respect to lock acquire order as that's
  generally nicer.

  Spotted by:     johan

Approved by:    re (kensmith)
2005-10-16 17:12:18 +00:00
Robert Watson 741347619e Merge ufs_extattr.c:1.82 from RELENG_6 to RELENG_6_0:
When performing a VOP_LOOKUP() as part of UFS1 extended attribute
  auto-start, set cnp.cn_lkflags to LK_EXCLUSIVE.  This flag must now
  be set so that lockmgr knows what kind of lock to acquire, and it
  will panic if not specified.  This resulted in a panic when using
  extended attributes on UFS1 as of locking work present in the 6.x
  branch.

  Reported by:    lofi

Approved by:    re (kensmith)
2005-10-16 16:52:14 +00:00
Hiroki Sato 07d746f573 Update version numbers for upcoming 6.0-RELEASE.
Approved by:	re (implicitly)
2005-10-16 14:07:44 +00:00
Hiroki Sato 32dc657349 Update various version numbers and entities
for upcoming 6.0-RELEASE.

Approved by:	re (implicitly)
2005-10-16 08:28:10 +00:00
Hiroki Sato 8051874cd7 Use RELENG_6_0 for standard-supfile.
Approved by:	re (implicitly)
2005-10-16 08:15:29 +00:00
Xin LI a8e6180850 MFR6 Release Notes Language Improvements
Approved by:	re (hrs)
2005-10-16 07:35:40 +00:00
Gleb Smirnoff 8b7a63f7e1 Merge the 'kldstat -q' functionality, that is required for proper
operation of the /etc/rc.d/pfsync script, that was merged before
the RELENG_6_0 has been forked.

Approved by:	re (kensmith)
2005-10-14 14:38:56 +00:00
Scott Long 75c7560dfb MFC: Sync the driver with RELENG_6 to pick up critical atapi-cd and ata-raid
fixes, as well as ATI support.

Submitted by:	sos
Approved by:	re
2005-10-14 09:34:50 +00:00
Xin LI f2adbc2073 MFC (by gibbs):
| Correct bug that caused the completed "recovery" scb to have its
| timer reset rather than the timer of an SCB still pending on the
| controller after recovery completed.  This should correct timeout
| loops seen in the field.
|
| Revision  Changes    Path
| 1.22      +2 -1      src/sys/dev/aic7xxx/aic79xx_osm.c
| 1.43      +2 -1      src/sys/dev/aic7xxx/aic7xxx_osm.c

Approved by:	re (kensmith)
2005-10-14 02:19:02 +00:00
Xin LI 4c096043ce MFRELENG_6 Simplified Chinese translation of Release Documentations
Approved by:	re (hrs)
2005-10-13 17:32:39 +00:00
David Xu e9c4c22b54 MFC revision 1.24:
> The pthread_attr_set_createsuspend_np was broken, fix it by
 > replacing THR_FLAGS_SUSPENDED with THR_FLAGS_NEED_SUSPEND.

Approved by: re (scottl)
2005-10-11 23:24:25 +00:00
Colin Percival 0f88086d1a Correct a man-in-the-middle SSL version rollback vulnerability.
Security:       FreeBSD-SA-05:21.openssl
Approved by:    re@ (scottl)
2005-10-11 11:53:03 +00:00
cvs2svn bdc8787cc2 This commit was manufactured by cvs2svn to create branch 'RELENG_6_0'. 2005-10-09 17:28:13 +00:00
Paul Saab fee177401c MFC:
> revision 1.277
> date: 2005/10/03 12:49:54;  author: cperciva;  state: Exp;  lines: +8 -0
> If sufficiently bad things happen during a call to kern_execve(), it is
> possible for do_execve() to call exit1() rather than returning.  As a
> result, the sequence "allocate memory; call kern_execve; free memory"
> can end up leaking memory.
>
> This commit documents this astonishing behaviour and adds a call to
> exec_free_args() before the exit1() call in do_execve().  Since all
> the users of kern_execve() in the tree use exec_free_args() to free
> the command-line arguments after kern_execve() returns, this should
> be safe, and it fixes the memory leak which can otherwise occur.
>
> Submitted by:   Peter Holm
> MFC after:      3 days
> Security:       Local denial of service

Approved by:	re (scottl)
2005-10-09 17:28:12 +00:00
Scott Long 6c4f6a449a Move on to 6.0-RC1.
Approved by: re
2005-10-09 16:59:34 +00:00
Xin LI 7f2c8767d4 MFC (by des)
| Eliminate an unnecessary bcopy().
|
| Revision  Changes    Path
| 1.57      +15 -15    src/sys/fs/pseudofs/pseudofs_vnops.c

Approved by:	re (scottl)
No objection:	des
2005-10-09 08:59:34 +00:00
Maxim Konovalov a4b011b7ce MFC rev. 1.234: teach sysctl_drop() how to deal with the sockets
in TIME_WAIT state.

Approved by:	re (scottl)
2005-10-09 08:21:34 +00:00
Roman Kurakin bdfedb5cb8 MFC:
----------------------------
	revision 1.281
	date: 2005/10/04 16:27:54;  author: rik;  state: Exp;  lines: +3 -1
	Use FILEDESC_UNLOCK(fdp) after FILE_UNLOCK(p), not before to avoid LOR.
	Slightly discussed on current@.

	LOR #055

Approved by:	re(scottl)
Requested by:	delphij
2005-10-09 08:13:56 +00:00
Alexander Leidinger 9f110b437e MFC:
Don't use the builtin vaalist for icc.

  Submitted by:	Igor Sysoev <[email protected]>

Approved by:	re (scottl)
2005-10-09 07:48:48 +00:00
Hajimu UMEMOTO c5fff20427 MFC: be consistent on naming advanced API functions; use ip6_XXXpktopt(s).
sys/netinet6/ip6_output.c:	1.93
	sys/netinet6/ip6_var.h:		1.31
	sys/netinet6/mld6.c:		1.20
	sys/netinet6/raw_ip6.c:		1.51
	sys/netinet6/udp6_output.c:	1.20

Approved by:    re (scottl)
Committed at:   CBUG Meeting meets XCAST6 Festival
2005-10-09 06:51:11 +00:00
Hajimu UMEMOTO 43df062ca7 MFC 1.92: NULL is not zero.
Approved by:    re (scottl)
Committed at:   CBUG Meeting meets XCAST6 Festival
2005-10-09 06:46:27 +00:00
Hajimu UMEMOTO 1e4447bc9b MFC 1.49: do not hardcode if_mtu values in here, except for IFT_{ARC,FDDI} -
they need special handling.  makes it possible to take advantage of 9k ether
frames.

Approved by:    re (scottl)
Committed at:   CBUG Meeting meets XCAST6 Festival
2005-10-09 06:42:41 +00:00
Scott Long 727e45252f MFC: Support new adapters and new communication protocol.
Submitted by: Adaptec, Inc.
Approved by: re
2005-10-09 06:39:21 +00:00
Hajimu UMEMOTO 808d0f11aa MFC: move RFC3542 related definitions into ip6.h.
sys/contrib/pf/net/pf_norm.c:	1.12
	sys/netinet/ip6.h:		1.15

Approved by:    re (scottl)
Committed at:   CBUG Meeting meets XCAST6 Festival
2005-10-09 05:50:43 +00:00
Hajimu UMEMOTO 4fd1122556 MFC 1.18: add missing RFC3542 definition.
Approved by:    re (scottl)
Committed at:   CBUG Meeting meets XCAST6 Festival
2005-10-09 05:34:33 +00:00
Hajimu UMEMOTO 328e6e5229 MFC: update comments:
- RFC2292bis -> RFC3542
    - typo fixes

	sys/netinet/icmp6.h		1.17
	sys/netinet/ip6.h:		1.14
	sys/netinet6/in6.h:		1.37
	sys/netinet6/ip6_input.c:	1.82
	sys/netinet6/ip6_mroute.h:	1.7
	sys/netinet6/ip6_output.c:	1.91

Approved by:    re (scottl)
Committed at:   CBUG Meeting meets XCAST6 Festival
2005-10-09 05:21:18 +00:00
Xin LI ff0d1f908c MFC (by stefanf)
| Fix a comment.
|
| Submitted by:   Liam J. Foy
|
| Revision  Changes    Path
| 1.20      +1 -1      src/bin/sleep/sleep.c

Approved by:	re (scottl)
2005-10-09 04:39:07 +00:00
Xin LI 65f3800836 MFC (by le)
| Set the G_PF_WITHER flag on the subdisk provider that is about to
| be destroyed.  That way the GEOM system handles all deallocations
| and we don't have to do it ourselves.
|
| Revision  Changes    Path
| 1.8       +1 -34     src/sys/geom/vinum/geom_vinum_rm.c

Approved by:	re (scottl)
2005-10-09 04:37:34 +00:00
Xin LI 994407defb MFC (by le)
|  Prevent that sync operations can be started when they are already
|  in progress, and be a bit more user friendly in terms of error
|  messages returned from the kernel.
|
|  Revision  Changes    Path
|  1.11      +81 -71    src/sys/geom/vinum/geom_vinum_init.c

Approved by:	re (scottl)
2005-10-09 04:36:44 +00:00
Xin LI ad918d93d0 MFC (by le)
| Correct the check if a plex is accessible in case it is not up.
| This makes degraded RAID5 plexes actually work.
|
| Revision  Changes    Path
| 1.10      +1 -1      src/sys/geom/vinum/geom_vinum_volume.cle

Approved by:	re (scottl)
2005-10-09 04:35:42 +00:00
Hajimu UMEMOTO 8d3ea92cb8 MFC 1.16: stop RFC 4193 address on the outside interface.
Approved by:	re (scottl)
Committed at:	CBUG Meeting meets XCAST6 Festival
2005-10-09 04:35:10 +00:00
Xin LI 0c785ccd4d MFC (by le)
| Shuffle around the order in which the components are compiled.
|
| This way, the VINUMDRIVE class is loaded before the VINUM class,
| but since geom does the tasting for newly arrived classes
| last-in-first-out, the VINUM class tastes first.
|
| This removes the need to call gv_parse_config() in the drive
| taste path.
|
| Revision  Changes    Path
| 1.20      +4 -14     src/sys/geom/vinum/geom_vinum_drive.c
| 1.2       +1 -1      src/sys/modules/geom/geom_vinum/Makefile

Approved by:	re (scottl)
2005-10-09 04:34:29 +00:00
Xin LI 7cc8689679 MFC (by jhb)
| - Add an assertion to panic if one tries to call mtx_trylock() on a spin
|   mutex.
| - Don't panic if a spin lock is held too long inside _mtx_lock_spin() if
|   panicstr is set (meaning that we are already in a panic).  Just keep
|   spinning forever instead.
|
|   Revision  Changes    Path
|   1.157     +4 -1      src/sys/kern/kern_mutex.c

Approved by:	re (scottl)
2005-10-09 04:30:31 +00:00
Xin LI 5278b7359e MFC (by andre)
| Use the correct mbuf type for MGET().
|
| Revision  Changes    Path
| 1.304     +1 -1      src/sys/netinet/ip_input.c
| 1.246     +1 -1      src/sys/netinet/ip_output.c
| 1.232     +1 -1      src/sys/netinet/tcp_subr.c
| 1.97      +1 -1      src/sys/netinet6/ip6_output.c

Approved by:	re (scottl)
2005-10-09 04:24:45 +00:00
Xin LI b28fb96865 MFC (by andre)
| Use the correct mbuf type for MGET().
|
| Revision  Changes    Path
| 1.28      +1 -1      src/sys/netatalk/ddp_output.c

Approved by:	re (scottl)
2005-10-09 04:22:03 +00:00
Xin LI 2d8727f32f MFC (by andre)
| Test the mbuf flags against the correct constant.  The previous
| version worked as intended but only by chance.
|
| MT_HEADER == M_PKTHDR == 0x2.
|
| Revision  Changes    Path
| 1.85      +1 -1      src/sys/compat/ndis/kern_ndis.c

Approved by:	re (scottl)
2005-10-09 04:21:11 +00:00
Xin LI 5dd61e6780 MFC (by ru)
| Fix "struct ifnet" leak if attach() fails in the middle.
|
| Revision  Changes    Path
| 1.39      +2 -0      src/sys/contrib/dev/oltr/if_oltr.c
| 1.94      +1 -0      src/sys/dev/fe/if_fe.c
| 1.114     +3 -1      src/sys/dev/lnc/if_lnc.c
| 1.11      +3 -1      src/sys/dev/nve/if_nve.c
| 1.12      +3 -1      src/sys/dev/patm/if_patm_attach.c

Approved by:	re (scottl)
2005-10-09 04:18:18 +00:00
Xin LI f877875263 MFC (by ru)
| Avoid deferencing NULL in if_free().
|
| Revision  Changes    Path
| 1.16      +2 -3      src/sys/dev/ral/if_ral.c

Approved by:	re (scottl)
2005-10-09 04:15:59 +00:00
Xin LI 5c087ae0e1 MFC (by ru)
| Fix "struct ifnet" leaks when attach() fails in the middle.
|
| Revision  Changes    Path
| 1.28      +4 -5      src/sys/dev/bfe/if_bfe.c
| 1.95      +3 -2      src/sys/dev/bge/if_bge.c
| 1.21      +2 -0      src/sys/dev/cnw/if_cnw.c
| 1.261     +2 -1      src/sys/dev/ed/if_ed.c
| 1.38      +9 -2      src/sys/dev/en/if_en_pci.c
| 1.59      +3 -1      src/sys/dev/ex/if_ex.c
| 1.26      +4 -3      src/sys/dev/hatm/if_hatm.c
| 1.105     +2 -1      src/sys/dev/ie/if_ie.c
| 1.17      +2 -1      src/sys/dev/vge/if_vge.c

Approved by:	re (scottl)
2005-10-09 04:15:12 +00:00
Xin LI e2056e36ed MFC (by ru)
| Fix "struct ifnet" leaks when attach() fails in the middle, e.g.
| when mii_phy_probe() or bus_setup_intr() fails.  For drivers that
| call their detach() in this case, call if_free() there to cover
| this case too.
|
| Revision  Changes    Path
| 1.168     +2 -2      src/sys/pci/if_dc.c
| 1.75      +2 -2      src/sys/pci/if_pcn.c
| 1.156     +3 -5      src/sys/pci/if_rl.c (already merged)
| 1.87      +2 -2      src/sys/pci/if_sf.c
| 1.136     +2 -3      src/sys/pci/if_sis.c
| 1.110     +2 -3      src/sys/pci/if_sk.c
| 1.89      +2 -2      src/sys/pci/if_ste.c
| 1.110     +2 -2      src/sys/pci/if_ti.c
| 1.103     +2 -2      src/sys/pci/if_tl.c
| 1.107     +2 -2      src/sys/pci/if_vr.c
| 1.83      +2 -2      src/sys/pci/if_wb.c
| 1.196     +2 -2      src/sys/pci/if_xl.c

Approved by:	re (scottl)
2005-10-09 04:11:20 +00:00
Xin LI 9ae3deddd9 MFC (by ru)
| Fix "struct ifnet" leak on detach.
|
| Revision  Changes    Path
| 1.104     +1 -0      src/sys/dev/ath/if_ath.c

Approved by:	re (scottl)
2005-10-09 04:00:47 +00:00
Xin LI 8b8807b0f0 MFC (by ru)
| Add missing mtx_destroy() when if_alloc() fails.
| Add missing if_free() when mii_phy_probe() fails.
| Put if_free() into the correct #ifdef in detach().
|
| Revision  Changes    Path
| 1.93      +6 -1      src/sys/dev/usb/if_aue.c
| 1.33      +6 -1      src/sys/dev/usb/if_axe.c
| 1.9       +2 -0      src/sys/dev/usb/if_cdce.c
| 1.60      +5 -1      src/sys/dev/usb/if_cue.c
| 1.67      +5 -1      src/sys/dev/usb/if_kue.c
| 1.17      +3 -0      src/sys/dev/usb/if_udav.c

Approved by:	re (scottl)
2005-10-09 03:59:36 +00:00
Xin LI d22234ff2b MFC (by ru)
| Add missing if_free() in rue_detach().
|
| Revision  Changes    Path
| 1.25      +1 -0      src/sys/dev/usb/if_rue.c

Approved by:	re (scottl)
2005-10-09 03:56:37 +00:00
Xin LI 55ad878013 MFC (by ps)
| Unbreak tail -f on non-local filesystems.
|
| Revision  Changes    Path
| 1.39      +10 -0     src/usr.bin/tail/forward.c

Approved by:	re (scottl)
2005-10-09 03:51:55 +00:00
Xin LI b955328d05 MFC (by dds)
| Interpret correctly the glob(3) return value.
| Previously, interactive commands specifying a non-existent file or
| directory used to display an "out of memory error".
|
| MFC after:      2 weeks
|
| Revision  Changes    Path
| 1.18      +7 -1      src/sbin/restore/interactive.c

Approved by:	re (scottl)
2005-10-09 03:50:30 +00:00
Xin LI a5423cd0d3 MFC revision 1.70
date: 2005/07/17 03:24:11;  author: obrien;  state: Exp;  lines: +0 -29
Catch up with menus.c revision 1.399.

Approved by:	re (scottl)
2005-10-09 03:48:42 +00:00
Xin LI 6332e2d0a3 MFC (by stefanf):
| Log:
| El_parse's third parameter is now const-qualified, add a cast.
|
| Revision  Changes    Path
| 1.27      +1 -1      src/bin/sh/histedit.c

Approved by:	re (scottl)
2005-10-09 03:46:26 +00:00
Xin LI cf438f9962 MFC (by stefanf):
| The libedit update made a const cast necessary.
|
| Revision  Changes    Path
| 1.30      +1 -1      src/sbin/fsdb/fsdb.c

Approved by:	re (scottl)
2005-10-09 03:45:28 +00:00
Xin LI f7e8484379 MFC stefanf's work on libedit. This includes a sync with NetBSD/OpenBSD
and some bugfixes.

Approved by:	re (scottl)
2005-10-09 03:44:01 +00:00
Xin LI faff5d19ff MFC (by obrien)
| Fix bug where GCC thought athlon-tbird had SSE support.
|
| Revision  Changes    Path
| 1.21      +4 -4      src/contrib/gcc/config/i386/i386.h

Approved by:	re (scottl)
2005-10-09 03:37:42 +00:00
Xin LI 81ccfb4700 MFC (by obrien)
| Remove WANT_FORCE_OPTIMIZATION_DOWNGRADE and out dated warnings about
| libalias(3) exposing compiler bugs.
|
| Revision  Changes    Path
| 1.266     +2 -10     src/share/examples/etc/make.conf

Approved by:	re (scottl)
2005-10-09 03:36:41 +00:00
Xin LI 7fb945be7f MFC (by obrien)
| Ensure the full value is written into inode variables.
|
| PR:             85503
| Submitted by:   Dmitry Pryanishnikov <[email protected]>
|
| Revision  Changes    Path
| 1.89      +2 -2      src/sys/fs/msdosfs/msdosfs_denode.c

Approved by:	re (scottl)
2005-10-09 03:33:52 +00:00
Xin LI 88b35bbded MFC (by phk)
| Comment typo
|
| Revision  Changes    Path
| 1.23      +1 -1      src/sys/geom/bde/g_bde_crypt.c

Approved by:	re (scottl)
2005-10-09 03:30:30 +00:00
Xin LI 3b0ad1946d MFC (by davidxu)
| Reorder statements to avoid accessing unknown memory.
| In theory, invoking kenv with very long string can panic
| kernel.
|
| Revision  Changes    Path
| 1.41      +2 -2      src/sys/kern/kern_environment.c

Approved by:	re (scottl)
2005-10-09 03:29:03 +00:00
Xin LI a39d39ded4 MFC (by netchild)
|  Add bounds checking to the setenv part of the kernel environment.
|
| PR:             83687 [1]
| Submitted by:   Harry Coin <[email protected]> [1]
| Submitted by:   Ariff Abdullah <[email protected]> [2]
|
| Revision  Changes    Path
| 1.40      +10 -1     src/sys/kern/kern_environment.c

Approved by:	re (scottl)
2005-10-09 03:27:36 +00:00
Xin LI 8c3ad08a52 MFC (by jhb):
| Trim a couple of unneeded includes.
|
| Revision  Changes    Path
| 1.153     +0 -1      src/sys/kern/subr_turnstile.c
| 1.35      +0 -1      src/sys/vm/vm_zeroidle.c

Approved by:	re (scottl)
2005-10-09 03:25:37 +00:00
Xin LI 4a7499a6ec MFC (by ps):
| Fix up the comment for MAX_SACK_BLKS.
|
| Submitted by:   Noritoshi Demizu
|
| Revision  Changes    Path
| 1.32      +1 -1      src/sys/netinet/tcp.h

Approved by:	re (scottl)
2005-10-09 03:22:51 +00:00
Xin LI 8c21b608cb MFC (by ps):
| Fixes for NFS crashes on architectures that require strict alignment.
| - Fix nfsm_disct() so that after pulling up data, the remaining data
|   is aligned if necessary.
| - Fix nfs_clnt_tcp_soupcall() to bcopy() the rpc length out of the
|   mbuf (instead of casting m_data to a uint32).
|
| Submitted by:   Pyun YongHyeon
| Reviewed by:    Mohan Srinivasan
|
| Revision  Changes    Path
| 1.118     +12 -3     src/sys/nfs/nfs_common.c
| 1.38      +6 -0      src/sys/nfs/nfs_common.h
| 1.126     +2 -1      src/sys/nfsclient/nfs_socket.c

Approved by:	re (scottl)
2005-10-09 03:21:56 +00:00
Xin LI d82f1efe64 MFC (by andre)
| Remove unnecessary IPSEC includes.
|
| MFC after:      2 weeks
| Sponsored by:   TCP/IP Optimization Fundraise 2005
|
| Revision  Changes    Path
| 1.27      +0 -11     src/sys/netinet/tcp_sack.c
| 1.126     +0 -5      src/sys/netinet/tcp_usrreq.c

Approved by:	re (scottl)
2005-10-09 03:17:41 +00:00
Xin LI 323f36148b MFC (by ps)
| In nfs_nget() if two threads race on the same filehandle, the loser
| should cause the nfsnode to get freed. This fixes a potential vnode
| (and nfsnode) leak in that path.
|
| Submitted by:   Mohan Srinivasan
| Reviewed by:    phk
|
| Revision  Changes    Path
| 1.78      +2 -1      src/sys/nfsclient/nfs_node.c

Approved by:	re (scottl)
2005-10-09 03:15:36 +00:00
Xin LI 0342bbe491 MFC (by andre)
| Remove bogous semicolons at the end of the definitions of
| 'do { ... } while (0)' macros.
|
| PR:             kern/83088
| Sumbitted by:   <antoine.brodin at laposte.net>

Approved by:	re (scottl)
2005-10-09 03:13:49 +00:00
Xin LI b37f177410 MFC (by alc)
| Eliminate an incorrect cast.
|
| Revision  Changes    Path
| 1.208     +1 -1      src/sys/vm/vm_fault.c

Approved by:	re (scottl)
2005-10-09 03:08:28 +00:00
Xin LI a49b9e6763 MFC (by alc)
| Eliminate an incorrect (and unnecessary) cast.
|
| Revision  Changes    Path
| 1.367     +1 -1      src/sys/vm/vm_map.c

Approved by:	re (scottl)
2005-10-09 03:07:29 +00:00
Xin LI 2013e71bca MFC (by peter)
| Remove unused (but initialized) variable 'objsize' from vm_mmap()
|
| Revision  Changes    Path
| 1.201     +1 -2      src/sys/vm/vm_mmap.c

Approved by:	re (scottl)
2005-10-09 03:05:23 +00:00
Seigo Tanimura 56677b139e MFC 1.35: do not derefer NULL sc in ngt_input().
Approved by:	re (scottl)
2005-10-09 00:19:28 +00:00
Craig Rodrigues a629da7218 MFC 1.58
Fix so that when a slice or a partition is removed through g_slice_config(),
  it is destroyed in GEOM, in addition to being removed from /dev.
  Before this patch, if you applied a new MBR which deleted a slice,
  the deleted slice would not be in /dev, but it would still appear
  in kern.geom.conftxt and kern.geom.confxml, which would confused
  the diskPartitionEditor in sysinstall.

Submitted by:	pjd
Requested by:	delphij
Approved by:	re (scottl)
2005-10-08 22:11:38 +00:00
Pawel Jakub Dawidek 9241f7fce6 MFC: lib/libmd/sha256.3 1.3
Correct type.

Approved by:	re (scottl)
Requested by:	delphij
OK'ed by:	cperciva
2005-10-08 21:46:23 +00:00
Andrew Thompson 4a3c9249af MFC r1.2
Display the status of the spanning tree for each port.

        member: xl0 flags=7<LEARNING,DISCOVER,STP>
        member: gem0 flags=7<LEARNING,DISCOVER,STP>
 to:
        member: xl0 flags=7<LEARNING,DISCOVER,STP>
                port 3 priority 128 path cost 55 forwarding
        member: gem0 flags=7<LEARNING,DISCOVER,STP>
                port 1 priority 128 path cost 55 learning

Approved by:	re (scottl)
2005-10-08 21:19:15 +00:00
Xin LI 7c5d388263 MFC (by ume)
| refer RFC 3542 rather than RFC 2292bis.
|
| Submitted by:   Keiichi SHIMA <keiichi__at__iijlab.net>
| Obtained from:  KAME
|
| Revision  Changes    Path
| 1.8       +2 -2      src/lib/libc/net/ip6opt.c
| 1.25      +1 -1      src/lib/libc/net/rcmd.3 (already merged)
| 1.8       +1 -1      src/lib/libc/net/rthdr.c

Approved by:	re (scottl)
2005-10-08 20:58:29 +00:00
Xin LI 7476739035 MFC (by ume)
| fixed the validation code of routing header length in inet6_rth_getaddr().
| reported by Delia Kecskemeti <delia.kecskemeti__at__windriver.com>
|
| Submitted by:   Keiichi SHIMA <keiichi__at__iijlab.net>
| Obtained from:  KAME
|
| Revision  Changes    Path
| 1.7       +3 -4      src/lib/libc/net/rthdr.c

Approved by:	re (scottl)
2005-10-08 20:52:53 +00:00
Giorgos Keramidas feb7c0bb4c MFC:
1.36	- Removal of obsolete/wrong OPTIONS section
	1.37	- Workaround for an mdoc bug by trhodes

Approved by:	re (kensmith)
2005-10-08 19:01:21 +00:00
Warner Losh 3aca131e39 MFC: Bring in support for new PC Card chipset (TC5299J) and old
ISA/PCI chipset (RTL8019 and RTL8029).  Eliminate ED_NO_MIIBUS option.
You are now required to have miibus if you have pccard in your kernel
(but not required if you don't!).  Split out register definitions for
possible future subsetting.

Approved by: re@ (scottl)
2005-10-08 18:00:41 +00:00
Xin LI 66890c43dc MFC (by deischen)
|  Add usleep to the map files.
|
|  Noticed by:     davidxu
|
|  Revision  Changes    Path
|  1.15      +2 -0      src/lib/libpthread/pthread.map
|  1.4       +2 -0      src/lib/libthr/pthread.map

Approved by:	re (kensmith)
Ok'ed by:	deischen, davidxu
2005-10-08 17:58:11 +00:00
Xin LI 569c4357be MFC (by deischen)
|  Add a cancellation point for usleep().
|
|  Revision  Changes    Path
|  1.9       +16 -1     src/lib/libpthread/thread/thr_sleep.c

Approved by:	re (kensmith)
Ok'ed by:	deischen, davidxu
2005-10-08 17:57:49 +00:00
Xin LI fb060d5d7f MFC (by deischen)
|  Add a cancellation point for usleep().
|
|  While here, fix sleep() so that it is also a cancellation point (a
|  missing weak reference prevented that).
|
|  Revision  Changes    Path
|  1.10      +19 -0     src/lib/libthr/thread/thr_syscalls.c

Approved by:	re (kensmith)
Ok'ed by:	deischen, davidxu
2005-10-08 17:57:28 +00:00
Maxim Konovalov f0b9488f2f MFC rev. 1.77: restore kerneldumpheader.architectureversion bytes
swopping.

Approved by:	re (kensmith)
2005-10-08 17:57:15 +00:00
Xin LI 34e7df678e MFC (by deischen)
|  Make syslog() use the internal (non-cancellation point) _usleep().
|  Prior to this it was calling the cancellable usleep() while holding
|  a lock.
|
|  Revision  Changes    Path
|  1.36      +1 -1      src/lib/libc/gen/syslog.c

Approved by:	re (kensmith)
Ok'ed by:	deischen, davidxu
2005-10-08 17:57:10 +00:00
Xin LI d8f160b880 MFC (by deischen)
| Make usleep() overridable by the thread libraries so they can provide
| cancellation points.
|
| Noticed by:     phk
|
| Revision  Changes    Path
| 1.29      +4 -1      src/lib/libc/gen/usleep.c

Approved by:	re (kensmith)
Ok'ed by:	deischen, davidxu
2005-10-08 17:56:53 +00:00
Xin LI c6be1a55e9 MFC (by deischen)
| Add namespace #defines for usleep.
|
| Revision  Changes    Path
| 1.17      +1 -0      src/lib/libc/include/namespace.h
| 1.14      +1 -0      src/lib/libc/include/un-namespace.h

Approved by:	re (kensmith)
Ok'ed by:	deischen, davidxu
2005-10-08 17:56:33 +00:00
Xin LI 28868ed18e MFC 1.50 (by keramida):
| Add a short description of how a literal colon ':' can be inlined in the
| value of capability databases, since it's not really obvious how a colon
| can be escaped, and a pointer to the getcap(3) manpage for more details.
|
| Triggered by:	a question by Ceri on -questions

Approved by:	re (kensmith)
2005-10-08 17:37:29 +00:00
Doug Barton 529cf10359 MFC rm.c 1.53 and rm.1 1.3[78], better handling of the -P flag
on a read-only file, and related doc change.

Approved by:	re (kensmith)
2005-10-08 17:27:37 +00:00
Christian Brueffer f3d2e00b36 MFC: rev. 1.66
hptmv(4) now works on amd64.

Approved by:	re (hrs)
2005-10-08 08:39:58 +00:00
Gleb Smirnoff d60b636441 This line fell out of the merge, too.
Approved by:	re (implicitly)
2005-10-08 07:35:10 +00:00
Pawel Jakub Dawidek b064dedaee MFC: sys/kern/kern_mib.c 1.76
mp_ncpus is always (properly) initialized, even on UP kernels,
so just use it.

Approved by:	re (scottl) (approval from 30 Aug 2005)
Reminded by:	delphij
2005-10-08 07:06:49 +00:00
Scott Long aa4ea9a8a0 Outwit gcc.
Submitted by: glebius, kensmith
Approved by: re
2005-10-08 05:29:27 +00:00
Yaroslav Tykhiy 71218e993a MFC:
Add an rc.d script to start the pfsync interface after all
the conventional network interfaces have been started so that
pfsync can be attached to any of the latter.

Record the dependency of rc.d/pf on the newly added rc.d/pfsync.
Also make rc.d/pf start as early as before rc.d/routing to improve
system security.

Document rc.d/pfsync on pfsync(4) and rc.conf(5).

Approved by:	re (scottl), mlaier
2005-10-08 03:32:54 +00:00
Jonathan Chen 06eddaf119 MFC of 1.34: fix innetgr() returning false positives and negatives when reverse netgroup matching is used.
PR:		35506
Approved by:	re
2005-10-07 19:38:07 +00:00
Søren Schmidt 447e94312c MFC:
Add support for setting the SG list segment size.
Use this for the SiI3112 workaround to get rid of the "oversized DMA" errors.

Approved by: re@ (scottl)
2005-10-07 19:25:05 +00:00
Brooks Davis 558a33af53 MFC rev 1.6:
Don't print anything if we can't do any localpkg shutdown (start already
does this).

Submitted by:	Andre Albsmeier <Andre dot Albsmeier at siemens dot com>
PR:		conf/86606
Approved by:	re (kensmith)
2005-10-07 17:20:35 +00:00
Yoshihiro Takahashi e74be4f4a8 MFC: Switch from OLDCARD to NEWCARD on pc98.
Approved by:	re (scottl)
2005-10-07 15:56:30 +00:00
Poul-Henning Kamp 31d14eb0d6 MFC:
make sure the type is set early enough for the kthread to know
	to grab Giant for vnode backed devices.

Approved by:	re@ (scottl)
2005-10-07 15:08:41 +00:00
Poul-Henning Kamp 24beec7c08 MFC:
close a race in waiting for all geom events to have been
	handled.

Approved by:	re@ (scottl)
2005-10-07 15:06:27 +00:00
cvs2svn 968d7a6a6d This commit was manufactured by cvs2svn to create branch 'RELENG_6_0'. 2005-10-07 14:00:07 +00:00
Gleb Smirnoff 6ed190bfed Big overall MFC of polling(4) cleanup:
o First attempt on removing Giant from polling. Details:
  http://lists.freebsd.org/pipermail/cvs-src/2005-September/051848.html
o Second attempt, and big polling cleanup including:
  - Functinal approach to turning polling on/off
  - Deprecating of poll_in_trap
  - Removal of ifnet knowledge from kern_poll.c
  Details:
  http://lists.freebsd.org/pipermail/cvs-src/2005-October/053267.html
o Improved checking of user configurable sysctls. Details:
  http://lists.freebsd.org/pipermail/cvs-src/2005-October/053351.html
o Moving DEVICE_POLLING from opt_global.h to opt_device_polling.h:
  http://lists.freebsd.org/pipermail/cvs-src/2005-October/053479.html

o All related documentation fixes.

Approved by:	re (kensmith)
Thanks to:	everyone, who helped with testing
2005-10-07 14:00:06 +00:00
Gleb Smirnoff a1ffef2cf2 MFC:
Define HAVE_KERNEL_OPTION_HEADERS when building kernel and when building
  modules along with kernel.

  After this change it is possible to embrace opt_*.h includes with ifdef
  HAVE_KERNEL_OPTION_HEADERS. And thus, avoid editing a lot of Makefiles
  in modules directory each time we introduce a new opt_xxx.h.

  Requested by:   bde

Approved by:	re (kensmith)
2005-10-07 13:55:58 +00:00
Poul-Henning Kamp 9d534054be MFC:
make the kernels printf more paranoid about unknown %-formats

Approved by:	re@ (scottl)
2005-10-07 12:40:51 +00:00
Andrew Thompson 7b20d5db39 MFC r1.144
When bridging is enabled and an ARP request is recieved on a member interface,
 the arp code will search all local interfaces for a match. This triggers a
 kernel log if the bridge has been assigned an address.

 arp: ac:de:48:18:83:3d is using my IP address 192.168.0.142!

 bridge0: flags=8041<UP,RUNNING,MULTICAST> mtu 1500
         inet 192.168.0.142 netmask 0xffffff00
         ether ac:de:48:18:83:3d

 Silence this warning for 6.0 to stop unnecessary bug reports, the code will need
 to be reworked.

Approved by:	re (scottl)
2005-10-07 01:51:29 +00:00
Warner Losh 40d719d9f2 MFC: if data is NULL, don't pass that to userland as (null)
Approved by: re@ (scottl)
2005-10-06 23:15:18 +00:00
Warner Losh 35900aaad4 MFC: if no device-name, look at subsystem
Approved by: re@ (scottl)
2005-10-06 23:12:05 +00:00
Jung-uk Kim 5a7f1b24f7 MFC: Minor fixes and add amd64 support:
- Fix SMBIOS entry point structure.
- Add structure length sanity check.
- Fix revision number output.

Approved by:	re (kensmith)
2005-10-06 20:43:44 +00:00
Andrew Thompson cb8f3c434f MFC: if_bridge.c r1.23
> Do not packet filter in the bridge_start() routine, locally generated packets
> are already filtered by the higher layers.

Approved by:	re (kensmith)
2005-10-06 20:43:24 +00:00
John Baldwin 91c8538be1 MFC: Don't save and restore the ELCR across suspend and resume for a
particular Intel chipset.

Approved by:	re (scottl)
2005-10-06 20:21:03 +00:00
John Baldwin 9d73e3f4c3 MFC: Minor fixups:
- Use if_printf() and device_printf().
- Don't zero the softc.
- Cleanup error handling in attach().
- Don't double init the callout handle.

Approved by:	re (scottl)
2005-10-06 20:20:12 +00:00
John Baldwin d85fd523b7 MFC: Pin curthread longer during an interrupt so that we don't have to
ignore preemptions caused by fast interrupt handlers.

Approved by:	re (scottl)
2005-10-06 20:18:20 +00:00
John Baldwin 8014d4f746 MFC: Fixup locking in rl(4) and re(4).
Approved by:	re (scottl)
2005-10-06 20:17:17 +00:00
John Baldwin 97dee16616 MFC: Consolidate common code for assigning interrupts to PCI devices and
add a sledgehammer tunable to override PCI interrupt routing for any PCI
device.

Approved by:	re (scottl)
2005-10-06 20:05:04 +00:00
Xin LI aa82034305 MFC 1.280 (by des):
| Two minor optimizations of fdalloc():
|
|  - if minfd < fd_freefile (as is most often the case, since minfd is
|    usually 0), set it to fd_freefile.
|
|  - remove a call to fd_first_free() which duplicates work already done
|    by fdused().
|
| This change results in a small but measurable speedup for processes
| with large numbers (several thousands) of open files.
|
| PR:             kern/85176
| Submitted by:   Divacky Roman <[email protected]>
|
| Revision  Changes    Path
| 1.280     +3 -1      src/sys/kern/kern_descrip.c

Approved by:	re
2005-10-06 19:23:02 +00:00
Xin LI db96ab740e MFC (by alc):
| Handle vm_map_wire()'s failure.
|
| Revision  Changes    Path
| 1.89      +5 -1      src/sys/kern/link_elf_obj.c

Approved by:	re (scottl)
2005-10-06 19:01:42 +00:00
Xin LI 80ddd7b458 MFC (by alc):
| Correctly handle vm_map_wire()'s failure.  (See also revisions 1.81 and
| 1.82.)
|
| Reviewed by:    tegge
|
| Revision  Changes    Path
| 1.84      +5 -1      src/sys/kern/link_elf.c

Approved by:	re (scottl)
2005-10-06 19:00:39 +00:00
Xin LI 372bf7604e MFC (by alc):
| Eliminate an unneeded reference on a vm object.  If, in fact, the nearby
| vm_map_find() fails, then the excess reference causes the vm object to be
| leaked.
|
| Reviewed by:    tegge
|
| Revision  Changes    Path
| 1.83      +0 -2      src/sys/kern/link_elf.c
| 1.88      +0 -2      src/sys/kern/link_elf_obj.c

Approved by:	re (scottl)
2005-10-06 18:58:59 +00:00
Xin LI 46d0413e97 MFC 1.82:
| Revert the previous change for two reasons: (1) If vm_map_find() succeeds
| but vm_map_wire() fails, then a vm object, vm map entries, and kernel_map
| free space is leaked and (2) unwiring is handled automatically by
| vm_map_remove().
|
| Suggested by:   tegge
|
| Revision  Changes    Path
| 1.82      +10 -17    src/sys/kern/link_elf.c

Approved by:	re (scottl)
2005-10-06 18:57:13 +00:00
Xin LI 39639a0675 Forced commit to note that the previous commit was to:
MFC: Hook up the hptmv driver for amd64.

| Revision  Changes    Path
| 1.442     +1 -0      src/sys/amd64/conf/GENERIC
| 1.42      +1 -1      src/sys/amd64/conf/NOTES
| 1.76      +10 -0     src/sys/conf/files.amd64
| 1.454     +1 -0      src/sys/modules/Makefile

Approved by:    re (scottl, implicitly)
2005-10-06 18:52:26 +00:00
Xin LI 53f5bec08c MFC Import of the new version of the HPTMV driver from Highpoint.
The major change here is the support for amd64, as well as possible
support for PAE.  Many thanks to Highpoint for continuing to support
FreeBSD.

Obtained from:  Steve Chang @ Highpoint

Merged revisions:

| 1.3      dev/hptmv/access601.h
| 1.1      dev/hptmv/amd64-elf.raid.o.uu
| 1.3      dev/hptmv/array.h
| 1.3      dev/hptmv/atapi.h
| 1.3      dev/hptmv/command.h
| 1.9+1.10 dev/hptmv/entry.c
| 1.4      dev/hptmv/global.h
| 1.5      dev/hptmv/gui_lib.c
| 1.3      dev/hptmv/hptintf.h
| 1.6      dev/hptmv/hptproc.c
| 1.5      dev/hptmv/i386-elf.raid.o.uu
| 1.5      dev/hptmv/ioctl.c
| 1.3      dev/hptmv/mv.c
| 1.4      dev/hptmv/mvOs.h
| 1.3      dev/hptmv/mvSata.h
| 1.4      dev/hptmv/mvStorageDev.h
| 1.5      dev/hptmv/osbsd.h
| 1.3      dev/hptmv/raid5n.h
| 1.3      dev/hptmv/readme.txt
| 1.3      dev/hptmv/vdevice.h
| 1.4      modules/hptmv/Makefile

Approved by:	re (scottl)
2005-10-06 18:47:58 +00:00
Xin LI b2529c3c2b MFC 1.244 (by kbyanc)
| Make getsockopt(..., SOL_SOCKET, SO_ACCEPTCONN, ...) work per IEEE Std
| 1003.1 (POSIX).
|
| Revision  Changes    Path
| 1.244     +1 -0      src/sys/kern/uipc_socket.c

Approved by:	re (scottl)
2005-10-06 18:31:38 +00:00
Xin LI ec4e607ad3 MFC 1.12 (by netchild)
| The resource_xxx routines in subr_hints.c are called before and after the
| kenv environment in kern_environment.c switches to dynamic kenv. The prior
| call sets the static variable hintp to the static hints in subr_hints.c
| (hintmode==0).
|
| However, changes to the environment are not detected by the resource_xxx
| lookups after the change to dynamic kernel environment, so the lookup
| routines only report the old stuff of hintmode==0, even after the change to
| the dynamic kenv. This causes kenv users to see a different environment than
| the kernel routines.
|
| This is a problem in the mixer.c code that looks up initial mixer volume
| settings from the hints: If the hints are dynamic and not from the
| device.hints file, mixer.c doesn't see them, but kenv does.
|
| The patch from the PR (modified to comply to the style of the function)
| solves this.
|
| PR:             83686
| Submitted by:   Harry Coin <[email protected]>

Approved by:	re (scottl)
2005-10-06 18:29:30 +00:00
Xin LI 57050c84e5 MFC 1.154 (by rodrigc)
|  In ext2_mountfs(), check that the superblock size, SBSIZE,
|  is aligned with the sectorsize value returned by GEOM, before
|  doing a bread() of the superblock.
|  This eliminates a panic when trying the following on an empty CD-ROM drive:
|  mount_ext2fs /dev/acd0 /mnt
|
|  Reviewed by:    phk
|
|  Revision  Changes    Path
|  1.154     +12 -0     src/sys/gnu/fs/ext2fs/ext2_vfsops.c

Approved by:	re (scottl)
2005-10-06 18:27:27 +00:00
Xin LI 09c157b360 Complete MFC of rev. 1.215:
Fix a LOR between sched_lock and sleep queue lock.

Approved by:	re (scottl)
2005-10-06 18:24:24 +00:00
Pawel Jakub Dawidek 7581e880f3 MFC: sbin/geom/class/mirror/gmirror.8 1.17
Add a note in example as well, that last sector is used for metadata,
so it don't provoke confusions.

Noticed by:	Victor Sudakov <[email protected]>
Approved by:	re (scottl)
2005-10-06 18:19:13 +00:00
Pawel Jakub Dawidek 609352bdd9 MFC: sys/geom/eli/g_eli.h 1.4
Add a __packed keyword to g_eli_metadata struct definition, so
sizeof(struct g_eli_metadata) will return the exact number of bytes needed
for storing it on the disk.
Without this change GELI was unusable on amd64 (and probably other 64-bit
archs), because sizeof(struct g_eli_metadata) was greater than 512 bytes
and geli(8) was failing on assertion.

Reported by:	Michael Reifenberger <[email protected]>
Reminded by:	delphij
Approved by:	re (scottl)
2005-10-06 18:17:29 +00:00
John Baldwin 3fc368ac9d MFC: Add the simple refcount API.
Approved by:	re (scottl)
2005-10-06 18:13:19 +00:00
John Baldwin d18aa8f911 MFC: Add atomic_fetchadd(9) operation for types int and 32.
Other small updates to atomic(9) include:
- Note that arm and ppc don't provide 64-bit atomic ops.
- Update sample code.

Approved by:	re (scottl)
2005-10-06 18:12:06 +00:00
Stephan Uphoff 9792cc4623 MFC: 1.176
Don't pretend to be thread0 when calling sync().
It confuses the lock manager since in some places thread0 is
then used for vnode locking while curthread is used for vnode unlocking.

Approved by:    re (scottl@)
2005-10-06 17:53:46 +00:00
Warner Losh 54067f6a3a MFC: OLDCARD removal: don't build pccardd.
Approved by: re@ (scottl)
2005-10-06 16:56:45 +00:00
Warner Losh 6cc5227669 MFC: Remove references to OLDCARD
Approved by: re@ (scottl)
2005-10-06 16:36:31 +00:00
Warner Losh 611c3542c3 MFC: Remove OLDCARD. It only panics on my pc98 laptop. I'll fix cbb to attach to isa.
Approved by: re (scottl)
2005-10-06 16:34:27 +00:00
Poul-Henning Kamp 89e457aa1f MFC:
Make sure clonelists are correctly sorted.

Approved by:	re@ (scottl)
2005-10-06 15:17:41 +00:00
Yaroslav Tykhiy b361079c0e MFC:
ifconfig.c 1.116

	For the sake of consistency and easier typing,
	introduce "-tunnel" as an alias for "deletetunnel".
	The latter is overly long and prone to typos,  but
	keep it for POLA since it costs nothing.

    ifvlan.c 1.8

	Deprecate the useless argument to -vlandev.

    ifconfig.8 1.102-1.105

	Document the above changes.
	Logically group vlan- and tunnel-related parameters.

Approved by:	re (scottl)
2005-10-06 15:01:56 +00:00
Robert Watson 14d8fd6077 Merge db_command.c:1.62 from HEAD to RELENG_6:
Add a DDB "traceall" function, which stack traces all known process
  threads.  This is quite useful if generating a debug log for post-mortem
  by another developer, in which case the person at the console may not
  know which threads are of interest.  The output of this can be quite
  long.

  Discussed with: kris

Approved by:	re (scottl)
2005-10-06 13:15:21 +00:00
Joel Dahl 9df3ea96a9 MFC:
pcm.4           1.41-1.42
snd_cmi.4       1.5
snd_csa.4       1.14
snd_emu10k1.4   1.6
snd_es137x.4    1.6
snd_sbc.4       1.15

Approved by:    re (scottl)
2005-10-06 10:58:16 +00:00
Marius Strobl 1a1b6619b5 MFC: if_gem.c 1.31 + 1.35, if_gem_pci.c 1.20, if_gemvar.h 1.11
- In gem_ioctl() move the call to ether_ioctl() to the default case of
  the switch statement in order to make this driver more like other
  Ethernet NIC drivers.
- In gem_attach() call gem_stop() in addition to gem_reset() to make
  sure the chip actually is stopped and not just reset.
- In gem_stop() also stop the gem_rint_timeout() callout in case the
  driver is compiled with GEM_RINT_TIMEOUT defined.
- Remove NOP spl*() calls and add locking (making gem(4) MPSAFE).

This MFC actually brings the RELENG_6 gem(4) in line with HEAD which
means that it additionally includes a comment update regarding the
IFF_OACTIVE -> IFF_DRV_OACTIVE rename which was part of if_gem.c 1.33
but missed in the respective MFC in 1.29.2.2.

Requested by:	thompsa
Approved by:	re (scottl)
2005-10-05 22:08:17 +00:00
Marius Strobl 448a4a7870 MFC: 1.21
Fix an endianness issue in pnp_eisaformat().

Approved by:	re (scottl)
2005-10-05 21:53:17 +00:00
Marius Strobl c0f7f26cf3 MFC: creator.c 1.9, fbreg.h 1.19, gfb.c 1.8, machfb.c 1.4,
ofw_syscons.c 1.9, s3_pci.c 1.10, scgfbrndr.c 1.23, scmouse.c 1.40,
	scvgarndr.c 1.20, scvidctl.c 1.37, syscons.c 1.439, syscons.h 1.85,
	tga.c 1.8, vesa.c 1.52, vga.c 1.35

Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_t
and do some preparations for handling 12x22 fonts (currently lots of code
implies and/or hardcodes a font width of 8 pixels). This will be required
on sparc64 which uses a default font size of 12x22 in order to add font
loading and saving support as well as to use a syscons(4)-supplied mouse
pointer image.

Approved by:	re (scottl)
2005-10-05 21:48:03 +00:00
Tai-hwa Liang 5cf9c71c3f MFC: (1.193) fixing WEP bustage in hostap mode.
Approved by:	re (scottl)
2005-10-05 13:16:29 +00:00
Tai-hwa Liang 1f6b29596c MFC: (1.27) fixing WEP bustage in hostap mode.
Approved by:	re (scottl)
2005-10-05 13:13:46 +00:00
Robert Watson c05aacfbdd Merge netisr.c:1.16 from HEAD to RELENG_6:
Rename net.isr.enable to net.isr.direct.

  No compatibility code is provided, as this will be the production name
  as of 6.0.  Previously this has been an experimental and unsupported
  feature.

  Requested by:	scottl

Approved by:	re (kensmith)
2005-10-05 12:32:23 +00:00
Robert Watson 85822579e3 Merge init_main.c:1.258, mac_vfs.c:1.110, mac_biba.c:1.89,
mac_lomac.c:1.37, mac_mls.c:1.74, mac_stub.c:1.55, mac_test.c:1.62,
mac.h:1.69, mac_policy.h:1.70 from HEAD to RELENG_6:

  Remove mac_create_root_mount() and mpo_create_root_mount(), which
  provided access to the root file system before the start of the
  init process.  This was used briefly by SEBSD before it knew about
  preloading data in the loader, and using that method to gain
  access to data earlier results in fewer inconsistencies in the
  approach.  Policy modules still have access to the root file system
  creation event through the mac_create_mount() entry point.

  Removed now, and will be removed from RELENG_6, in order to gain
  third party policy dependencies on the entry point for the lifetime
  of the 6.x branch.

  Obtained from: TrustedBSD Project
  Submitted by:  Chris Vance <Christopher dot Vance at SPARTA dot com>

Approved by:	re (scottl)
2005-10-05 10:31:05 +00:00
Tai-hwa Liang cecc5554d0 MFC: (1.192) honouring ic->ic_dtim_period.
Approved by:	re (scottl)
2005-10-05 06:54:12 +00:00
Don Lewis 64e3f63c15 MFC kern_proc.c - fix locking in sysctl_kern_proc()
Original commit message:

  FreeBSD src repository

  Modified files:
    sys/kern             kern_proc.c
  Log:
  Always wire the sysctl output buffer in sysctl_kern_proc() before
  calling sysctl_out_proc().  -- fix from jhb

  Move the code in fill_kinfo_thread() that gathers data from struct proc
  into the new function fill_kinfo_proc_only().

  Change all callers of fill_kinfo_thread() to call both
  fill_kinfo_proc_only() and fill_kinfo() thread.  When gathering
  data from a multi-threaded process, fill_kinfo_proc_only() only needs
  to be called once.

  Grab sched_lock before accessing the process thread list or calling
  fill_kinfo_thread().

PR:		kern/84684
Approved by:	re (scottl)
2005-10-05 05:30:24 +00:00
Don Lewis 7ffa5c45ff MFC ffs_alloc.c 1.135 - clear i_flag field in recycled inodes
Original commit message:

  FreeBSD src repository

  Modified files:
    sys/ufs/ffs          ffs_alloc.c
  Log:
  Initialize the inode i_flag field in ffs_valloc() to clean up any
  stale flag bits left over from before the inode was recycled.

  Without this change, a leftover IN_SPACECOUNTED flag could prevent
  softdep_freefile() and softdep_releasefile() from incrementing
  fs_pendinginodes.  Because handle_workitem_freefile() unconditionally
  decrements fs_pendinginodes, a negative value could be reported at
  file system unmount time with a message like:
          unmount pending error: blocks 0 files -3
  The pending block count in fs_pendingblocks could also be negative
  for similar reasons.  These errors can cause the data returned by
  statfs() to be slightly incorrect.  Some other cleanup code in
  softdep_releasefile() could also be incorrectly bypassed.

Reviewed by:	tegge
Approved by:	re (scottl)
2005-10-05 05:24:53 +00:00
cvs2svn c321a51806 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-10-05 05:21:08 +00:00
Craig Rodrigues a05ff45aa7 MFC 1.53
Fix so that color changes are not lost when the video mode changes.

PR:             bin/83553
Submitted by:   Dan Lukes <dan at obluda dot cz>
Approved by:	re (scottl)
Reminded by:	delphij
2005-10-05 04:29:59 +00:00
Craig Rodrigues eb2bfb76e7 MFC 1.81
Call gctl_free() to free resource allocated with gctl_get_handle().

PR:		bin/84664
Submitted by:	Daan Vreeken <Danovitsch at Vitsch dot net>
Approved by:	re (scottl)
2005-10-05 01:16:39 +00:00
David Xu 4af387f622 MFC kern/kern_thread.c revision 1.217
kern/kern_kse.c     revision 1.218

Fix scheduler and sleep queue LOR.

Approved by: re (scottl)
2005-10-04 22:53:56 +00:00
Ralf S. Engelschall 89d93b0fd0 MFC to RELENG_6:
| Fix system shutdown timeout handling by again supporting longer running
| shutdown procedures (which have a duration of more than 120 seconds).
|
| We have two user-space affecting shutdown timeouts: a "soft" one in
| /etc/rc.shutdown and a "hard" one in init(8). The first one can be
| configured via /etc/rc.conf variable "rcshutdown_timeout" and defaults
| to 30 seconds. The second one was originally (in 1998) intended to be
| configured via sysctl(8) variable "kern.shutdown_timeout" and defaults
| to 120 seconds.
|
| Unfortunately, the "kern.shutdown_timeout" was declared "unused" in 1999
| (as it obviously is actually not used within the kernel itself) and
| hence was intentionally but misleadingly removed in revision 1.107 from
| init_main.c. Kernel sysctl(8) variables are certainly a wrong way to
| control user-space processes in general, but in this particular case the
| sysctl(8) variable should have remained as it supports init(8), which
| isn't passed command line flags (which in turn could have been set via
| /etc/rc.conf), etc.
|
| As there is already a similar "kern.init_path" sysctl(8) variable which
| directly affects init(8), resurrect the init(8) shutdown timeout under
| sysctl(8) variable "kern.init_shutdown_timeout". But this time document
| it as being intentionally unused within the kernel and used by init(8).
| Also document it in the manpages init(8) and rc.conf(5).
|
| Reviewed by: phk
| MFC after: 2 weeks
|
| Revision  Changes    Path
| 1.48      +7 -1      src/sbin/init/init.8
| 1.61      +1 -1      src/sbin/init/init.c
| 1.264     +16 -1     src/share/man/man5/rc.conf.5
| 1.257     +11 -0     src/sys/kern/init_main.c

Approved by: re (scottl)
2005-10-04 17:29:00 +00:00
Robert Watson ff332b1cb9 Merge fifo_vnops.c:1.132 from HEAD to RELENG_6:
Second attempt at a work-around for fifo-related socket panics during
  make -j with high levels of parallelism: acquire Giant in fifo I/O
  routines.

  Discussed with: ups

Approved by:	re (scottl)
2005-10-04 15:33:06 +00:00
Diomidis Spinellis 6de5c88f67 MFC 1.28
Bug fix: a numeric flag specification in the substitute command would
cause the next substitute flag to be ignored.
While working at it, detect and report overflows.

Reported by:	Jingsong Liu
Bugged by:	Xin Li
Approved by:	re (kensmith)
2005-10-04 15:26:10 +00:00
John Baldwin de3886b88f MFC: Add interrupt counters for IPIs.
Approved by:	re (scottl)
2005-10-04 15:15:22 +00:00
John Baldwin 7a3d878283 MFC: Rename the lapic timer interrupt counter to cpuX: timer.
Approved by:	re (scottl)
2005-10-04 15:13:06 +00:00
Andrey A. Chernov 5b918fcc98 MFC: 1.26-1.28
Approved by: re
2005-10-04 14:33:09 +00:00
Andrey A. Chernov cf5b9ffda5 MFC: 1.23
Approved by: re
2005-10-04 14:31:10 +00:00
Gleb Smirnoff b86ce95715 MFC 1.73:
In em_process_receive_interrupts() store and clear adapter->fmt. This
  make function reenterable. In the runtime the race is masked by
  serializing
  of em_process_receive_interrupts() either by interrupt thread, or by
  polling. The race can be triggered when polling is switched on or off.

Approved by:	re (scottl)
2005-10-04 14:07:44 +00:00
Poul-Henning Kamp d97973829c MFC:
Add the flash device sizing subroutine.

Approved by:	re@ (scottle)
Reminded by:	simon@
2005-10-04 13:56:35 +00:00
Peter Edwards 07936fafa5 MFC BOOTSIG[23] removal:
msdosfs_vfsops.c v1.146
    bootsect.h v1.13

    Remove checks for BOOTSIG[23] from FAT32 bootblocks.
    There seems to be very little documentary evidence outside this
    implementation to suggest a these checks are neccessary, and more
    than one camera-formatted flash disk fails the check, but mounts
    successfully on most other systems.

Approved by: re (scottl@)
2005-10-04 13:13:57 +00:00
Olivier Houchard 02fa0b3973 MFC rev 1.146 (and 1.147)
revision 1.146
date: 2005/09/28 16:05:13;  author: cognet;  state: Exp;  lines: +7 -1
Use SO_REUSEADDR on the socket, to make the use of syslogd in jails easier.

Submitted by:   Jeremie Le Hen <jeremie le-hen org>
Approved by:	re
2005-10-04 12:50:11 +00:00
Don Lewis 48f273d048 MFC snaplk deadlock fix
src/sys/kern/vfs_bio.c          1.495, 1.496
        src/sys/kern/vfs_subr.c         1.648
        src/sys/sys/buf.h               1.190, 1.191
        src/sys/sys/proc.h              1.436
        src/sys/ufs/ffs/ffs_snapshot.c  1.104, 1.105, 1.106

Original commit messages:

    Log:
    Un-staticize runningbufwakeup() and staticize updateproc.

    Add a new private thread flag to indicate that the thread should
    not sleep if runningbufspace is too large.

    Set this flag on the bufdaemon and syncer threads so that they skip
    the waitrunningbufspace() call in bufwrite() rather than than
    checking the proc pointer vs. the known proc pointers for these two
    threads.  A way of preventing these threads from being starved for
    I/O but still placing limits on their outstanding I/O would be
    desirable.

    Set this flag in ffs_copyonwrite() to prevent bufwrite() calls from
    blocking on the runningbufspace check while holding snaplk.  This
    prevents snaplk from being held for an arbitrarily long period of
    time if runningbufspace is high and greatly reduces the contention
    for snaplk.  The disadvantage is that ffs_copyonwrite() can start
    a large amount of I/O if there are a large number of snapshots,
    which could cause a deadlock in other parts of the code.

    Call runningbufwakeup() in ffs_copyonwrite() to decrement runningbufspace
    before attempting to grab snaplk so that I/O requests waiting on
    snaplk are not counted in runningbufspace as being in-progress.
    Increment runningbufspace again before actually launching the
    original I/O request.

    Prior to the above two changes, the system could deadlock if enough
    I/O requests were blocked by snaplk to prevent runningbufspace from
    falling below lorunningspace and one of the bawrite() calls in
    ffs_copyonwrite() blocked in waitrunningbufspace() while holding
    snaplk.

    See <http://www.holm.cc/stress/log/cons143.html>

    Revision  Changes    Path
    1.495     +3 -3      src/sys/kern/vfs_bio.c
    1.648     +2 -1      src/sys/kern/vfs_subr.c
    1.190     +1 -0      src/sys/sys/buf.h
    1.436     +1 -1      src/sys/sys/proc.h
    1.104     +16 -4     src/sys/ufs/ffs/ffs_snapshot.c

    Log:
    Un-staticize waitrunningbufspace() and call it before returning from
    ffs_copyonwrite() if any async writes were launched.

    Restore the threads previous TDP_NORUNNINGBUF state before returning
    from ffs_copyonwrite().

    Revision  Changes    Path
    1.496     +1 -1      src/sys/kern/vfs_bio.c
    1.191     +1 -0      src/sys/sys/buf.h
    1.105     +13 -1     src/sys/ufs/ffs/ffs_snapshot.c

    Log:
    Correct previous commit to fix the sense of the TDP_NORUNNINGBUF
    check in ffs_copyonwrite() that is a precondition for calling
    waitrunningbufspace().

    Pointed out by: tegge
    Pointy hat to:  truckman
    MFC after:      3 days

    Revision  Changes    Path
    1.106     +1 -1      src/sys/ufs/ffs/ffs_snapshot.c

Approved by:	re (scottl)
2005-10-04 04:41:27 +00:00
Don Lewis 41a7db5e3f MFC kern_exec.c 1.276 (and 1.278)
Original commit messages:

  truckman    2005-10-01 08:33:57 UTC

    FreeBSD src repository

    Modified files:
      sys/kern             kern_exec.c
    Log:
    Copy new process argument list in do_execve() before grabbing PROC_LOCK
    to avoid touching pageable memory while holding a mutex.

    Simplify argument list replacement logic.

    PR:            kern/84935
    Submitted by:  "Antoine Pelisse" apelisse AT gmail.com (in a different form)
    MFC after:     3 days

    Revision  Changes    Path
    1.276     +10 -10    src/sys/kern/kern_exec.c

  truckman    2005-10-04 04:02:33 UTC

    FreeBSD src repository

    Modified files:
      sys/kern             kern_exec.c
    Log:
    Add missing word to comment.

    Revision  Changes    Path
    1.278     +1 -1      src/sys/kern/kern_exec.c

PR:		kern/84935
Submitted by:	"Antoine Pelisse" apelisse AT gmail.com (in a different form)
Approved by:	re (scottl)
2005-10-04 04:29:08 +00:00
Greg Lehey 1c6c3a953f MFC:
Initialize uninitialized variables.
  Remove one possible way of shooting yourself in the foot.

Requested by:   Dan Lukes <[email protected]>
Approved by:	RE (kensmith@)

And now for the scripts which refuse the line above:

Approved by: re
2005-10-03 23:45:01 +00:00
Colin Percival 6767577f8e MFC revision 1.11: Fix a bug introduced in revision 1.9 which causes
chkgrp to coredump on certain corrupt files.

Approved by:	re (scottl)
2005-10-03 21:39:21 +00:00
Stephan Uphoff 909620d76b MFC revision 1.9:
Fix the "fpudna: fpcurthread == curthread XXX times" problem.

Approved by: re (scottl@)
2005-10-03 20:08:00 +00:00
Peter Edwards 0c8c53f795 MFC revision 1.494:
Close a race in biodone(), whereby the bio_done field of the passed
    bio may have been freed and reassigned by the wakeup before being
    tested after releasing the bdonelock.

Approved by: re (scottl@)
2005-10-03 09:30:12 +00:00
Hiroki Sato a56eb468d3 Add KPnS (known problems and solutions) entries:
- /dev/ttyv* not found on FreeBSD/sparc64 when
   there is no framebuffer[1].

 - KLDs do not work on FreeBSD/sparc64 with >4GB RAM[2].

 - kgdb is broken for debugging panics on FreeBSD/sparc64[2].

Thanks to:	marius[1], kris[2]
Approved by:	re (implicitly)
2005-10-02 20:11:34 +00:00
Colin Percival ea5b8286db MFC revision 1.639: Don't let the upper bits of %dr6/%dr7 get set.
Submitted by:	Nate Eldredge
Approved by:	re@ (scottl)
Security:	Local denial of service
2005-10-02 16:38:12 +00:00
Andre Oppermann e7c9741b76 MFC IP_DONTFRAG IP socket option.
Approved by:	re (scottl)
2005-10-02 15:45:47 +00:00
Joel Dahl c14308d44f MFC rev 1.55-1.58:
*  Document existing support for:
  -  ALI M5229
  -  ALI M5281
  -  ALI M5287
  -  ALI M5289
  -  CMD 646U2
  -  Highpoint HPT372N
  -  Intel 6300ESB
  -  Intel ICH7
  -  Nvidia nForce2 MCP
  -  Nvidia nForce3 MCP
  -  Nvidia nForce3 Pro
  -  Nvidia nForce4
  -  Promise PDC20571
  -  Promise PDC20575
  -  Promise PDC20579
  -  Promise PDC20580
  -  Promise PDC20621
  -  Promise PDC20622
  -  Promise PDC40518
  -  Promise PDC40519
  -  Promise PDC40718
  -  Promise PDC40719
  -  SIS 180
  -  SIS 181
  -  SIS 182
  -  SIS 965
  -  VIA VT6410
  -  VIA VT6420
  -  VIA VT6421

*  Add two missing dots.

*  Remove HPT366 duplicate.

Approved by:	re (hrs)
2005-10-02 14:32:06 +00:00
Ruslan Ermilov f970ac377d MFC: 1.46: Document that -q also affects "route change".
Approved by:	re (hrs)
2005-10-02 13:44:05 +00:00
Max Khon 9a376aa640 MFC g_uzip.c rev. 1.5:
- Fix "end_blk out of range" panic when INVARIANTS.
- Do not allow rw access.

Approved by:	re (scott)
2005-10-02 11:22:28 +00:00
Robert Watson 8eb830cdb9 Merge kern_lock.c:1.95 from HEAD to RELENG_6:
Include kdb.h so that kdb_active is declared regardless of KDB being
  included in the kernel.

Approved by:	re (kensmith)
2005-10-02 10:08:29 +00:00
Robert Watson 4f510d8c77 Merge fifo_vnops.c:1.130 from HEAD to RELENG_6:
Assert v_fifoinfo is non-NULL in fifo_close() in order to catch
  non-conforming cases sooner.

  Reported by:    Peter Holm <peter at holm dot cc>

Approved by:	re (scottl)
2005-10-02 10:07:21 +00:00
Robert Watson 1186cfa1d1 Merge subr_pcpu.c:1.7 from HEAD to RELENG_6:
Add "show allpcpu" to DDB, which prints the current CPU id followed by
  the per-cpu data for all CPUs.  This is easier to ask users to do than
  "figure out how many CPUs you have, now run show pcpu, then run it
  once for each CPU you have".

Approved by:	re (scottl)
2005-10-02 10:06:49 +00:00
Robert Watson 9c667ea480 Merge subr_kdb.c:1.13 from HEAD to RELENG_6:
If KDB_STOP_NMI is compiled into the kernel, default
  debug.kdb.stop_cpus_with_nmi to 1 rather than 0.

Approved by:	re (scottl)
2005-10-02 10:06:15 +00:00
Robert Watson 6eae5d0ae2 Merge kern_lock.c:1.94 from HEAD to RELENG_6:
In lockstatus(), don't lock and unlock the interlock when testing the
  sleep lock status while kdb_active, or we risk contending with the
  mutex on another CPU, resulting in a panic when using "show
  lockedvnods" while in DDB.

  Reviewed by:    jhb
  Reported by:    kris

Approved by:	re (scottl)
2005-10-02 09:58:54 +00:00
Don Lewis 42365efcea MFC ffs_softdep.c 1.185
Original commit message:

  truckman    2005-09-29 21:50:26 UTC

   FreeBSD src repository

   Modified files:
     sys/ufs/ffs          ffs_softdep.c
   Log:
   After a rmdir()ed directory has been truncated, force an update of
   the directory's inode after queuing the dirrem that will decrement
   the parent directory's link count.  This will force the update of
   the parent directory's actual link to actually be scheduled.  Without
   this change the parent directory's actual link count would not be
   updated until ufs_inactive() cleared the inode of the newly removed
   directory, which might be deferred indefinitely.  ufs_inactive()
   will not be called as long as any process holds a reference to the
   removed directory, and ufs_inactive() will not clear the inode if
   the link count is non-zero, which could be the result of an earlier
   system crash.

   If a background fsck is run before the update of the parent directory's
   actual link count has been performed, or at least scheduled by
   putting the dirrem on the leaf directory's inodedep id_bufwait list,
   fsck will corrupt the file system by decrementing the parent
   directory's effective link count, which was previously correct
   because it already took the removal of the leaf directory into
   account, and setting the actual link count to the same value as the
   effective link count after the dangling, removed, leaf directory
   has been removed.  This happens because fsck acts based on the
   actual link count, which will be too high when fsck creates the
   file system snapshot that it references.

   This change has the fortunate side effect of more quickly cleaning
   up the large number dirrem structures that linger for an extended
   time after the removal of a large directory tree.  It also fixes a
   potential problem with the shutdown of the syncer thread timing out
   if the system is rebooted immediately after removing a large directory
   tree.

   Submitted by:   tegge
   MFC after:      3 days

   Revision  Changes    Path
   1.185     +2 -0      src/sys/ufs/ffs/ffs_softdep.c

Submitted by:	tegge
Approved by:	re (scottl)
2005-10-02 08:25:33 +00:00
Ken Smith 99d0c095dd MFC revision 1.890:
> date: 2005/09/28 12:39:00;  author: kensmith;  state: Exp;  lines: +17 -6
> Add SHA256 checksums to the release build.
>
> Requested by:           cperciva (so)
> Reviewed/improved by:   ru

Approved by:	re (scottl)
2005-10-02 05:47:04 +00:00
Christian S.J. Peron cf7856ef12 MFC bpf.c v1.159
Make stats a bit more accurate by refreshing the PID after each
descriptor operation.

Approved by:	re (scottl)
2005-10-01 18:43:16 +00:00
Poul-Henning Kamp 9ef23e7e5e MFC:
one character fix in mount option name.

Approved by:	re@ (scottl)
2005-10-01 17:39:50 +00:00
Hajimu UMEMOTO a49a1145e4 MFC: add product ID for Linux Ethernet/RNDIS gadget on pxa210/25x/26x.
sys/dev/usb/if_cdce.c:	1.11
	sys/dev/usb/usbdevs:	1.234

Approved by:	re (scottl)
2005-10-01 16:26:25 +00:00
Andre Oppermann 0a7be88571 MFC: IP_MINTTL socket option.
Approved by:	re (scottl)
2005-10-01 15:56:44 +00:00
Joseph Koshy 04774959f5 MFC r1.11-1.12:
- Correct a typo.
  - Note the requirement for 'device apic' on i386 systems.
  - Consistently use 'x86' when referring to behaviour common to the
    i386 and amd64.

Approved by:	re (hrs)
2005-10-01 15:52:13 +00:00
Joseph Koshy dc7137f378 MFC r1.5:
The 'intr_bufferfull' driver statistic actually counts the number
  of times sampling was stopped due to a space shortage; change its
  description in the output of `pmcstat -s` to match reality.

Approved by:	re (scottl)
2005-10-01 15:48:02 +00:00
Dag-Erling Smørgrav 2c9daaf535 MFC: don't take unprotected keys into account for authentication.
PR:		bin/81231
Approved by:	re (kensmith)
2005-09-30 14:02:29 +00:00
Yoshihiro Takahashi 9cdd01a143 MFC: Call gctl_free() to free resource allocated with gctl_get_handle().
Approved by:	re (kensmith)
2005-09-30 13:09:01 +00:00
Xin LI 3bd2cc9dc5 MFC sys/fs/hpfs/hpfs_vfsops.c:1.54-1.56,
sys/fs/msdosfs/msdosfs_vfsops.c:1.145,
    sys/fs/ntfs/ntfs_vfsops.c:1.79-1.80,
    sys/fs/udf/udf_vfsops.c:1.34-1.35,
    sys/gnu/fs/ext2fs/ext2_vfsops.c:1.152-1.153,
    sys/gnu/fs/reiserfs/reiserfs_vfsops.c:1.2-1.3 (by ssouhlal):

*_mountfs() (if the filesystem mounts from a device) needs devvp to be
locked, so lock it.

Approved by:	re (scottl)
2005-09-30 06:26:42 +00:00
Xin LI 7d15289b58 MFC 1.293 (by ssouhlal):
ffs_mountfs() needs devvp to be locked, so lock it.

Approved by:	re (scottl)
2005-09-30 06:14:44 +00:00
Xin LI 5836b8f5f7 MFC 1.197 (by ssouhlal):
Don't unbusy the devfs mount in vfs_mountroot_try() as it gets accessed
and unbusied in devfs_fixup(), which assumes that the devfs mount is
still locked.

Approved by:	re (scottl)
2005-09-30 06:10:59 +00:00
Christian S.J. Peron c3d79f4cd8 MFC src/contrib/pf/pflogd/pflogd.c rev 1.9
Implement BIOCLOCK

Approved by:	re (kensmith)
2005-09-29 23:50:29 +00:00
Christian S.J. Peron 4454cd3fc3 MFC privilege separation enhancements for bpf(4)
Introduce BIOCLOCK and BIOCSETWF

Revision(s)
    1.158     +81 -23    src/sys/net/bpf.c
    1.40      +2 -0      src/sys/net/bpf.h
    1.31      +4 -1      src/sys/net/bpfdesc.h

Approved by:	re (scottl)
2005-09-29 23:48:04 +00:00
Robert Watson 06a775e5aa Merge if.c:1.247, in.c:1.88, in.h:1.92 from HEAD to RELENG_6:
Take a first cut at cleaning up ifnet removal and multicast socket
  panics, which occur when stale ifnet pointers are left in struct
  moptions hung off of inpcbs:

  - Add in_ifdetach(), which matches in6_ifdetach(), and allows the
    protocol to perform early tear-down on the interface early in
    if_detach().

  - Annotate that if_detach() needs careful consideration.

  - Remove calls to in_pcbpurgeif0() in the handling of SIOCDIFADDR --
    this is not the place to detect interface removal!  This also
    removes what is basically a nasty (and now unnecessary) hack.

  - Invoke in_pcbpurgeif0() from in_ifdetach(), in both raw and UDP
    IPv4 sockets.

  It is now possible to run the msocket_ifnet_remove regression test
  using HEAD without panicking.

  Reported by:	Gavin Atkinson <gavin dot atkinson at ury dot york dot ac dot uk>

Approved by:	re (scottl)
2005-09-29 20:57:07 +00:00
John Baldwin 61d52c96a3 MFC: Use correct VFS locking in kern_alternate_path().
Approved by:	re (scottl)
2005-09-29 18:53:10 +00:00
John Baldwin 74b2e9a759 MFC various fixes to sis(4):
- Remove sis_unit and use device_printf() and if_printf() instead.
- Use callout_init_mtx() for the callout.
- Remove spls.
- Fix locking for ifmedia to happen in the ifmedia handlers rather than in
  sis_ioctl().

Approved by:	re (scottl)
2005-09-29 18:52:21 +00:00
John Baldwin 129a9ed4e2 MFC: Add the spin lock used by the binary nvidia-driver to the static lock
order list.

Approved by:	re (scottl)
2005-09-29 18:47:31 +00:00
Robert Watson 3c084fb31a Merge subr_prof.c:1.119, 1.120, 1.121, nfs_socket.c:1.130,
rpcclnt.c:1.14 from HEAD to RELENG_6:

Acquire Giant in uprintf() and tprintf() due to the non-MPSAFEty of
the tty code invoked from these functions.  In two cases, during
timeout handling in NFS-related RPC client code, acquire Giant in
the caller before other mutexes the caller might hold, in order to
avoid lock order reversals with Giant (a recursive acquire is not
a reversal as it won't ever wait).

Correct age-old comments about uprintf()/tprintf() sleeping: they
will never sleep.

Much useful feedback from:	bde
Approved by:			re (scottl)
2005-09-29 18:40:36 +00:00
Gleb Smirnoff 8d83bb6285 MFC 1.62:
- Print space character in show_stat(). Remove a lot of priuntf(" ").
  - Utilize show_stat() in sidewaysintpr() loop. This makes periodic
    statistics to honor -h flag.

Approved by:	re (kensmith)
2005-09-29 13:19:10 +00:00
Christian Brueffer 0259e20517 MFC: rev. 1.6
Fix typo.

Approved by:	re (hrs)
2005-09-28 16:51:27 +00:00
Ruslan Ermilov 790ce6a78a MFC: 1.57: Respect IFF_PROMISC.
Approved by:	re (scottl)
2005-09-28 16:46:17 +00:00
Ken Smith 0be27f3c8b MFC v1.43: Move hme_stop() BEFORE ether_ifdetach() and if_free() to
prevent a memory-referenced-after-free panic if the hme interface
fails to attach.

Patch obtained from:	marius
Suggested same thing:	brooks
Approved by:		re (scottl)
2005-09-28 14:10:00 +00:00
Ken Smith 1186cacdbd MFC v1.30: Update for RELENG_6.
Approved by:	re (scottl)
2005-09-28 14:00:13 +00:00
Robert Watson ab6b1024ea Merge fifo_vnops.c:1.129 from HEAD to RELENG_6:
Lock the read socket receive buffer when frobbing the sb_state flag on
  that socket during open, not the write socket receive buffer.

  Spotted by:	ups

Approved by:	re (scottl)
2005-09-28 06:55:02 +00:00
Robert Watson 588c26b2b1 Merge uipc_usrreq.c:1.156 from HEAD to RELENG_6:
Canonicalize the UNIX domain socket copyright layout: original holders
  before more recent holders.

Approved by:	re (scottl)
2005-09-28 06:52:10 +00:00
Robert Watson 796f6db980 Merge fifo_vnops.c:1.128 from HEAD to RELENG_6:
For reasons of consistency (and necessity), assert an exclusive vnode
  lock on the fifo vnode in fifo_open(): we rely on the vnode lock to
  serialize access to v_fifoinfo.

Approved by:	re (scottl)
2005-09-28 06:47:32 +00:00
Robert Watson d96e8533f9 Merge uipc_socket.c:1.249, socket.h:1.89 from HEAD to RELENG_6:
Add three new read-only socket options, which allow regression tests
  and other applications to query the state of the stack regarding the
  accept queue on a listen socket:

  SO_LISTENQLIMIT    Return the value of so_qlimit (socket backlog)
  SO_LISTENQLEN      Return the value of so_qlen (complete sockets)
  SO_LISTENINCQLEN   Return the value of so_incqlen (incomplete sockets)

  Minor white space tweaks to existing socket options to make them
  consistent.

  Discussed with: andre

Approved by:	re (scottl)
2005-09-27 21:14:10 +00:00
Max Laier a51c47afb9 Document bridge(4) removal.
Approved by:	re (scottl)
2005-09-27 18:51:02 +00:00
Warner Losh 5dd842418a MFC: CIS exported to userland, and a number of cosmetic fixups
Approved by: re@ (scottl)
2005-09-27 18:42:20 +00:00
Xin LI 0834b2e5bf MFC 1.64: Restore a historical ufs_inactive behavior that respect
the RDONLY option, so subsequent call of UFS_TRUNCATE (ffs_truncate)
would not panic the system.  This fixes a panic that can happen
when mounting a corrputed filesystem read-only, and reading data
from it.

Reviewed by:	mckusick
Approved by:	re (scottl)
2005-09-27 17:03:53 +00:00
Mark Peek 16c2b483ab Bump up BUFSIZE from 4k to 8k. This was requested by portmgr@ to allow
ports builds in the cluster to work correctly.

Approved by: re
2005-09-27 14:49:41 +00:00
Kirill Ponomarev 5e4f9d9f58 MFC: 1.20
date: 2005/09/24 21:41:47;  author: krion;  state: Exp;  lines: +1 -1
  Do not bitch about bsdpan modules not having origin.

  Based on PR:    bin/82269
  Submitted by:   Steven Hartland <killing at multiplay dot co dot uk>
  MFC after:      3 days

Approved by:	re (kensmith)
2005-09-27 13:39:06 +00:00
Kirill Ponomarev 21a616e063 MFC: 1.39
date: 2005/09/24 19:41:56;  author: krion;  state: Exp;  lines: +1 -1
    Remove '\n' since it's redundant in case if file doesn't exist while
    running 'pkg_info -g'

    Based on PR:    bin/42609
    Submitted by:   Jeff King <peff-freebsd at peff dot net>
    MFC after:      3 days

Approved by:	re (kensmith)
2005-09-27 13:37:53 +00:00
David Xu bf4ac3bbb4 MFC kern/sys_process.c revision 1.132
kern/kern_kse.c    revision 1.215

     > Fix a LOR between sched_lock and sleep queue lock.

Approved by: re(scottl)
2005-09-27 12:17:38 +00:00
David Xu 5eb953e90c MFC revisions 1.156 - 1.159, improve stability of ULE scheduler.
Approved by: re (scottl)
2005-09-27 12:00:31 +00:00
Warner Losh 0914839d22 MFC: 1.297 and 1.298
Split the do_powerstaes knob into do_power_resume and do_power_nodriver.
Go ahead and enable power state management for suspend/resume, but leave
the nodriver powerdown off by default.  The MFC that changed do_power_state
default to 0 broke some resume on some laptops.

Approved by: re@ (scottl)
2005-09-27 05:57:47 +00:00
John Baldwin 970639bf36 MFC: Stop using the '+' constraint modifier with memory operands in
inline assembly.  We still use it for register operands in various places.

Approved by:	re (kensmith)
2005-09-26 19:54:19 +00:00
John Baldwin bb4883920f MFC: Adjust comment to note that we now do handle the PMC LVT entry and
try to avoid recursively panicing.

Approved by:	re (kensmith)
2005-09-26 19:50:38 +00:00
John Baldwin b9f05e541c MFC: Use the new thread no sleeping facility to replace the g_xup, g_xdown,
and dont_sleep_in_callout mutexes.  Also, disallow sleeping in hardware
interrupt handlers.

Approved by:	re (kensmith)
2005-09-26 19:49:12 +00:00
John Baldwin a630fc3f14 MFC: Add a new simple facility for marking the current thread as being in a
state where sleeping on a sleep queue is not allowed.

Approved by:	re (kensmith)
2005-09-26 19:43:37 +00:00
John Baldwin d4accbfec7 MFC: Explicitly switch to the new TSS when adding one in i386_extend_pcb().
Approved by:	re (kensmith)
2005-09-26 19:38:12 +00:00
John Baldwin 57a6c2fedd MFC: Fixup locking and mark MPSAFE.
Approved by:	re (kensmith)
2005-09-26 19:36:38 +00:00
John Baldwin 2f5d3318ad MFC: Add a memory barrier for PREWRITE operations to ensure all writes by
the CPU have drained before further writes to kick off the DMA operation.

Approved by:	re (kensmith)
2005-09-26 19:35:33 +00:00
Poul-Henning Kamp 5eec9ecc16 MFC:
Fixes for various races in md.

Approved by:	re@ (scottl)
2005-09-26 18:14:38 +00:00
Damien Bergamini e3589c6371 sync with HEAD.
o Brings WME and IBSS support.
o Fix association with APs hiding their SSIDs.

Approved by:	re (scottl)
2005-09-26 17:31:36 +00:00
Damien Bergamini 886670277d sync with HEAD.
Approved by:	re (scottl)
2005-09-26 17:21:15 +00:00
Poul-Henning Kamp 721a9870c3 MFC:
nanobsd conversion to shell script.

Approved by:	re@ (scottl)
2005-09-26 15:00:49 +00:00
Gleb Smirnoff 5fa0e0af41 MFC 1.80:
- Understand EADDRINUSE, and forget EDQUOT. [1]
  - Add description for EEXIST.
  - Change description for ENOBUFS. Routing socket can return
    this error for many different reasons, including general
    memory shortage, mbuf memory shortage and rtentry zone.

  PR:	kern/64090 [1]

Approved by:	re (scottl)
2005-09-26 15:00:34 +00:00
Gleb Smirnoff 7b15fbe3a5 MFC 1.113:
Several fixes to rt_setgate(), that fix problems with route changing:

  - Rearrange code so that in a case of failure the affected
    route is not changed. Otherwise, a bogus rtentry will be
    left and later rt_check() can recurse on its lock. [1]
  - Remove comment about protocol cloning.
  - Fix two places where rtentry mutex was recursed on, because
    accessed via two different pointers, that were actually pointing
    to the same rtentry in some cases. [1]
  - Return EADDRINUSE instead of bogus EDQUOT, in case when gateway
    uses the same route. [2]

  Reported & tested by:	ps, Andrej Zverev <az inec.ru> [1]
  PR:			kern/64090 [2]

Approved by:	re (scottl)
2005-09-26 14:59:12 +00:00
Gleb Smirnoff 521c3e4cf5 MFC 1.71, 1.72:
Check IFF_DRV_RUNNING before calling em_start_locked().

Approved by:	re (scottl)
2005-09-26 14:46:10 +00:00
Poul-Henning Kamp 02eb92cc0e MFC:
DEVFS fixes of many sorts.

Approved by:	re@ (scottl)
2005-09-26 14:36:54 +00:00
Andre Oppermann da7684092a MFC 1.160: Undo optimization which broke BIOCGSEESENT handling.
Approved by:	re (scottl)
2005-09-26 12:06:18 +00:00
Andre Oppermann 512a7c42c1 MFC 1.77: Do not ignore all other TCP options when TCP_MD5.
Approved by:	re (scottl)
2005-09-26 12:03:37 +00:00
Andrew Thompson c0dc51e8fb MFC: if_bridge.c, r1.22
> Fix an alignment panic my preserving the 2byte padding (ETHER_ALIGN) on our
> copied mbuf, which keeps the IP header 32-bit aligned. This copied mbuf is
> reinjected back into ether_input and off to the IP routines.
>
> Reported and tested by: Peter van Dijk

Approved by:	re (scottl), mlaier (mentor)
2005-09-25 20:36:02 +00:00
Robert Watson 5a7539465e Merge kern_acct.c:1.75 from HEAD to RELENG_6:
Pass 'curthread' into VFS_STATFS() from acctwatch(), rather than passing
  NULL.  The NFS client expects that a thread will always be present for a
  VOP so that it can check for signal conditions, and will dereference a
  NULL pointer if one isn't present.

Approved by:	re (scottl)
2005-09-25 18:54:28 +00:00
Robert Watson 485c329e67 Merge Makefile:1.262, namei.9:1.27, and VFS_LOCK_GIANT.9:1.1 from
HEAD to RELENG_6:

  Add discussion of Giant, the MPSAFE flag, and NDHASGIANT() to namei(9).

  Add a VFS_LOCK_GIANT(9)/VFS_UNLOCK_GIANT(9) man page.

  Discussed with: jeff

Approved by:	re (hrs)
2005-09-25 18:51:45 +00:00
Robert Watson b32ccd7850 Merge rc.conf:1.260, kerberos:1.5, rc.conf.5:1.265 from HEAD to RELENG_6:
Add a new rc.conf entry, kerberos5_server_flags, which allows the
  administrator to specify additional start-up flags to the Kerberos
  5 Authentication Server.

Approved by:	re (scottl)
2005-09-25 18:45:56 +00:00
Wilko Bulte 28ed9b63af Try to avoid crashes during kernel startup by limiting the # of EISA
slots to probe.  Problems have been reported in this area, lets hope
this  bandaid helps.

	!! Owners of EISA-equipped Alpha machines are requested to at least
	!! boot-test a 6-BETA build and report back to the Alpha list. Thanks!

Approved by: re (scottl)
Suggested by: ticso
2005-09-25 18:34:18 +00:00
Olivier Houchard 742917c66a It seems I can't MFC something without forgetting half the files.
MFC rev 1.25
revision 1.25
date: 2005/09/18 19:23:35;  author: cognet;  state: Exp;  lines: +2 -4
Slightly change the API for the SNPSTTY ioctl so that the userland now
provides a file descriptor instead of a dev_t.

Approved by:	re
2005-09-24 13:19:20 +00:00
Olivier Houchard d816eaea3b MFC rev 1.27:
revision 1.27
date: 2005/09/19 13:48:45;  author: ru;  state: Exp;  lines: +8 -5
Restore the ability to detach from a tty via SIOCSTTY and document
recent changes in a manpage.

Approved by:	re
2005-09-24 13:17:33 +00:00
Christian Brueffer a0a0b1f21a MFC:
- Sort the list of ethernet devices by driver-name.
- Sort the list of disk controllers by driver-name.  The notable exception is
  ata(4), which should stay on top.
- Add esp(4).

Approved by:	re (hrs)
2005-09-24 10:46:38 +00:00
Christian Brueffer 5356783f26 MFC: rev. 1.286
Don't claim matcd(4) support, it was removed long ago.

Approved by:	re (hrs)
2005-09-24 07:45:21 +00:00
Christian Brueffer e8f561bd8f MFC: rev. 1.2
Use the correct function name as .Nm argument.

Approved by:	re (hrs)
2005-09-24 07:13:37 +00:00
Giorgos Keramidas 140e3c10dc MFC: a lot of manpage fixes from HEAD.
Approved by:	re (hrs)
2005-09-24 01:59:40 +00:00
Olivier Houchard 3500d47121 MFC rev 1.32, 1.33, 1.34:
revision 1.32
date: 2005/09/18 19:24:05;  author: cognet;  state: Exp;  lines: +8 -2
Open the tty device and pass the fd for SNPSTTY.

revision 1.33
date: 2005/09/19 13:48:45;  author: ru;  state: Exp;  lines: +3 -3
Restore the ability to detach from a tty via SIOCSTTY and document
recent changes in a manpage.

revision 1.34
date: 2005/09/21 14:30:14;  author: cognet;  state: Exp;  lines: +8 -8
Close the tty file descriptor once we're done with it.
Use O_NONBLOCK when opening the tty device.

Approved by:	re
2005-09-23 23:24:55 +00:00
Olivier Houchard 47d123b76e MFC rev 1.5:
revision 1.5
date: 2005/09/19 10:14:05;  author: mux;  state: Exp;  lines: +1 -1
Fix the module build for snp(4).

Approved by:	re
2005-09-23 23:23:54 +00:00
Olivier Houchard a33e352637 MFC rev 1.101 and 1.102:
revision 1.101
date: 2005/09/18 19:23:35;  author: cognet;  state: Exp;  lines: +14 -5
Slightly change the API for the SNPSTTY ioctl so that the userland now
provides a file descriptor instead of a dev_t.

revision 1.102
date: 2005/09/19 13:48:45;  author: ru;  state: Exp;  lines: +5 -5
Restore the ability to detach from a tty via SIOCSTTY and document
recent changes in a manpage.

Approved by:	re
2005-09-23 23:22:22 +00:00
Søren Schmidt 86a3db20bd MFC:
Harden the hotplug support for SATA devices.
	This also fixes a few races that was present in the timeout/detach code.
	Fix support for the VIA 6421 controller.
	Fixes the losage of some ATAPI device that reported failed probing.
	Fix problem finding the still working disk in a broken mirror on VIA.

Approved by: re@ (scottl)
2005-09-23 18:06:11 +00:00
Robert Watson 5434627fed Merge rc.initdiskless:1.45 from HEAD to RELENG_6:
Use sysctl -q when querying for kern.bootp_cookie in order to avoid
  printing boot-time errors that don't reflect true error conditions.

Approved by:	re (kensmith)
2005-09-22 16:58:56 +00:00
Robert Watson e8f8afb664 Merge sysctl.8:1.59, sysctl.c:1.68 from HEAD to RELENG_6:
Add "-q" argument to sysctl(8), which suppresses a limited set of
  warnings/ errors generated.  In particular, it suppresses "unknown oid"
  when attempting to get or set a sysctl not present in the kernel.

Approved by:	re (kensmith)
2005-09-22 15:30:21 +00:00
Giorgos Keramidas 27d90051d5 MFC 1.167: panic on attach failure...
% When bus_alloc_resource_any() fails, dc_detach() is called and it
% attempts to deallocate busdma tags and resources that haven't been
% allocated yet, causing a panic every time a dc interface fails to
% attach.  Fix by checking that we really have something to dealloc
% before calling bus_dma*() functions.
%
% Approved by:    jhb
% MFC after:      1 week

Approved by:	re (kensmith)
2005-09-22 12:46:01 +00:00
Ken Smith eeaff9eded Fix a whitespace screw-up I made when doing the MFC of COMPAT_FREEBSD5.
It's supposed to be "option", "space", "tab"; not "option", "tab", "tab".

Approved by:	re (scottl)
Pointed out by:	rwatson
Pointy hat:	kensmith
2005-09-22 12:36:39 +00:00
John Baldwin e5300670fd MFC: Various small cleanups. No functional change.
Approved by:	re (kensmith)
2005-09-21 21:11:28 +00:00
John Baldwin eac79ac32c MFC: Several improvements to the manual page including mentioning that
mtx_trylock() only works with MTX_DEF mutexes.

Approved by:	re (kensmith)
2005-09-21 21:09:36 +00:00
John Baldwin 22dc7d6602 MFC: Use if_printf() and device_printf().
Approved by:	re (kensmith)
2005-09-21 21:06:39 +00:00
John Baldwin 5b9cc6028d MFC: Destroy sx locks created with SX_SYSINIT() during module unload via a
SYSUNINIT.

Approved by:	re (kensmith)
2005-09-21 21:05:19 +00:00
John Baldwin 9b892f82ba MFC: Add witness checks to make sure exiting threads don't hold any locks.
Approved by:	re (kensmith)
2005-09-21 21:04:16 +00:00
Craig Rodrigues 5c803da891 MFC: 1.16:
In mountd_precmd(), use rc_args, not mountd_args to
  override the value of mountd_args.  This fixes the problem
  where mountd_args was not properly being set if
  weak_mountd_authentifcation="YES" was set in rc.conf.

PR:             conf/86260
Submitted by:   Thierry Herbelot <thierry at herbelot dot com>
Approved by:	re (kensmith)
2005-09-21 20:27:50 +00:00
cvs2svn 6b13c0483b This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-09-21 20:08:25 +00:00
Robert Watson 70dfc5aae7 Merge uipc_socket.c:1.248 from HEAD to RELENG_6:
Fix spelling in a comment.

Approved by:	re (scottl)
2005-09-21 15:32:21 +00:00
Robert Watson d967b070a4 Merge fifo_vnops.c:1.126 from HEAD to RELENG_6:
Assert that (vp) is locked in fifo_close(), since we rely on the
  exclusive vnode lock to synchronize the reference counts on struct
  fifoinfo.

Approved by:	re (scottl)
2005-09-21 15:31:26 +00:00
Robert Watson 790cc81ab7 Merge uipc_socket2.c:1.148 from HEAD to RELENG_6:
Re-comment sbcompress() to explain what it is it does; it took me
  quite a bit of reading to figure it out, and I want to avoid figuring
  it out again.

  Convert an if (foo) else printf("this is almost a panic") into a
  KASSERT.

Approved by:	re (scottl)
2005-09-21 15:30:54 +00:00
Pyun YongHyeon 7d6e897cbb MFC rev. 1.29 to RELENG_6:
fix LOR by dropping driver lock before calling resource_int_value(9).

Approved by:	re(scottl)
2005-09-21 03:18:30 +00:00
Tim Kientzle 50352c825d MFC archive_read_extract.c 1.42 and 1.43: Correctly restore file flags.
Approved by: re
2005-09-21 03:12:45 +00:00
Pyun YongHyeon 8912045c56 MFC rev. 1.21 to RELENG_6: fix module unloading panic
Approved by:	re(scottl)
2005-09-21 02:44:09 +00:00
Robert Watson e85b340f0d Merge fifo_vnops.c:1.125 from HEAD to RELENG_6:
The socket pointers in fifoinfo are not permitted to be NULL, so
  don't check if they are, it just confuses the fifo code more.

Approved by:	re (kensmith)
2005-09-20 13:57:17 +00:00
Gleb Smirnoff 44027ad876 MFC typo fix from 1.75:
Dej'a vu of revision 1.35

  PR:		kern/86258
  Submitted by:	Hiroshi Oota <ghelp excite.co.jp>

Approved by:	re (kensmith)
2005-09-20 13:46:15 +00:00
Gleb Smirnoff d40e00381d MFC 1.84 by yar:
Test the new M_VLANTAG packet flag before calling
  m_tag_locate().  This adds little overhead of a simple
  bitwise operation in case hardware VLAN acceleration
  is on, yet saves the more expensive function call if
  the acceleration is off.

  Reviewed by:	ru, glebius

Approved by:	re (kensmith)
2005-09-20 13:44:36 +00:00
Gleb Smirnoff 456f33935c MFC 1.69:
When message can't fit into socket receive buffer return ENOBUFS
  to userland program instead of letting it wait until end of days.

  PR:	kern/85907

Approved by:	re (kensmith)
2005-09-20 13:42:20 +00:00
Gleb Smirnoff 11b02f6e8e Merge locking of ng_pptpgre node. See 1.38, 1.39 log for longer
description.

Approved by:	re (kensmith)
2005-09-20 13:40:55 +00:00
Robert Watson 51a4db9b6e Merge savecore.c:1.76 from HEAD to RELENG_6:
Don't consider being unable to open the bounds file worthy of printing
  at LOG_WARNING by default; instead, consider it something to be printed
  to the tty when 'verbose' mode is set.  This avoids printing out extra
  lines at every boot on a system with crash dumps enabled, but that has
  not yet had to generate a crashdump.

Approved by:	re (kensmith)
2005-09-20 13:29:37 +00:00
Robert Watson 5d5e387e80 Merge dumpon:1.10 from HEAD to RELENG_6:
Use kenv -q to extract dumpdev rather than kenv, in order to avoid
  spamming the console in the event that a loader tunable 'dumpdev'
  isn't defined, which is not a relevant failure to report.

Approved by:	re (kensmith)
2005-09-20 13:28:01 +00:00
Robert Watson 6f7da852da Merge kenv.1:1.12, kenv.c:1.8 from HEAD to RELENG_6:
Add a "-q" quiet flag to kenv so that warnings can be suppressed.

Approved by:	re (kensmith)
2005-09-20 13:26:21 +00:00
Gleb Smirnoff b6286e83fa Suppress warning, to avoid fake bug reports from users of 6.0-RELEASE.
Push warning in net_add_domain() down under DIAGNOSTIC. At the moment, the
only loadable domain is netgraph and it has no problems to be loaded
at runtime, since it doesn't use if_afdata[AF_NETGRAPH], yet.

Approved by:	re (scottl)
2005-09-20 09:16:10 +00:00
Xin LI 120dad7f14 MFC 1.64 by kientzle:
The bsdtar_warnc() reporting function requires the program name to be
set up before it is called, so move the progname initialization before
the first possible call to bsdtar_warnc().

Thanks to: Stanislav Sedov
PR: bin/83366

Approved by:	re (scottl)
2005-09-20 07:48:00 +00:00
Christian Brueffer fb1f6457c3 MFC: rev. 1.886 by joel
New release notes: snd_t4dwave(4) manual page added.

Approved by:	re (hrs)
2005-09-20 04:53:12 +00:00
Christian Brueffer d28f50d4b8 MFC:
Auto generate device listings for snd_t4dwave(4).

Approved by:	re (hrs)
2005-09-20 04:51:32 +00:00
Christian Brueffer 511f3b8fe0 MFC: rev. 1.40 by joel
Xref snd_t4dwave(4).

Approved by:	re (hrs)
2005-09-20 04:49:59 +00:00
Christian Brueffer 1b5c21995f MFC:
Add manual page for snd_t4dwave(4).

Approved by:	re (hrs)
2005-09-20 04:48:30 +00:00
Christian S.J. Peron 9b46f284be MFC v1.129 src/sys/net/rtsock.c
Make sysctl_rtsock MP safe.

Approved by:	re (scottl)
2005-09-20 01:59:54 +00:00
Craig Rodrigues d0bf980be9 MFC: 1.61
Clarify wording for -m flag.

PR:     docs/84704
Approved by:	re (hrs)
2005-09-20 00:34:54 +00:00
Joe Marcus Clarke b7d67367bc MFC:
Correct a mis-merge from HEAD, and make sure the socket permissions are set
to 0666.

Reported by:	delphij via rwatson
Approved by:	re (scottl)
2005-09-19 21:50:31 +00:00
Colin Percival 23d3b80fd7 MFC revision 1.5:
When (re)allocating space for an array of pointers to char, use
  sizeof(*list), not sizeof(**list).  (i.e., sizeof(pointer) rather than
  sizeof(char)).

Approved by:	re (scottl)
2005-09-19 20:56:10 +00:00
Christian Brueffer f57f75b69b MFC:
- ed(4) MPSAFE
- acpi_ibm.4 and acpi_sony.4 manpages added

While here, correct two entities.

Approved by:	re (hrs)
2005-09-19 16:53:59 +00:00
Christian Brueffer 492871e2d8 MFC:
Manpage for the acpi_sony(4) driver.

Approved by:	re (hrs)
2005-09-19 16:51:10 +00:00
Poul-Henning Kamp e0b2ad6b7b MFC:
This bit missed out in the DEVFS MFC earlier today:
	SYSCTL debug.sizeof.cdev moved to relevant source file.

Approved by:	re@ (scottl)
2005-09-18 17:13:17 +00:00
Scott Long 93b84fdf68 MFC rev 1.94:
Fix race condition that caused activation of an event to
  be ignored immediately after it was deactivated.

Submitted by: Stephan Uphoff, Yahoo
Approved by: re
2005-09-18 15:03:31 +00:00
Poul-Henning Kamp 5dc21d2be6 MFC:
Various fixes for DEVFS, in particular "devfs ruleset already running".

Approved by:	re@ (scottl)
2005-09-18 07:10:57 +00:00
Scott Long 30ad9643f0 Switch over to 6.0-BETA5.
Approved by: re
2005-09-18 05:12:39 +00:00
Scott Long cc4a102d2b Take a step closer to the release and turn off malloc debugging.
Approved by: re (implicit)
2005-09-18 03:45:24 +00:00
Scott Long 84e108840b Now that our showstopper list has shrunk, take another step closer to the
release and turn off kernel debugging.  Also turn off SMP on i386 and amd64
and add an SMP kernel config.

Approved by: re (implicit)
2005-09-18 03:37:59 +00:00
Christian S.J. Peron 3db4865aab MFC v1.163 src/sys/kern/imgact_elf.c
MFC v1.82  src/sys/kern/vfs_lookup.c
MFC v1.394 src/sys/kern/vfs_syscalls.c

Approved by:	re (scottl)
2005-09-18 03:31:35 +00:00
Warner Losh 2e0289dfb2 MFC: Merge resource fixes for pci devices on pci0 for ioport.
Approved by: re (scottl)
2005-09-18 02:55:10 +00:00
Matt Jacob c852b22c0f MFC 1.156 (mjacob). Original log:
>Make the exploring of all luns supported by an HBA more of a
>tunable (until we get REPORT LUNS in place).
>
>If we're probing luns, and each probe succeeds, we keep going past
>lun 7 if we're a SCSI3 or better device (until we fail to probe).
>
>If we're probing luns, and a probe fails, we only keep going if
>we're quirked *for* it (CAM_QUIRK_HILUNS), and if we're not quirked
>*against* it (CAM_QUIRK_NOHILUNS), or we're a SCSI3 or better device
>and the tunable (kern.cam.cam_srch_hi) is set non-zero.

Approved by: re (scottl)
2005-09-18 02:29:27 +00:00
Gary W. Swearingen 5fd52474dd MFC 1.21
Approved by:	re
2005-09-17 17:12:18 +00:00
Xin LI b79b245e54 Oops, actually MFC 1.89 (by kan) which was missed in previous commit:
Handle a race condition where NULLFS vnode can be cleaned while threads
can still be asleep waiting for lowervp lock.

Tested by:	kkenn
Discussed with: ssouhlal, jeffr

(this is an early MFC for inclusion in the upcoming 6.0-BETA5)

Approved by:	re (scottl)
2005-09-17 15:51:41 +00:00
Tor Egge 152367c7dd MFC: Break out of loop if next buffer pointer has become invalid while
flushing current buffer.

Approved by:	re (scottl)
2005-09-17 15:51:12 +00:00
Xin LI 4977dd0d18 MFC 1.88 (by ssouhlal):
Use vput() instead of vrele() in null_reclaim() since the lower vnode
is locked.

MFC 1.89 (by kan):

Handle a race condition where NULLFS vnode can be cleaned while threads
can still be asleep waiting for lowervp lock.

Tested by:	kkenn
Discussed with: ssouhlal, jeffr

(rev. 1.89 is an early MFC for inclusion in the upcoming 6.0-BETA5)

Approved by:	re (scottl)
2005-09-17 15:48:05 +00:00
Colin Percival 6f20b87a9a MFC revision 1.3:
Log:
  Handle circular dependencies properly (via errx(3)) rather than dumping
  core.  This bug was made visible by a recent change to the audio/timidity++
  port, which now has itself as a run dependency.

Approved by:	re (scottl)
2005-09-17 15:43:40 +00:00
Gary W. Swearingen dbc55a21e6 MFC 1.25
Approved by: re
2005-09-17 15:27:27 +00:00
Max Laier 2739b1dd10 MFC: if_pfsync.c, 1.23:
Stop leaking a lock.  This used to cause a propagate_priority() page fault
  when setting syncdev and syncpeer.

  Reported by:    Dominic Marks

Approved by:	re (scottl)
2005-09-17 15:19:38 +00:00
Bjoern A. Zeeb c5150c4979 MFC: rev. 1.111
Fix panic when kernel compiled without INET6 by rejecting
IPv6 opcodes which are behind #if(n)def INET6 now.

PR:		kern/85826
Approved by:	re (scottl)
2005-09-17 13:43:36 +00:00
Joseph Koshy f922a16e32 MFC { r1.4, r1.5 "pmcstat_log.c" }
- Determine where the runtime loader got mapped to when a dynamically
   linked process was exec()'ed, and map samples in that address range
   into the appropriate buckets in the runtime loader's profile.

 - Fix a bug that caused generated gmon.out profiles to be out of
   whack.  Use saturating arithmetic when incrementing a bucket.

 - Improve a few comments.

Approved by:	re (scottl)
2005-09-17 13:04:10 +00:00
Brian Somers 68120cecc1 MFC: Add a -h option to tell cmp not to follow symbolic links.
Approved by:	re (scottl)
Sponsored by:	Sophos/ActiveState
2005-09-17 11:33:41 +00:00
Warner Losh 3c4f74e836 MFC: pccard updates
o New APIs to access CIS, attribute memory and pccard registers
o Lock ed driver
o Support more cards in ed, ep, sn, xe
o Use new APIs to get MAC address right more often.

Approved by: re (scottl)
2005-09-17 04:01:05 +00:00
cvs2svn 36c2183039 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-09-17 03:36:48 +00:00
Paul Saab d038f2869c MFC: rev 1.66
Don't allow ioctl commands to be interrupted by the user.

Approved by:	re (scottl)
2005-09-16 18:04:10 +00:00
Paul Saab 273271b835 MFC: rev 1.67
Print the actual disk device we failed to complete i/o on.

Approved by:	re (scottl)
2005-09-16 18:02:38 +00:00
Paul Saab ae94c3b11c MFC:
Ignore mutex asserts when we're dumping as well.  This allows me
to panic a system from DDB when INVARIANTS is compiled into the
kernel on a scsi system.

Approved by:	re (scottl)
2005-09-16 18:01:55 +00:00
Paul Saab d469161bde MFC:
Add support for HP branded 2610SA

Approved by:	re (scottl)
2005-09-16 18:00:59 +00:00
Paul Saab 620a03a2e2 MFC:
There's no reason to check the valence.  This allows ciss to work
on the P600.

Approved by:	re (scottl)
2005-09-16 17:59:48 +00:00
Paul Saab 676adad4d4 MFC: rev 1.283
Remove a KASSERT in the sack path that fails because of a interaction
between sack and a bug in the "bad retransmit recovery" logic. This is
a workaround, the underlying bug will be fixed later.

Approved by:	re (scottl)
2005-09-16 17:58:54 +00:00
Paul Saab 2278db1f16 MFC: rev 1.20
For FreeBSD 4 binaries, when trying to read from a device that does
not exsist, do not have ioctl return an error, but instead set -1
in the data returned to the user.  This allows the HP bios flash
utilities to work without requiring changes to their code.

Approved by:	re (scottl)
2005-09-16 17:58:06 +00:00
Robert Watson a44a9308c4 Merge fifo_vnops.c:1.124 from HEAD to RELENG_6:
Trim down now (believed to be) unused fifo_ioctl() and
  fifo_kqfilter() VOP implementations, since they in theory are used
  only on open file descriptors, in which case the ioctls are via
  fifo_ioctl_f() and kqueue requests are via fifo_kqfilter_f().
  Generate warnings if they are entered for now.  These printf()
  calls should become panic() calls.

  Annotate and re-implement fifo_ioctl_f(): don't arbitrarily
  forward ioctls to the socket layer, only forward the ones we
  explicitly support for fifos.  In the case of FIONREAD, don't
  forward the request to the write socket on a read-write fifo, or
  the read result is overwritten.  Annotate a nasty case for the
  undefined POSIX O_RDWR on fifos, in which failure of the second
  ioctl will result in the socket pair being in an inconsistent
  state.

  Assert copyright as I find myself rewriting non-trivial parts of
  fifofs.

Approved by:	re (scottl)
2005-09-16 14:03:57 +00:00
Robert Watson fbdf9a0e9c Merge fifo_vnops.c:1.122 from HEAD to RELENG_6:
Annotate two issues:

  1) fifo_kqfilter() is not actually ever used, it likely should be GC'd.

  2) fifo_kqfilter_f() doesn't implement EVFILT_VNODE, so detecting events
     on the underlying vnode for a fifo no longer works (it did in 4.x).
     Likely, fifo_kqfilter_f() should forward the request to the VFS using
     fp->f_vnode, which would work once fifo_kqfilter() was detached from
     the vnode operation vector (removing the fifo override).

  Discussed with: phk

Approved by:	re (scottl)
2005-09-16 14:03:10 +00:00
Robert Watson 68128f5309 Merge fifo_vnops.c:1.123 from HEAD to RELENG_6:
As a result of kqueue locking work, socket buffer locks will always
  be held when entering a kqueue filter for fifos via a socket buffer
  event: as such, assert the lock unconditionally rather than acquiring
  it conditionally.

Approved by:	re (scottl)
2005-09-16 13:36:44 +00:00
Robert Watson 02ac96f910 Merge fifo_vnops.c:1.121 from HEAD to RELENG_6:
Introduce no-op nosup fifo kqueue filter and detach routine, which are
  used when a read filter is requested on a write-only fifo descriptor, or
  a write filter is requested on a read-only fifo descriptor.  This
  permits the filters to be registered, but never raises the event, which
  causes kqueue behavior for fifos to more closely match similar semantics
  for poll and select, which permit testing for the condition even though
  the condition will never be raised, and is consistent with POSIX's notion
  that a fifo has identical semantics to a one-way IPC channel created
  using pipe() on most operating systems.

  The fifo regression test suite can now run to completion on HEAD without
  errors.

Approved by:	re (kensmith)
2005-09-15 20:53:56 +00:00
Robert Watson 1eafbfb990 Merge if.c:1.246 from HEAD to RELENG_6:
In netkqfilter(), return EINVAL instead of 1 (EPERM) when a filter type
  is requested on a network interface file descriptor that is
  non-applicable.

Approved by:	re (kensmith)
2005-09-15 20:53:22 +00:00
Robert Watson 835b028cc0 Merge vfs_subr.c:1.646 from HEAD to RELENG_6:
In vfs_kqfilter(), return EINVAL instead of 1 (EPERM) when an unsupported
  kqueue filter type is requested on a vnode.

Approved by:	re (kensmith)
2005-09-15 20:52:53 +00:00
Robert Watson c5242a9ef0 Merge fifo_vnops.c:1.120 from HEAD to RELENG_6:
When a request is made to register a filter on a fifo that doesn't
  apply to the fifo (i.e., not EVFILT_READ or EVFILT_WRITE), reject
  it as EINVAL, not by returning 1 (EPERM).

Approved by:	re (kensmith)
2005-09-15 20:50:31 +00:00
Robert Watson 6134bc6715 Merge fifo_vnops.c:1.119 from HEAD to RELENG_6:
Remove DFLAG_SEEKABLE from fifo file descriptors: fifos are not seekable
  according to POSIX, not to mention the fact that it doesn't make sense
  (and hence isn't really implemented).  This causes the fifo_misc
  regression test to succeed.

Approved by:	re (scottl)
2005-09-15 20:50:04 +00:00
Robert Watson d9e9ffdd83 Merge fifo_vnops.c:1.118 from HEAD to RELENG_6:
Only poll the fifo for read events if the fifo is attached to a readable
  file descriptor.  Otherwise, the read end of a fifo might return that it
  is writable (which it isn't).

  Only poll the fifo for write events if the fifo attached to a writable
  file descriptor.  Otherwise, the write end of a fifo might return that
  it is readable (which it isn't).

  In the event that a file is FREAD|FWRITE (which is allowed by POSIX, but
  has undefined behavior), we poll for both.

Approved by:	re (kensmith)
2005-09-15 20:28:56 +00:00
Robert Watson 0b4dff3760 Merge fifo_vnops.c:1.117 from HEAD to RELENG_6:
After going to some trouble to identify only the write-related events
  to poll the write socket for, the fifo polling code proceeded to poll
  for the complete set of events.  Use 'levents' instead of 'events' as
  the argument to poll, and only poll the write socket if there is
  interest in write events.

Approved by:	re (kensmith)
2005-09-15 20:28:27 +00:00
Robert Watson 723772ac9b Merge fifo_vnops.c:1.116 from HEAD to RELENG_6:
When a writer opens a fifo, wake up the read socket for read, not the
  write socket.

Approved by:	re (kensmith)
2005-09-15 20:27:56 +00:00
Robert Watson 877d85d24c Merge fifo_vnops.c:1.115 from HEAD to RELENG_6:
Add an assertion that fifo_open() doesn't race against other threads
  while sleeping to allocate fifo state: due to using the vnode lock to
  serialize access to a fifo during open, it shouldn't happen (tm).

Approved by:	re (kensmith)
2005-09-15 20:27:25 +00:00
Robert Watson ff954f586c Merge fifo_vnops.c:1.114 from HEAD to RELENG_6:
Rather than reaching into the internals of the UNIX domain socket code
  by calling uipc_connect2() to connect two socket endpoints to create a
  fifo, call soconnect2().

Approved by:    re (kensmith)
2005-09-15 20:26:19 +00:00
John Baldwin 412af1575b MFC: Fixup locking and mark MPSAFE.
Approved by:	re (kensmith)
2005-09-15 19:16:29 +00:00
Joseph Koshy a8d7daf6b7 MFC r1.12:
``Process one NMI interrupt per handler invocation as the processor
  buffers pending NMIs from multiple interrupting PMCs and delivers
  them serially.''

Approved by:	re (kensmith)
2005-09-15 15:48:16 +00:00
Pawel Jakub Dawidek 5a475b87bb MFC: sys/geom/eli/g_eli.c 1.12,1.13
- Don't forget to initialize crp_etype field.

  Reported by:	Nick Evans <[email protected]>

- Fix copy&paste typo.

Approved by:	re (scottl)
2005-09-15 14:17:31 +00:00
Pawel Jakub Dawidek 1e989c625b MFC: sbin/geom/class/eli/geom_eli.c 1.4
Even if there are no valid keys in metadata, but provider is attached
we can still use setkey subcommand.

Found by:	regression tests
Approved by:	re (scottl)
2005-09-15 14:12:54 +00:00
Pawel Jakub Dawidek 90be936c65 MFC: sys/dev/bge/if_bge.c 1.94
When bge_stop() is called from bge_detach(), mii is already NULL, so check
before trying to use it.
This fix allows to 'kldunload if_bge' without panicing.

Reviewed by:	bz
Approved by:	re (scottl)
2005-09-15 14:10:41 +00:00
Marcel Moolenaar 9d9533b68d Mega-MFC:
o  Manpage type fix:
	kgdb/kgdb.1: 1.8

o  Unwind across trapframes:
	kgdb/kgdb.h: 1.3
	kgdb/kthr.c: 1.3
	kgdb/main.c: 1.9
	kgdb/trgt.c: 1.4
	kgdb/trgt_alpha.c: 1.3, 1.4
	kgdb/trgt_amd64.c: 1.3, 1.4, 1.5
	kgdb/trgt_i386.c: 1.3, 1.4, 1.5
	kgdb/trgt_ia64.c: 1.3, 1.4
	kgdb/trgt_sparc64.c: 1.4, 1.5, 1.6
	libgdb/Makefile: 1.10
	libgdb/frame-unwind.diff: 1.1

Approved by: re (scottl)
2005-09-15 05:32:11 +00:00
Marius Strobl 81262e6696 MFC: 1.26
Add gem(4) to the list of devices supporting VLAN-sized frames natively
(since sys/dev/gem/if_gem.c rev. 1.34, MFC'ed in rev. 1.29.2.4).

Approved by:	re (scottl)
2005-09-14 21:26:09 +00:00
Marius Strobl f3aa5b8c36 MFC: 1.34
- Allow for VLAN-sized frames and set IFCAP_VLAN_MTU.
- On resume all registers have to be initialized again like after
  power-on so reset sc_inited in gem_suspend() in order get all of
  the registers set next time gem_init_regs() is called.
- On at least some ERI and GEM revisions GEM_MAC_RX_OVERFLOW happen
  often due to a silicon bug and re-initializing is all we can do
  about these errors so make handling them non-verbose.
- Remove a superfluous memset(3) call in gem_meminit(), all elements
  are initialized to 0 anyway.

Approved by:	re (scottl)
2005-09-14 21:23:50 +00:00
Marius Strobl 96f922a3aa MFC: 1.10
As with NO_CRYPT, don't try to compile geli(8) when NO_OPENSSL is defined
either.

Approved by:	re (scottl)
2005-09-14 21:21:45 +00:00
Xin LI 5611427e69 MFC 1.118:
When padding with zero, do pad after prefixes rather than padding
before prefixes.

Use cases:
	printf("%05d", -42);   -->   "00-42"   (should be "-0042")
	printf("%#05x", 12);   -->   "000xc"   (should be "0x00c")

Submitted by:	Oliver Fromme
PR:		kern/85520
Approved by:	re (kensmith)
2005-09-14 02:45:50 +00:00
Marcel Moolenaar 27c5d6ac5a Mega-MFC: Add SMP support and enable it by default. This includes:
conf/GENERIC: 1.73, 1.53
	ia64/exception.S: 1.57
	ia64/interrupt.c: 1.50, 1.51
	ia64/machdep.c: 1.201, 1.202
	ia64/mp_machdep.c: 1.56, 1.57, 1.58
	ia64/pmap.c: 1.161, 1.162, 1.164, 1.165, 1.166
	ia64/sal.c: 1.15
	ia64/trap.c: 1.114, 1.115
	ia64/vm_machdep.c: 1.91, 1.92
	include/ia64_cpu.h: 1.20
	include/param.h: 1.21
	include/pmap.h: 1.25
	include/proc.h: 1.15
	include/smp.h: 1.10

Approved by: re (kensmith, scottl -- thanks!)
2005-09-13 21:07:14 +00:00
Marcel Moolenaar 17e767d722 MFC 1.20: Remove the execute permission for stacks.
Approved by: re (blanket)
2005-09-13 20:54:00 +00:00
Andrew Thompson 8c632c4ab0 MFC: if_bridge.c, r1.21; if_ethersubr.c, r1.198; in6_ifattach.c, r1.28;
nd6.c, r1.55; nd6_nbr.c, r1.33

> Add support for multicast to the bridge and allow inet6 addresses to be
> assigned to the interface.
>
> IPv6 auto-configuration is disabled. An IPv6 link-local address has a
> link-local scope within one link, the spec is unclear for the bridge case and
> it may cause scope violation.
>
> An address can be assigned in the usual way;
>   ifconfig bridge0 inet6 xxxx:...
>
> Tested by:      bmah
> Reviewed by:    ume (netinet6)
> Approved by:    mlaier (mentor)

Approved by:	re (kensmith), mlaier (mentor)
2005-09-13 18:02:39 +00:00
Joseph Koshy f82948b38a MFC r1.9: Improve an error message.
Approved by:	re (kensmith)
2005-09-13 15:23:26 +00:00
Gleb Smirnoff 9f79477875 MFC 1.141:
- Do not hold route entry lock, when calling arprequest(). One such
    call was introduced by me in 1.139, the other one was present before.
  - Do all manipulations with rtentry and la before dropping the lock.
  - Copy interface address from route into local variable before dropping
    the lock. Supply this copy as argument to arprequest().

  (LOR Ids in original commit message.)

Approved by:	re (scottl)
2005-09-13 14:37:58 +00:00
Maxim Konovalov 8b2590702c MFC rev. 1.10: postpone a temporary file creation until we realize
if ipfw(4) ever used.

Approved by:	re (scottl)
2005-09-13 14:34:11 +00:00
Andre Oppermann 1a5be58d46 MFC rev. 1.233: Fix ICMP_UNREACH_NEEDFRAG case where no MTU was proposed
in the ICMP reply.

PR:             kern/81813
Submitted by:   Vitezslav Novy <vita at fio.cz>
Approved by:	re (kensmith)
2005-09-13 13:56:22 +00:00
Gleb Smirnoff 579f8c6e5f MFC 1.7:
Plug item leak in case when not all hooks are connected.

  Found by:	David Vos <david.vos gmail.com>

Approved by:	re (kensmith)
2005-09-13 12:44:19 +00:00
Gleb Smirnoff 8deb7fdc66 MFC 1.68 by obrien:
Fix missing '=' in structure initialization.

Approved by:	re (kensmith)
2005-09-13 12:43:15 +00:00
Gleb Smirnoff a0bef1d046 MFC 1.26 by ru:
Fixed parsing of unsigned integers.

Approved by:	re (kensmith)
2005-09-13 12:41:05 +00:00
Peter Grehan 5ba5244e24 MFC 1.3
Comment out ofw_console 'screen' entry and zs tty entries.
   The OpenFirmware console isn't used on real systems anymore and
   I never get to multi-user mode in psim. There are problems with
   zs that need to be resolved before these lines can be enabled.

   This eliminates disconcerting warnings on boot.

Approved by:	re (Ken Smith)
2005-09-13 05:59:07 +00:00
Peter Grehan ee4c283cac MFC r1.101
Fix boot-time hang/panic on G3 systems when modifying IBAT0 in
  pmap_bootstrap by using the sync;isync big hammer to make sure
  all prior operations have completed.

  Reported by:    Nathan Whitehorn <nathan at uchicago edu>

Approved by:	re (Ken Smith)
2005-09-13 05:11:37 +00:00
Maksim Yevmenkin 328d870b71 MFC to RELENG_6
Fix typo in usage

Submitted by:	Jonatan B <onatan at gmail dot com>
Approved by:	re (scottl)
2005-09-12 16:09:23 +00:00
Tor Egge 860f0d7fd4 MFC: Giant is no longer needed here.
Approved by:	re (scottl)
2005-09-12 15:56:07 +00:00
Tor Egge fb52fe2f49 MFC: Don't retry when vget() returns ENOENT in the nonblocking case due to
the vnode being doomed.  It causes a livelock.

Approved by:	re (scottl)
2005-09-12 15:53:58 +00:00
Gleb Smirnoff 173f934083 MFC 1.112:
Fix an item leak, that happens when some node calls ng_callout() two
  times consequently, without checking whether callout has been serviced
  or not. (ng_pptpgre and ng_ppp were catched in this behavior).

    - In ng_callout() save old item before calling callout_reset(). If the
      latter has returned 1, then free this item.
    - In ng_uncallout() clear c->c_arg.

  Problem reported by:    Alexandre Kardanev

Approved by:	re (kensmith)
2005-09-12 14:46:19 +00:00
Gleb Smirnoff fa7329a6e3 MFC:
Make callout_reset() return a non-zero value if a pending callout
  was rescheduled. If there was no pending callout, then return 0.

  Reviewed by:    iedowse, cperciva

Approved by:	re (kensmith)
2005-09-12 13:43:34 +00:00
Gleb Smirnoff bbcb3f4bab MFC 1.33:
Change default KTR_COMPILE from KTR_GEN to KTR_ALL, to match with
  manual page.

  Reviewed by:    jhb, pjd

Approved by:	re (kensmith)
2005-09-12 13:39:47 +00:00
Gleb Smirnoff b7d317fd8a MFC 1.31:
When a carp(4) interface is being destroyed and is in a promiscous mode,
  first interface is detached from parent and then bpfdetach() is called.
  If the interface was the last carp(4) interface attached to parent, then
  the mutex on parent is destroyed. When bpfdetach() calls if_setflags()
  we panic on destroyed mutex.

  To prevent the above scenario, clear pointer to parent, when we detach
  ourselves from parent.

Approved by:	re (kensmith)
2005-09-12 13:37:56 +00:00
Max Laier 8870017ad5 Commit imported changes to RELENG_6:
pf_ioctl.c Revision 1.153 Sun Aug 7 11:37:33 2005 UTC by dhartmei
 | verify ticket in DIOCADDADDR, from Boris Polevoy, ok deraadt@

 pf_ioctl.c Revision 1.158 Mon Sep 5 14:51:08 2005 UTC by dhartmei
 | in DIOCCHANGERULE, properly initialize table, if used in NAT rule.
 | from Boris Polevoy <vapcom at mail dot ru>, ok mcbride@

 pf.c Revision 1.502 Mon Aug 22 11:54:25 2005 UTC by dhartmei
 | when nat'ing icmp 'connections', replace icmp id with proxy values
 | (similar to proxy ports for tcp/udp). not all clients use
 | per-invokation random ids, this allows multiple concurrent
 | connections from such clients.
 | thanks for testing to Rod Whitworth, "looks ok" markus@

 pf.c Revision 1.501 Mon Aug 22 09:48:05 2005 UTC by dhartmei
 | fix rdr to bitmask replacement address pool. patch from Max Laier,
 | reported by Boris Polevoy, tested by Jean Debogue, ok henning@

Approved by:	re (scottl)
2005-09-12 11:25:17 +00:00
Scott Long d6c475c21b MFC rev 1.13 of c-decl.c. A nice side effect is that it's once again
possible to compile a HEAD kernel in a RELENG_6 world via the normal
shortcuts.

Approved by: re
2005-09-12 10:22:53 +00:00
Robert Watson 398ed1d1a6 Merge umask.2:1.13 from HEAD to RELENG_6:
Add mkfifo(2) to the man page SEE ALSO list for umask(2) -- it's
  mentioned in the description.

Approved by:	re (hrs)
2005-09-12 09:19:25 +00:00
Matt Jacob 9a1de60e77 MFC: Restore the 929X support that got nuked in merge
Approved by: re
2005-09-12 05:25:29 +00:00
Warner Losh 02b249d28d Change the default of pci_do_powerstate to 0, per request from re@.
The number of raid controllers that violate the WHQL seems to be
growing in number and not isolated to old versions as previously
thought.  Though the numbers of these seen in the wild is still
relatively small, they hang the system when parts of their devices are
powered down.  The one area that these parts appear often are in the
higher end servers.  As such, be conservative about powering down
devices that have no driver attached by default.  Until a better
approach is proven in current, this is the prudent choice.

Laptop users wishing the benefits of powering down devices with no
drivers will now need to set hw.pci.do_powerstate=1 in their
/boot/loader.conf file.  Some users will have devices that will
prevent this setting (hence the need to make it default 0).

Approved by: re@ (scottl)
2005-09-11 19:28:30 +00:00
Don Lewis 6cfe78e1fc MFC src/sys/gnu/fs/ext2fs/fs.h 1.18
src/sys/kern/kern_shutdown.c	1.175
	src/sys/sys/buf.h 		1.189

  Modified files:
    sys/gnu/fs/ext2fs    fs.h
    sys/kern             kern_shutdown.c
    sys/sys              buf.h
  Log:
  Add a new struct buf flag bit, B_PERSISTENT, and use it to tag
  struct bufs that are persistently held by ext2fs.  Ignore any buffers
  with this flag in the code in boot() that counts "busy" and dirty
  buffers and attempts to sync the dirty buffers, which is done before
  attempting to unmount all the file systems during shutdown.

  This fixes the problem caused by any ext2fs file systems that are
  mounted at system shutdown time, which caused boot() to give up on
  a non-zero number of buffers and skip the call to vfs_unmountall().
  This left all the mounted file systems in a dirty state and caused
  them to all require cleanup by fsck on reboot.

  Move the two separate copies of the "busy" buffer test in boot()
  to a separate function.

  Nuke the useless spl() stuff in the ext2fs ULCK_BUF() macro.

  Bring the PRINT_BUF_FLAGS definition in sys/buf.h up to date with
  this and previous flag changes.

  PR:             kern/56675, kern/85163
  Tested by:      "Matthias Andree" matthias.andree at gmx.de
  Reviewed by:    bde
  MFC after:      3 days

PR:		kern/56675, kern/85163
Tested by:	"Hanspeter Roth" hampi at rootshell.be
Tested by:	"Matthias Andree" matthias.andree at gmx.de
Reviewed by:	bde
Approved by:	re (scottl)
2005-09-11 19:06:50 +00:00
David E. O'Brien 0a5194d50f MFC the license files.
Approved by:	re(scottl)
2005-09-11 18:46:33 +00:00
cvs2svn 27e55f5031 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-09-11 17:50:21 +00:00
Yaroslav Tykhiy eba54cda2e MFC rev. 1.263:
Reflect a recent change in /etc/rc.subr that made ``-M''
  appear in tmpmfs and varmfs default flags explicitly.
  Explain why -M is good for these file systems (it maximizes
  performance and makes the system more stable at low memory
  conditions by reducing the chance of thrashing.)

  Bump .Dd accordingly.

Approved by:	re (hrs)
2005-09-11 17:24:49 +00:00
Dag-Erling Smørgrav be4cc68444 Upgrade to 4.2p1.
Approved by:	re (kensmith)
2005-09-11 16:50:37 +00:00
Brooks Davis 2451497381 Sync network interface startup code with HEAD.
etc/network.subr: 1.165-1.167
 - kill removable_interfaces
 - add NOAUTO keyword
 - fix quoted entries in ifconfig_<ifn> variables
 - always up the interface
 - if ifconfig_<ifn> is defined, but empty, don't set it to
   ifconfig_DEFAULT
 - always configure lo0 first if it exists
etc/pccard_ether: 1.46
 - kill removable_interfaces
 - add NOAUTO keyword
etc/rc.d/netif: 1.15-1.17
 - block Ctrl-C in dhclient
 - minor cleanup of the interface list generation code

Approved by:	re (scottl)
Requested by:	many (death to removable_interfaces!)
2005-09-10 17:05:04 +00:00
Brooks Davis ebd0446134 MFC 1.43 and 1.44:
- Add new template sources to keep /conf more organized.

Approved by:	re (scottl)
2005-09-10 17:02:45 +00:00
Brooks Davis c6fdfded4b Sync dhclient with HEAD with exception of bpf.c:1.5.
sbin/dhclient/*.c:
 - add __FBSDID
sbin/dhclient/conflex.c: 1.3-1.4
 - fix a minor buffer overflow in config parsing
 - actually support backslash escaping in config files
bin/dhclient/dhclient-script: 1.6-1.10
 - don't create or remove routes to our address through 127.0.0.1
 - improved detection of the interface of the default route
 - support quotes in the medium string
 - clear interface state more effectively on failure
 - don't update resolv.conf when unchanged
bin/dhclient/dhclient.c: 1.10-1.11
 - validate domain-name (used as resolv.conf search string)
 - handle superseded subnet-mask correctly

Approved by:	re (scottl)
2005-09-10 17:01:16 +00:00
Christian Brueffer b0d4cfb03f MFC: rev. 1.3 by tjr
Add HISTORY section.

Requested by:	pav
Approved by:	re (hrs)
2005-09-10 14:10:52 +00:00
Doug Barton 5a70a0d0b8 MFC 1.22 which removes the IP6.INT example per RFC 4159
Approved by:	re (scottl)
2005-09-10 08:27:27 +00:00
Christian S.J. Peron 47c3af75ee MFC md.c rev 1.154
MFC mdconfig.c rev 1.44

Dont allow read only backing stores to be modified

PR:		kern/84635
Approved by:	re (kensmith)
2005-09-09 21:39:47 +00:00
Andrew Thompson b6c79e3595 MFC: if_bridge.4, r1.7
> Clarify that any firewall that has pfil(9) hooks can be used.
>
> Suggested by:   sam

Approved by:	re (hrs), mlaier (mentor)
2005-09-09 08:47:26 +00:00
Gleb Smirnoff 174b442d4b MFC 1.57 (see original revision for full description):
- in ng_ksocket_incoming2() clear m_nextpkt on all mbufs
    read from socket.
  - restore rev. 1.54 change in ng_ksocket_incoming().

  PR:		kern/84952
  PR:		kern/82413
  In collaboration with:	rwatson

Approved by:	re (scottl)
2005-09-09 06:13:25 +00:00
Gleb Smirnoff d1f522da30 MFC 1.109:
Raise one more bit in READER_MASK. I believe that before this change
  it was possible to have 1 reader and 1 writer thread working on
  a node simultaneously.

  Reviewed by:	julian

Approved by:	re (scottl)
2005-09-09 06:08:07 +00:00
Gleb Smirnoff b37287d484 MFC 1.108, 1.110, 1.111:
Use non-debug macros inside debugging functions, to prevent
  important information from being rewritten.

  In INVARIANTS case also check that nodes do not pass queues of mbufs
  each other.

Approved by:	re (scottl)
2005-09-09 06:06:51 +00:00
Sam Leffler 7b061101fd MFC 1.110: clear lock on error in O_LIMIT case of install_state
Approved by:	re (scottl)
2005-09-08 22:49:23 +00:00
Sam Leffler 7569b38481 MFC 1.245: reclaim sbuf and clear lock on error in ifconf
Approved by:	re (scottl)
2005-09-08 22:43:10 +00:00
Warner Losh fb3a75b590 MFC: 1.188 and 1.189 remove bogus counter to allow ore than one card
to work in the system.

Approved by: re@ (scottl)
2005-09-08 17:51:24 +00:00
R. Imura b11c39e748 MFC 1.12: Fix panic on sparc64 caused by touching uninitialized address.
Approved by:	re (scottl)
2005-09-08 15:48:35 +00:00
R. Imura 68ba4fe4a1 MFC: check capable size of given strings correctly.
1.4 src/contrib/smbfs/lib/smb/kiconv.c
  1.2 src/lib/libkiconv/xlat16_sysctl.c
  1.11 src/sys/libkern/iconv.c

Approved by:	re (scottl)
2005-09-08 15:46:38 +00:00
Craig Rodrigues 6038f5e826 MFC:
scmouse.c, 1.39:  In set_mouse_pos(), try to avoid division by zero errors.

  scvidctl.c, 1.36:
	In sc_set_text_mode(), reset fontwidth if it is <= 0.
	Eliminates division by zero errors in syscons driver.

Approved by:	re (scottl)
2005-09-07 22:58:59 +00:00
Gary W. Swearingen 7adcfc967d MFC: Added a sentence to explain what "span" means.
PR:             docs/84850
Approved by:    re
2005-09-07 16:41:51 +00:00
Gary W. Swearingen e7fe45634c MFC: Improved descriptions of block size handling.
PR:             docs/84765
Approved by:    re
2005-09-07 16:29:11 +00:00
Gary W. Swearingen 660164f5a2 Added ENVIRONMENT section (PAGER, MANPATH, etc.).
PR:             docs/84485
Approved by:    re
2005-09-07 16:20:13 +00:00
Colin Percival 059d1f1f4c MFC: Correct insecure temporary file usage.
Security:	FreeBSD-SA-05:20.cvsbug
Approved by:	re (scottl)
2005-09-07 13:43:05 +00:00
Tor Egge bb05ec5d9d MFC: Retain generation count when writing zeroes instead of an inode to disk.
Don't free a struct inodedep if another process is allocating saved
     inode memory for the same struct inodedep in
     initiate_write_inodeblock_ufs[12]().

     Handle disappearing dependencies in softdep_disk_io_initiation().

Approved by:	re (scottl)
2005-09-07 00:03:38 +00:00
Marcel Moolenaar 523089d6dd Sync with HEAD:
Makefile: 1.7
	add.c: 1.12, 1.23
	create.c: 1.11
	destroy.c: 1.6
	gpt.8: 1.14, 1.15
	gpt.c: 1.11, 1.12, 1.13
	gpt.h: 1.8, 1.9, 1.10
	label.c: 1.1
	map.c: 1.6
	map.h: 1.6
	migrate.c: 1.14, 1.15, 1.16
	recover.c: 1.8
	remove.c: 1.5, 1.6, 1.7, 1.8
	show.c: 1.12, 1.13
o  New -l and -u options to the show command,
o  New label command to support GPT labels,
o  The remove command doesn't print the total partitions removed,
   as it prints each partition it removes by name already,
o  Added ellipsis to most usage messages.

PR: ia64/83124
Approved by: re (scottl)
2005-09-06 23:59:01 +00:00
Christian Brueffer a32239c8ab MFC: update release notes:
- VIA PadLock support
- GEOM_ELI added
- de, my, pcn, sf MPSAFE

Approved by:	re (hrs)
2005-09-06 21:15:57 +00:00
Nate Lawson d78723b7db MFC: ignore non-useful cpufreq levels and change the powerd algorithm to
one that saves more power with possibly more performance loss.  This is
kern_cpu.c:1.20,1.21 and powerd.c:1.9

Approved by:	re (scottl)
2005-09-06 18:01:44 +00:00
Warner Losh edb882636e MFC: 1.293 1.294: Treat resources that are 0xfffxxxx as being unassigned
like we treat 0.

Approved by: re@ (scottl)
2005-09-05 18:04:33 +00:00
Poul-Henning Kamp 68103aa3b0 MFC:
missing dev_relthread() call.

Approved by:	re@ (scottl)
2005-09-05 11:02:30 +00:00
Scott Long d5c1c03d40 Prepare for BETA4 builds.
Approved by: re
2005-09-04 05:07:06 +00:00
Sam Leffler 667d62894f MFC 1.28: use media type to recognize eth+802.11 network interfaces
instead of doing a regex on device names

Approved by:	re (scottl)
2005-09-03 22:49:22 +00:00
Sam Leffler 67320dafb3 sync with HEAD for net80211 changes:
o list mac support
o update manual page

Approved by:	re (scottl)
2005-09-03 22:47:47 +00:00
Sam Leffler cdb627afdd sync with HEAD after net80211 changes:
o ic_curchan
o beacon/listen interval split
o split tx+rx crypto key and h/w key index -> node mapping support

Also for ath:
o correct duration calculation when protection is enabled

Also for wi:
o handle all-zero mac address properly
o fix media status handling so devd recognizes cards on insert

Also for ipw/iwi:
o always include statistics sysctls (was only when compiled w/ debugging)
o honor manual roaming setting

Also for ral/ural:
o fix basic rate set
o fix IFS parameters
o honor operating mode when selecting ack rate
o honor manual roaming setting

Approved by:	re (scottl)
2005-09-03 22:46:43 +00:00
Sam Leffler 189d85f27b sync with HEAD:
o add ic_curchan to resolve issues with what the "current channel" is
o split beacon and listen interval
o fixup mac acl support so you can query state
o split h/w tx+rx key indices in crypto state
o add optional h/w key index -> node mapping
o change default key index allocator to DTRT for legacy parts
  that are WPA capable
o define typedef for a h/w key index
o fix race on node refcnt handling with sending probe response frames
o isolate scanning-related input handling to reduce diffs against
  future scanning code
o sanity check beacon interval in recv'd management frames and
  discard frames with out-of-range data
o fix refcnt race sending null data frames
o lock ioctl to get sta info
o fix misc races in ap mode sta state teardown

Approved by:	re (scottl)
2005-09-03 22:40:02 +00:00
Suleiman Souhlal ba11b2a1a7 MFC r1.643:
Fix a typo in vop_rename_pre() where we ended up using vholdl()
  instead of vhold(), even though the vnode interlock is unlocked.

Approved by:	re (scottl)
2005-09-03 19:01:13 +00:00
Sam Leffler a0128e885c MFC 1.8: correct alignment of addresses passed to ether_ntoa to
fix segfaults on amd64

Approved by:	re (scottl)
2005-09-03 17:45:54 +00:00
Hajimu UMEMOTO 4dbeead5f0 MFC 1.74: SADB_UPDATE did not return an error when key length is invalid.
Approved by:	re (scottl)
2005-09-03 16:13:05 +00:00
Pawel Jakub Dawidek b70af692ed MFC: sys/dev/md/md.c 1.155
- Add md_mtx lock to protect ID number and list of devices.
- Always check mdnew() return value, as even in !autounit case
  kthread_create() can fail.

Those two changes fix serval panics provoked by simple stress test.

Tested by:	Kris The BugMagnet
Approved by:	re (scottl)
2005-09-03 16:02:37 +00:00
Pawel Jakub Dawidek 6de6c83977 MFC: sys/kern/vfs_syscalls.c 1.393
In case of mac_check_vnode_rename_from() or vn_start_write() failure,
vn_finished_write() should not be called.

Reviewed by:	ssouhlal
Approved by:	re (scottl)
2005-09-03 15:57:04 +00:00
Joseph Koshy 9808e3310e MFC: { db_trace.c:1.69, exception.S:1.127, genassym.c:1.156, trap.c:1.290 }
- Special-case NMI handling on the AMD64.

  On entry or exit from the kernel the 'alltraps' and 'doreti' the code
  used by normal traps disables interrupts to protect the critical sections
  where it is setting up %gs.

  This protection is insufficient in the presence of NMIs since NMIs
  can be taken even when the processor has disabled normal interrupts.
  Thus the NMI handler needs to actually read MSR_GBASE on entry to
  the kernel to determine whether a swap of %gs using 'swapgs' is
  needed.  However, reads of MSRs are expensive and integrating this
  check into the 'alltraps'/'doreti' path would penalize normal
  interrupts.

- Teach DDB about the 'nmi_calltrap' symbol.

Reviewed by:	bde, peter (an older version) and ups
Approved by:	re (scottl)
2005-09-03 11:57:28 +00:00
Brian Somers b2bd23c95a MFC: If we fail in chown(2), try to just change the group and continue on to
change the permissions.  Failures are still recorded.

Approved by:	re (scottl)
Sponsored by:	Sophos/ActiveState
2005-09-03 11:04:25 +00:00
cvs2svn 5e1bf608fc This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-09-03 06:59:35 +00:00
Maksim Yevmenkin b6d7001810 MFC to RELENG 6
Fix dangling callout problem in the Bluetooth L2CAP code that leads to
panic. The panic happens when outgoing L2CAP connection descriptor is
deleted with the L2CAP command(s) pending in the queue. In this case when
the last L2CAP command is deleted (due to cleanup) and reference counter
for the L2CAP connection goes down to zero the auto disconnect timeout
is incorrectly set. pjd gets credit for tracking this down and committing
bandaid.

Reported by:	Jonatan B <onatan at gmail dot com>
Approved by:	re (scottl)
2005-09-03 03:34:23 +00:00
Don Lewis ba24479812 MFC vfs_subr.c 1.636 and 1.642
vfs_subr.c 1.642 fixes a small race condition in vlrureclaim() and depends
on 1.636.

  Modified files:
    sys/kern             vfs_subr.c
  Log:
   - Allow vnlru to drop giant if the filesystem does not require it.  The
     vnlru proc is extremely inefficient, potentially iteration over tens of
     thousands of vnodes without blocking.  Droping Giant allows other threads
     to preempt us although we should revisit the algorithm to fix the runtime
     problems especially since this may hold up all vnode allocations.
   - Remove the LK_NOWAIT from the VOP_LOCK in vlrureclaim.  This provides
     a natural blocking point to help alleviate the situation described above
     although it may not technically be desirable.
   - yield after we make a pass on all mount points to prevent us from
     blocking other threads which require Giant.

  MFC after:      2 weeks

  Revision  Changes    Path
  1.636     +11 -2     src/sys/kern/vfs_subr.c

  Modified files:
    sys/kern             vfs_subr.c
  Log:
  Back out the removal of LK_NOWAIT from the VOP_LOCK() call in
  vlrureclaim() in vfs_subr.c 1.636  because waiting for the vnode
  lock aggravates an existing race condition.  It is also undesirable
  according to the commit log for 1.631.

  Fix the tiny race condition that remains by rechecking the vnode
  state after grabbing the vnode lock and grabbing the vnode interlock.

  Fix the problem of other threads being starved (which 1.636 attempted
  to fix by removing LK_NOWAIT) by calling uio_yield() periodically
  in vlrureclaim().  This should be more deterministic than hoping
  that VOP_LOCK() without LK_NOWAIT will block, which may not happen
  in this loop.

  Reviewed by:    kan
  MFC after:      5 days

  Revision  Changes    Path
  1.642     +37 -7     src/sys/kern/vfs_subr.c

Approved by:	re (scottl)
2005-09-03 00:21:55 +00:00
Simon L. B. Nielsen 06e485a4d5 MFC rev 1.8:
Correct a comment to match the configuration parameter it describes.

Approved by:	re (scottl)
2005-09-02 19:10:14 +00:00
Craig Rodrigues dec095fca8 MFC:
Prevent division by zero errors in sc_mouse_move()
  by explicitly setting sc->font_width, in the same
  places where sc->font_size is set, instead of
  relying on the default initialized value of 0 for sc->font_width.

PR:             kern/84836
Reported by:    Andrey V. Elsukov <bu7cher at yandex dot ru>
Approved by:	re (scottl)
2005-09-02 15:31:03 +00:00
Gleb Smirnoff 19704ecf7e MFC 1.8, 1.9:
- Correctly parse output, when logging amount is limited in the
    rule itself, not in verbose_limit sysctl. [1]
  - Do check rules, even if verbose_limit is set 0. Rules may have
    their own log limits.

  PR:		conf/77929
  Submitted by:	Andriy Gapon [1]
  Reviewed by:	matteo

Approved by:	re (scottl)
2005-09-02 14:13:16 +00:00
Gleb Smirnoff 7e20345f51 MFC: net.graph.ngqfreemax has been deprecated.
Approved by:	re (scottl)
2005-09-02 14:08:19 +00:00
Gleb Smirnoff eb7b53adc9 Merge 1.82:
Fix fallout from revision 1.77, mark outgoing packets with M_VLANTAG flag.

  PR:		kern/80646
  Reviewed by:	yar

Approved by:	re (scottl)
2005-09-02 14:06:26 +00:00
Gregory Neil Shapiro f10ce9f2b1 MFC: Be sure to execute sendmail_precmd() to check sendmail.cf conflicts and
rebuild the aliases file if necessary.

     Revision  Changes    Path
     1.15      +1 -0      src/etc/rc.d/sendmail

Approved by:	re (scottl)
2005-09-02 03:53:10 +00:00
Craig Rodrigues 7e123d5bb7 MFC 1.29, 1.30:
Rewrite linux_ifconf() to be more like ifconf() in net/if.c
  so that we do not call uiomove() while IFNET_RLOCK() is held.
  This eliminates the witness warning:

  Calling uiomove() with the following non-sleepable locks held:
  exclusive sleep mutex ifnet r = 0 (0xc096dd60) locked @
  /usr/src/sys/modules/linux/../../compat/linux/linux_ioctl.c:2170

Approved by:	re (scottl)
2005-09-02 03:52:28 +00:00
Gregory Neil Shapiro cb1857f965 Clean up duplicate entry for sendmail.
Approved by:	re (scottl)
2005-09-02 03:52:11 +00:00
Craig Rodrigues a6db4d4a04 MFC 1.5:
Add __BEGIN_DECLS/__END_DECLS so that this header can be included in C++
programs.  Also, add include guards.

PR:             bin/44277
Submitted by:   Alex Zepeda <freebsd at blarf dot homeip dot net>
Approved by:	re (scottl)
2005-09-02 03:16:30 +00:00
Craig Rodrigues 66450a4526 MFC: 1.380
FDOPT_NORETRY is an option, and must be compared with fd->options,
 not fd->flags.

PR:             kern/85481
Submitted by:   Lev Levinson <llevinson at inbox dot ru>
Approved by:	re (ken)
2005-09-02 00:33:30 +00:00
Philip Paeps 534ff3c5fe MFC: r1.6 - Fix unhandled malloc errors.
Approved by:	re (kensmith)
2005-09-01 13:52:12 +00:00
Warner Losh 0dd92f5a6e MFC: Allow one to override {CAP,PWD}_MKDB_ENDIAN from the command line.
Approved by: re@ (scottl)
2005-09-01 01:24:42 +00:00
Gleb Smirnoff 430f3c96f2 MFC 1.28:
- Document the fact that the real length of listen queue is 1.5 more
    than the value of backlog argument.
  - Document the fact that a subsequent listen(2) calls on the listening
    socket change the backlog argument.
  - Note that current listen queue lengths can be queried using netstat(1).

  Submitted by:   Igor Sysoev <is rambler-co.ru>
  Wording by:     gnn

Approved by:	re (kensmith)
2005-08-31 14:01:48 +00:00
Gleb Smirnoff 140be5f59b MFC 1.21:
Add newline to debuging printf.

  PR:             kern/85271
  Submitted by:   Simon Morgan

Approved by:	re (kensmith)
2005-08-31 13:58:28 +00:00
Giorgos Keramidas 85b09f5253 MFC 1.23:
Make it clear that the .ko extention of a module to be loaded
is optional.

Approved by:	re (hrs)
2005-08-31 13:57:37 +00:00
Gleb Smirnoff 6f0d645dea MFC 1.76:
- Refuse hashsize of 0, since it is invalid.
  - Use defined constant instead of 512.

Approved by:	re (kensmith)
2005-08-31 13:56:15 +00:00
Craig Rodrigues 783092a047 MFC: VOP_LISTEXTATTR.9, 1.7
Update man page to reflect the fact that VOP_LISTEXTATTR
  does not return a list of ASCII NUL terminated strings.
  Instead, a list of attribute names is returned, where each
  list entry consists of one byte for the name length, followed
  by the name, without a terminating ASCII NUL.
  This in similar to change 1.17 to extattr_get_file.2

Reviewed by:	rwatson, ru
Approved by:	re (hrs)
2005-08-31 00:27:35 +00:00
Andrew Thompson 261a2a1675 MFC: if_bridge, r1.20
> Fix a panic in softclock() if the interface is destroyed with a bpf consumer
> attached.
>
> This is caused by bpf_detachd clearing IFF_PROMISC on the interface which does
> a SIOCSIFFLAGS ioctl. The problem here is that while the interface has been
> stopped, IFF_UP has not been cleared so IFF_UP != IFF_DRV_RUNNING, this causes
> the ioctl function to init() the interface which resets the callouts.
>
> The destroy then completes and frees the softc but softclock will panic on a
> dead callout pointer.
>
> Ensure ifp->if_flags matches reality by clearing IFF_UP when we destroy.

Approved by:	re (kensmith), mlaier (mentor)
2005-08-30 20:30:44 +00:00
Andrew Thompson ac1d6c037a MFC: bridgestp.c, r1.6; if_bridge.c, r1.18
> Mark the callouts as MPSAFE as if_bridge has been giant-free since day 1.
>
> Use the SMP friendly callout_init_mtx() while we are here.
>

Approved by:	re (kensmith), mlaier (mentor)
2005-08-30 20:26:53 +00:00
Murray Stokely 59f5e13c88 MFC: r1.240 - update number and size of ports distribution.
Approved by:	re (scottl)
2005-08-30 20:01:32 +00:00
Murray Stokely de2a30511d Update versions of KDE/GNOME included with FreeBSD 6.0, and minor
grammatical changes.

Approved by:	re (hrs@)
2005-08-30 19:37:33 +00:00
Max Laier eb3ca228f4 MFC: if_ethersubr.c, 1.197:
Don't loop back packets that have been routed by pf.  This fixes an
  endless loop where the same packet is sent over and over again.

  Obtained from:  OpenBSD
  Reported by:    Sergey Lapin
  Tested by:      Sergey Lapin

Approved by:	re (scottl)
2005-08-30 16:43:24 +00:00
Alexander Kabaev 265a2cff6c MFC r1.81:
Do not keep parent directory locked while calling VFS_ROOT to
traverse mount points in lookup(). The lock can be dropped safely
around VFS_ROOT because LOCKPARENT semantics with child and parent
vnodes coming from different FSes does not really have any meaningful
use and we do not really care about parent state after we relock it.
This prevents easily triggered deadlock on systems using automounter
daemon.

Approved by:	re (scottl)
2005-08-30 16:12:03 +00:00
Pawel Jakub Dawidek ef58748556 MFC: sys/geom/eli/g_eli.c 1.6-11
sys/geom/eli/g_eli.h	1.3-4
	sys/geom/eli/g_eli_ctl.c	1.2
	sbin/geom/class/eli/geli.8	1.4-6
	sbin/geom/class/eli/geom_eli.c	1.3

Sync with HEAD:
- We don't need to clear allocated memory. This will speed-up things a bit.
- Even if crypto_dispatch() return an error, request is not canceled and
  our callback will still be called, just to tell us that requested
  failed...
- Always run dedicated kernel thread (even when we have hardware support).
  There is no performance impact, but allows to allocate memory with
  M_WAITOK flag.
  As a side effect this simplify code a bit.
- Allow to change number of iterations for PKCS#5v2. It can only be used
  when there is only one key set.
- Add a __packed keyword to g_eli_metadata struct definition, so
  sizeof(struct g_eli_metadata) will return the exact number of bytes needed
  for storing it on the disk.
  Without this change GELI was unusable on amd64 (and probably other 64-bit
  archs), because sizeof(struct g_eli_metadata) was greater than 512 bytes
  and geli(8) was failing on assertion.

Approved by:	re (scottl)
2005-08-30 15:27:30 +00:00
Pawel Jakub Dawidek 9d31330c07 MFC: sys/geom/label/g_label_ext2fs.c 1.2
sys/geom/label/g_label_iso9660.c	1.2
	sys/geom/label/g_label_reiserfs.c	1.2

Verify if we can actually read the data at given offset.

Approved by:	re (scottl)
2005-08-30 15:18:54 +00:00
Pawel Jakub Dawidek 25aef68e4c MFC: sys/geom/label/g_label.c 1.17
Back-out the change from revision 1.14 and allow for '/' in labels again.

Convinced by:	green, Gavin Atkinson, dougb, gordon
Approved by:	re (scottl)
2005-08-30 15:16:14 +00:00
Pawel Jakub Dawidek 6e0a5880d2 MFC: sys/sys/systm.h 1.235
sys/i386/i386/mp_machdep.c	1.253
	sys/amd64/amd64/mp_machdep.c	1.262
	sys/geom/stripe/g_stripe.c	1.27
	sys/geom/stripe/g_stripe.h	1.8

Avoid code duplication and implement bitcount32() function in systm.h only.

Approved by:	re (scottl)
2005-08-30 15:14:40 +00:00
Pawel Jakub Dawidek d34a392d83 MFC: sbin/class/raid3/geom_raid3.c 1.13
sbin/misc/subr.c	1.4
	sbin/misc/subr.h	1.4

Move function for calculating number of bits into more central place.

Approved by:	re (scottl)
2005-08-30 15:09:06 +00:00
Pawel Jakub Dawidek 110cd34d63 MFC: sys/crypto/rijndael/rijndael-alg-fst.c 1.9,1.11
sys/opencrypto/xform.c	1.6

Check key size for rijndael, as invalid key size can lead to kernel panic.
I checked other algorithms against this bug and it seems they aren't
affected.

Reported by:	Mike Tancsa <[email protected]>
PR:		i386/84860
Approved by:	re (scottl)
2005-08-30 15:01:50 +00:00
Pawel Jakub Dawidek 90f8bc08ae MFC: Add VIA/ACE "PadLock" support as a crypto(9) driver.
HW donated by:			Mike Tancsa <[email protected]>
Most of the code obtained from:	OpenBSD
Approved by:			re (scottl)
2005-08-30 14:56:02 +00:00
Maxime Henrion 58a8df8cff MFC if_nve.c r1.8:
date: 2005/07/25 22:21:11;  author: mux;  state: Exp;  lines: +0 -1
  Remove an erroneous m_freem() call.  If m_defrag() returns a non-NULL
  pointer, it has already freed the original mbuf chain, so we shouldn't
  do it again.

Approved by:	re (scottl)
2005-08-30 09:03:13 +00:00
John Baldwin 95a02d0198 MFC: Locking and sundry fixes; mark MPSAFE:
- Use device_printf() and if_printf().
- Remove pre-new-bus and other #if 0 code.
- Overhaul failure handling in my_attach().

Approved by:	re (scottl)
2005-08-29 20:00:31 +00:00
Andre Oppermann d77468cac3 MFC addition of memmem(3).
Submitted by:	Pascal Gloor <pascal.gloor at spale.com>
Approved by:	re (scottl)
2005-08-29 18:46:39 +00:00
Andre Oppermann 989b28e965 MFC rev. 1.27 (Pretty print multipath routes).
Approved by:	 re (scottl)
2005-08-29 17:57:36 +00:00
Andre Oppermann bf5d3596f8 MFC rev. 1.31 (correct layer 2 broad- and multicast handling) and rev. 1.29
(Misc spelling and/or English fixes in comments).

PR:		kern/85052
Approved by:	re (scottl)
2005-08-29 17:52:53 +00:00
Maksim Yevmenkin 1b3533dff2 MFC to RELENG_6
Address minor locking issues. Use taskqueue_swi instead of taskqueue_swi_giant.

Approved by:	re (scottl)
2005-08-29 17:00:54 +00:00
Maksim Yevmenkin a534baf915 MFC to RELENG_6
Make sure ng_fec_init() uses the same calling convention as the rest of
the code, i.e. ng_fec_init() is called with the ifp->if_softc pointer and
NOT with the ifp pointer.

PR:		kern/85239
Reviewed by:	brooks
Approved by:	re (scottl)
2005-08-29 16:23:21 +00:00
cvs2svn 5047141c9e This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-08-29 11:34:09 +00:00
Gleb Smirnoff 093706044d MFC:
Remove all references to T/TCP, which was removed several months ago.

Approved by:	re (scottl)
2005-08-29 09:10:22 +00:00
Gleb Smirnoff 1caaea641f MFC 1.140:
When we have a published ARP entry for some IP address, do reply on
  ARP requests only on the network where this IP address belong, to.

  Before this change we did replied on all interfaces. This could
  lead to an IP address conflict with host we are doing ARP proxy
  for.

  PR:		kern/75634
  Reviewed by:	andre

Approved by:	re (scottl)
2005-08-29 09:06:30 +00:00
Gleb Smirnoff 497b59e83e MFC:
Backout revision 1.54, because it exposes a worse problem, than
  it fixes. I believe the problem lives somewhere outside ng_ksocket,
  but until it is found, let the node be working.

  PR:		kern/84952
  PR:		kern/82413

Approved by:	re (scottl)
2005-08-29 09:01:58 +00:00
Gleb Smirnoff 37b5c5a0d4 MFC 1.87:
In order to support CARP interfaces kernel was taught to handle more
  than one interface in one subnet. However, some userland apps rely on
  the believe that this configuration is impossible.

  Add a sysctl switch net.inet.ip.same_prefix_carp_only. If the switch
  is on, then kernel will refuse to add an additional interface to
  already connected subnet unless the interface is CARP. Default
  value is off.

  PR:				bin/82306
  In collaboration with:	mlaier

Approved by:	re (scottl)
2005-08-29 08:58:45 +00:00
Suleiman Souhlal aa6b21b113 MFC rev 1.292:
Set the mountpoint path in the superblock (fs_fsmnt) at mount-time
  so that it appears in the various messages (not cleanly unmounted,
  filesystem full, etc). This has been broken since rev 1.261.

Approved by:	re (scottl)
2005-08-28 17:04:43 +00:00
Yaroslav Tykhiy 3a8c2dbfd4 MFC defaults/rc.conf#1.259, rc.subr#1.37:
Stop hard-coding an -M flag to mdmfs(8) in /etc/rc.subr.
  Now this flag can be set, or not set, for memory-backed
  file systems on individual basis, as illustrated by the
  rc.conf(5) variables tmpmfs_flags and varmfs_flags.  The
  flag is set for those FS'en by default, in /etc/defaults/rc.conf,
  in order to stay compatible with the old rc.subr behaviour.

Approved by:	re (scottl)
2005-08-28 09:08:05 +00:00
Yaroslav Tykhiy 8f9ef1adec MFC rev. 1.52:
List -W as one of the meaningful options to the -i (interfaces)
  display of netstat(1).

Approved by:	re (hrs)
2005-08-28 09:03:45 +00:00
Robert Watson 2d08011696 Merge rtsock.c:1.127 from HEAD to RELENG_6:
De-spl parts of the routing socket code now generally protected
  through locking; leave some spl references around code where there
  are open questions about global variable references.  Also, add
  an XXX regarding locking in sysctl.

Approved by:	re (scottl)
2005-08-28 04:31:40 +00:00
Markus Brueffer c9b4a600ab MFC: rev. 1.5 + 1.6
rev. 1.6:
     - Document the led(4) interface for the Thinklight
     - Bump .Dd

  rev. 1.5:
    - Clarify how events are used and how the different event sysctl correlate
    - Document how an event looks like that is received by devd(8) from
      acpi_ibm(4)
    - Document the event codes as they occur on a T41p
    - Add a note about sysctl.conf and an Xref to it
    - Add an example section providing an example script and an entry for
      devd.conf. This is an adapted version of the one in acpi_fujitsu(4).
    - s/Fn-F4/Fn+F4/ for consistency sake
    - Add a button description where refering to a T41p, remove it otherwise,
      since it might vary from model to model
    - Bump .Dd

Approved by:	re (hrs)
2005-08-27 22:51:25 +00:00
Colin Percival 7ba9a292e2 Note the addition of bsdiff(1), bspatch(1), and portsnap(8) into the
base system.

Approved by:	re (hrs)
2005-08-27 20:12:11 +00:00
Tor Egge ae124555f3 MFC: Don't set the COMPLETE flag in an inodedep structure before the
related inode has been written.

Approved by:	re (scottl)
2005-08-27 18:40:06 +00:00
Marius Strobl 8ca50a3f98 MFC: 1.98
Now that at least some screen savers work on sparc64 sync with other
archs and enable splash(4) by default.

Approved by:	re (scottl)
2005-08-27 18:04:43 +00:00
Marius Strobl f15e5c1d48 MFC: 1.30
- Wrap the handler and associated code for collecting completed RX
  descriptors that are still marked owned in #ifdef GEM_RINT_TIMEOUT
  instead of #if 0 for convenience.
- Remove stale code and comment about relying on the preset XIF config.
- In case of a watchdog timeout call the init function instead of just
  the start function so the chip is properly reset.

Merge from hme(4):
- Convert to use bus_dmamap_load_mbuf_sg() for loading RX buffers.
- Protect from a duplicate mbuf free panic in case the DMA engine hangs.

Approved by:	re (scottl)
2005-08-27 18:02:15 +00:00
Marius Strobl 5a0ba2b141 MFC: sys/boot/sparc64/loader/metadata.c 1.14,
sys/dev/uart/uart_cpu_sparc64.c 1.21

- Change the code that determines whether to use a serial console and
  which serial device to use in that case respectively to not rely on
  the OFW names of the input/output and stdin/stdout devices. While at
  it save on some variables and for sys/boot/sparc64/loader/metadata.c
  move the code in question to a new function md_bootserial() so it can
  be kept in sync with uart_cpu_getdev_console() more easily.
- Adjust the size of some buffers.
- Remove the package handle of the '/options' node from the argument
  list of uart_cpu_getdev_dbgport().

Approved by:	re (scottl)
2005-08-27 15:52:05 +00:00
Joseph Koshy 6ac41aea85 MFC: { r1.8--r1.10 }
- Add COMPATIBILITY and HISTORY sections.  Fix an -mdoc error.
   Cross-reference pmclog(3).

 - Document two new diagnostic messages in hwpmc(4).

 - Document the diagnostic message printed at startup time.  Keep the
   list of diagnostic messages sorted.

 - Document the recently introduced EOPNOTSUPP error return.  Repair
   sort ordering for the list of error descriptions.

Approved by:	re (hrs)
2005-08-27 04:25:49 +00:00
Andrew Thompson 8da896ed41 MFC: if_bridge.c, r1.19
> The mtu check in bridge_enqueue is bogus as the maximum Ethernet frame is
> actually 1514, so comparing the mbuf length which includes the Ethernet
> header
> to the interface MTU is wrong.
>
> The check was a little over the top so just remove it.

Approved by:	re (scottl), mlaier (mentor)
2005-08-26 20:00:25 +00:00
Joseph Koshy b2bdd605bb MFC:
[ hwpmc_mod.c:1.14,1.15 ]
 - Print PMC capabilities at module load time.

 - Return EOPNOTSUPP instead of EINVAL if a PMC allocation request
   specifies a PMC capability (e.g., sampling) that is not supported
   by hardware.  Return EINVAL early if the PMC class passed in is
   not recognized.

 [ hwpmc_x86.c:1.3 ]
 - On x86 processors, turn off 'INTERRUPT' capabilities on PMCs
   if the CPU does not have its local APIC enabled.

Approved by:	re (scottl)
2005-08-26 19:49:32 +00:00
John Baldwin 133f7f47c1 MFC: Conditionally lock Giant in xl's taskqueue handler function.
Approved by:	re (scottl)
2005-08-26 15:31:09 +00:00
John Baldwin dd6fde7a00 MFC: Use if_printf() and device_printf() and remove ste_unit from the
softc.

Approved by:	re (scottl)
2005-08-26 15:27:23 +00:00
John Baldwin 695bbaea54 MFC: Add aliases for atomic operations on 64-bit integers.
Approved by:	re (scottl)
2005-08-26 14:53:57 +00:00
John Baldwin 259d014e1a MFC: Fix up locking and mark MPSAFE.
Approved by:	re (scottl)
2005-08-26 14:52:36 +00:00
John Baldwin 538f73db7c MFC: Fixup locking including moving the taskqueue_drain() out of xl_stop().
Approved by:	re (scottl)
2005-08-26 14:46:22 +00:00
John Baldwin 4de5f4f1e9 MFC: Various locking fixups including removing Giant from a bus dma
callback.

Approved by:	re (scottl)
2005-08-26 14:40:03 +00:00
John Baldwin d356512cf2 MFC: Fix up locking and remove spls and support for 4.x.
Approved by:	re (scottl)
2005-08-26 14:35:45 +00:00
John Baldwin f8c55f89ab MFC: Fix up the locking in pcn(4) and mark it MPSAFE.
Approved by:	re (scottl)
2005-08-26 14:33:05 +00:00
Bjoern A. Zeeb f7b5f9b939 MFC rev. 1.109:
* Solve "No PHY found" problem for more Yukon Lite variants.
   * Catch a bus attach error.
   * Improve locking.
   (missing in original commit message but was not worth a forced commit):
   * put interrupt moderation messages under bootverbose

Approved by:	re (kensmith)
2005-08-26 10:46:20 +00:00
Giorgos Keramidas 10662d5ec3 MFC revision 1.24:
% Add a small paragraph that describes how the current environment
% settings can be displayed, near the end of the DESCRIPTION section,
% immediately after the paragraph that describes how they can be set.
%
% Add a reference to printenv(1) too (and the ``printenv'' csh builtin).
%
% Submitted by:   Gary W. Swearingen <[email protected]>
% PR:             docs/85008

Approved by:	re (hrs)
2005-08-26 10:25:44 +00:00
Colin Percival db2b47746e MFC: When looking for new lines in diff output, grep for '^[>+]'
instead of '^>', in order to catch both normal and unified diffs.

Approved by:	re (scottl)
2005-08-25 19:07:28 +00:00
Colin Percival a402b66128 MFC: Tell locate to ignore /var/db/portsnap by default because it isn't
very interesting.

Approved by:	re (scottl)
2005-08-25 19:06:11 +00:00
Søren Schmidt cf3c32f6e7 MFC:
Add support for working around controllers that cannot do DMA in 48bit.
	The workaround use PIO mode above ~137GB to allow using the disk.
	Add the Acer chips with rev < 0xc4 as first candidate.

	Add support for the Promise PDC4071[89] chips on the Fasttrak TX4300.
	Docs kindly provided by Promise.

	Apply fix for "pr82261 DMA-support on Sparc64 broken"

	Use the bio field instead of the driver field as intended.

	Dont set default mode to ATA_DMA_MAX on devices not capable of DMA.

Approved by: re@ (scottl)
2005-08-25 16:21:05 +00:00
Søren Schmidt f463bf9455 MFC:
Add definition for SATAII 3Gb/s mode.

Approved by: re@ (scottl)
2005-08-25 16:16:45 +00:00
Maksim Yevmenkin 8dbc923ce7 MFC to RELENG_6
Fix multiple typos in the mutex names. This fixes false positive (and pretty
strange looking too) LORs I have seen on my system. Pointy hat to goes to me.

Approved by:	re (scottl)
2005-08-25 16:14:33 +00:00
Robert Watson cde30cf12f White space sync: add missing line break.
Approved by:	re (kensmith - earlier whitespace fixes)
2005-08-25 05:44:06 +00:00
Robert Watson 439114992d Merge if.h:1.98 from HEAD to RELENG_6:
For each interface flag, indicate whether or not it is owned by the
  device driver, owned by the network stack, or initialized by the device
  driver before attach and read-only from then on.

  Not all device drivers and network stack components currently follow
  these rules, especially with respect to IFF_UP, and a few exceptions
  with IFF_ALLMULTI.

Approved by:	re (scottl)
2005-08-25 05:02:28 +00:00
Robert Watson a4a8a0bc4b Merge linux_ioctl.c:1.128 svr4_sockio.c:1.17 altq_cbq.c:1.3 if_oltr.c:1.38
if_pflog.c:1.14 if_pfsync.c:1.21 if_an.c:1.70 if_ar.c:1.72 if_arl.c:1.11
amrr.c:1.10 onoe.c:1.10 if_ath.c:1.101 awi.c:1.41 if_bfe.c:1.27
if_bge.c:1.93 if_cm_isa.c:1.7 smc90cx6.c:1.16 if_cnw.c:1.20 if_cp.c:1.25
if_cs.c:1.42 if_ct.c:1.26 if_cx.c:1.46 if_ed.c:1.256 if_em.c:1.68
if_en_pci.c:1.37 midway.c:1.66 if_ep.c:1.143 if_ex.c:1.58 if_fatm.c:1.20
if_fe.c:1.93 if_fwe.c:1.38 if_fwip.c:1.8 if_fxp.c:1.244 if_gem.c:1.33
if_hatm.c:1.25 if_hatm_intr.c:1.20 if_hatm_ioctl.c:1.13 if_hatm_rx.c:1.10
if_hatm_tx.c:1.14 if_hme.c:1.39 if_ie.c:1.104 if_ndis.c:1.101
if_ic.c:1.24 if_ipw.c:1.10 if_iwi.c:1.10 if_ixgb.c:1.13 if_lge.c:1.41
if_lnc.c:1.113 if_my.c:1.31 if_nge.c:1.77 if_nve.c:1.10 if_owi.c:1.12
if_patm.c:1.9 if_patm_intr.c:1.6 if_patm_ioctl.c:1.10 if_patm_tx.c:1.10
pdq_ifsubr.c:1.28 if_plip.c:1.38 if_ral.c:1.12 if_ral_pci.c:1.2
if_ray.c:1.81 if_rayvar.h:1.22 if_re.c:1.49 if_sbni.c:1.21 if_sbsh.c:1.14
if_sn.c:1.48 dp83932.c:1.21 if_snc_pccard.c:1.9 if_sr.c:1.70 if_tx.c:1.91
if_txp.c:1.33 if_aue.c:1.92 if_axe.c:1.32 if_cdce.c:1.8 if_cue.c:1.59
if_kue.c:1.66 if_rue.c:1.23 if_udav.c:1.16 if_ural.c:1.12 if_vge.c:1.16
if_vx.c:1.58 if_wi.c:1.185 if_wi_pci.c:1.26 if_wl.c:1.68 if_xe.c:1.60
if_xe_pccard.c:1.30 if_el.c:1.68 i4b_ipr.c:1.35 i4b_isppp.c:1.31
kern_poll.c:1.20 bridge.c:1.94 bridgestp.c:1.4 if_arcsubr.c:1.27
if_atm.h:1.24 if_atmsubr.c:1.40 if_bridge.c:1.16 if_ef.c:1.35
if_ethersubr.c:1.196 if_faith.c:1.37 if_fddisubr.c:1.100 if_fwsubr.c:1.14
if_gif.c:1.54 if_gre.c:1.34 if_iso88025subr.c:1.70 if_loop.c:1.107
if_ppp.c:1.106 if_spppsubr.c:1.121 if_tap.c:1.57 if_tun.c:1.154
if_vlan.c:1.80 ppp_tty.c:1.67 ieee80211_ioctl.c:1.32 atm_if.c:1.31
ng_eiface.c:1.33 ng_ether.c:1.50 ng_fec.c:1.19 ng_iface.c:1.44
ng_sppp.c:1.9 ip_carp.c:1.30 ip_fastfwd.c:1.30 in6.c:1.53 nd6_nbr.c:1.31
natm.c:1.40 if_dc.c:1.162 if_de.c:1.168 if_pcn.c:1.72 if_rl.c:1.154
if_sf.c:1.84 if_sis.c:1.135 if_sk.c:1.108 if_ste.c:1.86 if_ti.c:1.109
if_tl.c:1.101 if_vr.c:1.106 if_wb.c:1.81 if_xl.c:1.194 from HEAD to
RELENG_6:

  Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
  IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
  ifnet.if_drv_flags.  Device drivers are now responsible for
  synchronizing access to these flags, as they are in if_drv_flags.  This
  helps prevent races between the network stack and device driver in
  maintaining the interface flags field.

  Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
  some less so.

  Reviewed by:    pjd, bz

Approved by:	re (scottl)
2005-08-25 05:01:24 +00:00
Robert Watson 1fd4ce4b9d Merge if.c:1.242, if.h:1.97, if_var.h:1.102, rtsock.c:1.125 from HEAD
to RELENG_6:

  Rename IFF_RUNNING to IFF_DRV_RUNNING, IFF_OACTIVE to IFF_DRV_OACTIVE,
  and move both flags from ifnet.if_flags to ifnet.if_drv_flags, making
  and documenting the locking of these flags the responsibility of the
  device driver, not the network stack.  The flags for these two fields
  will be mutually exclusive so that they can be exposed to user space as
  though they were stored in the same variable.

  Provide #defines to provide the old names #ifndef _KERNEL, so that user
  applications (such as ifconfig) can use the old flag names.  Using the
  old names in a device driver will result in a compile error in order to
  help device driver writers adopt the new model.

  When exposing the interface flags to user space, via interface ioctls
  or routing sockets, or the two fields together.  Since the driver flags
  cannot currently be set for user space, no new logic is currently
  required to handle this case.

  Add some assertions that general purpose network stack routines, such
  as if_setflags(), are not improperly used on driver-owned flags.

  With this change, a large number of very minor network stack races are
  closed, subject to correct device driver locking.  Most were likely
  never triggered.

  Driver sweep to follow; many thanks to pjd and bz for the line-by-line
  review they gave this patch.

  Reviewed by:    pjd, bz

Approved by:	re (scottl)
2005-08-25 04:55:48 +00:00
Craig Rodrigues 6f454978eb MFC rev 1.411:
- Remove NTP servers which do not resolve in DNS.
 - Use pool.ntp.org servers where possible, thanks to
   Chuck Swiger <cswiger at mac dot com> .
 - Update list of Swedish NTP servers, thanks to
   Fredrik Lindberg <fli+freebsd-current at shapeshifter dot se> .

PR:		bin/75479
Approved by:	re (scottl)
2005-08-25 00:42:26 +00:00
Robert Watson 89348f94f0 Merge if_atmsubr.c:1.38 from HEAD to RELENG_6:
Lock down netnatm and mark as MPSAFE:

  - Introduce a subsystem mutex, natm_mtx, manipulated with accessor macros
    NATM_LOCK_INIT(), NATM_LOCK(), NATM_UNLOCK(), NATM_LOCK_ASSERT().  It
    protects the consistency of pcb-related data structures.  Finer grained
    locking is possible, but should be done in the context of specific
    measurements (as very little work is done in netnatm -- most is in the
    ATM device driver or socket layer, so there's probably not much
    contention).

  - Remove GIANT_REQUIRED, mark as NETISR_MPSAFE, remove
    NET_NEEDS_GIANT("netnatm").

  - Conditionally acquire Giant when entering network interfaces for
    ifp->if_ioctl() using IFF_LOCKGIANT(ifp)/IFF_UNLOCKGIANT(ifp) in order
    to coexist with non-MPSAFE atm ifnet drivers..

  - De-spl.

  Reviewed by:    harti, bms (various versions)

Approved by:	re (hrs)
2005-08-24 18:10:51 +00:00
Robert Watson ad82081bf1 Merge subr_witness.c:1.196, igmp.c:1.49, in.c:1.86, in_var.h:1.55,
ip_input.c:1.303, ip_output.c:1.243 from HEAD to RELENG_6:

  Introduce in_multi_mtx, which will protect IPv4-layer multicast address
  lists, as well as accessor macros.  For now, this is a recursive mutex
  due code sequences where IPv4 multicast calls into IGMP calls into
  ip_output(), which then tests for a multicast forwarding case.

  For support macros in in_var.h to check multicast address lists, assert
  that in_multi_mtx is held.

  Acquire in_multi_mtx around iteration over the IPv4 multicast address
  lists, such as in ip_input() and ip_output().

  Acquire in_multi_mtx when manipulating the IPv4 layer multicast
  addresses, as well as over the manipulation of ifnet multicast address
  lists in order to keep the two layers in sync.

  Lock down accesses to IPv4 multicast addresses in IGMP, or assert the
  lock when performing IGMP join/leave events.

  Eliminate spl's associated with IPv4 multicast addresses, portions of
  IGMP that weren't previously expunged by IGMP locking.

  Add in_multi_mtx, igmp_mtx, and if_addr_mtx lock order to hard-coded
  lock order in WITNESS, in that order.

  Problem reported by:    Ed Maste <emaste at phaedrus dot sandvine dot ca>

Approved by:	re (scottl)
2005-08-24 17:30:44 +00:00
Robert Watson f0b4541341 Merge if_ath.c:1.99 awi.c:1.39 if_bfe.c:1.26 if_bge.c:1.92 if_ed.c:1.255
if_em.c:1.67 if_ex.c:1.57 if_fe.c:1.92 if_fxp.c:1.242 if_gem.c:1.32
if_hme.c:1.38 if_ie.c:1.103 if_ndis.c:1.100 if_ixgb.c:1.12 if_lge.c:1.40
if_lnc.c:1.112 if_my.c:1.30 if_nge.c:1.76 if_nve.c:1.9 if_owi.c:1.11
pdq_ifsubr.c:1.27 if_ray.c:1.80 if_re.c:1.47 if_sn.c:1.47 dp83932.c:1.20
if_tx.c:1.90 if_txp.c:1.32 if_aue.c:1.91 if_axe.c:1.31 if_cue.c:1.58
if_kue.c:1.65 if_rue.c:1.22 if_udav.c:1.15 if_vge.c:1.15 if_wi.c:1.182
if_wl.c:1.67 if_xe.c:1.58 if_dc.c:1.161 if_de.c:1.167 if_pcn.c:1.70
if_rl.c:1.153 if_sf.c:1.83 if_sis.c:1.134 if_sk.c:1.107 if_ste.c:1.85
if_ti.c:1.108 if_tl.c:1.100 if_vr.c:1.105 if_wb.c:1.80 if_xl.c:1.193
from HEAD to RELENG_6:

  Modify device drivers supporting multicast addresses to lock if_addr_mtx
  over iteration of their multicast address lists when synchronizing the
  hardware address filter with the network stack-maintained list.

  Problem reported by:    Ed Maste (emaste at phaedrus dot sandvine dot ca>

Approved by:	re (scottl)
2005-08-24 16:50:46 +00:00
Giorgos Keramidas f08224f928 MFC 1.34: Spell "partition" correctly.
Reminded by:	simon
Approved by:	re (scottl)
2005-08-24 15:42:12 +00:00
Robert Watson 88f723ddbd Merge in_var.h:1.54, in6_var.h:1.23, mld6.c:1.22 from HEAD to RELENG_6:
Modify network protocol consumers of the ifnet multicast address lists
  to lock if_addr_mtx.

  Problem reported by:    Ed Maste <emaste at phaedrus dot sandvine dot ca>

Approved by:	re (scottl)
2005-08-24 15:18:38 +00:00
Robert Watson 15f7d3f2ea Merge if_arcsubr.c:1.26, if_ethersubr.c:1.195, if_fddisubr.c:1.99,
if_iso88025subr.c:1.68 from HEAD to RELENG_6:

  When allocating link layer ifnet address list entries in
  ifp->if_resolvemulti(), do so with M_NOWAIT rather than M_WAITOK, so
  that a mutex can be held over the call.  In the FDDI code, add a
  missing M_ZERO.  Consumers are already aware that if_resolvemulti()
  can fail.

Approved by:	re (scottl)
2005-08-24 13:51:55 +00:00
Robert Watson 2ace4b53a4 Merge if_var.h:1.101 from HEAD to RELENG_6:
- Rename ifmaof_ifpforaddr() to if_findmulti(); assert if_addr_mtx.
    Staticize.

  Problem reported by:    Ed Maste <emaste at phaedrus dot sandvine dot ca>

Approved by:	re (scottl)
2005-08-24 13:26:14 +00:00
Simon L. B. Nielsen 1c919e7899 MFC rev 1.35:
Remove reference to raid(4), the RAIDframe manual page, which was
  deleted a while ago.

Approved by:	re (scottl)
2005-08-24 08:07:29 +00:00
SUZUKI Shinsuke 8cacfddaa9 MFC 1.55
added a missing unlock (just do the same thing as in netinet/raw_ip.c)

Approved by: re(scottl)
2005-08-24 06:46:16 +00:00
Robert Watson 2b1489c086 Merge if.c:1.240, if.c:1.241, if.c:1.242 from HEAD to RELENG_6, which
correct nits in the addition of if_addr_mtx:

if.c:1.240:
  Initialize the if_addr mutex in if_alloc() rather than waiting until
  if_attach().  This allows ethernet drivers to use it in their routines
  to program their MAC filters before ether_ifattach() is called (de(4) is
  one such driver).  Also, the if_addr mutex is destroyed in if_free()
  rather than if_detach(), so there was another potential bug in that a
  driver that failed during attach and called if_free() without having
  called ether_ifattach() would have tried to destroy an uninitialized
  mutex.

  Reported by:    Holm Tiffe holm at freibergnet dot de
  Discussed with: rwatson

if.c:1.241:
  destroy lock _before_ free'ing the structure it resides in

if.c:1.242:
  - Move IF_ADDR_LOCK_DESTROY(ifp) from if_free to if_free_type.
  - Add a note that additions should be made to if_free_type and not
    if_free to help avoid this in the future.

  This apparently fixes a use after free in if_bridge and may fix bugs
  in other direct if_free_type consumers.

  Reported by:    thompsa

Approved by:	re (hrs)
2005-08-24 04:45:02 +00:00
Robert Watson b65ff148a9 Merge if.c:1.239, if_var.h:1.101 from HEAD to RELENG_6:
Protect link layer network interface multicast address list manipulation
  using ifp->if_addr_mtx:

  - Initialize if_addr_mtx when ifnet is initialized.

  - Destroy if_addr_mtx when ifnet is torn down.

  - Rename ifmaof_ifpforaddr() to if_findmulti(); assert if_addr_mtx.
    Staticize.

  - Extract ifmultiaddr allocation and initialization into if_allocmulti();
    accept a 'mflags' argument to indicate whether or not sleeping is
    permitted.  This centralizes error handling and address duplication.

  - Extract ifmultiaddr tear-down and deallocation in if_freemulti().

  - Re-structure if_addmulti() to hold if_addr_mtx around manipulation of
    the ifnet multicast address list and reference count manipulation.
    Make use of non-sleeping allocations.  Annotate the fact that we only
    generate routing socket events for explicit address addition, not
    implicit link layer address addition.

  - Re-structure if_delmulti() to hold if_addr_mtx around manipulation of
    the ifnet multicast address list and reference count manipulation.
    Annotate the lack of a routing socket event for implicit link layer
    address removal.

  - De-spl all and sundry.

  Problem reported by:    Ed Maste <emaste at phaedrus dot sandvine dot ca>

Approved by:	re (hrs)
2005-08-24 04:42:03 +00:00
Robert Watson 79f8c3ecb3 Merge if.c:1.235 from HEAD to RELENG_6:
- Introduce a helper function if_setflag() containing the code common
    to ifpromisc() and if_allmulti() instead of duplicating the code poorly,
    with different bugs.
  - Call ifp->if_ioctl() in a consistent way: always use more compatible C
    syntax and check whether ifp->if_ioctl is not NULL prior to the call.

Discussed with:	yar
Approved by:	re (scottl)
2005-08-24 04:19:48 +00:00
Robert Watson 2004ea17af Merge vfs_subr.c:1.641 from HEAD to RELENG_6:
Silence "busy" warnings when unmounting devfs at system shutdown.  This
  is a workaround for non-symetric teardown of the file systems at
  shutdown with respect to the mount order at boot.  The proper long term
  fix is to properly detach devfs from the root mount before unmounting
  each, and should be implemented, but since the problem is non-harmful,
  this temporary band-aid will prevent false positive bug reports and
  unnecessary error output for 6.0-RELEASE.

  Tested by:      pav, pjd

Approved by:	re (scottl)
2005-08-23 01:50:19 +00:00
Ken Smith f8c24fc024 Almost ready for BETA3 builds.
Approved by:	re (implicit)
2005-08-22 03:01:35 +00:00
Robert Watson 26f04e07f6 Merge ip_output.c:1.244 from HEAD to RELENG_6:
Add helper function ip_findmoptions(), which accepts an inpcb, and attempts
  to atomically return either an existing set of IP multicast options for the
  PCB, or a newlly allocated set with default values.  The inpcb is returned
  locked.  This function may sleep.

  Call ip_moptions() to acquire a reference to a PCB's socket options, and
  perform the update of the options while holding the PCB lock.  Release the
  lock before returning.

  Remove garbage collection of multicast options when values return to the
  default, as this complicates locking substantially.  Most applications
  allocate a socket either to be multicast, or not, and don't tend to keep
  around sockets that have previously been used for multicast, then used for
  unicast.

  This closes a number of race conditions involving multiple threads or
  processes modifying the IP multicast state of a socket simultaenously.

Approved by:	re (scottl)
2005-08-20 21:32:08 +00:00
Robert Watson 4d6ce91f6e Merge libmemstat.3:1.10 from HEAD to RELENG_6:
The "Mbuf" zone was renamed "mbuf" to improve consistency, but the code
  example in libmemstat.3 was not updated to take this rename into account.
  Update the example.

  PR:             84946
  Submitted by:   Wojciech A. Koszek <dunstan at freebsd dot czest dot pl>

Approved by:	re (scottl)
2005-08-20 21:25:21 +00:00
Robert Watson 1b24988d7b Merge if_var.h:1.99 from HEAD to RELENG_6:
Allocate one of the spare ifnet integer fields to hold if_drv_flags,
  which in the future will hold IFF_OACTIVE and IFF_RUNNING, and have
  its access synchronized by the device driver rather than the
  protocol stack.  This will avoid potential races in the management
  of flags in if_flags.

  Discussed with: various (scottl, jhb, ...)

Approved by:	re (kensmith)
2005-08-20 13:38:22 +00:00
Robert Watson 7cbce16a86 Merge in_pcb.c:1.166 from HEAD to RELENG_6:
Remove no-op spl references in in_pcb.c, since in_pcb locking has been
  basically complete for several years now.  Update one spl comment to
  reference the locking strategy.

Approved by:	re (kensmith)
2005-08-20 13:34:59 +00:00
Robert Watson d112c6cae7 Merge tcp_subr.c:1.229, tcp_syncache.c:1.75, tcp_timer.c:1.75 from HEAD
to RELENG_6:

  Remove no-op spl's and most comment references to spls, as TCP locking
  is believed to be basically done (modulo any remaining bugs).

Approved by:	re (kensmith)
2005-08-20 13:34:13 +00:00
Robert Watson d3aea05630 Merge uma_dbg.c:1.21, uma_dbg.h:1.9 from HEAD to RELENG_6:
Improve canonicalization of copyrights.  Order copyrights by order of
  assertion (jeff, bmilekic, rwatson).

  Suggested ages ago by:  bde

Approved by:	re (kensmith)
2005-08-20 13:31:05 +00:00
Robert Watson b38eb1f6e6 Merge mdoc.local:1.50 from HEAD to RELENG_6:
Hook up libmemstat(3) to the library list in mdoc.local.  This will cause
  the library description (specifically, -lmemstat) to render properly in
  the libmemstat.3 man page.

  Submitted by:   ru

Approved by:	re (kensmith)
2005-08-20 13:24:28 +00:00
Hajimu UMEMOTO 67cf14591e MFC 1.34, 1.35:
- avoid exclusive sleep mutex witness warning using sx lock.
  - use TAILQ_FOREACH() for readability.

Approved by:	re (kensmith)
2005-08-20 12:20:48 +00:00
Bjoern A. Zeeb be97df34c9 MFC:
rev. 1.108, 1.109 src/sys/netinet/ip_fw2.c
rev. 1.101        src/sys/netinet/ip_fw.h
rev. 1.77         src/sbin/ipfw/ipfw2.c
rev. 1.176        src/sbin/ipfw/ipfw.8

* Add dynamic sysctl for net.inet6.ip6.fw.
* Correct handling of IPv6 Extension Headers.
* Add unreach6 code.
* Add logging for IPv6.
* Fix build without INET6 and IPFIREWALL compiled into kernel.[1]

Submitted by:   sysctl handling derived from patch from ume needed for ip6fw
Obtained from:  is_icmp6_query and send_reject6 derived from similar
                functions of netinet6,ip6fw
Reviewed by:    ume, gnn; silence on ipfw@
Spotted and tested by:  Michal Mertl <mime at traveller.cz>[1]
Approved by:    re (kensmith)
2005-08-20 08:36:57 +00:00
Yaroslav Tykhiy cec83b5f6e MFC rev. 1.29-1.31:
Make the procfs module buildable again in the MODULES_WITH_WORLD case.
This means defining a target for default opt_compat.h, but only if we
are not building the modules along with the kernel.

Approved by:	re (kensmith)
2005-08-20 08:05:01 +00:00
Alan Cox 51c40a77c6 MFC
Eliminate inconsistency in the setting of the B_DONE flag.

Approved by:	re (kensmith)
2005-08-20 06:07:55 +00:00
Brooks Davis efe01a711c MFC rev 1.9, remove an incorrect and unnecessicary bzero of the softc.
Approved by:	re (kensmith)
2005-08-20 04:35:29 +00:00
Brooks Davis 0d8cf5791f MFC rev 1.81, use if_free_type to avoid leaking struct arpcoms.
Approved by:	re (kensmith)
2005-08-20 04:34:11 +00:00
Brooks Davis f5ba655fc9 MFC rev 1.244, removal of if_findindex and correction of two if_alloc
calls before an if_attach.

Partial MFC of 1.243.  The change it was a response to has not been
MFCd, but the comment is relevent without it.

Approved by:	re (kensmith)
2005-08-20 04:32:54 +00:00
Brooks Davis c740ee65dc MFC revs 1.257 and 1.216.
- interface startup doc updates
 - s/ISC dhclient/OpenBSD dhclient/

Approved by:	re (kensmith)
2005-08-20 04:30:35 +00:00
Ian Dowse c5f5d12af8 MFC 1.22: in the ufsdirhash_build() failure case for corrupted
directories or unreadable blocks, make sure to destroy the mutex
we created.

Approved by:	re (scottl)
2005-08-20 04:27:15 +00:00
Gregory Neil Shapiro 75060007fc MFC: Make links for hoststat(8) and purgestat(8) man pages.
Revision  Changes    Path
     1.52      +2 -0      src/usr.sbin/sendmail/Makefile

Approved by:	re (hrs)
2005-08-20 01:39:08 +00:00
Doug Barton bf2503bba1 MFC 1.1.1.3, a patch to aid in out of memory conditions.
Take this opportunity to note that glebius indicated
that the initial work in this area was done by
Igor Sysoev <is rambler-co.ru>

Approved by:	re (kensmith)
2005-08-19 22:09:16 +00:00
Brian Somers 1f8a43081e MFC: Make ichsmb unloadable
Approved by:	re (kensmith)
Sponsored by:	Sophos/ActiveState
2005-08-19 18:38:55 +00:00
Hajimu UMEMOTO 1ca6cf07a4 MFC 1.36: create sysctl tree dynamically. it is required to share
net.inet6.ip6.fw with upcoming ipfw2 improvement for IPv6.

Requested by:	bz
Approved by:	re (kensmith)
2005-08-19 17:38:52 +00:00
Christian Brueffer 5d0e78b338 MFC: rev. 1.27
Clarify how the 'channel' argument should look like and add an
example on how to obtain information on devices on an ata channel.

Approved by:	re (hrs)
2005-08-19 15:54:42 +00:00
Gleb Smirnoff bc656e500e MFC:
Add a new switch -h for interface stats mode, which prints all interface
  statistics in human readable form.

  In collaboration with:	vsevolod
  Reviewed by:			cperciva

Approved by:	re (kensmith)
2005-08-19 15:08:43 +00:00
Gleb Smirnoff 01d0c2e494 MFC:
Axe ppp_for_tty(). Use tty->t_lsc pointer to store sc. This
  also eliminates recursive use of ppp_softc_list_mtx.
  PR:		kern/84686
  Reviewed by:	phk

Approved by:	re (kensmith)
2005-08-19 14:52:21 +00:00
Yoshihiro Takahashi 3de6016b8a MFC: Attempt g_ctl for metadata modification.
Approved by:	re (kensmith)
2005-08-19 12:43:55 +00:00
Yoshihiro Takahashi fb0a9a3e9b MFC: revision 1.54 (Implement g_ctl api).
Approved by:	re (kensmith)
2005-08-19 12:40:32 +00:00
Pawel Jakub Dawidek 378f5074ac MFC: sys/opencrypto/cryptodev.c 1.26
Fix bogus check. It was possible to panic the kernel by giving 0 length.
This is actually a local DoS, as every user can use /dev/crypto if there
is crypto hardware in the system and cryptodev.ko is loaded (or compiled
into the kernel).

Reported by:    Mike Tancsa <[email protected]>
Security:	Local DoS on systems with crypto HW and with /dev/crypto available
Approved by:	re (kensmith)
2005-08-19 12:04:19 +00:00
Pawel Jakub Dawidek 1714785828 MFC: usr.sbin/jls/jls.c 1.4,1.5
Not sure why, but SYSCTL_OUT() can sometimes keep returning ENOMEM
in sysctl_jail_list(). Because of this, jls(8) could enter into
an endless loop. The strange thing is, that we can call jls(8) while
the other one is in loop and it will succeed - SYSCTL_OUT() will
not return ENOMEM there.

Approved by:	re (kensmith)
2005-08-19 11:09:11 +00:00
Gleb Smirnoff 3cfaa35966 MFC:
Implement a new feature for ping(8) - sweeping pings. In a sweeping
  ping ICMP payload of packets being sent is increased with given step.
  Sweeping pings are useful for testing problematic channels, MTU
  issues or traffic policing functions in networks.

  PR:		bin/82625
  Submitted by:	Chris Hellberg <chellberg juniper.net> (with some cleanups)

Approved by:	re (kensmith)
2005-08-19 09:29:25 +00:00
Lukas Ertl c9732718ae MFC:
geom_vinum.c        rev. 1.17
  geom_vinum_drive.c  rev. 1.19
  geom_vinum_plex.c   rev. 1.16
  geom_vinum_rm.c     rev. 1.7
  geom_vinum_var.h    rev. 1.9, 1.10
  geom_vinum_volume.c rev. 1.9

Approved by:  re (kensmith)
2005-08-19 08:48:04 +00:00
Christian S.J. Peron ea207a4d7a MFC revision 1.157
date: 2005/08/18 22:30:52;  author: csjp;  state: Exp;  lines: +4 -2
Add missing braces around bpf_filter which were missed when I
merged the bpfstat code.

Approved by:	re (kensmith)
2005-08-19 04:52:02 +00:00
Christian S.J. Peron 8cc3bc3e54 Synch with HEAD:
MFC revision 1.167
date: 2005/08/08 21:06:42;  author: csjp;  state: Exp;  lines: +2 -0
Drop in a WITNESS_WARN into SYSCTL_IN to make sure that we are
not holding any non-sleep-able-locks locks when copyin is called.
This gets executed un-conditionally since we have no function
to wire the buffer in this direction.

MFC revision 1.166
date: 2005/08/08 18:54:35;  author: csjp;  state: Exp;  lines: +6 -1
Check to see if we wired the user-supplied buffers in SYSCTL_OUT, if
the buffer has not been wired and we are holding any non-sleep-able locks,
drop a witness warning. If the buffer has not been wired, it is possible
that the writing of the data can sleep, especially if the page is not in
memory. This can result in a number of different locking issues, including
dead locks.

Approved by:	re (kensmith)
2005-08-19 04:50:08 +00:00
Colin Percival 993c98cf9d MFC: Pad the strings sccs[], version[], and osrelease[], and add a
BRANCH_OVERRIDE environment variable (which, if set, overrides the
BRANCH specified here).  These make my FreeBSD Update build code
simpler by making it easier to recognize when two kernels are identical
modulo version numbers.

Approved by:	re (kensmith)
2005-08-19 04:12:41 +00:00
Marcel Moolenaar ffbd1b0688 MFC 1.3: Fix backtraces.
Approved by: re (kensmith)
2005-08-19 04:02:34 +00:00
Murray Stokely 1eef8f8fe7 MFC: correct date, fix typos, add 07/07 london bombing entry.
Approved by:	re (kensmith)
2005-08-19 03:23:07 +00:00
Colin Percival bcbde1f535 MFC: Remove dates, since they serve no purpose and result in files
spuriosuly changing each time they are built.  Also add $FreeBSD$ tags,
because cvs wants them.

Approved by:	re (kensmith)
2005-08-19 02:53:00 +00:00
Colin Percival c0beafff93 MFC: Add -frandom-seed=RepeatabilityConsideredGood to CFLAGS in order
to make this library build repeatably.

Approved by:	re (kensmith)
2005-08-19 02:49:55 +00:00
Andrew Thompson 3e2bfbde3d MFC: if_bridge.c, r1.17; bridgestp.c, r1.5
>   Ensure that we are holding the lock when initialising the bridge interface. We
>   could initialise while unlocked if the bridge is not up when setting the inet
>   address, ether_ioctl() would call bridge_init.
>
>   Change it so bridge_init is always called unlocked and then locks before
>   calling bstp_initialization().

Approved by:	re (kensmith), mlaier (mentor)
2005-08-19 02:43:07 +00:00
Robert Watson 3e9e6d7e7e Merge Makefile:1.12, vmstat.c:1.87 from HEAD to RELENG_6:
Teach vmstat -m and vmstat -z to use libmemstat(3).  Certain
  statistics from -z are now a bit different due to changes in the
  way statistics are now measured.  Reproduce with some amount of
  accuracy the slightly obscure layouts adopted by the two kernel
  sysctls.  In the future, we might want to normalize them.

  GC dosysctl(), which is now no longer used.

Merge vmstat.c:1.88 from HEAD to RELENG_6:

  Minor syntax tweaks:

  - Remove some extra blank lines.
  - Remove comments that don't contribute to understanding.
  - Remove additional blank lines in output added to maximize
    compatibility with older vmstat output, but that is actually
    somewhat gratuitous.

  Submitted by:   bde

Approved by:	re (kensmith)
2005-08-19 00:07:06 +00:00
Robert Watson fd5cc4ac2f Merge if.c:1.238 from HEAD to RELENG_6:
In multicast routines:

  Compare pointers with NULL rather than treating them as booleans.

  Compare pointers with NULL rather than 0 to make it more clear
  they are pointers.

  Assign pointers value of NULL rather than 0 to make it more clear
  they are pointers.

Approved by:	re (kensmith)
2005-08-18 18:36:53 +00:00
Robert Watson 58e16c22e8 Merge if.c:1.237 from HEAD to RELENG_6:
Rename equal() macro to sa_equal(), which matches the definitions
  of sa_equal() in other files, and makes it more clear what equal()
  is comparing.

Approved by:	re (kensmith)
2005-08-18 18:34:23 +00:00
Giorgos Keramidas 0dbc56408b MFC spelling fixes of several manpages.
Approved by:	re (kensmith)

The merged revisions/files are:

Revision  Path
1.10      src/lib/libarchive/archive_entry.3
1.21      src/lib/libarchive/archive_read.3
1.8       src/lib/libautofs/libautofs.3
1.10      src/lib/libc/net/inet6_rth_space.3
1.8       src/lib/libc/posix1e/acl_get_entry.3
1.15      src/lib/libc/posix1e/mac.3
1.7       src/lib/libc/posix1e/mac_prepare.3
1.37      src/lib/libc/stdtime/strftime.3
1.16      src/lib/libc/sys/kse.2
1.8       src/lib/libc/sys/uuidgen.2
1.4       src/share/man/man4/man4.i386/acpi_ibm.4
1.6       src/share/man/man4/man4.i386/acpi_panasonic.4
1.40      src/share/man/man4/man4.i386/ep.4
1.6       src/share/man/man4/man4.i386/pbio.4
1.5       src/share/man/man4/man4.i386/snc.4
1.2       src/share/man/man4/man4.sparc64/openprom.4
1.4       src/share/man/man4/man4.sparc64/snd_audiocs.4
1.11      src/share/man/man4/witness.4
1.3       src/share/man/man5/devfs.conf.5
1.51      src/share/man/man9/ifnet.9
1.7       src/share/man/man9/printf.9
1.12      src/usr.bin/file2c/file2c.1
1.27      src/usr.bin/indent/indent.1
1.17      src/usr.bin/lockf/lockf.1
1.90      src/usr.bin/make/make.1
1.45      src/usr.bin/systat/systat.1
1.19      src/usr.bin/truss/truss.1
1.33      src/usr.bin/xinstall/install.1
1.11      src/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8
1.4       src/usr.sbin/bluetooth/sdpd/sdpd.8
1.9       src/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3
1.36      src/usr.sbin/i4b/isdnd/isdnd.rc.5
1.53      src/usr.sbin/mtree/mtree.8
1.8       src/usr.sbin/ndiscvt/ndiscvt.8
1.13      src/usr.sbin/ntp/doc/ntpdc.8
1.26      src/usr.sbin/pppd/pppd.8
1.40      src/usr.sbin/syslogd/syslog.conf.5
1.5       src/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5
2005-08-18 15:01:27 +00:00
Peter Grehan 794cfc2d40 MFC: r1.141
>restore the ability to mount cd9660 filesystems as root by inverting
    >some of the options test, specifically the joliet and rockridge tests.
    > ...

Approved by:	re (Ken Smith)
2005-08-18 11:32:06 +00:00
Peter Grehan 790d05428e MFC: r1.8
> Remove unnecessary and alarming printf.

Approved by:	re (Ken Smith)
2005-08-18 11:03:53 +00:00
Gleb Smirnoff 86e36e1492 MFC 1.126:
To prevent a race between RTM_DELETE message and
  arptimer() deleting stale entry, we need to lock
  rtentry before unlocking radix head.

Approved by:	re (kensmith)
2005-08-18 10:15:25 +00:00
Gleb Smirnoff cad56251c2 MFC 1.139, that closes several races in ARP code. See original
commit log for more information.

Approved by:	re (kensmith)
2005-08-18 10:14:22 +00:00
Gleb Smirnoff a387015641 o Make rt_check() return a locked rtentry.
o Make rt_check() function more strict:
  - rt0 passed to rt_check() must not be NULL, assert this.
  - rt returned by rt_check() must be valid locked rtentry,
    if no error occured.
o Modify callers, so that they never pass NULL rt0
  to rt_check().
o Modify callers, so that they unlock rtentry.

Revisions merged:

net/if_atmsubr.c	- 1.39, 1.41
net/if_fwsubr.c		- 1.13, 1.15
net/if_iso88025subr.c	- 1.69, 1.71
net/route.c		- 1.110, 1.111
netinet6/nd6.c		- 1.51-1.53

netinet/if_ether.c intentionally not touched by this merge.

Approved by:	re (kensmith)
2005-08-18 10:12:42 +00:00
SUZUKI Shinsuke 4f66f33b42 MFC: IPv6 stealth forwarding
Revision  Changes    Path
   1.39      +3 -1      src/sys/netinet6/in6.h
   1.35      +8 -0      src/sys/netinet6/in6_proto.c
   1.30      +8 -0      src/sys/netinet6/ip6_forward.c
   1.34      +3 -0      src/sys/netinet6/ip6_var.h

PR: kern/54625
Approved by: re(kensmith)
2005-08-18 09:01:48 +00:00
Kenneth D. Merry 85351eca46 MFC, rev 1.28:
Remove a reference to compute_stats(), since it is no longer documented at
least.

Submitted by:	osa
Approved by:	re (hrs)
2005-08-18 04:46:26 +00:00
Tai-hwa Liang 8f684ddd5f MFC: (1.26) Fixing a regression introduced in rev1.25 by honouring the errno.
This should keep 'ugidfw list' to stop complaining about "Data error in
security.mac.bsdextended.rules.N: Unknown error: 0" if there is a "hole"
within the rule set.

Approved by:	re (hrs)
2005-08-17 14:35:20 +00:00
Colin Percival fe0799e89d MFC revision 1.149: Change the default partition sizes to provide more
space in /, /var, and /tmp, and if the device is large enough, provide
extra space to /var sufficient to store a crash dump.

Approved by:	re (kensmith)
2005-08-17 13:53:11 +00:00
Ken Smith e15a8c2d3b MFC v1.125:
>   Log:
>   The /stand directory now disappears out from under sysinstall while
>   it is running during installations.  The vsystem() function does get
>   used after this happens (e.g. if you manually configure the network
>   interface and ask it to enable the interface) so it needs to be a
>   little smarter about whether it uses /stand/sh or /bin/sh.

Approved by:	re (hrs)
2005-08-17 13:32:29 +00:00
Andrew Thompson 42663c7ba8 MFC: ifconfig.8, r1.101
> Document two missed if_bridge commands 'addr' and 'static'.

Approved by:	re (hrs), mlaier (mentor)
2005-08-17 02:27:08 +00:00
Poul-Henning Kamp 60bbcee642 MFC: Pull in stuff from -current.
Approved by:	re@
2005-08-16 22:49:11 +00:00
Poul-Henning Kamp 49fba49c1f MFC: fix a bug relating to multiple (>2) data sets.
Approved by:	re@
2005-08-16 22:48:12 +00:00
Poul-Henning Kamp 7ba46bf9e3 MFC: better facility for extracting and inspecting BIOS strings.
Approved by:	re@
2005-08-16 22:47:14 +00:00
Poul-Henning Kamp 0508e9d743 MFC: use g_ctl for metadata modification if possible.
Approved by:	re@
2005-08-16 22:46:05 +00:00
Poul-Henning Kamp 11885e2f0d MFC: use g_ctl for modifying metadata if possible.
Approved by:	re@
2005-08-16 22:45:33 +00:00
Poul-Henning Kamp 3c18940a8c MFC: Implement g_ctl api for metadata modification.
Approved by:	re@
2005-08-16 22:44:39 +00:00
Poul-Henning Kamp 7cba6ac65c MFC: fix a tiny race in statistics collection.
Approved by:	re@
2005-08-16 22:43:51 +00:00
Poul-Henning Kamp 35ee3c7c4e MFC: Remove map3270 file, telnet3270 is long gone.
Approved by:	re@
2005-08-16 22:42:46 +00:00
Poul-Henning Kamp bd90075c6a MFC: fix typo in debugging statement.
Approved by:	re@
2005-08-16 22:41:39 +00:00
Poul-Henning Kamp 5f881830e6 MFC: Remove vttest program, it lives in ports.
Approved by:	re@
2005-08-16 22:40:54 +00:00
Poul-Henning Kamp 1bd8cf6b99 Remove paper about the Berkeley Pascal Runtime which we have never had
in FreeBSD because it was VAX specific.

Approved by:	re@
2005-08-16 22:39:27 +00:00
Poul-Henning Kamp 7fa3be4c99 Remove pointless formatting date.
Approved by: re@
2005-08-16 22:36:54 +00:00
Christian Brueffer b0619422b3 MFC: rev. 1.11
- add missing ether_poll_deregister
- add per-device polling
- move the setting of if_capenable further down so that the
  VLAN caps are honored as well

Approved by:	re (kensmith), ru
2005-08-16 20:49:47 +00:00
cvs2svn fc207dde71 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-08-16 19:08:02 +00:00
Pawel Jakub Dawidek 0a4d97fbf5 MFC: share/man/man5/rc.conf.5 1.258,1.259,1.260
etc/defaults/rc.conf		1.255,1.256,1.257

- Remove gbde_swap_enable variable (it has no effect).
- Add geli_swap_flags variable which holds flags used by geli(8) when
  configuring GELI-encrypted swap partitions.
- Add variables used by rc.d/geli and rc.d/geli2 scripts.

Approved by:	re (kensmith)
2005-08-16 09:30:13 +00:00
Pawel Jakub Dawidek d080394f1a MFC: etc/rc.d/Makefile 1.54,1.55
- Disconnect gbde_swap from the build.
- Connect encswap, geli and geli2 to the build.

Approved by:	re (kensmith)
2005-08-16 09:23:45 +00:00
Pawel Jakub Dawidek 9660fbff2b MFC:
Add scripts for GELI device configuration on boot.

rc.d/geli - configures encryption (ask for passphrases, etc.);
rc.d/geli2 - is called after file systems are mounted and mark devices for
             detach on last close.

Approved by:	re (kensmith)
2005-08-16 09:20:32 +00:00
Robert Watson 81dbb1a34e Merge if_var.h:1.100 from HEAD to RELENG_6:
Add if_addr_mtx to struct ifnet, a mutex to protect ifnet-related address
  lists.  Add accessor macros.

  This changes the size of struct ifnet, but ideally, all ifnet consumers
  are now using if_alloc() to allocate these structures rather than
  embedding them into device driver softc's, so this won't modify the
  network device driver ABI.

Approved by:	re (hrs)
2005-08-16 09:15:14 +00:00
Pawel Jakub Dawidek b5c803d41e MFC: etc/rc.subr 1.36
Add a function which creates list of devices for GELI-encryption.

Approved by:	re (kensmith)
2005-08-16 09:06:42 +00:00
Pawel Jakub Dawidek c8ddf4d0c5 MFC: Remove gbde_swap script and introduce encswap script, which knows how to
encrypt swap partitions using both: gbde and geli.

Approved by:	re (kensmith)
2005-08-16 09:04:55 +00:00
Pawel Jakub Dawidek 1298f9d6ff MFC: sbin/geom/class/eli/geom_eli.c 1.2
When keys were configured without passphrase, number of iterations in
metadata is equal to -1. if we then wanted to attach provider (or change
keys) and forget about '-p' flag it failed on assertion (quite ok, without
assertion it could call PKCS#5v2 with 4294967295 iterations).

Instead of failing on assertion, remind about '-p' flag.

Approved by:	re (kensmith)
2005-08-16 09:02:22 +00:00
Pawel Jakub Dawidek ba72366311 MFC: sys/geom/eli/g_eli.h 1.2
Be case-insensitive when dealing with algorithm names.

Submitted by:	Benjamin Lutz <[email protected]>
PR:		kern/84659
Approved by:	re (kensmith)
2005-08-16 09:00:24 +00:00
Pawel Jakub Dawidek f031454303 MFC: sbin/geom/class/eli/geli.8 1.3
sys/geom/eli/g_eli.c		1.4,1.5

- GELI doesn't need cryptodev.
- Because code paths for I/O requests are quite complex, add comments above
  the functions which participate in I/O paths.

Approved by:	re (kensmith)
2005-08-16 08:58:33 +00:00
Pawel Jakub Dawidek 6eefffea57 MFC: sbin/geom/core/geom.c 1.23
Unfortunately dlerror(3) returns string, so there is no clean way to
ignore "no such file" errors only, which I wanted to do.
Because of this I ignored all other errors on dlopen(3) failure as well,
which isn't good.
Fix this situation by calling access(2) on library file first and ignore
only ENOENT error. This allows to report all the rest of dlopen(3) errors.

Approved by:	re (kensmith)
2005-08-16 08:45:11 +00:00
Pawel Jakub Dawidek 51ff910f9e MFC: etc/rc.d/jail 1.25
Skip jails which are already running and inform why.
We're checking for /var/run/jail_<name>.id file and if it exists, we don't
start the jail. It should be also safe in case of reboot(8), because
rc.d/cleanvar script is going to remove /var/run/jail_* files.

It helps to avoid potential mess when the same jail is started twice,
because of an administrator mistake (been there, done that).

Approved by:	re (kensmith)
2005-08-16 08:43:06 +00:00
Pawel Jakub Dawidek 539b2b9cce MFC: rc.d/cleanvar 1.10
Skip 'logpriv' socket when cleaning /var/.

Approved by:	re (kensmith)
2005-08-16 08:41:30 +00:00
Pawel Jakub Dawidek ade75492c6 MFC: rc.d/gbde 1.13
rc.subr		1.35

Move 'local_tr' function to rc.subr and change its name to 'ltr'.

Approved by:	re (kensmith)
2005-08-16 08:39:36 +00:00
Pawel Jakub Dawidek 3859a90844 MFC:
- Add code for Ext2FS and ReiserFS labels recognition.
- Avoid creating directories in devfs by changing all '/' in labels to '_'.

Submitted by:	Stanislav Sedov <[email protected]>
PR:		kern/84638
Approved by:	re (kensmith)
2005-08-16 08:20:48 +00:00
Pawel Jakub Dawidek 98168a3844 MFC: Add strcasecmp() and strncasecmp() to libkern and connect to the build.
Approved by:	re (kensmith)
2005-08-16 08:11:00 +00:00
Marcel Moolenaar 9cfad07ea9 Partial MFC rev 1.3:
o  Remove the obscure tid command, because it does what the thread
     command does, but worse.
  o  Move the PID to the extra thread info, where it makes sense and
     where it doesn't confuse users. The extra thread info holds some
     process information, to which the PID belongs.
  o  Implement the to_find_new_threads target method by having it call
     the target beneath us if we're not using KVM. This makes sure that
     new threads are found when using the remote target.

  o  Fix various core dump scenarios:
     -  Implement the to_files_info target method. Previously the
        'info target' command would cause a NULL pointer dereference.
     -  Don't assume there's a current thread. We're not initialized
        in all cases. This prevents a NULL pointer dereference.
     -  When we're not ussing KVM, have the to_xfer_memory target
        method call the target beneath us. This avoids calling into
        KVM with a NULL pointer.

Approved by: re (kensmith)
2005-08-16 03:29:22 +00:00
Joseph Koshy c59077cf70 MFC r1.7 "Sync usage message with the code and manual page".
Approved by:	re (kensmith)
2005-08-16 02:03:48 +00:00
Marcel Moolenaar d20aa9cdae MFC 1.8:
o  As mentioned in the previous commit: make the KVM error buffer
   static.
o  Register a function with atexit(3) to close the KVM object if
   we have one open.
o  Show the unread portion of the kernel's message buffer before
   presenting the prompt. It's bound to provide some useful info.
o  Don't call kgdb_target() twice. It results in having all threads
   listed twice.

Approved by: re (hrs)
2005-08-16 00:29:26 +00:00
Colin Percival eeb6ee519e MFC addition of portsnap to the base system plus subsequent enhancements
and bug fixes.

Approved by:	re (kensmith)
2005-08-15 20:24:08 +00:00
Julian Elischer bf6cd502fd MFC: reduce warnings when compiled under -W.
Obtained from:	Sandvine inc.
Approved by:  re (ken)
2005-08-15 20:04:28 +00:00
Joseph Koshy 14cdfc2259 MFC { sys/dev/hwpmc/hwpmc_mod.c:1.13, sys/kern/kern_pmc.c:1.5,
sys/sys/pmckern.h:1.5 }

Fail the module loading process if the currently executing kernel
was not compiled with 'options HWPMC_HOOKS' or if the compiled-in
version numbers of the kernel and module are not in sync.

Approved by:	re (kensmith)
2005-08-15 18:46:13 +00:00
Colin Percival 226c592181 MFC addition of bsdiff and bspatch to the base system, in order to
allow them to be used by portsnap(8) in 6.0-RELEASE.

Approved by:	re (kensmith)
2005-08-15 18:34:21 +00:00
cvs2svn b3ae05e667 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-08-15 17:07:38 +00:00
Joseph Koshy 3bd6fa1e8c MFC r1.8 "Correctly print system-wide PMC counts for short-lived command lines".
Approved by:	re (hrs)
2005-08-15 15:33:59 +00:00
Tor Egge e0fc127801 MFC: Check for marker pages when scanning active and inactive page queues.
Approved by:	re (kensmith)
2005-08-15 14:28:48 +00:00
Alexander Kabaev d109fabc39 MFC: Do not use vm_pager_init() to initialize vnode_pbuf_freecnt variable.
vm_pager_init() is run before required nswbuf variable has been set
to correct value. This caused system to run with single pbuf available
for vnode_pager. Handle both cluster_pbuf_freecnt and vnode_pbuf_freecnt
variableis in the same way.

Approved by:	re (kensmith)
2005-08-15 14:04:47 +00:00
Anton Berezin 4aa0568752 MFC: Recognize D-Link DGE-528(T) Gigabit as an re(4) device.
Approved by:	re (kensmith)
2005-08-15 14:02:37 +00:00
Alexander Kabaev 7e5fbb34e3 MFC r1.639: Do not drop the vnode interlock if vdropl is called on already
doomed vnode. vdropl callers expect it to return with interlock still being
held.

Approved by:	re (hrs)
2005-08-15 13:50:38 +00:00
Robert Watson 470403fc5c Merge if_atm.c:1.20 from HEAD to RELENG_6:
Add NATM_LOCK() and NATM_UNLOCK() in places where npcb_add() and
  npcb_free() are called, in order to eliminate witness panics.
  This was overlooked in removal of GIANT from ATM.

Approved by:	re (hrs)
2005-08-15 09:54:00 +00:00
Robert Watson 7096558609 Merge natm.c:1.39, natm.h:1.12, natm_proto.c:1.17 from HEAD to RELENG_6:
Remove FreeBSD 2.2 protocol usrreq compatibility code.

  Remove minor #ifdefs for early NetBSD and OpenBSD compatibility.

  Remove spl-related definitions.

Approved by:	re (hrs)
2005-08-15 09:52:22 +00:00
Robert Watson 8008f0db95 Merge if_atmsubr.c:1.38, natm.c:1.38, natm.h:1.11, natm_pcb.c:1.16,
natm_proto.c:1.16 from HEAD to RELENG_6:

  Lock down netnatm and mark as MPSAFE:

  - Introduce a subsystem mutex, natm_mtx, manipulated with accessor macros
    NATM_LOCK_INIT(), NATM_LOCK(), NATM_UNLOCK(), NATM_LOCK_ASSERT().  It
    protects the consistency of pcb-related data structures.  Finer grained
    locking is possible, but should be done in the context of specific
    measurements (as very little work is done in netnatm -- most is in the
    ATM device driver or socket layer, so there's probably not much
    contention).

  - Remove GIANT_REQUIRED, mark as NETISR_MPSAFE, remove
    NET_NEEDS_GIANT("netnatm").

  - Conditionally acquire Giant when entering network interfaces for
    ifp->if_ioctl() using IFF_LOCKGIANT(ifp)/IFF_UNLOCKGIANT(ifp) in order
    to coexist with non-MPSAFE atm ifnet drivers..

  - De-spl.

  Reviewed by:    harti, bms (various versions)

Approved by:	re (hrs)
2005-08-15 09:51:15 +00:00
Robert Watson 2b6c5bb1a5 Merge mac_policy.h:1.69 from HEAD to RELENG_6:
Insert a series of place-holder function pointers in mac_policy.h for
  entry points that will be inserted over the life-time of the 6.x branch,
  including for:

  - New struct file labeling (void * already added to struct file), events,
    access control checks.
  - Additional struct mount access control checks, internalization/
    externalization.
  - mac_check_cap()
  - System call enter/exit check and event.
  - Socket and vnode ioctl entry points.

Approved by:	re (hrs)
2005-08-15 09:03:50 +00:00
Robert Watson 225f959f29 Merge vm_page.h:1.137 from HEAD to RELENG_6:
Don't perform a nested include of opt_vmpage.h if LIBMEMSTAT is defined,
  as opt_vmpage.h will not be available to user space library builds.  A
  similar existing check is present for KLD_MODULE for similar reasons.

Approved by:	re (hrs)
2005-08-15 09:02:01 +00:00
Robert Watson 44d8425481 Merge uma_int.h:1.37 from HEAD to RELENG_6:
Wrap inlines in uma_int.h in #ifdef _KERNEL so that uma_int.h can be
  used from memstat_uma.c for the purposes of kvm access without lots
  of additional unsafe includes.

Approved by:	re (hrs)
2005-08-15 09:01:11 +00:00
Suleiman Souhlal 375af1003b MFC rev 1.222:
Use atomic operations on runningbufspace.

 PR:             kern/84318
 Submitted by:   ade

Approved by:	re (kensmith)
2005-08-15 06:22:09 +00:00
Suleiman Souhlal 9b716877e2 MFC rev 1.73:
The kernel is usually at /boot/kernel/kernel nowadays.

 PR:     i386/81756
 Submitted by:   trasz <[email protected]>

Approved by:	re (kensmith)
2005-08-15 06:14:07 +00:00
Suleiman Souhlal b4d6d93121 MFC rev 1.11:
it's actually 11 minutes when the machine is assumed to be down and removed
  from the output.

  Obtained from:  DragonFlyBSD

Approved by:	re (kensmith)
2005-08-15 06:07:23 +00:00
Suleiman Souhlal 8050ba73f7 MFC:
Holding a vnode doesn't prevent v_mount from disappearing (when the
  vnode is inactivated), possibly leading to a NULL dereference when
  checking if the mount wants knotes to be activated in the VOP hooks.
  So, we add a new vnode flag VV_NOKNOTE that is only set in  getnewvnode(),
  if necessary, and check it when activating knotes.
  Since the flags are not erased when a vnode is being held, we can safely
  read them.

Approved by:	re (kensmith)
2005-08-15 06:01:36 +00:00
SUZUKI Shinsuke f8c2600733 MFC Rev. 1.31
fixed a kernel crash at the start-up time of an IPv6 multicast daemon
  (e.g. pim6sd/pim6dd)

Approved by: re(kensmith)
2005-08-15 00:28:31 +00:00
Murray Stokely 801c893ab2 MFC: r1.46 - grammar improvements.
Approved by:	re (kensmith)
2005-08-14 18:52:34 +00:00
Murray Stokely bfd12c3262 MFC: r1.15 - Fix typo.
Approved by:	re (kensmith)
2005-08-14 18:48:54 +00:00
Robert Watson 13b0fe7fb5 Bump __FreeBSD_version for dev_clone eventhandler to add credential.
Approved by:	re
2005-08-13 21:27:58 +00:00
Robert Watson 7e993ff3bc Merge two sets of changes relating to devfs device node cloning from
HEAD to RELENG_6: changes to introduce a credentialed version of the
clone event handler, and then changes to merge the regular and
credentialed versions into a single interface (along with updates to
existing consumers).  With this merge, 6.x and 7.x are in sync.

First batch merges devfs_devs.c:1.37, devfs_vnops.c:1.115,
kern_conf.c:1.187, tty_pty.c:1.138, mac_vfs.c:1.109, mac_biba.c:1.36,
mac_lomac.c:1.36, mac_mls.c:1.73, mac_stub.c:1.53, mac_test.c:1.61,
conf.h:1.223, mac.h:1.68, mac_policy.h:1.67 from HEAD to RELENG_6:

  When devfs cloning takes place, provide access to the credential of the
  process that caused the clone event to take place for the device driver
  creating the device.  This allows cloned device drivers to adapt the
  device node based on security aspects of the process, such as the uid,
  gid, and MAC label.

  - Add a cred reference to struct cdev, so that when a device node is
    instantiated as a vnode, the cloning credential can be exposed to
    MAC.

  - Add make_dev_cred(), a version of make_dev() that additionally
    accepts the credential to stick in the struct cdev.  Implement it and
    make_dev() in terms of a back-end make_dev_credv().

  - Add a new event handler, dev_clone_cred, which can be registered to
    receive the credential instead of dev_clone, if desired.

  - Modify the MAC entry point mac_create_devfs_device() to accept an
    optional credential pointer (may be NULL), so that MAC policies can
    inspect and act on the label or other elements of the credential
    when initializing the skeleton device protections.

  - Modify tty_pty.c to register clone_dev_cred and invoke make_dev_cred(),
    so that the pty clone credential is exposed to the MAC Framework.

  While currently primarily focussed on MAC policies, this change is also
  a prerequisite for changes to allow ptys to be instantiated with the UID
  of the process looking up the pty.  This requires further changes to the
  pty driver -- in particular, to immediately recycle pty nodes on last
  close so that the credential-related state can be recreated on next
  lookup.

  Submitted by:   Andrew Reisse <[email protected]>
  Obtained from:  TrustedBSD Project
  Sponsored by:   SPAWAR, SPARTA

Second batch merges scsi_target.c:1.68, coda_fbsd.c:1.43,
firewirereg.h:1.38, fwdev.c:1.47, nmdm.c:1.36, snp.c:1.100, dsp.c:1.82,
mixer.c:1.45, vkbd.c:1.9, devfs_vnops.c:1.117, tty_pty.c:1.139,
tty_tty.c:1.57, bpf.c:1.156, if_tap.c:1.56, if_tun.c:1.153,
smb_dev.c:1.28, conf.h:1.224 from HEAD to RELENG_6:

  Merge the dev_clone and dev_clone_cred event handlers into a single
  event handler, dev_clone, which accepts a credential argument.
  Implementors of the event can ignore it if they're not interested,
  and most do.  This avoids having multiple event handler types and
  fall-back/precedence logic in devfs.

  This changes the kernel API for /dev cloning, and may affect third
  party packages containg cloning kernel modules.

  Requested by:   phk

These changes modifies the kernel device driver API for device cloning,
and might require minor modifications to third party device drivers that
make use of devfs cloning.  It will not be merged to RELENG_5.

Approved by:	re (scottl)
2005-08-13 21:24:18 +00:00
Christian Brueffer 2c5b802f10 MFC: rev. 1.70
Add some more info about jail startup and shutdown.

Approved by:	re (hrs)
2005-08-12 22:29:42 +00:00
Christian Brueffer 129fc91af6 MFC: rev. 1.42
Remove stray comma

Approved by:	re (hrs)
2005-08-12 22:28:25 +00:00
Christian Brueffer fc1f875076 MFC: rev. 1.5
nForce3 and nForce4 are supported as well.

Approved by:	re (hrs)
2005-08-12 22:27:37 +00:00
Christian Brueffer a648cdd7ce MFC: rev. 1.18
Sort the list of supported hardware.

Approved by:	re (hrs)
2005-08-12 22:26:03 +00:00
John Baldwin 1496051a7b MFC: Call tulip_start() rather than tulip_ifstart() from the interrupt
handler to avoid recursing on the driver lock.

Approved by:	re (kensmith)
2005-08-12 17:57:38 +00:00
Nate Lawson a8cdfc3299 MFC 1.18: Fix for 99% being reported instead of 100% when one battery
is missing.

Approved by:	re (kensmith)
2005-08-12 17:29:58 +00:00
Nate Lawson eae543bb3d MFC rev 1.15: use more reasonable boundary for user setting of lowest
Approved by:	re (kensmith)
2005-08-12 17:25:59 +00:00
Tor Egge 263daf2afa MFC: Don't allow pagedaemon to skip pages while scanning active and
inactive page queues due to the vm object being locked.

Approved by:	re (kensmith)
2005-08-12 16:43:27 +00:00
Christian Brueffer ce516d74b2 MFC:
More tcpdump 8->1 cleanup.

Approved by:	re (hrs)
2005-08-12 16:15:24 +00:00
Andrew Thompson e80b9a1305 MFC: if_bridge.c, r.1.5
> Use m_copypacket() which is an optimization of the common case
> m_copym(m, 0, M_COPYALL, how).
>
> This is required for strict alignment architectures where we align the
> IP header in the input path but m_copym() will create an unaligned copy
> in bridge_broadcast(). m_copypacket() preserves alignment of the first
> mbuf.
>
> Noticed by:     Petri Simolin
> Approved by:    mlaier (mentor)

Approved by:	re (kensmith), mlaier (mentor)
2005-08-11 20:57:59 +00:00
Markus Brueffer ab8a4e2f41 MFC Rev. 1.8:
Don't lock when holding led_mtx, instead use AcpiOsQueueForExecution to defer
  the locking.

  Idea taken from: acpi_asus(4)

  Approved by:    philip
  Reported by:    avatar
                  Gordon Bergling <[email protected]>

Approved by:	re (kensmith)
2005-08-11 15:35:58 +00:00
John Baldwin f82882525e MFC: Correct some if tests to fix a confusing printf when we route a new
IRQ for a link.

Approved by:	re (kensmith)
2005-08-11 15:35:41 +00:00
Anton Berezin 83739ae4e1 MFC 1.4: make kernel build succeed when with "options CPU_DISABLE_SSE".
Approved by:	re (kensmith)
2005-08-11 14:28:42 +00:00
Ian Dowse de31732a74 MFC 1.78: fix two bugs that caused page faults when using mice with
tilt movements.

Approved by:	re (kensmith)
2005-08-11 00:22:28 +00:00
Jesus R. Camou 0a539acfb5 MFC: config-recursive target.
Approved by:	re (hrs)
2005-08-10 20:43:27 +00:00
Bjoern A. Zeeb 32b223f5f3 MFC: rev. 1.33 src/sys/net/if_gre.c, rev. 1.20 src/sys/netinet/ip_gre.c
Add support for IPv6 over GRE [1]. PR kern/80340 includes the
  FreeBSD specific ip_newid() changes NetBSD does not have.
Correct handling of non AF_INET packets passed to bpf [2].

PR:		kern/80340[1], NetBSD PRs 29150[1], 30844[2]
Obtained from:	NetBSD ip_gre.c rev. 1.34,1.35, if_gre.c rev. 1.56
Submitted by:	Gert Doering <gert at greenie.muc.de>[2]
Approved by:	re (kensmith)
2005-08-10 19:12:32 +00:00
Jesus R. Camou e1f3dc4487 MFC: Information about starting jails
at boot time if specified in rc.conf.

Submitted by:	matteo
Approved by:	re (hrs), trhodes (mentor)
2005-08-10 19:00:43 +00:00
Sam Leffler 729c85b0e8 MFC: m_align
Approved by:	re (kensmith)
2005-08-10 17:02:29 +00:00
Yoshihiro Takahashi fb4202128a MFi386: revision 1.1202.2.1 (r300 DRM support).
Approved by:	re (kensmith)
2005-08-10 15:56:13 +00:00
Gleb Smirnoff cf8478f315 MFC 1.10:
Check that we have first fragment before pulling up TCP/UDP header.

Approved by:	re (kensmith)
2005-08-10 15:00:57 +00:00
Gleb Smirnoff facf684127 MFC:
Enhance struct ng_hook - add hk_type field and bump NG_ABI_VERSION.

Approved by:	re (kensmith)
2005-08-10 14:58:18 +00:00
Gleb Smirnoff 36dc1f701d MFC 1.103, 1.105:
avoid recursion problems in netgraph(4). See 1.103 log for
more information.

Approved by:	re (kensmith)
2005-08-10 14:54:52 +00:00
Pawel Jakub Dawidek ccb305b6e4 MFC: rc.d/jail 1.24
Allow to give more than one jail's name, eg.:

	# /etc/rc.d/jail start www mail

Approved by:	re (kensmith)
2005-08-10 14:30:05 +00:00
Stephan Uphoff 88a87d85a4 MFC ffs_softdep.c 1.182, softdep.h 1.18
Delay freeing disk space for file system blocks until all
dirty buffers are safely released. This fixes softdep
problems on truncation (deletion) of files with dirty
buffers.

Approved by:	re (kensmith)
2005-08-10 14:09:25 +00:00
Brian Somers 9913bfe2c0 MFC: Mention that console= can set multiple consoles.
Relate boot_ options to their kernel command line flags and make it clear
     how kenv(1) is used.

Approved by:	re (hrs)
2005-08-09 12:38:17 +00:00
Tai-hwa Liang f9d748d16f MFC: (1.10) Fixing compilation bustage.
Approved by:	re (kensmith)
2005-08-09 01:27:31 +00:00
Tai-hwa Liang fbe925cebb MFC: (1.7) Fixing compilation bustage.
Approved by:	re (kensmith)
2005-08-09 01:25:32 +00:00
Peter Grehan 071b54122a MFC machdep.c r1.90
trap.c    r1.55
     trap_subr.S r1.15

   Temporary band-aid to fix hang when a process exec's Altivec
 instructions.

    trap_subr.S:  declare a stub for the a-unavailable trap
                  that does an absolute jump to the vector-assist trap.
                  This is due to the fact that the vec-unavail trap
                  doesn't start at a 256-byte boundary, so the trick of
                  masking the bottom 8 bits of the link register to identify
                  the interrupt doesn't work, so let the vec-assist
                  case handle Altivec-disabled for the time being.

                  Note that this will be fixed in the future with a much
                  smaller vector code-stub (< 16 bytes) that will allow
                  use of strange vector offsets that are also present in
                  4xx processors, and also allow smaller differences in
                  vector codepaths on the G5.

    trap.c:       Treat altivec-unavailable/assist process traps as SIGILL.
                  Not quite correct, since altivec-assist should really
 		  be a panic,
                  but it is fine for the moment due to the above measure.

    machdep.c     Install the stub code for the altivec-unavailable trap, and
                  the standard trap code at the altivec-assist.

Approved by:	re (Ken Smith)
2005-08-08 07:02:12 +00:00
Ceri Davies a393ec0616 MFC r1.71.
Correct the description of the TAPE environment variable.
  Based on:

PR:             docs/84200
Submitted by:   Gary W. Swearingen <garys at opusnet dot com>
Approved by:	re (hrs)
2005-08-07 18:49:50 +00:00
Christian Brueffer ec8c914dbb MFC: rev. 1.54
Document ITE IT8211F support.

Approved by:	re (hrs)
2005-08-07 16:02:17 +00:00
Christian Brueffer 3f34f80b7b MFC: rev. 1.5
Remove Xref to non-existant usb(3) manpage.

Approved by:	re (hrs)
2005-08-07 15:49:53 +00:00
Søren Schmidt a620ace01c MFC:
Remove stale struct ata_channel declaration
        Add support for the ITE IT8211F controller
        Dont limit all transfers to DEV_BSIZE (stale dbug code)
        Hide the loaded/unloaded message behind bootverbose

Approved by: re@
2005-08-07 11:20:28 +00:00
Søren Schmidt cae160799c MFC:
Fix status to report status from the given array

Approved by: re@
2005-08-07 11:16:58 +00:00
Søren Schmidt 1a8fcecd10 MFC:
Allow the array number to be read back on atacontrol create
	Make IOCATARAIDSTATUS IOWR so status can be gotten correctly

Approved by: re@
2005-08-07 11:16:08 +00:00
Ollivier Robert 840cd808c4 MFC of revision 1.10:
The check for invalid characters introduced in 1.9 incorrectly
flags NIS entries as invalid.

Submitted by:   Bob Willcox <[email protected]>
PR:             bin/82325 (but I used the patch from Bob).
Approved by:	re (kensmith)
2005-08-07 05:56:54 +00:00
Sam Leffler 7e46ee0b14 sync with HEAD
Approved by:	re (kensmith)
2005-08-07 02:23:32 +00:00
Christian S.J. Peron edce2d71b8 MFC revision 1.61 to RELENG_6
date: 2005/07/30 20:00:13;  author: csjp;  state: Exp;  lines: +16 -4
Introduce kdevtoname, which when given the kernel address of a
cdev structure, returns the device name associated with it through
the __si_namebuf member. This un-breaks the processing of devices.

Approved by:	re (kensmith)
2005-08-06 22:26:51 +00:00
Markus Brueffer 78b066a0f4 MFC Rev. 1.13
s/Lefler/Leffler/

Approved by:	re (hrs)
2005-08-06 14:47:16 +00:00
Markus Brueffer bc65233a4b MFC Rev. 1.38
- Fix spelling of 'multiplexer'
- Grammar fixes

Approved by:	re (hrs)
2005-08-06 14:45:18 +00:00
Markus Brueffer 4c36a68441 MFC: Rev. 1.2
- Reword a sentence
- Grammar fixes
- s/CAVEAT/CAVEATS/

Approved by:	re (hrs)
2005-08-06 14:41:55 +00:00
Christian Brueffer b545d972c2 MFC: rev. 1.11
Mention that the softc is zeroed after allocation.

Approved by:	re (hrs)
2005-08-06 07:26:42 +00:00
David Xu f65720d804 MFC Revision 1.117:
In adjustrunqueue(), add code to handle thread migrating case for
    ULE scheduler. In original code, local run queue of threaded ksegrp
    is corrupted if adjustrunqueue() is called while thread is migrating.

Approved by:	re (kensmith)
Tested by:	delphij
2005-08-06 03:06:25 +00:00
David Xu 202f5faf18 MFC Revision 1.155:
If a thread was removed from system run queue, kseq_assign
    shouldn't add it again.

Approved by:	re (kensmith)
Tested by:	delphij
2005-08-06 03:03:10 +00:00
Max Laier 93bcd2e297 MFC: pf.c, 1.35 pfvar.h, 1.12
Prevent a race condition.  As pf_send_tcp() - called for expired synproxy
  states - has to drop the lock when calling back to ip_output(), the state
  purge timeout might run and gc the state. This results in a rb-tree
  inconsistency.  With this change we flag expiring states while holding the
  lock and back off if the flag is already set.

  Reported by:	glebius

Approved by:	re (kensmith)
2005-08-06 01:52:35 +00:00
Sam Leffler d731ca2ae1 MFC: 1.99:
Wireless suport fixups: add a bunch of stuff that's been in the
code but not documented (e.g. wme, mac acl) and correct some
information, etc.

Approved by:	re (kensmith)
2005-08-05 21:36:01 +00:00
Sam Leffler fd3f88199e MFC: 1.23: acm and ack are specified per-ac
Approved by:	re (kensmith)
2005-08-05 21:35:22 +00:00
Andrew Thompson 9e52c1448f MFC: if_bridge.c, r1.14
>   We check that all the member interfaces have the same MTU on attach to the
>   bridge but the interface can still be changed afterwards.
>
>   This falls under the 'dont do that' category but log an warning when INVARIANTS
>   is defined.
>
>   Approved by:    mlaier (mentor)
>
>   Revision  Changes    Path
>   1.14      +8 -0      src/sys/net/if_bridge.c

Approved by:	re (kensmith), mlaier (mentor)
2005-08-05 20:33:21 +00:00
Pawel Jakub Dawidek ad65911a6d MFC: sbin/geom/class/Makefile 1.9
Don't try to compile geli(8) when NO_CRYPT knob if defined.

Reported by:		Alexander Polakov
Committed to HEAD by:	ru
Approved by:		re (kensmith (implicit))
2005-08-05 20:24:37 +00:00
John Baldwin 39813579a8 MFC: Include a SYSUNINIT to destroy the mutex in MTX_SYSINIT.
Approved by:	re (kensmith)
MFC after:	1 week
2005-08-05 20:21:46 +00:00
Pawel Jakub Dawidek df29864fee MFC: Add regression tests (121 in total) for GEOM_ELI class.
To use them, run:

	# prove /usr/src/tools/regression/geom_eli

Sponsored by:	Wheel Sp. z o.o.
		http://www.wheel.pl
Approved by:	re (kensmith)
2005-08-05 20:04:38 +00:00
Pawel Jakub Dawidek bc921f9c4b MFC: Connect GEOM_ELI class to the build.
Sponsored by:	Wheel Sp. z o.o.
		http://www.wheel.pl
Approved by:	re (kensmith)
2005-08-05 20:02:46 +00:00
Pawel Jakub Dawidek 3a02479713 MFC: Introduce GEOM_ELI class which provides GEOM providers encryption.
For features list and usage see manual page: geli(8).

Sponsored by:	Wheel Sp. z o.o.
		http://www.wheel.pl
Approved by:	re (kensmith)
2005-08-05 19:58:14 +00:00
John Baldwin d35f842ecd MFC: Add extra constraints to inform the compiler that the memory being
modified is an input and output rather than just the register holding the
pointer being the input and output.

Approved by:	re (kensmith)
2005-08-05 19:46:13 +00:00
John Baldwin 95b1c1e157 MFC: Convert the atomic pointer operations to operate on uintptr_t rather
than void *.

Approved by:	re (kensmith)
2005-08-05 19:44:00 +00:00
Pawel Jakub Dawidek 3bad92aa35 MFC: g_raid3.c 1.41
g_raid3.h	1.12

Use root_mount KPI for RAID3 to delay root file system mount.
Actually, one cannot setup root file system on RAID3 device, but when
other file system exist in /etc/fstab which are placed on RAID3 device,
boot process will be interrupted when these devices are missing.

Approved by:	re (kensmith)
2005-08-05 19:43:29 +00:00
Pawel Jakub Dawidek 06ba06bfee MFC: pw_user.c 1.58
Change /home symbolic link, so it will point to usr/home instead of /usr/home.
Previous symlink was confusing:

	# cd /jails/virtual_system_1/home
	# realpath .
	/usr/home

...and slower.

OK'ed by:	rwatson, phk
Approved by:	re (kensmith)
2005-08-05 19:39:25 +00:00
John Baldwin bb9b7f27b3 MFC: Add support for the hw.apic.enable_extint tunable.
Approved by:	re (kensmith)
2005-08-05 19:08:25 +00:00
John Baldwin cff7fc9758 MFC: Various and sundry cleanups to remove old code and fix cruftiness.
Also, add locking and mark the driver as MPSAFE.

Approved by:	re (kensmith)
2005-08-05 19:07:19 +00:00
John Baldwin 30f52de3e8 MFC: Close a race where the last thread in a process could be harvested via
wait() before it has finished dying.

Approved by:	re (kensmith)
MFC after:	1 week
2005-08-05 19:02:56 +00:00
Brian Somers 98518f2012 MFC: Fix a comparison that broke ``set console=vidconsole'' and even the
loader.conf line ``console="vidconsole"''.

Approved by:	re (kensmith)
2005-08-05 00:36:59 +00:00
Maxim Sobolev 015b17bcdb MFC: Propagate return value of the kern_execve() to the caller properly.
Approved by:	re
2005-08-04 23:25:32 +00:00
Maksim Yevmenkin 8875da99c0 MFC if_an.c v1.69 to RELENG_6
Reorganize an_detach() a bit. Make sure ether_ifdetach() and if_free()
are called outside of AN_LOCK()/AN_UNLOCK. This fixes the following
WITNESS warning (produced when an(4) PCMCIA card is detached).
taskqueue_drain with the following non-sleepable locks held:
exclusive sleep mutex an0 (network driver) r = 0 (0xc59af168) locked @ /usr/src/
sys/dev/an/if_an.c:2836

Do not lock an to check gone flag. Only need to hold the lock to set
the gone flag.

Reviewed by:	imp
Approved by:	re (kemsmith)
2005-08-04 21:12:22 +00:00
Christian Brueffer 8ed7105420 MFC: rev. 1.28
Mention the default value of PATH and that it may be overridden.

Approved by:	re (hrs)
2005-08-04 19:58:48 +00:00
Pawel Jakub Dawidek 03818ab4e7 MFC: ggatec.8 1.6
Update manual page after ggate rewrite.

Approved by:	re (hrs)
2005-08-04 18:05:33 +00:00
John-Mark Gurney 94a0b19cc2 MFC: v1.45 intro.2, v1.40 help.common
fix a couple documentation nits

Approved by:	re (hrs)
2005-08-04 17:53:40 +00:00
Eric Anholt 28d0b02472 MFC: r300 DRM support. Supports all current non-PCIE Radeons, as far as the
developers know.

Approved by:	re (kensmith)
2005-08-04 17:31:02 +00:00
John Baldwin 28369c9e9f MFC: Fix a typo in the name of a dmamap for a bus_dmamap_sync().
Approved by:	re (kensmith)
2005-08-04 16:44:17 +00:00
John Baldwin de67d26e00 MFC: Fix a bug in pmap_protect() in the PAE case where it could look up the
wrong vm_page_t associated with a pte.

Approved by:	re (kensmith)
2005-08-04 16:41:25 +00:00
Jacques Vidrine 2721d3599f Disable hyperthreading by default for 6.x.
Approved by:	re
2005-08-04 15:17:06 +00:00
Ken Smith 58a3019d97 Almost ready for BETA2 builds...
Approved by:	re (implicit)
2005-08-01 18:14:48 +00:00
cvs2svn 4dd1b957b8 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-08-01 17:50:20 +00:00
Robert Watson 7a87b1ddf5 Merge memstat.c:1.6, memstat_internal.h:1.6, memstat_malloc.c:1.5,
memstat_uma.c:1.9 from HEAD to RELENG_6:

 Correct two libmemstat(3) bugs:

  - Move memory_type_list flushing logic from memstat_mtl_free() to
    _memstat_mtl_empty(), a libmemstat-internal function that can
    be called from other parts of the library.  Invoke
    _memstat_mtl_empty() from memstat_mtl_free(), which also frees
    the containing list structure.

    Invoke _memstat_mtl_empty() instead of memstat_mtl_free() in
    various error cases in memstat_malloc.c and memstat_uma.c, which
    previously resulted in the list being freed prematurely.

  - Reverse the order of updating the mt_kegfree and mt_free fields
    of the memory_type in memstat_uma.c, otherwise keg free items
    won't be counted properly for non-secondary zones.

Merged to RELENG_6 earlier than the proposed MFC after date so that it
can make BETA2.

Approved by:	re (kensmith)
2005-08-01 17:14:51 +00:00
Christian S.J. Peron 18c0e01372 Synch with HEAD, this brings in net.bpf.stats.
MFC revision 1.155 (bpf.c)
MFC revision 1.30 (bpfdesc.h)

Approved by:	re@ (kensmith)
2005-07-31 00:48:18 +00:00
Christian S.J. Peron e216bce7c6 MFC revision 1.24
date: 2005/07/30 15:53:40;  author: csjp;  state: Exp;  lines: +2 -1
Add missing parenthesis around error handling code upon attaching
mlx devices. This fixes an issue where mlx device drives fail to be
detected at system boot.

Approved by:	re@ (scottl)
2005-07-31 00:41:53 +00:00
Maxime Henrion bb17d21560 MFC r1.241:
date: 2005/07/29 22:40:06;  author: mux;  state: Exp;  lines: +1 -0
  Add a new PCI id for fxp(4) cards found on ICH7-based systems.

  Submitted by:   Martin Nilsson <[email protected]>

Approved by:	re@ (kensmith)
2005-07-30 21:45:32 +00:00
Hiroki Sato b77930a605 MFC: Document IODATA USB-RSAQ3 USB-Serial Adapter as a supported device.
Approved by:	re (scottl)
2005-07-30 09:35:38 +00:00
Hiroki Sato a8af060793 MFC: Fix typos and use consistent section names in manual pages:
s/SYSCTLS/SYSCTL VARIABLES/
 s/TUNABLES/LOADER TUNABLES/
 s/CAVEAT/CAVEATS/
 s/DESCIPTION/DESCRIPTION/

Approved by:	re (scottl)
2005-07-30 09:34:58 +00:00
Joseph Koshy 92563e4bb7 MFC r1.7:
Add COMPATIBILITY and HISTORY sections.

Approved by:	re (kensmith)
2005-07-30 09:12:51 +00:00
Joseph Koshy 77623cb29f MFC r1.3:
Catch with the source code.  Sort a list alphabetically.  Add a
  HISTORY section.

Approved by:	re (kensmith)
2005-07-30 09:11:25 +00:00
Dag-Erling Smørgrav 55d4253c17 MFC: build BIND without thread support.
Approved by:	re (kensmith)
2005-07-30 07:56:28 +00:00
Pawel Jakub Dawidek 86f114ed16 MFC:
GEOM_ZERO class for performance testing.

Approved by:	re (kensmith)
2005-07-30 06:22:25 +00:00
Pawel Jakub Dawidek 36961839ef MFC: kern_malloc.c 1.145
Fix the way how "InUse" column in 'vmstat -m' output works:
- increase number of allocations count only on successfull malloc(9),
  so it doesn't confuse people;
- because we need to check if 'size > 0', hide 'mtsp->mts_memalloced += size;'
  under the check as well, as for size=0 it is of course a no-op;
- avoid critical_enter()/critical_exit() in case of failure in
  malloc_type_allocated() as there will be nothing to do.

OK'ed by:	rwatson
Approved by:	re (kensmith)
2005-07-30 06:14:57 +00:00
Sam Leffler 162fdd5837 MFC of api changes (missed in previous commit)
Approved by:	re (kensmith)
2005-07-30 04:09:06 +00:00
Sam Leffler 54df9d3b30 MFC: add fragthreshold support and accept - (or any) for rtsthreshold
Approved by:	re (kensmith)
2005-07-30 03:31:15 +00:00
Sam Leffler 8df2724438 MFC fixes to deal with interfaces being removed:
o we no longer loop
o wpa_supplicant terminates when the last configured interface goes away

Approved by:	re (kensmith)
2005-07-30 01:19:10 +00:00
Brooks Davis f102929348 Sync dhclient with HEAD:
- Don't complain when debouncing dhclient startup.
 - Fix buffer handling in reveive_packet().  This fixes infinite cpu
   eating loops and probably some crashes.
 - Spell if_defaultroute route correctly in dhclient-script so we
   are allowed to change the default route.
 - Document dhclient -b.
 - Treat reassociation like association.
 - Do not force server-name to be a valid domain name.
 - Handle servers that send NUL-terminated host-name options.

Approved by:	re (scottl)
2005-07-29 23:36:28 +00:00
Sam Leffler 479d871299 Sync wireless support from HEAD:
o numerous net80211 fixes including fixes for internal bridging,
  frag threshold ioctl, rts threshold bounds checking, min wep
  length check, reject assoc requests w/ wpa/rsn ie when wpa
  is not configured
o misc api changes to reduce differences against forthcoming changes
o add stats for future use and reserve space
o probe inactive neighbors in adhoc mode before timing them out
o debug msg fixups (diff reduction against forthcoming code)
o driver mods to track api changes

Also for ath driver:
o fix diversity handling
o use any fixed antenna setting when sending beacons in adhoc mode

Approved by:	re (kensmith)
2005-07-29 23:31:04 +00:00
Kris Kennaway 8c4009e8a3 MFC:
>  devfs is not yet fully MPSAFE - for example, multiple concurrent devfs(8)
>  processes can cause a panic when operating on rulesets.

Approved by:	re (scottl)
2005-07-29 23:21:23 +00:00
Kirill Ponomarev cb6bbeb753 MFC: main.c:1.6, perform.c:1.13, pkg_version.1:1.36, version.h:1.5
date: 2005/07/27 07:55:12;  author: krion;  state: Exp;  lines: +12 -2
  Add -o/-O options to pkg_version:

   -o  Show the origin recorded on package generation instead of the
       package name.

   -O  Only list packages whose registered origin is origin.

Approved by:	re (kensmith)
2005-07-29 18:16:06 +00:00
Maksim Yevmenkin 2e3f0078e6 Insta-MFC to RELENG_6
Fix typo and check correct (rsp) pointer against the NULL value.

Submitted by:	Oliver < urnenfel at tiscali dot es >
Approved by:	re (kensmith)
2005-07-29 16:42:42 +00:00
Nate Lawson 1eb7c7ca80 MFC: Bring up to HEAD. Notify user if they don't have permission to run
powerd and don't exit if the error is EPERM.

Approved by:	re (kensmith)
2005-07-29 16:34:05 +00:00
Nate Lawson 0789f51d77 MFC: Bring up to HEAD, fixing output format bugs and adding power status
support.

Approved by:	re (kensmith)
2005-07-29 16:31:58 +00:00
Nate Lawson 477d41b5de MFC: Bring acpi_battery support up to HEAD, changing the API slightly
and fixing various bugs.

Approved by:	re (kensmith)
2005-07-29 16:27:07 +00:00
Nate Lawson 5aae1134cb MFC: Use __FBSDID
Approved by:	re (kensmith)
2005-07-29 16:22:37 +00:00
Hajimu UMEMOTO 14ce655361 MFC 1.12: don't accept invalid form of an address like 1:2:3:4:5:6:7::8.
Approved by:	re (kensmith)
2005-07-29 16:10:35 +00:00
R. Imura e4c373935d MFC rev 1.2: Fix core dump when "smbutil lc".
Approved by:	re (kensmith)
2005-07-29 16:06:33 +00:00
R. Imura a5c00857ef MFC rev 1.17: Don't compile ral and ural in the PAE kernel.
Approved by:	re (kensmith)
2005-07-29 16:02:27 +00:00
Maxime Henrion c7d923647e MFC r1.441:
date: 2005/07/24 17:55:57;  author: mux;  state: Exp;  lines: +1 -2
  Add back ed(4) in amd64 GENERIC.  It now works nicely and since those
  chips are commonly found, it makes sense to have it in GENERIC.  This
  is a candidate for a RELENG_6 MFC.

  Approved by;    peter
  Requested by:   pav
  Tested by:      pav

Approved by:	re@ (kensmith)
2005-07-29 15:40:58 +00:00
Xin LI 6da205e913 MFC 1.123:
Allow PLAY_MSF, PLAY_TRACK, PLAY_TRACK_REL, PAUSE, PLAY_12 commands to pass
through umass(4), in order to make cdcontrol(1) to issue commands to a USB
CD driver.

The command IDs were obtained from the CAM subsystem.  This was tested
on half dozen of USB CD drivers from different vendors.

Suggested by:   "intron" <intron at intron dot ac>
PR:             usb/83439
Reviewed by:    sanpei
Approved by:	re (kensmith)
2005-07-29 15:39:26 +00:00
cvs2svn 2f1d7645a3 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-07-29 10:06:58 +00:00
Joseph Koshy 2c542cd084 MFC r1.9:
Fix breakage introduced in rev 1.7.

Approved by:	re (kensmith)
2005-07-29 03:01:40 +00:00
Joseph Koshy 1e51aefe2a MFC r1.12:
Use LK_CANRECURSE since when a PMC-owning process performs an exec(),
  the new text vnode is already locked by itself.

Approved by:	re (kensmith)
2005-07-29 02:58:34 +00:00
Robert Watson d6532dd220 Merge mbuf.c:1.43,1.44 and Makefile:1.27 from HEAD to RELENG_6:
Modify "netstat -mb" to use libmemstat(3) when acting on a live system,
  with a number of positive benefits:

  - Start using UMA(9) statistics for mbufs and clusters, which avoids
    using the mbuf allocator statistics which suffer from races under
    load on SMP.  This should eliminate "negative" mbuf counts in
    netstat -mb.

  - We are now able to track cached (free) mbufs and clusters and count
    it towards memory allocated by the network stack.

  - We are now also able to track memory allocated to mbuf tags since
    libmemstat(3) can also query malloc(9).  We don't print this except
    as part of the total (for now - #if 0).

  - We are now able to track mbuf/cluster/packet allocation failures,
    although they are not currently printed (#if 0).

  - Don't print out sfbuf statistics when running on a kernel core, as
    currently that code is able only to query sysctl for statistics.

mbuf.c:1.44:

  Since libmemstat(3) now supports its own error management mechanism,
  use that instead of trying to use errno, in order to produce a
  sensible error message.

Approved by:	re (kensmith)
2005-07-28 19:54:55 +00:00
Yoshihiro Takahashi 00e490fd10 MFi386: revision 1.616.2.1
> Use an interrupt gate for the NMI handler and prevent too-early
> enabling of interrupts inside of trap().

Approved by:	re (kensmith)
2005-07-28 17:22:39 +00:00
Robert Watson 40afa88159 Merge Makefile:1.206 from HEAD to RELENG_6:
Hook libmemstat(3) up to the build.

Approved by:	re (kensmith)
2005-07-28 13:47:18 +00:00
Robert Watson 642a159618 Merge memstat_uma.c:1.8 from HEAD to RELENG_6:
If a retrieved UMA zone is a secondary zone, don't report keg free
  items, as they actually belong to the  primary zone, and maye otherwise
  be reported more than once.

Approved by:	re (kensmith)
2005-07-28 12:11:41 +00:00
Robert Watson 901efb48ee Merge uma.h:1.27, uma_core.c:1.129 from HEAD to RELENG_6:
Rename UMA_MAX_NAME to UTH_MAX_NAME, since it's a maximum in the
  monitoring API, which might or might not be the same as the internal
  maximum (currently none).

  Export flag information on UMA zones -- in particular, whether or
  not this is a secondary zone, and so the keg free count should be
  considered in that light.

Approved by:	re (kensmith)
2005-07-28 12:10:19 +00:00
Joseph Koshy bd1e485634 MFC { exception.s:r1.114, machdep.c:r1.617, trap.c:r1.278 }
Use an interrupt gate for the NMI handler and prevent too-early
enabling of interrupts inside of trap().

Revert rev 1.113 of "sys/i386/i386/exception.s" as it is no longer
needed.

Approved by:	re (kensmith)
2005-07-28 03:30:53 +00:00
Peter Grehan 1a1ff37658 MFC, r1.234:
Make sure /etc/fstab is written out for Apple-partitioned drives

    reviewed by:    scottl

Approved by:	re (Ken Smith)
2005-07-28 01:18:19 +00:00
Peter Grehan 2de20a342e MFC, r1.161:
Recognise GEM ethernet adapter (sparc64/ppc).

    reviewed by:    scottl

Approved by:	re (Ken Smith)
2005-07-28 01:17:12 +00:00
Tai-hwa Liang c45b14bfb3 MFC: (1.5) Fixing an off-by-one error.
Approved by:	re (kensmith)
2005-07-27 12:45:36 +00:00
Colin Percival f9972d2994 Correct a buffer overflow which can occur when decompressing a
carefully crafted deflated data stream. [1]

Correct problems in the AES-XCBC-MAC IPsec authentication algorithm. [2]

Submitted by:   suz [2]
Security:       FreeBSD-SA-05:18.zlib [1], FreeBSD-SA-05:19.ipsec [2]
Approved by:	re (kensmith)
2005-07-27 08:41:44 +00:00
Scott Long 4a0870f54a MFC: Don't cross-reference VFS_START.9 anymore.
Approved by: re
2005-07-27 02:11:20 +00:00
Scott Long 1dbf6b57d9 MFC: Don't reference VFS_START.9 in the Makefile anymore.
Approved by: re
2005-07-27 02:10:45 +00:00
Hiten Pandya b4917925cb Remove the VFS_START(9) manual page because it's no longer relevant. The
entry point was removed as its only consumer was MFS.

MFC of revision 1.13 of src/share/man/man9/VFS_START.9

Approved by:	re (hrs)
2005-07-26 23:59:55 +00:00
Christian Brueffer 2ccc0a3ef2 MFC: rev. 1.5
snd_ess needs snd_sbc to compile.

Noticed by:	oliver
Approved by:	re (hrs)
2005-07-26 18:33:19 +00:00
Matthew N. Dodd 511f8d9c49 MFC: 1.13
Move initialization above point of first possible reference to
avoid overwriting ty_status values set from the 'type' field.
Approved by:	 re (scottl)
2005-07-25 20:19:39 +00:00
Andrew Thompson f8c953e8bc MFC: if_bridge.c, r1.13
>   Clear the PROMISC flag from the vlan interface when we remove a member. We
>   checked for IFT_L2VLAN in bridge_ioctl_add() but not bridge_delete_member().
>
>   Approved by:    mlaier (mentor)
>
>   Revision  Changes    Path
>   1.13      +1 -0      src/sys/net/if_bridge.c

Approved by:	re (kensmith), mlaier (mentor)
2005-07-25 18:55:11 +00:00
Garance A Drosehn 18812dac86 MFC 1.3: Correct one regression test, and add a few more tests.
Approved by:	re(kensmith)
2005-07-25 18:52:07 +00:00
Garance A Drosehn fd04ed945d MFC 1.3->1.4: Fix minor bugs in -S processing:
1) An unquoted space is always a separator, even when not "in_arg".
 2) When a new destination buffer must be allocated during variable
    substitution, only copy data from the active buffer to the new
    one when we *are* "in_arg".
 3) Fix minor memory leak when expanding ${variable}s

Approved by:	re(kensmith)
2005-07-25 18:09:09 +00:00
Maksim Yevmenkin bfab6bd09d MFC to RELENG_6 ng_ubt.c v1.25
Add support for AVM BlueFRITZ! USB Bluetooth Adapter v2.0. It appears that
there are at least two versions of the adapter. Version 1 (product ID 0x2200)
of the adapter does not work with ng_ubt(4) and require special driver and
firmware. Version 2 (product ID 0x3800) seems to work just fine, except it
does not have bDeviceClass, bDeviceSubClass and bDeviceProtocol set to required
(by specification) values. This change forces ng_ubt(4) to attach to the
version 2 adapter.

Ignore AVM BlueFRITZ! USB Bluetooth Adapter v1.0 (product ID 0x2200).
It does not work with ng_ubt(4) and require special driver and firmware.

Submitted by:	Rainer Goellner < rainer at jabbe dot de >
Approved by:	re (kensmith)
Obtained from:	Marcel Holtmann < marcel at holtmann dot org >
2005-07-25 16:22:38 +00:00
Maksim Yevmenkin e76a66e639 MFC to RELENG_6
Fix kernel panic with vkbd(4). Initialize mutex properly (set name), or else
WITNESS gets upset.

Approved by:	re (kensmith)
2005-07-25 16:16:52 +00:00
Ken Smith f60852c0fb New __FreeBSD_version to mark the shared library version bump.
Approved by:	re (hrs)
2005-07-25 13:30:18 +00:00
Hiten Pandya 6f80dd38ed MFC revision 1.27, correct prototype for devstat_compute_etime(3) and
minor wordsmithing in nearby sentences.

PR:         	docs/82636
Approved by:	re (hrs)
2005-07-25 12:31:55 +00:00
Robert Watson 92c22a55fe Merge mac_stub.c:1.54 from HEAD to RELENG_6:
Remove duplicate initialization of mpo_create_stub pointer.

  PR:             83779
  Submitted by:   Wojciech A. Koszek <dunstan at freebsd dot czest dot pl>

Approved by:	re (kensmith)
2005-07-25 09:45:24 +00:00
Robert Watson 3cf6fc73c4 Merge kern_mbuf.c:1.10, uipc_mbuf.c:1.32, mbuf.h:1.171 from HEAD to
RELENG_6:

  Define four constants, MBUF_{,MEM,CLUSTER,PACKET,TAG}_MEM_NAME, which
  are string names for their respective UMA zones and malloc types, and
  are passed into uma_zcreate() and MALLOC_DEFINE().  Export them
  outside of _KERNEL in mbuf.h so that netstat can reference them.

  Change the names to improve consistency, with each zone/type
  associated with the mbuf allocator being prefixed mbuf_.

Approved by:	re (kensmith)
2005-07-25 00:08:12 +00:00
Robert Watson 30f90b2dca Merge bsd.libnames.mk:1.95 from HEAD to RELENG_6:
Add LIBMEMSTAT tp bsd.libnames.mk.

Approved by:	re (kensmith)
2005-07-24 16:17:25 +00:00
Robert Watson b9f89d829c Merge libmemstat(3) from HEAD to RELENG_6. Original commit description:
Add libmemstat(3), a library for use by debugging and monitoring
  applications in tracking kernel memory statistics.  It provides an
  abstracted interface to uma(9) and malloc(9) statistics, wrapped
  around the recently added binary stream sysctls for the allocators.

  Using this interface, it is easy to build monitoring tools, query
  specific memory types for usage information, etc.  Facilities are
  provided for binding caller-provided data to memory types,
  incremental updates of memory types, and queries that span multiple
  allocators.

  Support for additional allocators is (relatively) easy to add.

  The API for libmemstat(3) will probably change some over time as
  consumers are written, and requirements evolve.  It is written to
  avoid encoding ABIs for data structure layout into consuming
  applications for this reason.

This change merges all improvements, enhancements, bug fixes, etc, as
of this date.  Revisions merged are:

  Makefile:1.1-1.3
  libmemstat.3:1.1-1.6
  memstat.h:1.1-1.7
  memstat_all.c:1.1
  memstat_internal.h:1.5
  memstat_malloc.c:1.1-1.4
  memstat_uma.c:1.1-1.7

Approved by:	re (kensmith)
2005-07-24 14:49:49 +00:00
cvs2svn e0b04eb627 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-07-24 01:41:48 +00:00
Robert Watson 44e2176466 Merge kern_malloc.c:1.143,1.144 malloc.h:1.81 from HEAD to RELENG_6:
Introduce a new sysctl, kern.malloc_stats, which exports kernel malloc
  statistics via a binary structure stream:

  - Add structure 'malloc_type_stream_header', which defines a stream
    version, definition of MAXCPUS used in the stream, and a number of
    malloc_type records in the stream.

  - Add structure 'malloc_type_header', which defines the name of the
    malloc type being reported on.

  - When the sysctl is queried, return a stream header, followed by a
    series of type descriptions, each consisting of a type header
    followed by a series of MAXCPUS malloc_type_stats structures holding
    per-CPU allocation information.  Typical values of MAXCPUS will be 1
    (UP compiled kernel) and 16 (SMP compiled kernel).

  This query mechanism allows user space monitoring tools to extract
  memory allocation statistics in a machine-readable form, and to do so
  at a per-CPU granularity, allowing monitoring of allocation patterns
  across CPUs in order to better understand the distribution of work and
  memory flow over multiple CPUs.

  While here:

  - Bump statistics width to uint64_t, and hard code using fixed-width
    type in order to be more sure about structure layout in the stream.
    We allocate and free a lot of memory.

  - Add kmemcount, a counter of the number of registered malloc types,
    in order to avoid excessive manual counting of types.  Export via a
    new sysctl to allow user-space code to better size buffers.

  - De-XXX comment on no longer maintaining the high watermark in old
    sysctl monitoring code.

  A follow-up commit of libmemstat(3), a library to monitor kernel memory
  allocation, will occur in the next few days.  Likewise, similar changes
  to UMA.

kern_malloc.c:1.144:

  Correct build on 64-bit: cast u_int64_t to (unsigned long long) before
  printfing as (unsigned long long).  32-bit build on i386 didn't notice
  this.  Whoops.

  Reported by:    arved
  Tested by:      sledge

Approved by:	re (kensmith)
2005-07-23 17:11:33 +00:00
Max Laier a3c051ff3a MFC: -sp pfsync
Print newly exported pfsync statistics with netstat(8).

  Requested by:   glebius

Approved by:	re (kensmith)
2005-07-23 17:03:59 +00:00
Max Laier cb08093a44 MFC: if_pfsync.c, 1.20 in_proto.c, 1.78
Export pfsyncstats via sysctl "net.inet.pfsync" in order to print them
  with netstat (seperate commit).

  Requested by:   glebius

Approved by:	re (kensmith)
2005-07-23 17:02:10 +00:00
R. Imura 5e71040dc5 MFC 1.45: Fix looking up files having invalid short name.
PR:		77074
Approved by:	re (kensmith)
2005-07-23 17:02:04 +00:00
Max Laier 8790c1d23d MFC: if.c, 1.236
Move eventhandler for 'ifnet_departure_event' at the end of the progress.
  Some of the (IPv6) cleanup functions send packets to inform peers of the
  departure.  These packets confused users of ifnet_departure_event (pf at
  the moment).

  PR:             kern/80627
  Tested by:      Divacky Roman

Approved by:	re (kensmith)
2005-07-23 17:00:07 +00:00
Robert Watson 9a684f5523 Merge uma_core.c:1.128 from HEAD to RELENG_6:
Further UMA statistics related changes:

    - Add a new uma_zfree_internal() flag, ZFREE_STATFREE, which causes it to
      to update the zone's uz_frees statistic.  Previously, the statistic was
      updated unconditionally.

    - Use the flag in situations where a "real" free occurs: i.e., one where
      the caller is freeing an allocated item, to be differentiated from
      situations where uma_zfree_internal() is used to tear down the item
      during slab teardown in order to invoke its fini() method.  Also use
      the flag when UMA is freeing its internal objects.

    - When exchanging a bucket with the zone from the per-CPU cache when
      freeing an item, flush cache statistics back to the zone (since the
      zone lock and critical section are both held) to match the allocation
      case.

Approved by:	re (kensmith)
2005-07-23 15:11:13 +00:00
Robert Watson 2a6e440a26 Merge uma_core.c:1.127 from HEAD to RELENG_6:
Use mp_maxid in preference to MAXCPU when creating exports of UMA
  per-CPU cache statistics.  UMA sizes the cache array based on the
  number of CPUs at boot (mp_maxid + 1), and iterating based on MAXCPU
  could read off the end of the array (into the next zone).

  Reported by:    yongari

Approved by:	re (kensmith)
2005-07-23 15:10:29 +00:00
Robert Watson 42a3182cd4 Merge uma.h:1.26, uma_int.h:1.36, uma_core.c:1.126 from HEAD to
RELENG_6:

  Improve canonicalization of copyrights.  Order copyrights by order of
  assertion (jeff, bmilekic, rwatson).

  Suggested ages ago by:  bde

Approved by:	re (kensmith)
2005-07-23 15:10:00 +00:00
Robert Watson 7dccfdfd47 Merge uma_core.c:1.125 from HEAD to RELENG_5:
Move the unlocking of the zone mutex in sysctl_vm_zone_stats() so that
  it covers the following of the uc_alloc/freebucket cache pointers.
  Originally, I felt that the race wasn't helped by holding the mutex,
  hence a comment in the code and not holding it across the cache access.
  However, it does improve consistency, as while it doesn't prevent
  bucket exchange, it does prevent bucket pointer invalidation.  So a
  race in gathering cache free space statistics still can occur, but not
  one that follows an invalid bucket pointer, if the mutex is held.

  Submitted by:   yongari

Approved by:	re (kensmith)
2005-07-23 15:08:53 +00:00
Robert Watson e645659366 Merge uma.h:1.25, uma_int.h:1.35, uma_core.c:1.124 from HEAD to
RELENG_6:

  Increase the flags field for kegs from a 16 to a 32 bit value;
  we have exhausted all 16 flags.

Approved by:	re (kensmith)
2005-07-23 15:08:12 +00:00
Robert Watson 3f05780ca4 Merge uma.h:1.24, uma_int.h:1.34, uma_core.c:1.123 from HEAD to
RELENG_6:

  Track UMA(9) allocation failures by zone, and export via sysctl.

  Requested by:   victor cruceru <victor dot cruceru at gmail dot com>

Approved by:	re (kensmith)
2005-07-23 15:06:54 +00:00
Robert Watson 6ab1c7df2e Merge uma.h:1.23, uma_int.h:1.33, uma_core.c:1.122 from HEAD to
RELENG_6:

  Introduce a new sysctl, vm.zone_stats, which exports UMA(9) allocator
  statistics via a binary structure stream:

  - Add structure 'uma_stream_header', which defines a stream version,
    definition of MAXCPUs used in the stream, and the number of zone
    records in the stream.

  - Add structure 'uma_type_header', which defines the name, alignment,
    size, resource allocation limits, current pages allocated, preferred
    bucket size, and central zone + keg statistics.

  - Add structure 'uma_percpu_stat', which, for each per-CPU cache,
    includes the number of allocations and frees, as well as the number
    of free items in the cache.

  - When the sysctl is queried, return a stream header, followed by a
    series of type descriptions, each consisting of a type header
    followed by a series of MAXCPUs uma_percpu_stat structures holding
    per-CPU allocation information.  Typical values of MAXCPU will be
    1 (UP compiled kernel) and 16 (SMP compiled kernel).

  This query mechanism allows user space monitoring tools to extract
  memory allocation statistics in a machine-readable form, and to do so
  at a per-CPU granularity, allowing monitoring of allocation patterns
  across CPUs in order to better understand the distribution of work and
  memory flow over multiple CPUs.

  While here, also export the number of UMA zones as a sysctl
  vm.uma_count, in order to assist in sizing user swpace buffers to
  receive the stream.

  A follow-up commit of libmemstat(3), a library to monitor kernel memory
  allocation, will occur in the next few days.  This change directly
  supports converting netstat(1)'s "-mb" mode to using UMA-sourced stats
  rather than separately maintained mbuf allocator statistics.

Approved by:	re (kensmith)
2005-07-23 15:05:24 +00:00
Robert Watson dc7a1fc3f8 Merge uma_int.h:1.32, uma_core.c:1.121 from HEAD to RELENG_6:
In addition to tracking allocs in the zone, also track frees.  Add
  a zone free counter, as well as a cache free counter.

Approved by:	re (kensmith)
2005-07-23 15:03:49 +00:00
Robert Watson 9c910b2e18 Merge uma_core.c:1.20 from HEAD to RELENG_6:
In an earlier world order, UMA would flush per-CPU statistics to the
  zone whenever it was moving buckets between the zone and the cache,
  or when coalescing statistics across the CPU.  Remove flushing of
  statistics to the zone when coalescing statistics as part of sysctl,
  as we won't be running on the right CPU to write to the cache
  statistics.

  Add a missed gathering of statistics: when uma_zalloc_internal()
  does a special case allocation of a single item, make sure to update
  the zone statistics to represent this.  Previously this case wasn't
  accounted for in user-visible statistics.

Approved by:	re (kensmith)
2005-07-23 15:01:48 +00:00
Hajimu UMEMOTO 3efa946cbc MFC 1.418: mention getaddrinfo(3) ABI breakage on 64 bit arch.
Approved by:	re (kensmith)
2005-07-22 20:21:50 +00:00
Hajimu UMEMOTO 180e5a2537 MFC: Remove padding for ABI compatibility of ai_addrlen member
from struct addrinfo.  This change break ABI compatibility on
64 bit arch.

	include/netdb.h:		1.39
	lib/libc/net/getaddrinfo.c:	1.70

Approved by:	re (kensmith)
2005-07-22 20:17:30 +00:00
Ken Smith 3f0da39ca5 Insta-MFC of the shared library version bump. All shared libraries
whose version has not already been bumped since RELENG_5 are being
bumped.

Revisions of files being MFC-ed:

> Path						Revision
> src/gnu/lib/libdialog/Makefile		1.43
> src/gnu/lib/libg2c/Makefile			1.16
> src/gnu/lib/libobjc/Makefile			1.27
> src/gnu/lib/libreadline/Makefile.inc		1.12
> src/gnu/lib/libregex/Makefile			1.32
> src/gnu/lib/libstdc++/Makefile		1.56
> src/kerberos5/lib/Makefile.inc		1.7
> src/lib/Makefile.inc				1.3
> src/lib/libalias/Makefile			1.31
> src/lib/libarchive/Makefile			1.37
> src/lib/libbegemot/Makefile			1.3
> src/lib/libbluetooth/Makefile			1.2
> src/lib/libbsnmp/Makefile.inc			1.6
> src/lib/libbz2/Makefile			1.6
> src/lib/libc_r/Makefile			1.42
> src/lib/libcrypt/Makefile			1.36
> src/lib/libdevstat/Makefile			1.15
> src/lib/libdevstat/devstat.h			1.11
> src/lib/libedit/Makefile			1.29
> src/lib/libexpat/Makefile			1.5
> src/lib/libfetch/Makefile			1.45
> src/lib/libftpio/Makefile			1.14
> src/lib/libgpib/Makefile			1.2
> src/lib/libipsec/Makefile			1.17
> src/lib/libkiconv/Makefile			1.3
> src/lib/libmagic/Makefile			1.7
> src/lib/libmp/Makefile			1.10
> src/lib/libncp/Makefile			1.6
> src/lib/libncurses/Makefile			1.79
> src/lib/libnetgraph/Makefile			1.11
> src/lib/libngatm/Makefile			1.6
> src/lib/libopie/Makefile			1.21
> src/lib/libpam/Makefile.inc			1.17
> src/lib/libpthread/Makefile			1.54
> src/lib/libradius/Makefile			1.12
> src/lib/libsdp/Makefile			1.4
> src/lib/libsmb/Makefile			1.8
> src/lib/libtacplus/Makefile			1.7
> src/lib/libthr/Makefile			1.14
> src/lib/libthread_db/Makefile			1.6
> src/lib/libugidfw/Makefile			1.7
> src/lib/libusbhid/Makefile			1.10
> src/lib/libutil/Makefile			1.57
> src/lib/libvgl/Makefile			1.11
> src/lib/libwrap/Makefile			1.17
> src/lib/libypclnt/Makefile			1.13
> src/lib/msun/Makefile				1.72
> src/secure/lib/libcrypto/Makefile		1.74
> src/secure/lib/libssh/Makefile		1.35
> src/secure/lib/libssl/Makefile		1.22
> src/usr.sbin/bsnmpd/modules/Makefile.inc	1.10

Reviewed by:	ru
Approved by:	re (scottl)
2005-07-22 17:29:10 +00:00
Scott Long 19997e47e0 MFC rev 1.55: Check the correct IDs for the Dell PERC3/S/Di filter driver.
Approved by: re
2005-07-22 16:29:51 +00:00
Maksim Yevmenkin 0b5d902920 MFC to RELENG_6
kbdmux(4) keyboard multiplexer integration

o Hook up kbdmux(4) to the build.

Approved by:	re (kensmith)
2005-07-21 17:47:27 +00:00
Ken Smith f9271dae74 Forced commit to note the RELENG_6 branch tag was added to this file so
it can be part of the 6.0 release.

Requested by:	emax
Approved by:	re (implicit)
2005-07-21 17:09:24 +00:00
Maksim Yevmenkin dc6648522c MFC to RELENG_6
kbdmux(4) keyboard multiplexer integration

o Teach kbdcontrol(1) how to attach/detach keyboards to/from the keyboard
  multiplexor;

o Update kbdcontrol(1) man page and document new functionality.

To attach/detach keyboard to/from keyboard multiplexor one needs to use
keyboard device name (i.e. ukbd0).

Approved by:	re (kensmith)
2005-07-21 17:04:02 +00:00
Ken Smith 218619d2eb Forced commit to note the RELENG_6 branch tag was added so this file
can be part of the 6.0 release.

Requested by:	emax
Approved by:	re (implicit)
2005-07-21 16:41:18 +00:00
Ken Smith 6ab5a30d48 Forced commit to note the RELENG_6 branch tag was added to this file
so it can be part of the 6.0 release.

Requested by:	emax
Approved by:	re (implicit)
2005-07-21 16:40:07 +00:00
Paul Saab 675663d93a MFC: rev 1.127
Fix for a NFS soft mounts bug where if the number of retries exceeds
the max rexmits, the request was not being bounced back with a
ETIMEDOUT error.

Approved by:	re
2005-07-21 16:19:02 +00:00
Robert Watson d9b4d8208c Merge ifconfig.8:1.98, ifconfig.c:1.115, ifconfig.h:1.17,
ifieee80211.c:1.19 from HEAD to RELENG_6:

  Add a new flag '-k' to ifconfig(8), indicating that it is alright to
  print potentially sensitive keying material to stdout.  With the new
  802.11 support, ifconfig(8) is now capable of printing 802.11 keys,
  and did by default for the root user, which is undesirable in some
  environments.  Now it will not print keying material unless requested
  (and available to the user).

Approved by:	re (kensmith)
2005-07-21 12:25:40 +00:00
cvs2svn fcc7eb90c9 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-07-20 21:10:58 +00:00
Hartmut Brandt 3dd8ef558e MFC to RELENG_6.
Fix the "..." special command. If this command is found all further
commands for this target are appended to the .END target instead
of beeing executed now. They are executed when the graph is finished.
There was a bug with executing the .END target which came in when
doing conversion to LST_FOREACH() which caused make to dump core.

PR:		bin/83698
Submitted by:	Max Okumoto <[email protected]>
Approved by:	re
2005-07-20 19:05:23 +00:00
Maksim Yevmenkin 484fe85e27 MFC to RELENG_6
kbdmux(4) keyboard multiplexer integration

o Add two new ioctl's KBADDKBD and KBRELKBD. These are used to add and remove
  keyboard to (and from) kbdmux(4) keyboard multiplexer;

o Introduce new kbd_find_keyboard2() function. It does exactly the same job
  as kbd_find_keyboard() function except it allows to specify starting index.
  This function can be used to iterate over keyboards array;

o Re-implement kbd_find_keyboard() as call to kbd_find_keyboard2() with starting
  index of zero;

o Make sure syscons(4) passed KBADDKBD and KBRELKBD ioctl's onto currently
  active keyboard.

These changes should not have any visible effect.

Approved by:	re (kensmith)
2005-07-20 18:56:21 +00:00
John Baldwin 73321f9f7f Regenerate.
Approved by:	re (kensmith) (implicit)
2005-07-20 17:43:53 +00:00
John Baldwin d9c455d827 MFC: Sync up the MP safe flags of the compat ABIs with the master list and
mark known-safe ABI syscall wrappers as MP safe.

Approved by:	re (kensmith)
2005-07-20 17:42:15 +00:00
Simon L. B. Nielsen c7033163cf MFC rev 1.116 of src/sys/fs/devfs/devfs_vnops.c:
Correct devfs ruleset bypass.

Submitted by:	csjp
Reviewed by:	phk
Security:	FreeBSD-SA-05:17.devfs
Approved by:	re (scottl)
2005-07-20 13:35:07 +00:00
Pawel Jakub Dawidek f2a20a86ef MFC: g_concat.c 1.25
g_stripe.c	1.26

Before calling g_orphan_provider(), add G_PF_WITHER flag, so GEOM will know
to destroy it.

PR:		kern/81758
Submitted by:	trasz <[email protected]>
Approved by:	re (kensmith)
2005-07-20 13:12:20 +00:00
Robert Watson 331f12d6fe Merge ip_input.c:1.302 from HEAD to RELENG_6:
Remove spl() calls from ip_slowtimo(), as IP fragment queue locking was
  merged several years ago.

Approved by:	re (kensmith)
2005-07-20 12:03:38 +00:00
Robert Watson ca00b7f8a8 Merge if_sbsh.c:1.13 from HEAD to RELENG_6:
Mark if_sbsh as IFF_NEEDSGIANT, because it does.

Approved by:	re (kensmith)
2005-07-20 09:41:52 +00:00
Robert Watson 7245178f54 Merge if_cnw.c:1.19 from HEAD to RELENG_6:
Mark if_cnw as IFF_NEEDSGIANT, because it does.

Approved by:	re (kensmith)
2005-07-20 09:41:08 +00:00
Andrew Thompson 553561ff8f MFC: Allow interfaces with MTU != 1500 to be bridged
> 1.6       +3 -0      src/share/man/man4/if_bridge.4
> 1.12      +6 -1      src/sys/net/if_bridge.c

Approved by:	re (kensmith), mlaier (mentor)
2005-07-19 23:25:39 +00:00
John Baldwin 83b3a3b0e5 MFC: Add 'sysent' target.
Approved by:	re (kensmith)
2005-07-18 19:54:49 +00:00
John Baldwin 693129ffa7 MFC: Fix instant panics when booting with debug.mpsafevm=0 by fixing up
an old test.

Approved by:	re (kensmith)
2005-07-18 19:53:21 +00:00
John Baldwin a66c012789 MFC: Set timer0_max_count to a correct value in the lapic timer case and
fix i8254_restore() so that it actually works in the non-lapic timer case
thus unbreaking suspend/resume for several people.

Approved by:	re (kensmith)
2005-07-18 19:52:05 +00:00
John Baldwin 0cf8ca56fe MFC: Wrap freebsd32_mmap_partial() with Giant.
Approved by:	re (kensmith)
2005-07-18 19:49:48 +00:00
John Baldwin 98a54bfa70 Regenerate after IPC syscall addition.
Approved by:	re (kensmith) (implicit)
2005-07-18 19:48:44 +00:00
John Baldwin b3c5f9841c MFC: Stop hardcoding #define's and hook up the IPC syscalls.
Approved by:	re (kensmith)
2005-07-18 19:48:13 +00:00
John Baldwin 4eea996813 MFC: Don't provide an acpi attachment for the non-pnp mss(4) driver.
Approved by:	re (kensmith)
MFC after:	1 week
2005-07-18 19:46:38 +00:00
John Baldwin 57b2704343 MFC: Ignore BIOS IRQs > 15.
Approved by:	re (kensmith)
MFC after:	1 week
2005-07-18 19:45:21 +00:00
John Baldwin 44de88001d MFC: Don't probe PnP ISA devices.
Approved by:	re (kensmith)
MFC after:	1 week
2005-07-18 19:43:45 +00:00
Pawel Jakub Dawidek 4633afd963 MFC: geom_raid3.c 1.12
Don't forget to initialize 'id' field.

Approved by:	re (kensmith)
2005-07-18 16:14:21 +00:00
Yaroslav Tykhiy a97fa107c5 MFC 1.114: Add missing symbolic names of new interface flags.
Approved by:	re (kensmith)
2005-07-18 14:02:19 +00:00
Ken Smith 2c50af1e2f MFC addition of the COMPAT_FREEBSD5 option. Specific versions
being MFCed:

> Path                          Revision
> src/sys/alpha/conf/GENERIC    1.187
> src/sys/amd64/conf/GENERIC    1.440
> src/sys/i386/conf/GENERIC     1.430
> src/sys/ia64/conf/GENERIC     1.73
> src/sys/pc98/conf/GENERIC     1.270
> src/sys/powerpc/conf/GENERIC  1.49
> src/sys/sparc64/conf/GENERIC  1.97

Approved by:    re (scottl)
2005-07-18 12:23:42 +00:00
Peter Grehan 536a114421 MFC: r1.22
Remove obsolete ttya/ttyb entries and replace with ttyy0/1.
Mark origin of ofw_console(4) and zs(4) devices.

Approved by:	re (Ken Smith)
2005-07-18 12:06:38 +00:00
Sheldon Hearn 49789c8663 MFC rev 1.34: regen
Approved by:	re (kensmith)
2005-07-18 07:45:17 +00:00
Joe Marcus Clarke 7cbc8b473d MFC: revs 1.23 and 1.24
* Replace fch{mod,own} with straight ch{mod,own} as the former cannot be used
  on socket file descriptors
* Open permissions on /var/run/devd.pipe so that any user can read devd events
  from this socket
* Enable non-blocking I/O on devd.pipe to keep clients from wedging devd.
  If a write(2) on devd.pipe would block, the client in question will be
  removed

Approved by:	re (kensmith)
2005-07-18 02:10:22 +00:00
Robert Watson 1ff39e3d4b Merge pmcstat.8:1.6 from HEAD to RELENG_6:
Fix spelling error in sample command.

Approved by:	re (hrs)
2005-07-17 19:32:27 +00:00
Robert Watson 5b6aa6b30e Merge sem_init.3:1.18, sem_post.3:1.15, sem_wait.3:1.13 from HEAD to
RELENG_6:

  Cross-reference sem_getvalue(3) from several other semaphore-related
  functions.

Approved by:	re (hrs)
2005-07-17 19:28:55 +00:00
Xin LI 2fe0b3eca2 MFC revision 1.13
date: 2005/07/13 10:40:07;  author: delphij;  state: Exp;  lines: +7 -4
Better memory handling:

 - It is acceptable to call free(3) when the given pointer itself
   is NULL, so we do not need to determine NULL before passing
   a pointer to free(3)
 - Handle failure of malloc(3)

Submitted by:	Dan Lukes <dan at obluda cz>
PR:		bin/83352
Approved by:	re (scottl)
2005-07-17 17:29:22 +00:00
Christian Brueffer 8041946bb9 MFC:
- Remove MLINKS to nonexistant manpages
- Change some section numbers to match reality
- For MLINKS to manpages from ports, mention which port installs them

Approved by:	re (hrs)
2005-07-17 15:03:36 +00:00
Christian Brueffer b9f7c53437 MFC: rev. 1.321
MLINK firewire.4 to ieee1394.4

Approved by:	re (hrs)
2005-07-17 14:48:55 +00:00
Christian Brueffer 27294cdf64 MFC: rev. 1.96 + 1.97
Information about the capability flags in 'ifconfig foo0 scan' output.

Approved by:	re (hrs), (earlier version)
2005-07-16 19:09:56 +00:00
Christian Brueffer 368bf4117b MFC:
Spelling and grammar fixes.

Approved by:	re (kensmith)
2005-07-16 19:02:21 +00:00
Hideyuki KURASHINA 7d059b855d In Contributed Software section,
- lukemftp is derived from NetBSD, actually.
  - Unify OpenPAM entries.

Fix a typo.

Approved by:	re (hrs)
2005-07-15 18:39:44 +00:00
Hiroki Sato b782659d00 Update $RDIR to 6-STABLE.
Approved by:	re (implicitly)
2005-07-15 15:19:21 +00:00
Hiroki Sato b2b76485d5 Update version numbers to 6-STABLE.
Approved by:	re (implicitly)
2005-07-15 15:18:42 +00:00
Renato Botelho 140f02b650 Add myself to FreeBSD calendar
Approved by:	re (Ken Smith), flz (mentor)
2005-07-15 14:46:00 +00:00
Ken Smith 1b232a83d4 Sync name with current BETA builds.
Approved by:	re (implicit)
2005-07-15 11:40:36 +00:00
Ken Smith 7e967f429a Drop the -A argument to the cvs command which is no longer necessary.
Noticed by:	delphij, ru
Pointy hat:	kensmith
Approved by:	re (implicit)
2005-07-14 15:47:48 +00:00
Ken Smith 882f477d3c Retro-fit packages-5.4-release entry.
Approved by:	re (implicit)
2005-07-11 16:14:21 +00:00
Ken Smith 0069ee36ba Update branch tag.
Approved by:	re (implicit)
2005-07-11 16:07:25 +00:00
Ken Smith cdc8bfa000 Suggest this is a -STABLE branch now.
Approved by:	re (implicit)
2005-07-11 16:06:30 +00:00
Ken Smith 22bab6ba12 Add 7.0 as a version not in doc-common.
Approved by:	re (implicit)
2005-07-11 16:04:22 +00:00
Ken Smith 25df33fe8e Note date of RELENG_6 branch.
Approved by:	re (implicit)
2005-07-11 16:02:28 +00:00
Ken Smith 3f429c0918 Add branch tag for cvs update operation.
Approved by:	re (implicit)
2005-07-11 16:01:33 +00:00
Scott Long 8714d54f58 Welcome to 6.0-BETA. I, for one, welcome our new RELENG_6 overlords.
Approved by: re
2005-07-11 08:45:10 +00:00
cvs2svn 4f345d81ac This commit was manufactured by cvs2svn to create branch 'RELENG_6_0'. 2005-07-11 04:14:44 +00:00
cvs2svn 6ac68e81ff This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-07-11 04:14:43 +00:00
2025 changed files with 62094 additions and 190027 deletions

No files matched your search

+1 -9
View File
@@ -87,7 +87,7 @@ CLEANDIR= cleandir
.endif
CVS?= cvs
CVSFLAGS?= -A -P -d -I!
CVSFLAGS?= -r RELENG_6_0 -P -d -I!
SUP?= /usr/local/bin/cvsup
SUPFLAGS?= -g -L 2 -P -
.if defined(SUPHOST)
@@ -973,14 +973,6 @@ _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libexpat \
lib/libopie__L lib/libtacplus__L: lib/libmd__L
.if !defined(NO_BIND)
.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "sparc64"
_prebuild_libs+= lib/libc_r
.else
_prebuild_libs+= lib/libpthread
.endif
.endif
_generic_libs+= lib
.if !defined(NO_CRYPT)
+30 -23
View File
@@ -1,4 +1,4 @@
Updating Information for FreeBSD current users
Updating Information for FreeBSD STABLE users
This file is maintained and copyrighted by M. Warner Losh
<[email protected]>. See end of file for further details. For commonly
@@ -8,18 +8,25 @@ Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running
portupgrade.
NOTE TO PEOPLE WHO THINK THAT FreeBSD 6.x IS SLOW:
FreeBSD 6.x 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.
20051101:
FreeBSD 6.0-RELEASE
20051011: FreeBSD-SA-05:21.openssl
Correct a man-in-the-middle SSL version rollback vulnerability.
20051001:
kern.polling.enable sysctl MIB is now deprecated. Use ifconfig(8)
to turn polling(4) on your interfaces.
20050722:
The ai_addrlen of a struct addrinfo was changed to a socklen_t
to conform to POSIX-2001. This change broke an ABI
compatibility on 64 bit architecture. You have to recompile
userland programs that use getaddrinfo(3) on 64 bit
architecture.
20050711:
RELENG_6 branched here.
20050629:
The pccard_ifconfig rc.conf variable has been removed and a new
@@ -224,6 +231,9 @@ COMMON ITEMS:
prefix all make commands with 'env -i '. See the env(1) manual
page for more details.
Due to several updates to the build infrastructure, source
upgrades from versions prior to 5.3 no longer supported.
To build a kernel
-----------------
If you are updating from a prior version of FreeBSD (even one just
@@ -242,7 +252,7 @@ COMMON ITEMS:
To just build a kernel when you know that it won't mess you up
--------------------------------------------------------------
This assumes you are already running a 5.X system. Replace
This assumes you are already running a 6.X system. Replace
${arch} with the architecture of your machine (e.g. "i386",
"alpha", "amd64", "ia64", "pc98", "sparc64", etc).
@@ -295,8 +305,8 @@ COMMON ITEMS:
<reboot>
To upgrade in-place from 5.x-stable to current
----------------------------------------------
To upgrade in-place from 5.x-stable or higher to 6.x-stable
-----------------------------------------------------------
<make sure you have good level 0 dumps>
make buildworld [9]
make kernel KERNCONF=YOUR_KERNEL_HERE [8]
@@ -341,13 +351,10 @@ COMMON ITEMS:
[5] Usually this step is a noop. However, from time to time
you may need to do this if you get unknown user in the following
step. It never hurts to do it all the time. You may need to
install a new mergemaster (cd src/usr.sbin/mergemaster && make
install) after the buildworld before this step if you last updated
from current before 20020224 or from -stable before 20020408.
step. It never hurts to do it all the time.
[8] In order to have a kernel that can run the 4.x binaries
needed to do an installworld, you must include the COMPAT_FREEBSD4
[8] In order to have a kernel that can run the 5.x binaries
needed to do an installworld, you must include the COMPAT_FREEBSD5
option in your kernel. Failure to do so may leave you with a system
that is hard to boot to recover.
@@ -367,7 +374,7 @@ COMMON ITEMS:
FORMAT:
This file contains a list, in reverse chronological order, of major
breakages in tracking -current. Not all things will be listed here,
breakages in tracking -STABLE. Not all things will be listed here,
and it only starts on October 16, 2004. Updating files can found in
previous releases if your system is older than this.
+5 -5
View File
@@ -673,7 +673,7 @@ which can be used later to refer to the job in the commands described below.
Job numbers remain
the same until the job terminates and then are re-used.
.PP
When a job is started in the backgound using `&', its number, as well
When a job is started in the background using `&', its number, as well
as the process numbers of all its (top level) commands, is typed by the shell
before prompting you for another command.
For example,
@@ -699,7 +699,7 @@ foreground job. A background job can become suspended by using the
.I stop
command described below. When jobs are suspended they merely stop
any further progress until started again, either in the foreground
or the backgound. The shell notices when a job becomes stopped and
or the background. The shell notices when a job becomes stopped and
reports this fact, much like it reports the termination of background jobs.
For foreground jobs this looks like
.DS
@@ -742,7 +742,7 @@ starts `du' in the foreground, stops it before it finishes, then continues
it in the background allowing more foreground commands to be executed.
This is especially helpful
when a foreground job ends up taking longer than you expected and you
wish you had started it in the backgound in the beginning.
wish you had started it in the background in the beginning.
.PP
All
.I "job control"
@@ -775,7 +775,7 @@ in only one of the jobs.
The
.I jobs
command types the table of jobs, giving the job number,
commands and status (`Stopped' or `Running') of each backgound or
commands and status (`Stopped' or `Running') of each background or
suspended job. With the `\-l' option the process numbers are also
typed.
.DS
@@ -874,7 +874,7 @@ and then put in the background using
Some time later when the `s' command was finished,
.I ed
tried to read another command and was stopped because jobs
in the backgound cannot read from the terminal. The
in the background cannot read from the terminal. The
.I fg
command returned the `ed' job to the foreground where it could once again
accept commands from the terminal.
+1
View File
@@ -98,6 +98,7 @@
#define SYSMALLOC
/* Use LC_MESSAGES locale category to open the message catalog */
#define MCLoadBySet NL_CAT_LOCALE
#define BUFSIZE 8192
#endif
#if defined(__bsdi__)
+1 -1
View File
@@ -420,7 +420,7 @@ standard.
Protection mechanisms in the
.Xr geom 4
subsystem might prevent the super-user from writing blocks to a disk.
Instructions for temporarily disabling these protectsion mechanisms can be
Instructions for temporarily disabling these protection mechanisms can be
found in the
.Xr geom 4
manpage.
+8 -1
View File
@@ -32,10 +32,12 @@
.Nd dump or modify the kernel environment
.Sh SYNOPSIS
.Nm
.Op Fl h
.Op Fl hq
.Nm
.Op Fl q
.Ar variable Ns Op = Ns Ar value
.Nm
.Op Fl q
.Fl u
.Ar variable
.Sh DESCRIPTION
@@ -60,6 +62,11 @@ If the environment variable is followed by an optional
.Ar value ,
.Nm
will set the environment variable to this value.
.Pp
If the
.Fl q
option is set, warnings normally printed as a result of being unable to
perform the requested operation will be suppressed.
.Sh SEE ALSO
.Xr kenv 2 ,
.Xr loader 8
+12 -8
View File
@@ -42,15 +42,16 @@ static int ksetenv(char *, char *);
static int kunsetenv(char *);
static int hflag = 0;
static int qflag = 0;
static int uflag = 0;
static void
usage(void)
{
(void)fprintf(stderr, "%s\n%s\n%s\n",
"usage: kenv [-h]",
" kenv variable[=value]",
" kenv -u variable");
"usage: kenv [-hq]",
" kenv [-q] variable[=value]",
" kenv [-q] -u variable");
exit(1);
}
@@ -63,11 +64,14 @@ main(int argc, char **argv)
error = 0;
val = NULL;
env = NULL;
while ((ch = getopt(argc, argv, "hu")) != -1) {
while ((ch = getopt(argc, argv, "hqu")) != -1) {
switch (ch) {
case 'h':
hflag++;
break;
case 'q':
qflag++;
break;
case 'u':
uflag++;
break;
@@ -93,21 +97,21 @@ main(int argc, char **argv)
usage();
if (env == NULL) {
error = kdumpenv();
if (error)
if (error && !qflag)
warn("kdumpenv");
} else if (val == NULL) {
if (uflag) {
error = kunsetenv(env);
if (error)
if (error && !qflag)
warnx("unable to unset %s", env);
} else {
error = kgetenv(env);
if (error)
if (error && !qflag)
warnx("unable to get %s", env);
}
} else {
error = ksetenv(env, val);
if (error)
if (error && !qflag)
warnx("unable to set %s to %s", env, val);
}
return (error);
+48 -37
View File
@@ -180,29 +180,17 @@ using base 2 for sizes.
.It Fl i
For each file, print the file's file serial number (inode number).
.It Fl k
If the
.Fl s
option is specified, print the file size allocation in kilobytes,
not blocks.
This option overrides the environment variable
.Ev BLOCKSIZE .
Note that
.Fl k
is mutually exclusive to
.Fl h ,
and later
.Fl k
will nullify earlier
.Fl h .
This has the same effect as setting environment variable
.Ev BLOCKSIZE
to 1024, except that it also nullifies any
.Fl h
options to its left.
.It Fl l
(The lowercase letter
.Dq ell . )
List in long format.
(See below.)
A total sum (in blocks, see the
.Fl s
option for the block size unit) for all the file
sizes is output on a line before the long listing.
List files in the long format, as described in the
.Sx The Long Format
subsection below.
.It Fl m
Stream output format; list files across the page, separated by commas.
.It Fl n
@@ -226,13 +214,12 @@ this is the default when output is to a terminal.
.It Fl r
Reverse the order of the sort.
.It Fl s
Display the number of file system blocks actually used by each file, in units
of 512 bytes, where partial units are rounded up to the next integer value.
A total sum for all the file
sizes is output on a line before the listing.
The environment variable
.Ev BLOCKSIZE
overrides the unit size of 512 bytes.
Display the number of blocks used in the file system by each file.
Block sizes and directory totals are handled as described in
.Sx The Long Format
subsection below, except (if the long format is not also requested)
the directory totals are not output when the output is in a
single column, even if multi-column output is requested.
.It Fl t
Sort by time modified (most recently modified
first) before sorting the operands in lexicographical
@@ -318,10 +305,6 @@ number of bytes in the file, abbreviated
month, day-of-month file was last modified,
hour file last modified, minute file last
modified, and the pathname.
In addition, for each directory whose contents are displayed, the total
number of 512-byte blocks used by the files in the directory is displayed
on a line by itself immediately before the information for the files in the
directory.
.Pp
If the modification time of the file is more than 6 months
in the past or future, then the year of the last modification
@@ -340,6 +323,24 @@ If the file is a symbolic link the pathname of the
linked-to file is preceded by
.Dq Li -> .
.Pp
The listing of a directory's contents is preceded
by a labeled total number of blocks used in the file system by the files
which are listed as the directory's contents
(which may or may not include
.Pa \&.
and
.Pa ..
and other files which start with a dot, depending on other options).
.Pp
The default block size is 512 bytes.
The block size may be set with option
.Fl k
or environment variable
.Ev BLOCKSIZE .
Numbers of blocks in the output will have been rounded up so the
numbers of bytes is at least as many as used by the corresponding
file system blocks (which might have a different size).
.Pp
The file mode printed under the
.Fl l
option consists of the
@@ -446,12 +447,15 @@ The following environment variables affect the execution of
.Nm :
.Bl -tag -width ".Ev CLICOLOR_FORCE"
.It Ev BLOCKSIZE
If the environment variable
.Ev BLOCKSIZE
is set, the block counts
(see
.Fl s )
will be displayed in units of that size block.
If this is set, its value, rounded up to 512 or down to a
multiple of 512, will be used as the block size in bytes by the
.Fl l
and
.Fl s
options.
See
.Sx The Long Format
subsection for more information.
.It Ev CLICOLOR
Use
.Tn ANSI
@@ -663,3 +667,10 @@ command appeared in
.Sh BUGS
To maintain backward compatibility, the relationships between the many
options are quite complex.
.Pp
The exception mentioned in the
.Fl s
option description might be a feature that was
based on the fact that single-column output
usually goes to something other than a terminal.
It is debatable whether this is a design bug.
+5 -1
View File
@@ -32,7 +32,7 @@
.\" @(#)rm.1 8.5 (Berkeley) 12/5/94
.\" $FreeBSD$
.\"
.Dd October 28, 2004
.Dd September 29, 2005
.Dt RM 1
.Os
.Sh NAME
@@ -88,6 +88,10 @@ yet provides almost the same level of protection against mistakes.
Overwrite regular files before deleting them.
Files are overwritten three times, first with the byte pattern 0xff,
then 0x00, and then 0xff again, before they are deleted.
Specifying this flag for a read only file will cause
.Nm
to generate an error message and exit.
The file wil not be removed or overwritten.
.It Fl R
Attempt to remove the file hierarchy rooted in each file argument.
The
+5 -4
View File
@@ -452,11 +452,8 @@ check(char *path, char *name, struct stat *sp)
* talking to a terminal, ask. Symbolic links are excluded
* because their permissions are meaningless. Check stdin_ok
* first because we may not have stat'ed the file.
* Also skip this check if the -P option was specified because
* we will not be able to overwrite file contents and will
* barf later.
*/
if (!stdin_ok || S_ISLNK(sp->st_mode) || Pflag ||
if (!stdin_ok || S_ISLNK(sp->st_mode) ||
(!access(name, W_OK) &&
!(sp->st_flags & (SF_APPEND|SF_IMMUTABLE)) &&
(!(sp->st_flags & (UF_APPEND|UF_IMMUTABLE)) || !uid)))
@@ -464,6 +461,10 @@ check(char *path, char *name, struct stat *sp)
strmode(sp->st_mode, modep);
if ((flagsp = fflagstostr(sp->st_flags)) == NULL)
err(1, "fflagstostr");
if (Pflag)
errx(1,
"%s: -P was specified, but file is not writable",
path);
(void)fprintf(stderr, "override %s%s%s/%s %s%sfor %s? ",
modep + 1, modep[9] == ' ' ? "" : " ",
user_from_uid(sp->st_uid, 0),
+1 -1
View File
@@ -481,7 +481,7 @@ bindcmd(int argc, char **argv)
if (el == NULL)
error("line editing is disabled");
return (el_parse(el, argc, argv));
return (el_parse(el, argc, (const char **)argv));
}
#else
+1 -1
View File
@@ -88,7 +88,7 @@ main(int argc, char *argv[])
if (l > INT_MAX) {
/*
* Avoid overflow when `seconds' is huge. This assumes
* that the maximum value for a time_t is >= INT_MAX.
* that the maximum value for a time_t is <= INT_MAX.
*/
l = INT_MAX;
}
-79
View File
@@ -1,79 +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
.Op Fl o Ar filename
.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 by default.
The following options can be used to change the behaviour of
.Nm :
.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.
.It Fl o
Redirect output to
.Ar filename
instead of stdout.
.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 EXIT STATUS
.Ex -std
.Sh SEE ALSO
.Xr uuidgen 2 ,
.Xr uuid 3
.Sh HISTORY
The
.Nm
command first appeared in
.Fx 5.0 .
-113
View File
@@ -1,113 +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] [-o filename]\n");
exit(1);
}
int
main(int argc, char *argv[])
{
FILE *fp;
uuid_t *store, *uuid;
char *p;
int ch, count, i, iterate;
count = -1; /* no count yet */
fp = stdout; /* default output file */
iterate = 0; /* not one at a time */
while ((ch = getopt(argc, argv, "1n:o:")) != -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;
case 'o':
if (fp != stdout)
errx(1, "multiple output files not allowed");
fp = fopen(optarg, "w");
if (fp == NULL)
err(1, "fopen");
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);
fprintf(fp, "%s\n", p);
free(p);
}
free(store);
if (fp != stdout)
fclose(fp);
return (0);
}
+2 -2
View File
@@ -355,7 +355,7 @@ the features.
.%T Amd \- The 4.4 BSD Automounter
.Re
.Pp
.Pa http://www.cs.columbia.edu/~ezk/am-utils/
.Pa http://www.am-utils.org/
.Sh HISTORY
The
.Nm amd
@@ -365,7 +365,7 @@ utility first appeared in
.An Jan-Simon Pendry Aq [email protected] ,
Department of Computing, Imperial College, London, UK.
.Pp
.An Erez Zadok Aq ezk@cs.columbia.edu ,
.An Erez Zadok Aq ezk@am-utils.org ,
Department of Computer Science, Columbia University,
New York, USA.
.Pp
+1 -1
View File
@@ -571,7 +571,7 @@ option to
.Nm amd .
If
.Dq yes ,
then the name refered to by
then the name referred to by
.Va ${rhost}
is normalized relative to the host database before being used.
The effect is
+18 -6
View File
@@ -43,11 +43,12 @@
7) Generate and run configure:
$ autoconf253
$ autoheader253
$ aclocal
$ autoheader
$ autoconf
$ ./configure --prefix=/usr \
--infodir=/usr/share/info --mandir=/usr/share/man \
--enable-threads --enable-libbind --disable-ipv6 \
--disable-threads --enable-libbind --disable-ipv6 \
--enable-getifaddrs --disable-linux-caps \
--with-openssl=/usr --with-randomdev=/dev/random
@@ -55,9 +56,20 @@
command line; src/lib/bind/config.mk will re-enable it at compile
time if NO_INET6 is not defined.
8) Copy the resulting config.h to src/lib/bind, add an RCS id tag and
commit it. Do not commit any other file that was modified or
created in steps 6) or 7).
8) Copy the following generated files to src/lib/bind and commit them:
Path in src/contrib/bind9 Path in src/lib/bind
------------------------------------------------------------
config.h config.h
lib/bind/config.h bind/config.h
lib/bind/port_after.h bind/port_after.h
lib/bind/port_before.h bind/port_before.h
lib/isc/include/isc/platform.h isc/isc/platform.h
lib/lwres/include/lwres/netdb.h lwres/lwres/netdb.h
lib/lwres/include/lwres/platform.h lwres/lwres/platform.h
Do not commit any other file that was modified or created in
steps 6) or 7).
9) cd src/lib/bind/dns && make -DMAINTAINER_MODE generate && rm gen
Commit the new versions of the files generated.
+4 -2
View File
@@ -2665,7 +2665,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
{
fetchctx_t *fctx;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t result;
isc_result_t iresult;
isc_interval_t interval;
dns_fixedname_t qdomain;
@@ -2687,8 +2687,10 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
strcat(buf, "/"); /* checked */
strcat(buf, typebuf); /* checked */
fctx->info = isc_mem_strdup(res->mctx, buf);
if (fctx->info == NULL)
if (fctx->info == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup_fetch;
}
FCTXTRACE("create");
dns_name_init(&fctx->name, NULL);
result = dns_name_dup(name, res->mctx, &fctx->name);
+1 -1
View File
@@ -584,7 +584,7 @@ options of
.B \-T
Create/Update CVS/Template by copying it from the (local) repository.
This option is useful for developers maintaining a local cvs repository
but commiting to a remote repository. By maintaining CVS/Template the
but committing to a remote repository. By maintaining CVS/Template the
remote commits will still be able to bring up the proper template in the
commit editor session.
Available with the
-2
View File
@@ -109,14 +109,12 @@ elif [ -f /bin/domainname ]; then
/usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep "^$LOGNAME:" |
cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
ORIGINATOR="`cat $TEMP`"
rm -f $TEMP
fi
fi
if [ "$ORIGINATOR" = "" ]; then
grep "^$LOGNAME:" /etc/passwd | cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
ORIGINATOR="`cat $TEMP`"
rm -f $TEMP
fi
if [ -n "$ORGANIZATION" ]; then
+4 -1
View File
@@ -1264,7 +1264,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl))
/* Don't warn about forward parameter decls. */
&& !(TREE_CODE (newdecl) == PARM_DECL
&& TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)))
&& TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))
/* Don't warn about a variable definition following a declaration. */
&& !(TREE_CODE (newdecl) == VAR_DECL
&& DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl)))
{
warning ("%Jredundant redeclaration of '%D'", newdecl, newdecl);
warned = true;
+4 -4
View File
@@ -614,8 +614,8 @@ extern int x86_prefetch_sse;
else if (TARGET_ATHLON) \
{ \
builtin_define ("__tune_athlon__"); \
/* Only plain "athlon" lacks SSE. */ \
if (last_tune_char != 'n') \
/* Plain "athlon" & "athlon-tbird" lacks SSE. */ \
if (last_tune_char != 'n' && last_tune_char != 'd') \
builtin_define ("__tune_athlon_sse__"); \
} \
else if (TARGET_K8) \
@@ -679,8 +679,8 @@ extern int x86_prefetch_sse;
{ \
builtin_define ("__athlon"); \
builtin_define ("__athlon__"); \
/* Only plain "athlon" lacks SSE. */ \
if (last_arch_char != 'n') \
/* Plain "athlon" & "athlon-tbird" lacks SSE. */ \
if (last_tune_char != 'n' && last_tune_char != 'd') \
builtin_define ("__athlon_sse__"); \
} \
else if (ix86_arch == PROCESSOR_K8) \
-929
View File
@@ -1,929 +0,0 @@
Index: gdb/ia64-fbsd-nat.c
===================================================================
RCS file: gdb/ia64-fbsd-nat.c
diff -N gdb/ia64-fbsd-nat.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb/ia64-fbsd-nat.c 17 Apr 2004 19:39:20 -0000 1.3
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2004 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 "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#ifdef HAVE_SYS_PROCFS_H
+#include <sys/procfs.h>
+#endif
+
+#ifndef HAVE_GREGSET_T
+typedef struct reg gregset_t;
+#endif
+
+#ifndef HAVE_FPREGSET_T
+typedef struct fpreg fpregset_t;
+#endif
+
+#include "gregset.h"
+
+#define FPREG_SUPPLIES(r) ((r) >= IA64_FR0_REGNUM && (r) <= IA64_FR127_REGNUM)
+#define GREG_SUPPLIES(r) (!FPREG_SUPPLIES(r))
+
+/* XXX need to go away. */
+void ia64_fbsd_supply_fpregs (void *, int);
+void ia64_fbsd_supply_gregs (void *, int);
+
+void
+fetch_inferior_registers (int regno)
+{
+ union {
+ fpregset_t fpr;
+ gregset_t r;
+ } regs;
+
+ if (regno == -1 || GREG_SUPPLIES(regno))
+ {
+ if (ptrace (PT_GETREGS, PIDGET(inferior_ptid),
+ (PTRACE_ARG3_TYPE)&regs.r, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+ ia64_fbsd_supply_gregs (&regs.r, regno);
+ if (regno != -1)
+ return;
+ }
+
+ if (regno == -1 || FPREG_SUPPLIES(regno))
+ {
+ if (ptrace (PT_GETFPREGS, PIDGET(inferior_ptid),
+ (PTRACE_ARG3_TYPE)&regs.fpr, 0) == -1)
+ perror_with_name ("Couldn't get FP registers");
+ ia64_fbsd_supply_fpregs (&regs.fpr, regno);
+ if (regno != -1)
+ return;
+ }
+}
+
+void
+store_inferior_registers (int regno)
+{
+ union {
+ fpregset_t fpr;
+ gregset_t r;
+ } regs;
+
+ if (regno == -1 || GREG_SUPPLIES(regno))
+ {
+ if (ptrace (PT_GETREGS, PIDGET(inferior_ptid),
+ (PTRACE_ARG3_TYPE)&regs.r, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+ fill_gregset (&regs.r, regno);
+ if (ptrace (PT_SETREGS, PIDGET(inferior_ptid),
+ (PTRACE_ARG3_TYPE)&regs.r, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+ if (regno != -1)
+ return;
+ }
+
+ if (regno == -1 || FPREG_SUPPLIES(regno))
+ {
+ if (ptrace (PT_GETFPREGS, PIDGET(inferior_ptid),
+ (PTRACE_ARG3_TYPE)&regs.fpr, 0) == -1)
+ perror_with_name ("Couldn't get FP registers");
+ fill_fpregset (&regs.fpr, regno);
+ if (ptrace (PT_SETFPREGS, PIDGET(inferior_ptid),
+ (PTRACE_ARG3_TYPE)&regs.fpr, 0) == -1)
+ perror_with_name ("Couldn't get FP registers");
+ if (regno != -1)
+ return;
+ }
+}
+
+LONGEST ia64_fbsd_xfer_dirty (struct target_ops *ops, enum target_object obj,
+ const char *annex, void *rbuf, const void *wbuf,
+ ULONGEST ofs, LONGEST len)
+{
+ if (len != 8)
+ return (-1);
+ if (rbuf != NULL) {
+ if (ptrace (PT_GETKSTACK, PIDGET(inferior_ptid), (PTRACE_ARG3_TYPE)rbuf,
+ ofs >> 3) == -1) {
+ perror_with_name ("Couldn't read dirty register");
+ return (-1);
+ }
+ } else {
+ if (ptrace (PT_SETKSTACK, PIDGET(inferior_ptid), (PTRACE_ARG3_TYPE)wbuf,
+ ofs >> 3) == -1) {
+ perror_with_name ("Couldn't write dirty register");
+ return (-1);
+ }
+ }
+ return (len);
+}
+
+void
+_initialize_ia64_fbsd_nat (void)
+{
+}
Index: gdb/ia64-fbsd-tdep.c
===================================================================
RCS file: gdb/ia64-fbsd-tdep.c
diff -N gdb/ia64-fbsd-tdep.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb/ia64-fbsd-tdep.c 17 Apr 2004 19:39:20 -0000 1.6
@@ -0,0 +1,291 @@
+/*
+ * Copyright (c) 2004 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 "defs.h"
+#include "gdb_string.h"
+#include "regcache.h"
+#include "regset.h"
+#include "solib-svr4.h"
+#include "value.h"
+
+#include "ia64-tdep.h"
+
+#define FPREG_SUPPLIES(r) ((r) >= IA64_FR0_REGNUM && (r) <= IA64_FR127_REGNUM)
+#define GREG_SUPPLIES(r) (!FPREG_SUPPLIES(r))
+
+static int reg_offset[462] = {
+ -1, 96, 248, 256, 152, 160, 168, 176, /* Regs 0-7. */
+ 264, 272, 280, 288, 0, 64, 296, 304, /* Regs 8-15. */
+ 312, 320, 328, 336, 344, 352, 360, 368, /* Regs 16-23. */
+ 376, 384, 392, 400, 408, 416, 424, 432, /* Regs 24-31. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 32-39. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 40-47. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 48-55. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 56-63. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 64-71. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 72-79. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 80-87. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 88-95. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 96-103. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 104-111. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 112-119. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 120-127. */
+ -1, -1, 0, 16, 32, 48, 320, 336, /* Regs 128-135. */
+ 352, 368, 384, 400, 416, 432, 448, 464, /* Regs 136-143. */
+ 64, 80, 96, 112, 128, 144, 160, 176, /* Regs 144-151. */
+ 192, 208, 224, 240, 256, 272, 288, 304, /* Regs 152-159. */
+ 480, 496, 512, 528, 544, 560, 576, 592, /* Regs 160-167. */
+ 608, 624, 640, 656, 672, 688, 704, 720, /* Regs 168-175. */
+ 736, 752, 768, 784, 800, 816, 832, 848, /* Regs 176-183. */
+ 864, 880, 896, 912, 928, 944, 960, 976, /* Regs 184-191. */
+ 992, 1008, 1024, 1040, 1056, 1072, 1088, 1104, /* Regs 192-199. */
+ 1120, 1136, 1152, 1168, 1184, 1200, 1216, 1232, /* Regs 200-207. */
+ 1248, 1264, 1280, 1296, 1312, 1328, 1344, 1360, /* Regs 208-215. */
+ 1376, 1392, 1408, 1424, 1440, 1456, 1472, 1488, /* Regs 216-223. */
+ 1504, 1520, 1536, 1552, 1568, 1584, 1600, 1616, /* Regs 224-231. */
+ 1632, 1648, 1664, 1680, 1696, 1712, 1728, 1744, /* Regs 232-239. */
+ 1760, 1776, 1792, 1808, 1824, 1840, 1856, 1872, /* Regs 240-247. */
+ 1888, 1904, 1920, 1936, 1952, 1968, 1984, 2000, /* Regs 248-255. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 256-263. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 264-271. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 272-279. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 280-287. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 288-295. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 296-303. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 304-311. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 312-319. */
+ 16, 184, 192, 200, 208, 216, 440, 448, /* Regs 320-327. */
+ -1, -1, 24, 120, 88, 112, -1, -1, /* Regs 328-335. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 336-343. */
+ -1, -1, -1, -1, -1, -1, 72, 104, /* Regs 344-351. */
+ 40, 48, -1, -1, -1, -1, -1, 464, /* Regs 352-359. */
+ 472, -1, -1, -1, -1, -1, 456, -1, /* Regs 360-367. */
+ -1, -1, 8, -1, -1, -1, 80, -1, /* Regs 368-375. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 376-383. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 384-391. */
+ -1, -1, -1, -1, -1, -1, 32, 224, /* Regs 392-399. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 400-407. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 408-415. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 416-423. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 424-431. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 432-439. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 440-447. */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* Regs 448-455. */
+ -1, -1, -1, -1, -1, -1
+};
+
+static void
+ia64_fbsd_regcache_collect (struct regcache *regcache, int regno,
+ void *regs)
+{
+ int ofs;
+
+ if (regno < 0 || regno >= NUM_REGS)
+ return;
+
+ ofs = reg_offset[regno];
+ if (ofs >= 0)
+ regcache_raw_collect (regcache, regno, (char*)regs + ofs);
+}
+
+static void
+ia64_fbsd_regcache_supply (struct regcache *regcache, int regno,
+ const void *regs)
+{
+ int ofs;
+
+ if (regno < 0 || regno >= NUM_REGS)
+ return;
+
+ ofs = reg_offset[regno];
+ if (regno == IA64_BSP_REGNUM)
+ {
+ /* BSP is synthesized. It's not actually present in struct reg,
+ but can be derived from bspstore and ndirty. The offset of
+ IA64_BSP_REGNUM in the reg_offset array above is that of the
+ ndirty field in struct reg. */
+ uint64_t bsp;
+ bsp = *((uint64_t*)((char *)regs + ofs)); /* ndirty */
+ bsp += *((uint64_t*)((char *)regs + reg_offset[IA64_BSPSTORE_REGNUM]));
+ regcache_raw_supply (regcache, regno, &bsp);
+ }
+ else
+ {
+ if (ofs < 0)
+ regcache_raw_supply (regcache, regno, NULL);
+ else
+ regcache_raw_supply (regcache, regno, (char *)regs + ofs);
+ }
+}
+
+void
+fill_fpregset (void *fpregs, int regno)
+{
+ if (regno == -1)
+ {
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ if (FPREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_collect (current_regcache, regno, fpregs);
+ }
+ }
+ else
+ {
+ if (FPREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_collect (current_regcache, regno, fpregs);
+ }
+}
+
+void
+fill_gregset (void *gregs, int regno)
+{
+ if (regno == -1)
+ {
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ if (GREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_collect (current_regcache, regno, gregs);
+ }
+ }
+ else
+ {
+ if (GREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_collect (current_regcache, regno, gregs);
+ }
+}
+
+void
+ia64_fbsd_supply_fpregs (const void *fpregs, int regno)
+{
+ if (regno == -1)
+ {
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ if (FPREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_supply (current_regcache, regno, fpregs);
+ }
+ }
+ else
+ {
+ if (FPREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_supply (current_regcache, regno, fpregs);
+ }
+}
+
+void
+ia64_fbsd_supply_gregs (const void *gregs, int regno)
+{
+ if (regno == -1)
+ {
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ if (GREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_supply (current_regcache, regno, gregs);
+ }
+ }
+ else
+ {
+ if (GREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_supply (current_regcache, regno, gregs);
+ }
+}
+
+static void
+ia64_fbsd_supply_gregset (const struct regset *regset,
+ struct regcache *regcache, int regno,
+ const void *gregs, size_t len)
+{
+ if (regno == -1)
+ {
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ if (GREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_supply (regcache, regno, gregs);
+ }
+ }
+ else
+ if (GREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_supply (regcache, regno, gregs);
+}
+
+static void
+ia64_fbsd_supply_fpregset (const struct regset *regset,
+ struct regcache *regcache, int regno,
+ const void *fpregs, size_t len)
+{
+ if (regno == -1)
+ {
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ if (FPREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_supply (regcache, regno, fpregs);
+ }
+ }
+ else
+ if (FPREG_SUPPLIES(regno))
+ ia64_fbsd_regcache_supply (regcache, regno, fpregs);
+}
+
+static struct regset gregset = { NULL, ia64_fbsd_supply_gregset };
+static struct regset fpregset = { NULL, ia64_fbsd_supply_fpregset };
+
+static const struct regset *
+ia64_fbsd_regset_from_core_section (struct gdbarch *gdbarch,
+ const char *sect_name, size_t sect_size)
+{
+ if (strcmp (sect_name, ".reg") == 0)
+ return (&gregset);
+ if (strcmp (sect_name, ".reg2") == 0)
+ return (&fpregset);
+ return (NULL);
+}
+
+static int
+ia64_fbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ uint64_t gwpage = 5ULL << 61;
+ return (pc >= gwpage && pc < (gwpage + 8192)) ? 1 : 0;
+}
+
+static void
+ia64_fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ set_gdbarch_pc_in_sigtramp (gdbarch, ia64_fbsd_pc_in_sigtramp);
+ set_gdbarch_regset_from_core_section (gdbarch,
+ ia64_fbsd_regset_from_core_section);
+ set_solib_svr4_fetch_link_map_offsets (gdbarch,
+ svr4_lp64_fetch_link_map_offsets);
+ tdep->find_global_pointer = ia64_generic_find_global_pointer;
+}
+
+void
+_initialize_ia64_fbsd_tdep (void)
+{
+ gdbarch_register_osabi (bfd_arch_ia64, 0ul, GDB_OSABI_FREEBSD_ELF,
+ ia64_fbsd_init_abi);
+}
Index: gdb/ia64-tdep.c
===================================================================
RCS file: /home/marcel/CVS/gdb6/gdb/ia64-tdep.c,v
retrieving revision 1.1.1.3
retrieving revision 1.5
diff -u -r1.1.1.3 -r1.5
--- gdb/ia64-tdep.c 16 Apr 2004 00:51:25 -0000 1.1.1.3
+++ gdb/ia64-tdep.c 16 Apr 2004 01:28:33 -0000 1.5
@@ -45,17 +45,6 @@
#include "libunwind-ia64.h"
#endif
-/* Hook for determining the global pointer when calling functions in
- the inferior under AIX. The initialization code in ia64-aix-nat.c
- sets this hook to the address of a function which will find the
- global pointer for a given address.
-
- The generic code which uses the dynamic section in the inferior for
- finding the global pointer is not of much use on AIX since the
- values obtained from the inferior have not been relocated. */
-
-CORE_ADDR (*native_find_global_pointer) (CORE_ADDR) = 0;
-
/* An enumeration of the different IA-64 instruction types. */
typedef enum instruction_type
@@ -256,20 +245,6 @@
};
-struct gdbarch_tdep
- {
- CORE_ADDR (*sigcontext_register_address) (CORE_ADDR, int);
- /* OS specific function which, given a frame address
- and register number, returns the offset to the
- given register from the start of the frame. */
- CORE_ADDR (*find_global_pointer) (CORE_ADDR);
- };
-
-#define SIGCONTEXT_REGISTER_ADDRESS \
- (gdbarch_tdep (current_gdbarch)->sigcontext_register_address)
-#define FIND_GLOBAL_POINTER \
- (gdbarch_tdep (current_gdbarch)->find_global_pointer)
-
int
ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group)
@@ -682,9 +657,18 @@
if ((cfm & 0x7f) > regnum - V32_REGNUM)
{
+ ULONGEST bspstore;
ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
- reg = read_memory_integer ((CORE_ADDR)reg_addr, 8);
- store_unsigned_integer (buf, register_size (current_gdbarch, regnum), reg);
+ regcache_cooked_read_unsigned (regcache, IA64_BSPSTORE_REGNUM,
+ &bspstore);
+ if (reg_addr < bspstore) {
+ reg = read_memory_integer ((CORE_ADDR)reg_addr, 8);
+ store_unsigned_integer (buf, register_size (current_gdbarch,
+ regnum), reg);
+ } else
+ target_read_partial (&current_target, TARGET_OBJECT_DIRTY,
+ (void*)bspstore, buf, reg_addr - bspstore,
+ register_size (current_gdbarch, regnum));
}
else
store_unsigned_integer (buf, register_size (current_gdbarch, regnum), 0);
@@ -725,7 +709,21 @@
if (nat_addr >= bsp)
regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, &nat_collection);
else
- nat_collection = read_memory_integer (nat_addr, 8);
+ {
+ ULONGEST bspstore;
+ regcache_cooked_read_unsigned (regcache, IA64_BSPSTORE_REGNUM,
+ &bspstore);
+ if (nat_addr < bspstore)
+ nat_collection = read_memory_integer (nat_addr, 8);
+ else {
+ char natbuf[8];
+ target_read_partial (&current_target, TARGET_OBJECT_DIRTY,
+ (void*)bspstore, natbuf,
+ nat_addr - bspstore,
+ register_size (current_gdbarch, regnum));
+ nat_collection = *((uint64_t*)natbuf);
+ }
+ }
nat_bit = (gr_addr >> 3) & 0x3f;
natN_val = (nat_collection >> nat_bit) & 1;
}
@@ -789,8 +787,16 @@
if ((cfm & 0x7f) > regnum - V32_REGNUM)
{
+ ULONGEST bspstore;
ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
- write_memory (reg_addr, (void *)buf, 8);
+ regcache_cooked_read_unsigned (regcache, IA64_BSPSTORE_REGNUM,
+ &bspstore);
+ if (reg_addr < bspstore)
+ write_memory (reg_addr, (void *)buf, 8);
+ else
+ target_write_partial (&current_target, TARGET_OBJECT_DIRTY,
+ (void*)bspstore, buf, reg_addr - bspstore,
+ register_size (current_gdbarch, regnum));
}
}
else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
@@ -845,13 +851,33 @@
else
{
char nat_buf[8];
- nat_collection = read_memory_integer (nat_addr, 8);
+ ULONGEST bspstore;
+ regcache_cooked_read_unsigned (regcache, IA64_BSPSTORE_REGNUM,
+ &bspstore);
+ if (nat_addr < bspstore)
+ nat_collection = read_memory_integer (nat_addr, 8);
+ else {
+ char natbuf[8];
+ target_read_partial (&current_target, TARGET_OBJECT_DIRTY,
+ (void*)bspstore, natbuf,
+ nat_addr - bspstore,
+ register_size (current_gdbarch, regnum));
+ nat_collection = *((uint64_t*)natbuf);
+ }
if (natN_val)
nat_collection |= natN_mask;
else
nat_collection &= ~natN_mask;
- store_unsigned_integer (nat_buf, register_size (current_gdbarch, regnum), nat_collection);
- write_memory (nat_addr, nat_buf, 8);
+ store_unsigned_integer (nat_buf, register_size (current_gdbarch,
+ regnum),
+ nat_collection);
+ if (nat_addr < bspstore)
+ write_memory (nat_addr, nat_buf, 8);
+ else
+ target_write_partial (&current_target, TARGET_OBJECT_DIRTY,
+ (void*)bspstore, nat_buf,
+ nat_addr - bspstore,
+ register_size (current_gdbarch, regnum));
}
}
}
@@ -1813,6 +1839,7 @@
prev_bof = rse_address_add (prev_bsp, -(prev_cfm & 0x7f));
addr = rse_address_add (prev_bof, (regnum - IA64_GR32_REGNUM));
+ /* XXX marcel */
*lvalp = lval_memory;
*addrp = addr;
read_memory (addr, valuep, register_size (current_gdbarch, regnum));
@@ -2858,8 +2885,8 @@
DT_PLTGOT tag. If it finds one of these, the corresponding
d_un.d_ptr value is the global pointer. */
-static CORE_ADDR
-generic_elf_find_global_pointer (CORE_ADDR faddr)
+CORE_ADDR
+ia64_generic_find_global_pointer (CORE_ADDR faddr)
{
struct obj_section *faddr_sect;
@@ -3255,32 +3282,9 @@
tdep = xmalloc (sizeof (struct gdbarch_tdep));
gdbarch = gdbarch_alloc (&info, tdep);
-
- /* Set the method of obtaining the sigcontext addresses at which
- registers are saved. The method of checking to see if
- native_find_global_pointer is nonzero to indicate that we're
- on AIX is kind of hokey, but I can't think of a better way
- to do it. */
- if (info.osabi == GDB_OSABI_LINUX)
- tdep->sigcontext_register_address = ia64_linux_sigcontext_register_address;
- else if (native_find_global_pointer != 0)
- tdep->sigcontext_register_address = ia64_aix_sigcontext_register_address;
- else
- tdep->sigcontext_register_address = 0;
-
- /* We know that GNU/Linux won't have to resort to the
- native_find_global_pointer hackery. But that's the only one we
- know about so far, so if native_find_global_pointer is set to
- something non-zero, then use it. Otherwise fall back to using
- generic_elf_find_global_pointer. This arrangement should (in
- theory) allow us to cross debug GNU/Linux binaries from an AIX
- machine. */
- if (info.osabi == GDB_OSABI_LINUX)
- tdep->find_global_pointer = generic_elf_find_global_pointer;
- else if (native_find_global_pointer != 0)
- tdep->find_global_pointer = native_find_global_pointer;
- else
- tdep->find_global_pointer = generic_elf_find_global_pointer;
+ tdep->osabi = info.osabi;
+ tdep->sigcontext_register_address = NULL;
+ tdep->find_global_pointer = ia64_generic_find_global_pointer;
/* Define the ia64 floating-point format to gdb. */
builtin_type_ia64_ext =
@@ -3338,10 +3342,7 @@
set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint);
set_gdbarch_breakpoint_from_pc (gdbarch, ia64_breakpoint_from_pc);
set_gdbarch_read_pc (gdbarch, ia64_read_pc);
- if (info.osabi == GDB_OSABI_LINUX)
- set_gdbarch_write_pc (gdbarch, ia64_linux_write_pc);
- else
- set_gdbarch_write_pc (gdbarch, ia64_write_pc);
+ set_gdbarch_write_pc (gdbarch, ia64_write_pc);
/* Settings for calling functions in the inferior. */
set_gdbarch_push_dummy_call (gdbarch, ia64_push_dummy_call);
@@ -3365,6 +3366,8 @@
set_gdbarch_print_insn (gdbarch, ia64_print_insn);
set_gdbarch_convert_from_func_ptr_addr (gdbarch, ia64_convert_from_func_ptr_addr);
+
+ gdbarch_init_osabi (info, gdbarch);
return gdbarch;
}
Index: gdb/ia64-tdep.h
===================================================================
RCS file: /home/marcel/CVS/gdb6/gdb/ia64-tdep.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- gdb/ia64-tdep.h 26 Mar 2004 02:54:41 -0000 1.1.1.1
+++ gdb/ia64-tdep.h 28 Mar 2004 03:47:34 -0000 1.2
@@ -22,10 +22,25 @@
#ifndef IA64_TDEP_H
#define IA64_TDEP_H
-extern CORE_ADDR ia64_linux_sigcontext_register_address (CORE_ADDR, int);
-extern CORE_ADDR ia64_aix_sigcontext_register_address (CORE_ADDR, int);
-extern unsigned long ia64_linux_getunwind_table (void *, size_t);
-extern void ia64_write_pc (CORE_ADDR, ptid_t);
-extern void ia64_linux_write_pc (CORE_ADDR, ptid_t);
+#include "osabi.h"
+
+/* Target-dependent structure in gdbarch. */
+struct gdbarch_tdep
+{
+ enum gdb_osabi osabi; /* OS/ABI of inferior. */
+
+ CORE_ADDR (*sigcontext_register_address) (CORE_ADDR, int);
+ /* OS specific function which, given a frame address
+ and register number, returns the offset to the
+ given register from the start of the frame. */
+ CORE_ADDR (*find_global_pointer) (CORE_ADDR);
+};
+
+#define SIGCONTEXT_REGISTER_ADDRESS \
+ (gdbarch_tdep (current_gdbarch)->sigcontext_register_address)
+#define FIND_GLOBAL_POINTER \
+ (gdbarch_tdep (current_gdbarch)->find_global_pointer)
+
+extern CORE_ADDR ia64_generic_find_global_pointer (CORE_ADDR);
#endif /* IA64_TDEP_H */
Index: gdb/inftarg.c
===================================================================
RCS file: /home/marcel/CVS/gdb6/gdb/inftarg.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- gdb/inftarg.c 26 Mar 2004 02:54:41 -0000 1.1.1.1
+++ gdb/inftarg.c 28 Mar 2004 03:47:34 -0000 1.2
@@ -592,6 +592,13 @@
return NATIVE_XFER_WCOOKIE (ops, object, annex, readbuf, writebuf,
offset, len);
+ case TARGET_OBJECT_DIRTY:
+#ifndef TARGET_XFER_DIRTY
+#define TARGET_XFER_DIRTY(OPS,OBJECT,ANNEX,WRITEBUF,READBUF,OFFSET,LEN) (-1)
+#endif
+ return TARGET_XFER_DIRTY (ops, object, annex, readbuf, writebuf,
+ offset, len);
+
default:
return -1;
}
Index: gdb/remote.c
===================================================================
RCS file: /home/marcel/CVS/gdb6/gdb/remote.c,v
retrieving revision 1.1.1.3
retrieving revision 1.5
diff -u -r1.1.1.3 -r1.5
--- gdb/remote.c 16 Apr 2004 00:51:28 -0000 1.1.1.3
+++ gdb/remote.c 16 Apr 2004 01:28:33 -0000 1.5
@@ -998,6 +998,23 @@
show_packet_config_cmd (&remote_protocol_qPart_auxv);
}
+/* Should we try the 'qPart:dirty' (target dirty register read) request? */
+static struct packet_config remote_protocol_qPart_dirty;
+
+static void
+set_remote_protocol_qPart_dirty_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
+{
+ update_packet_config (&remote_protocol_qPart_dirty);
+}
+
+static void
+show_remote_protocol_qPart_dirty_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
+{
+ show_packet_config_cmd (&remote_protocol_qPart_dirty);
+}
+
/* Tokens for use by the asynchronous signal handlers for SIGINT */
static void *sigint_remote_twice_token;
@@ -2088,6 +2105,7 @@
downloading. */
update_packet_config (&remote_protocol_binary_download);
update_packet_config (&remote_protocol_qPart_auxv);
+ update_packet_config (&remote_protocol_qPart_dirty);
}
/* Symbol look-up. */
@@ -4925,6 +4943,23 @@
}
return -1;
+ case TARGET_OBJECT_DIRTY:
+ if (remote_protocol_qPart_dirty.support != PACKET_DISABLE)
+ {
+ snprintf (buf2, rs->remote_packet_size, "qPart:dirty:read::%lx",
+ (long)(offset >> 3));
+ i = putpkt (buf2);
+ if (i < 0)
+ return i;
+ buf2[0] = '\0';
+ getpkt (buf2, rs->remote_packet_size, 0);
+ if (packet_ok (buf2, &remote_protocol_qPart_dirty) != PACKET_OK)
+ return -1;
+ i = hex2bin (buf2, readbuf, len);
+ return i;
+ }
+ return -1;
+
default:
return -1;
}
@@ -5423,6 +5458,7 @@
show_remote_protocol_vcont_packet_cmd (args, from_tty, NULL);
show_remote_protocol_binary_download_cmd (args, from_tty, NULL);
show_remote_protocol_qPart_auxv_packet_cmd (args, from_tty, NULL);
+ show_remote_protocol_qPart_dirty_packet_cmd (args, from_tty, NULL);
}
static void
@@ -5670,6 +5706,13 @@
"qPart_auxv", "read-aux-vector",
set_remote_protocol_qPart_auxv_packet_cmd,
show_remote_protocol_qPart_auxv_packet_cmd,
+ &remote_set_cmdlist, &remote_show_cmdlist,
+ 0);
+
+ add_packet_config_cmd (&remote_protocol_qPart_dirty,
+ "qPart_dirty", "read-dirty-registers",
+ set_remote_protocol_qPart_dirty_packet_cmd,
+ show_remote_protocol_qPart_dirty_packet_cmd,
&remote_set_cmdlist, &remote_show_cmdlist,
0);
Index: gdb/target.h
===================================================================
RCS file: /home/marcel/CVS/gdb6/gdb/target.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- gdb/target.h 26 Mar 2004 02:54:42 -0000 1.1.1.1
+++ gdb/target.h 28 Mar 2004 03:47:34 -0000 1.2
@@ -229,7 +229,9 @@
/* Transfer auxilliary vector. */
TARGET_OBJECT_AUXV,
/* StackGhost cookie. See "sparc-tdep.c". */
- TARGET_OBJECT_WCOOKIE
+ TARGET_OBJECT_WCOOKIE,
+ /* Dirty registers. See "ia64-tdep.c". */
+ TARGET_OBJECT_DIRTY
/* Possible future objects: TARGET_OBJECT_FILE, TARGET_OBJECT_PROC, ... */
};
Index: gdb/config/ia64/fbsd.mh
===================================================================
RCS file: gdb/config/ia64/fbsd.mh
diff -N gdb/config/ia64/fbsd.mh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb/config/ia64/fbsd.mh 25 Jun 2004 03:55:31 -0000
@@ -0,0 +1,3 @@
+NATDEPFILES= fbsd-proc.o fbsd-thread.o fork-child.o gcore.o \
+ ia64-fbsd-nat.o infptrace.o inftarg.o
+NAT_FILE= nm-fbsd.h
Index: gdb/config/ia64/fbsd.mt
===================================================================
RCS file: gdb/config/ia64/fbsd.mt
diff -N gdb/config/ia64/fbsd.mt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb/config/ia64/fbsd.mt 28 Mar 2004 03:47:38 -0000 1.1
@@ -0,0 +1,2 @@
+TDEPFILES= corelow.o ia64-fbsd-tdep.o ia64-tdep.o solib.o solib-svr4.o
+TM_FILE= tm-fbsd.h
Index: gdb/config/ia64/nm-fbsd.h
===================================================================
RCS file: gdb/config/ia64/nm-fbsd.h
diff -N gdb/config/ia64/nm-fbsd.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb/config/ia64/nm-fbsd.h 16 Apr 2004 02:49:16 -0000 1.2
@@ -0,0 +1,24 @@
+/* GNU GPL */
+
+#ifndef NM_FBSD_H
+#define NM_FBSD_H
+
+/* Type of the third argument to the `ptrace' system call. */
+#define PTRACE_ARG3_TYPE caddr_t
+
+/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
+#define FETCH_INFERIOR_REGISTERS
+
+/* We can attach and detach. */
+#define ATTACH_DETACH
+
+/* Override child_pid_to_exec_file in 'inftarg.c'. */
+#define CHILD_PID_TO_EXEC_FILE
+
+#include "target.h"
+
+#define TARGET_XFER_DIRTY ia64_fbsd_xfer_dirty
+extern LONGEST ia64_fbsd_xfer_dirty(struct target_ops *, enum target_object,
+ const char *, void *, const void *, ULONGEST, LONGEST);
+
+#endif /* NM_FBSD_H */
Index: gdb/config/ia64/tm-fbsd.h
===================================================================
RCS file: gdb/config/ia64/tm-fbsd.h
diff -N gdb/config/ia64/tm-fbsd.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb/config/ia64/tm-fbsd.h 17 Apr 2004 01:43:21 -0000 1.2
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2004 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.
+ */
+
+#ifndef TM_FBSD_H
+#define TM_FBSD_H
+
+#include "solib.h"
+
+#include "ia64/tm-ia64.h"
+
+#endif /* TM_FBSD_H */
+1 -1
View File
@@ -10,6 +10,7 @@
.\"
.\" @(#)vi.ref 8.88 (Berkeley) 10/19/96
.\"
.\" $FreeBSD$
.\"
.so ref.so
.tp
@@ -27,7 +28,6 @@ Department of Electrical Engineering and Computer Science
University of California, Berkeley
Berkeley, California 94720
.sp 1
\*(td
.)l
.sp 3
.(l C
+5 -5
View File
@@ -23,7 +23,7 @@
The
.Xr pf 4
firewall and the
.Xr tcpdump 8
.Xr tcpdump 1
program can both fingerprint the operating system of hosts that
originate an IPv4 TCP connection.
The file consists of newline-separated records, one per fingerprint,
@@ -200,7 +200,7 @@ An absolutely braindead embedded operating system fingerprint could be:
.Ed
.Pp
The
.Xr tcpdump 8
.Xr tcpdump 1
output of
.Bd -literal
# tcpdump -s128 -c1 -nv 'tcp[13] == 2'
@@ -214,7 +214,7 @@ almost translates into the following fingerprint
57344:64:1:44:M1460: exampleOS:1.0::exampleOS 1.0
.Ed
.Pp
.Xr tcpdump 8
.Xr tcpdump 1
does not explicitly give the packet length.
But it can usually be derived by adding the size of the IPv4 header to
the size of the TCP header to the size of the TCP options.
@@ -236,7 +236,7 @@ three bytes.
.Pp
In the above example, the packet size comes out to 44 bytes.
.Sh SEE ALSO
.Xr tcpdump 1 ,
.Xr pf 4 ,
.Xr pf.conf 5 ,
.Xr pfctl 8 ,
.Xr tcpdump 8
.Xr pfctl 8
+3 -3
View File
@@ -41,7 +41,7 @@ the packet filter,
.Xr pf 4 .
Logged packets can easily be monitored in real
time by invoking
.Xr tcpdump 8
.Xr tcpdump 1
on the
.Nm
interface, or stored to disk using
@@ -75,13 +75,13 @@ struct pfloghdr {
# tcpdump -n -e -ttt -i pflog0
.Ed
.Sh SEE ALSO
.Xr tcpdump 1
.Xr inet 4 ,
.Xr inet6 4 ,
.Xr netintro 4 ,
.Xr pf 4 ,
.Xr ifconfig 8 ,
.Xr pflogd 8 ,
.Xr tcpdump 8
.Xr pflogd 8
.Sh HISTORY
The
.Nm
+23 -4
View File
@@ -42,7 +42,7 @@ table used by
.Xr pf 4 .
.\" XXX: not yet!
.\" State changes can be viewed by invoking
.\" .Xr tcpdump 8
.\" .Xr tcpdump 1
.\" on the
.\" .Nm
.\" interface.
@@ -129,7 +129,25 @@ dedicated to pfsync messages such as a crossover cable between two firewalls,
or specify a peer address and protect the traffic with
.Xr ipsec 4 .
.Pp
For
.Nm
to start its operation automatically at the system boot time,
.Va pfsync_enable
and
.Va pfsync_syncdev
variables should be used in
.Xr rc.conf 5 .
It is not advisable to set up
.Nm
with common network interface configuration variables of
.Xr rc.conf 5
because
.Nm
must start after its
.Cm syncdev ,
which cannot be always ensured in the latter case.
.\" XXX: not yet!
.\" .Pp
.\" There is a one-to-one correspondence between packets seen by
.\" .Xr bpf 4
.\" on the
@@ -167,14 +185,15 @@ indicated):
Interfaces configuration in
.Pa /etc/rc.conf :
.Bd -literal -offset indent
network_interfaces="lo0 sis0 sis1 sis2"
cloned_interfaces="carp0 carp1"
network_interfaces="lo0 sis0 sis1 sis2 carp0 carp1 pfsync0"
ifconfig_sis0="10.0.0.254/24"
ifconfig_sis1="192.168.0.254/24"
ifconfig_sis2="192.168.254.254/24"
ifconfig_carp0="vhid 1 pass foo 10.0.0.1/24"
ifconfig_carp1="vhid 2 pass bar 192.168.0.1/24"
ifconfig_pfsync0="up syncif sis2"
pfsync_enable="YES"
pfsync_syncdev="sis2"
.Ed
.Pp
.Xr pf 4
@@ -210,7 +229,7 @@ net.inet.carp.preempt=1
.Ed
.Sh BUGS
Possibility to view state changes using
.Xr tcpdump 8
.Xr tcpdump 1
has not been ported from
.Ox
yet.
+4 -2
View File
@@ -24,6 +24,8 @@
.\" (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 November 20, 2002
.Dt PFCTL 8
.Os
@@ -83,7 +85,7 @@ When the variable
is set to
.Dv YES
in
.Xr rc.conf.local 8 ,
.Xr rc.conf.local 5 ,
the rule file specified with the variable
.Va pf_rules
is loaded automatically by the
@@ -594,11 +596,11 @@ Passive operating system fingerprint database.
.Xr pf 4 ,
.Xr pf.conf 5 ,
.Xr pf.os 5 ,
.Xr rc.conf 5 ,
.Xr sysctl.conf 5 ,
.Xr authpf 8 ,
.Xr ftp-proxy 8 ,
.Xr rc 8 ,
.Xr rc.conf 8 ,
.Xr sysctl 8
.Sh HISTORY
The
+8 -6
View File
@@ -24,6 +24,8 @@
.\" (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 July 9, 2001
.Dt PFLOGD 8
.Os
@@ -46,14 +48,14 @@ to the packet logging interface
and writes the packets to a logfile (normally
.Pa /var/log/pflog )
in
.Xr tcpdump 8
.Xr tcpdump 1
binary format.
These logs can be reviewed later using the
.Fl r
option of
.Xr tcpdump 8 ,
.Xr tcpdump 1 ,
hopefully offline in case there are bugs in the packet parsing code of
.Xr tcpdump 8 .
.Xr tcpdump 1 .
.Pp
.Nm
closes and then re-opens the log file when it receives
@@ -112,7 +114,7 @@ Other file parsers may desire a higher snaplen.
Check the integrity of an existing log file, and return.
.It Ar expression
Selects which packets will be dumped, using the regular language of
.Xr tcpdump 8 .
.Xr tcpdump 1 .
.El
.Sh FILES
.Bl -tag -width /var/run/pflogd.pid -compact
@@ -178,12 +180,12 @@ the wi0 interface:
# tcpdump -n -e -ttt -i pflog0 inbound and action block and on wi0
.Ed
.Sh SEE ALSO
.Xr tcpdump 1 ,
.Xr pcap 3 ,
.Xr pf 4 ,
.Xr pflog 4 ,
.Xr pf.conf 5 ,
.Xr newsyslog 8 ,
.Xr tcpdump 8
.Xr newsyslog 8
.Sh HISTORY
The
.Nm
-4
View File
@@ -216,15 +216,11 @@ init_pcap(void)
cur_snaplen = snaplen = pcap_snapshot(hpcap);
#ifdef __FreeBSD__
/* We can not lock bpf devices ... yet */
#else
/* lock */
if (ioctl(pcap_fileno(hpcap), BIOCLOCK) < 0) {
logmsg(LOG_ERR, "BIOCLOCK: %s", strerror(errno));
return (-1);
}
#endif
return (0);
}
+1 -1
View File
@@ -52,7 +52,7 @@ kiconv_add_xlat_table(const char *to, const char *from, const u_char *table)
struct iconv_add_out dout;
size_t olen;
if (strlen(from) > ICONV_CSNMAXLEN || strlen(to) > ICONV_CSNMAXLEN)
if (strlen(from) >= ICONV_CSNMAXLEN || strlen(to) >= ICONV_CSNMAXLEN)
return EINVAL;
din.ia_version = ICONV_ADD_VER;
strcpy(din.ia_converter, "xlat");
+5 -1
View File
@@ -1,9 +1,13 @@
/* $FreeBSD$ */
#include <sys/param.h>
#include <sys/time.h>
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#ifdef APPLE
#include <err.h>
#include <sysexits.h>
+1
View File
@@ -946,6 +946,7 @@ main(int argc, char **argv)
continue;
if (!gotlastaddr ||
from->sin_addr.s_addr != lastaddr) {
if (probe > 0) printf("\n ");
print(packet, cc, from);
lastaddr = from->sin_addr.s_addr;
++gotlastaddr;
File diff suppressed because it is too large. Load diff
+26
View File
@@ -0,0 +1,26 @@
#ifndef DRIVER_NDIS_H
#define DRIVER_NDIS_H
struct ndis_pmkid_entry {
struct ndis_pmkid_entry *next;
u8 bssid[ETH_ALEN];
u8 pmkid[16];
};
struct wpa_driver_ndis_data {
void *ctx;
char ifname[100];
u8 own_addr[ETH_ALEN];
LPADAPTER adapter;
u8 bssid[ETH_ALEN];
int has_capability;
int no_of_pmkid;
int radio_enabled;
struct wpa_driver_capa capa;
struct ndis_pmkid_entry *pmkid;
int event_sock;
char *adapter_desc;
};
#endif /* DRIVER_NDIS_H */
+164
View File
@@ -0,0 +1,164 @@
/*
* WPA Supplicant - Windows/NDIS driver interface - event processing
* Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
* See README and COPYING for more details.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/unistd.h>
#include <sys/types.h>
#ifndef CONFIG_NATIVE_WINDOWS
#include <sys/socket.h>
#include <netinet/in.h>
#endif /* CONFIG_NATIVE_WINDOWS */
#include "common.h"
#include "driver.h"
#include "wpa_supplicant.h"
#include "l2_packet.h"
#include "eloop.h"
#include "wpa.h"
/* Keep this event processing in a separate file and without WinPcap headers to
* avoid conflicts with some of the header files. */
struct _ADAPTER;
typedef struct _ADAPTER * LPADAPTER;
#include "driver_ndis.h"
void wpa_driver_ndis_event_connect(struct wpa_driver_ndis_data *drv);
void wpa_driver_ndis_event_disconnect(struct wpa_driver_ndis_data *drv);
void wpa_driver_ndis_event_media_specific(struct wpa_driver_ndis_data *drv,
const u8 *data, size_t data_len);
enum event_types { EVENT_CONNECT, EVENT_DISCONNECT,
EVENT_MEDIA_SPECIFIC };
/* Event data:
* enum event_types (as int, i.e., 4 octets)
* InstanceName length (1 octet)
* InstanceName (variable len)
* data length (1 octet, optional)
* data (variable len, optional)
*/
static void wpa_driver_ndis_event_cb(int sock, void *eloop_ctx, void *sock_ctx)
{
struct wpa_driver_ndis_data *drv = eloop_ctx;
u8 buf[512], *pos, *data = NULL;
int res, i, desc_len;
enum event_types type;
unsigned char instance_len;
char *instance;
size_t data_len = 0;
res = recv(sock, buf, sizeof(buf), 0);
if (res < 0) {
perror("wpa_driver_ndis_event_cb - recv");
return;
}
wpa_hexdump(MSG_MSGDUMP, "NDIS: received event data", buf, res);
if (res < sizeof(int) + 1)
return;
type = *((int *) buf);
pos = buf + sizeof(int);
wpa_printf(MSG_DEBUG, "NDIS: event - type %d", type);
instance_len = *pos++;
if (instance_len > buf + res - pos) {
wpa_printf(MSG_DEBUG, "NDIS: event InstanceName overflow");
return;
}
instance = pos;
pos += instance_len;
wpa_hexdump_ascii(MSG_MSGDUMP, "NDIS: event InstanceName",
instance, instance_len);
if (buf + res - pos > 1) {
data_len = *pos++;
if (data_len > buf + res - pos) {
wpa_printf(MSG_DEBUG, "NDIS: event data overflow");
return;
}
data = pos;
wpa_hexdump(MSG_MSGDUMP, "NDIS: event data", data, data_len);
}
if (drv->adapter_desc) {
desc_len = strlen(drv->adapter_desc);
if (instance_len < desc_len ||
strncmp(drv->adapter_desc, instance, desc_len)) {
wpa_printf(MSG_DEBUG, "NDIS: ignored event for "
"another adapter");
return;
}
/* InstanceName:
* <driver desc> #<num>
* <driver desc> #<num> - <intermediate drv name> Miniport
*/
for (i = desc_len + 1; i < instance_len; i++) {
if (instance[i] == '-') {
wpa_printf(MSG_DEBUG, "NDIS: ignored event "
"for intermediate miniport");
return;
}
}
}
switch (type) {
case EVENT_CONNECT:
wpa_driver_ndis_event_connect(drv);
break;
case EVENT_DISCONNECT:
wpa_driver_ndis_event_disconnect(drv);
break;
case EVENT_MEDIA_SPECIFIC:
wpa_driver_ndis_event_media_specific(drv, data, data_len);
break;
}
}
int wpa_driver_register_event_cb(struct wpa_driver_ndis_data *drv)
{
struct sockaddr_in addr;
drv->event_sock = socket(PF_INET, SOCK_DGRAM, 0);
if (drv->event_sock < 0) {
perror("socket");
return -1;
}
/* These events are received from an external program, ndis_events,
* which is converting WMI events to more "UNIX-like" input for
* wpa_supplicant, i.e., UDP packets that can be received through the
* eloop mechanism. */
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl((127 << 24) | 1);
addr.sin_port = htons(9876);
if (bind(drv->event_sock, (struct sockaddr *) &addr, sizeof(addr)) < 0)
{
perror("bind");
close(drv->event_sock);
drv->event_sock = -1;
return -1;
}
eloop_register_read_sock(drv->event_sock, wpa_driver_ndis_event_cb,
drv, NULL);
return 0;
}
+14
View File
@@ -10,6 +10,8 @@
* license.
*
* See README and COPYING for more details.
*
* $FreeBSD$
*/
#include <stdlib.h>
@@ -871,6 +873,15 @@ static void wpa_supplicant_associnfo(struct wpa_supplicant *wpa_s,
}
static int any_interfaces(struct wpa_supplicant *head)
{
struct wpa_supplicant *wpa_s;
for (wpa_s = head; wpa_s != NULL; wpa_s = wpa_s->next)
if (!wpa_s->interface_removed)
return 1;
return 0;
}
void wpa_supplicant_event(struct wpa_supplicant *wpa_s, wpa_event_type event,
union wpa_event_data *data)
@@ -1001,6 +1012,9 @@ void wpa_supplicant_event(struct wpa_supplicant *wpa_s, wpa_event_type event,
wpa_supplicant_mark_disassoc(wpa_s);
l2_packet_deinit(wpa_s->l2);
wpa_s->l2 = NULL;
/* check if last interface */
if (!any_interfaces(wpa_s->head))
eloop_terminate();
break;
}
break;
+3 -1
View File
@@ -3,6 +3,7 @@ Tatu Ylonen <[email protected]> - Creator of SSH
Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
Theo de Raadt, and Dug Song - Creators of OpenSSH
Ahsan Rashid <[email protected]> - UnixWare long passwords
Alain St-Denis <[email protected]> - Irix fix
Alexandre Oliva <[email protected]> - AIX fixes
Andre Lucas <[email protected]> - new login code, many fixes
@@ -32,6 +33,7 @@ David Del Piero <[email protected]> - bug fixes
David Hesprich <[email protected]> - Configure fixes
David Rankin <[email protected]> - libwrap, AIX, NetBSD fixes
Dag-Erling Smørgrav <des at freebsd.org> - Challenge-Response PAM code.
Dhiraj Gulati <[email protected]> - UnixWare long passwords
Ed Eden <[email protected]> - configure fixes
Garrick James <[email protected]> - configure fixes
Gary E. Miller <[email protected]> - SCO support
@@ -98,5 +100,5 @@ Apologies to anyone I have missed.
Damien Miller <[email protected]>
$Id: CREDITS,v 1.79 2004/05/26 23:59:31 dtucker Exp $
$Id: CREDITS,v 1.80 2005/08/26 20:15:20 tim Exp $
+495 -2
View File
@@ -1,3 +1,496 @@
20050901
- (djm) Update RPM spec file versions
20050831
- (djm) OpenBSD CVS Sync
- [email protected] 2005/08/30 22:08:05
[gss-serv.c sshconnect2.c]
destroy credentials if krb5_kuserok() call fails. Stops credentials being
delegated to users who are not authorised for GSSAPIAuthentication when
GSSAPIDeletegateCredentials=yes and another authentication mechanism
succeeds; bz#1073 reported by paul.moore AT centrify.com, fix by
simon AT sxw.org.uk, tested todd@ biorn@ jakob@; ok deraadt@
- [email protected] 2005/08/31 09:28:42
[version.h]
4.2
- (dtucker) [README] Update release note URL to 4.2
- (tim) [configure.ac auth.c defines.h session.c openbsd-compat/port-uw.c
openbsd-compat/port-uw.h openbsd-compat/xcrypt.c] libiaf cleanup. Disable
libiaf bits for OpenServer6. Free memory allocated by ia_get_logpwd().
Feedback and OK dtucker@
20050830
- (tim) [configure.ac] Back out last change. It needs to be done differently.
20050829
- (tim) [configure.ac] ia_openinfo() seems broken on OSR6. Limit UW long
password support to 7.x for now.
20050826
- (tim) [CREDITS LICENCE auth.c configure.ac defines.h includes.h session.c
openbsd-compat/Makefile.in openbsd-compat/openbsd-compat.h
openbsd-compat/xcrypt.c] New files [openssh/openbsd-compat/port-uw.c
openssh/openbsd-compat/port-uw.h] Support long passwords (> 8-char)
on UnixWare 7 from Dhiraj Gulati and Ahsan Rashid. Cleanup and testing
by tim@. Feedback and OK dtucker@
20050823
- (dtucker) [regress/test-exec.sh] Do not prepend an extra "/" to a fully-
qualified sshd pathname since some systems (eg Cygwin) may consider "/foo"
and "//foo" to be different. Spotted by vinschen at redhat.com.
- (tim) [configure.ac] Not all gcc's support -Wsign-compare. Enhancements
and OK dtucker@
- (tim) [defines.h] PATH_MAX bits for OpenServer OK dtucker@
20050821
- (dtucker) [configure.ac defines.h includes.h sftp.c] Add support for
LynxOS, patch from Olli Savia (ops at iki.fi). ok djm@
20050816
- (djm) [ttymodes.c] bugzilla #1025: Fix encoding of _POSIX_VDISABLE,
from Jacob Nevins; ok dtucker@
20050815
- (tim) [sftp.c] wrap el_end() in #ifdef USE_LIBEDIT
- (tim) [configure.ac] corrections to libedit tests. Report and patches
by skeleten AT shillest.net
20050812
- (djm) OpenBSD CVS Sync
- [email protected] 2005/07/28 17:36:22
[packet.c]
missing packet_init_compression(); from solar
- [email protected] 2005/07/30 01:26:16
[ssh.c]
fix -D listen_host initialisation, so it picks up gateway_ports setting
correctly
- [email protected] 2005/07/30 02:03:47
[readconf.c]
listen_hosts initialisation here too; spotted greg AT y2005.nest.cx
- [email protected] 2005/08/06 10:03:12
[servconf.c]
Unbreak sshd ListenAddress for bare IPv6 addresses.
Report from Janusz Mucka; ok djm@
- [email protected] 2005/08/08 13:22:48
[sftp.c]
sftp prompt enhancements:
- in non-interactive mode, do not print an empty prompt at the end
before finishing
- print newline after EOF in editline mode
- call el_end() in editline mode
ok dtucker djm
20050810
- (dtucker) [configure.ac] Test libedit library and headers for compatibility.
Report from skeleten AT shillest.net, ok djm@
- (dtucker) [LICENCE configure.ac defines.h openbsd-compat/realpath.c]
Sync current (thread-safe) version of realpath.c from OpenBSD (which is
in turn based on FreeBSD's). ok djm@
20050809
- (tim) [configure.ac] Allow --with-audit=no. OK dtucker@
Report by skeleten AT shillest.net
20050803
- (dtucker) [openbsd-compat/fake-rfc2553.h] Check for EAI_* defines
individually and use a value less likely to collide with real values from
netdb.h. Fixes compile warnings on FreeBSD 5.3. ok djm@
- (dtucker) [openbsd-compat/fake-rfc2553.h] MAX_INT -> INT_MAX since the
latter is specified in the standard.
20050802
- (dtucker) OpenBSD CVS Sync
- [email protected] 2005/07/27 10:39:03
[scp.c hostfile.c sftp-client.c]
Silence bogus -Wuninitialized warnings; ok djm@
- (dtucker) [configure.ac] Enable -Wuninitialized by default when compiling
with gcc. ok djm@
- (dtucker) [configure.ac] Add a --with-Werror option to configure for
adding -Werror to CFLAGS when all of the configure tests are done. ok djm@
20050726
- (dtucker) [configure.ac] Update zlib warning message too, pointed out by
tim@.
- (djm) OpenBSD CVS Sync
- [email protected] 2005/07/19 15:32:26
[auth-passwd.c]
auth_usercheck(3) can return NULL, so check for that. Report from
mpech@. ok markus@
- [email protected] 2005/07/25 11:59:40
[kex.c kex.h myproposal.h packet.c packet.h servconf.c session.c]
[sshconnect2.c sshd.c sshd_config sshd_config.5]
add a new compression method that delays compression until the user
has been authenticated successfully and set compression to 'delayed'
for sshd.
this breaks older openssh clients (< 3.5) if they insist on
compression, so you have to re-enable compression in sshd_config.
ok djm@
20050725
- (dtucker) [configure.ac] Update zlib version check for CAN-2005-2096.
20050717
- OpenBSD CVS Sync
- [email protected] 2005/07/16 01:35:24
[auth1.c channels.c cipher.c clientloop.c kex.c session.c ssh.c]
[sshconnect.c]
spacing
- (djm) [acss.c auth-pam.c auth-shadow.c auth-skey.c auth1.c canohost.c]
[cipher-acss.c loginrec.c ssh-rand-helper.c sshd.c] Fix whitespace at EOL
in portable too ("perl -p -i -e 's/\s+$/\n/' *.[ch]")
- (djm) [auth-pam.c sftp.c] spaces vs. tabs at start of line
- [email protected] 2005/07/17 06:49:04
[channels.c channels.h session.c session.h]
Fix a number of X11 forwarding channel leaks:
1. Refuse multiple X11 forwarding requests on the same session
2. Clean up all listeners after a single_connection X11 forward, not just
the one that made the single connection
3. Destroy X11 listeners when the session owning them goes away
testing and ok dtucker@
- [email protected] 2005/07/17 07:17:55
[auth-rh-rsa.c auth-rhosts.c auth2-chall.c auth2-gss.c channels.c]
[cipher-ctr.c gss-genr.c gss-serv.c kex.c moduli.c readconf.c]
[serverloop.c session.c sftp-client.c sftp.c ssh-add.c ssh-keygen.c]
[sshconnect.c sshconnect2.c]
knf says that a 2nd level indent is four (not three or five) spaces
-(djm) [audit.c auth1.c auth2.c entropy.c loginrec.c serverloop.c]
[ssh-rand-helper.c] fix portable 2nd level indents at 4 spaces too
- (djm) [monitor.c monitor_wrap.c] -Wsign-compare for PAM monitor calls
20050716
- (dtucker) [auth-pam.c] Ensure that only one side of the authentication
socketpair stays open on in both the monitor and PAM process. Patch from
Joerg Sonnenberger.
20050714
- (dtucker) OpenBSD CVS Sync
- [email protected] 2005/07/06 09:33:05
[ssh.1]
clarify meaning of ssh -b ; with & ok jmc@
- [email protected] 2005/07/08 09:26:18
[misc.c]
Make comment match code; ok djm@
- [email protected] 2005/07/08 09:41:33
[channels.h]
race when efd gets closed while there is still buffered data:
change CHANNEL_EFD_OUTPUT_ACTIVE()
1) c->efd must always be valid AND
2a) no EOF has been seen OR
2b) there is buffered data
report, initial fix and testing Chuck Cranor
- [email protected] 2005/07/08 10:20:41
[ssh_config.5]
change BindAddress to match recent ssh -b change; prompted by markus@
- [email protected] 2005/07/08 12:53:10
[ssh_config.5]
new sentence, new line;
- [email protected] 2005/07/14 04:00:43
[misc.h]
use __sentinel__ attribute; ok deraadt@ djm@ markus@
- (dtucker) [configure.ac defines.h] Define __sentinel__ to nothing if the
compiler doesn't understand it to prevent warnings. If any mainstream
compiler versions acquire it we can test for those versions. Based on
discussion with djm@.
20050707
- dtucker [auth-krb5.c auth.h gss-serv-krb5.c] Move KRB5CCNAME generation for
the MIT Kerberos code path into a common function and expand mkstemp
template to be consistent with the rest of OpenSSH. From sxw at
inf.ed.ac.uk, ok djm@
- (dtucker) [auth-krb5.c] There's no guarantee that snprintf will set errno
in the case where the buffer is insufficient, so always return ENOMEM.
Also pointed out by sxw at inf.ed.ac.uk.
- (dtucker) [acconfig.h auth-krb5.c configure.ac gss-serv-krb5.c] Remove
calls to krb5_init_ets, which has not been required since krb-1.1.x and
most Kerberos versions no longer export in their public API. From sxw
at inf.ed.ac.uk, ok djm@
20050706
- (djm) OpenBSD CVS Sync
- [email protected] 2005/07/01 13:19:47
[channels.c]
don't free() if getaddrinfo() fails; report mpech@
- [email protected] 2005/07/04 00:58:43
[channels.c clientloop.c clientloop.h misc.c misc.h ssh.c ssh_config.5]
implement support for X11 and agent forwarding over multiplex slave
connections. Because of protocol limitations, the slave connections inherit
the master's DISPLAY and SSH_AUTH_SOCK rather than distinctly forwarding
their own.
ok dtucker@ "put it in" deraadt@
- [email protected] 2005/07/04 11:29:51
[ssh_config.5]
fix Xr and a little grammar;
- [email protected] 2005/07/04 14:04:11
[channels.c]
don't forget to set x11_saved_display
20050626
- (djm) OpenBSD CVS Sync
- [email protected] 2005/06/17 22:53:47
[ssh.c sshconnect.c]
Fix ControlPath's %p expanding to "0" for a default port,
spotted dwmw2 AT infradead.org; ok markus@
- [email protected] 2005/06/18 04:30:36
[ssh.c ssh_config.5]
allow ControlPath=none, patch from dwmw2 AT infradead.org; ok dtucker@
- [email protected] 2005/06/25 22:47:49
[ssh.c]
do the default port filling code a few lines earlier, so it really
does fix %p
20050618
- (djm) OpenBSD CVS Sync
- [email protected] 2005/05/20 12:57:01;
[auth1.c] split protocol 1 auth methods into separate functions, makes
authloop much more readable; fixes and ok markus@ (portable ok &
polish dtucker@)
- [email protected] 2005/06/17 02:44:33
[auth1.c] make this -Wsign-compare clean; ok avsm@ markus@
- (djm) [loginrec.c ssh-rand-helper.c] Fix -Wsign-compare for portable,
tested and fixes tim@
20050617
- (djm) OpenBSD CVS Sync
- [email protected] 2005/06/16 03:38:36
[channels.c channels.h clientloop.c clientloop.h ssh.c]
move x11_get_proto from ssh.c to clientloop.c, to make muliplexed xfwd
easier later; ok deraadt@
- [email protected] 2005/06/16 08:00:00
[canohost.c channels.c sshd.c]
don't exit if getpeername fails for forwarded ports; bugzilla #1054;
ok djm
- [email protected] 2005/06/17 02:44:33
[auth-rsa.c auth.c auth1.c auth2-chall.c auth2-gss.c authfd.c authfile.c]
[bufaux.c canohost.c channels.c cipher.c clientloop.c dns.c gss-serv.c]
[kex.c kex.h key.c mac.c match.c misc.c packet.c packet.h scp.c]
[servconf.c session.c session.h sftp-client.c sftp-server.c sftp.c]
[ssh-keyscan.c ssh-rsa.c sshconnect.c sshconnect1.c sshconnect2.c sshd.c]
make this -Wsign-compare clean; ok avsm@ markus@
NB. auth1.c changes not committed yet (conflicts with uncommitted sync)
NB2. more work may be needed to make portable Wsign-compare clean
- (dtucker) [cipher.c openbsd-compat/openbsd-compat.h
openbsd-compat/openssl-compat.c] only include openssl compat stuff where
it's needed as it can cause conflicts elsewhere (eg xcrypt.c). Found by
and ok tim@
20050616
- (djm) OpenBSD CVS Sync
- [email protected] 2005/06/07 13:25:23
[progressmeter.c]
catch SIGWINCH and resize progress meter accordingly; ok markus dtucker
- [email protected] 2005/06/06 11:20:36
[auth.c auth.h misc.c misc.h ssh.c ssh_config.5 sshconnect.c]
introduce a generic %foo expansion function. replace existing % expansion
and add expansion to ControlPath; ok markus@
- [email protected] 2005/06/08 03:50:00
[ssh-keygen.1 ssh-keygen.c sshd.8]
increase default rsa/dsa key length from 1024 to 2048 bits;
ok markus@ deraadt@
- [email protected] 2005/06/08 11:25:09
[clientloop.c readconf.c readconf.h ssh.c ssh_config.5]
add ControlMaster=auto/autoask options to support opportunistic
multiplexing; tested avsm@ and jakob@, ok markus@
- [email protected] 2005/06/09 13:43:49
[cipher.c]
Correctly initialize end of array sentinel; ok djm@
(Id sync only, change already in portable)
20050609
- (dtucker) [cipher.c openbsd-compat/Makefile.in
openbsd-compat/openbsd-compat.h openbsd-compat/openssl-compat.{c,h}]
Move compatibility code for supporting older OpenSSL versions to the
compat layer. Suggested by and "no objection" djm@
20050607
- (dtucker) [configure.ac] Continue the hunt for LLONG_MIN and LLONG_MAX:
in today's episode we attempt to coax it from limits.h where it may be
hiding, failing that we take the DIY approach. Tested by tim@
20050603
- (dtucker) [configure.ac] Only try gcc -std=gnu99 if LLONG_MAX isn't
defined, and check that it helps before keeping it in CFLAGS. Some old
gcc's don't set an error code when encountering an unknown value in -std.
Found and tested by tim@.
- (dtucker) [configure.ac] Point configure's reporting address at the
openssh-unix-dev list. ok tim@ djm@
20050602
- (tim) [configure.ac] Some platforms need sys/types.h for arpa/nameser.h.
Take AC_CHECK_HEADERS test out of ultrix section. It caused other platforms
to skip builtin standard includes tests. (first AC_CHECK_HEADERS test
must be run on all platforms) Add missing ;; to case statement. OK dtucker@
20050601
- (dtucker) [configure.ac] Look for _getshort and _getlong in
arpa/nameser.h.
- (dtucker) [configure.ac openbsd-compat/Makefile.in openbsd-compat/strtoll.c]
Add strtoll to the compat library, from OpenBSD.
- (dtucker) OpenBSD CVS Sync
- [email protected] 2005/05/26 02:08:05
[scp.c]
If copying multiple files to a target file (which normally fails, as it
must be a target directory), kill the spawned ssh child before exiting.
This stops it trying to authenticate and spewing lots of output.
deraadt@ ok
- [email protected] 2005/05/26 09:08:12
[ssh-keygen.c]
uint32_t -> u_int32_t for consistency; ok djm@
- [email protected] 2005/05/27 08:30:37
[ssh.c]
fix -O for cases where no ControlPath has been specified or socket at
ControlPath is not contactable; spotted by and ok avsm@
- (tim) [config.guess config.sub] Update to '2005-05-27' version.
- (tim) [configure.ac] set TEST_SHELL for OpenServer 6
20050531
- (dtucker) [contrib/aix/pam.conf] Correct comments. From davidl at
vintela.com.
- (dtucker) [mdoc2man.awk] Teach it to understand .Ox.
20050530
- (dtucker) [README] Link to new release notes. Beter late than never...
20050529
- (dtucker) [openbsd-compat/port-aix.c] Bug #1046: AIX 5.3 expects the
argument to passwdexpired to be initialized to NULL. Suggested by tim@
While at it, initialize the other arguments to auth functions in case they
ever acquire this behaviour.
- (dtucker) [openbsd-compat/port-aix.c] Whitespace cleanups while there.
- (dtucker) [openbsd-compat/port-aix.c] Minor correction to debug message,
spotted by tim@.
20050528
- (dtucker) [configure.ac] For AC_CHECK_HEADERS() and AC_CHECK_FUNCS() have
one entry per line to make it easier to merge changes. ok djm@
- (dtucker) [configure.ac] strsep() may be defined in string.h, so check
for its presence and include it in the strsep check.
- (dtucker) [configure.ac] getpgrp may be defined in unistd.h, so check for
its presence before doing AC_FUNC_GETPGRP.
- (dtucker) [configure.ac] Merge HP-UX blocks into a common block with minor
version-specific variations as required.
- (dtucker) [openbsd-compat/port-aix.h] Use the HAVE_DECL_* definitions as
per the autoconf man page. Configure should always define them but it
doesn't hurt to check.
20050527
- (djm) [defines.h] Use our realpath if we have to define PATH_MAX, spotted by
David Leach; ok dtucker@
- (dtucker) [acconfig.h configure.ac defines.h includes.h sshpty.c
openbsd-compat/bsd-misc.c] Add support for Ultrix. No, that's not a typo.
Required changes from Bernhard Simon, integrated by me. ok djm@
20050525
- (djm) [mpaux.c mpaux.h Makefile.in] Remove old mpaux.[ch] code, it has not
been used for a while
- (djm) OpenBSD CVS Sync
- [email protected] 2005/04/05 13:45:31
[ssh-keygen.c]
- [email protected] 2005/04/06 09:43:59
[sshd.c]
avoid harmless logspam by not performing setsockopt() on non-socket;
ok markus@
- [email protected] 2005/04/06 12:26:06
[ssh.c]
Fix debug call for port forwards; patch from pete at seebeyond.com,
ok djm@ (ID sync only - change already in portable)
- [email protected] 2005/04/09 04:32:54
[misc.c misc.h tildexpand.c Makefile.in]
replace tilde_expand_filename with a simpler implementation, ahead of
more whacking; ok deraadt@
- [email protected] 2005/04/14 12:30:30
[ssh.1]
arg to -b is an address, not if_name;
ok markus@
- [email protected] 2005/04/20 10:05:45
[dns.c]
do not try to look up SSHFP for numerical hostname. ok djm@
- [email protected] 2005/04/21 06:17:50
[ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 ssh_config.5 sshd.8]
[sshd_config.5] OpenSSH doesn't ever look at the $HOME environment
variable, so don't say that we do (bz #623); ok deraadt@
- [email protected] 2005/04/21 11:47:19
[ssh.c]
don't allocate a pty when -n flag (/dev/null stdin) is set, patch from
ignasi.roca AT fujitsu-siemens.com (bz #829); ok dtucker@
- [email protected] 2005/04/23 23:43:47
[readpass.c]
Add debug message if read_passphrase can't open /dev/tty; bz #471;
ok djm@
- [email protected] 2005/04/26 12:59:02
[sftp-client.h]
spelling correction in comment from wiz@netbsd;
- [email protected] 2005/04/26 13:08:37
[ssh.c ssh_config.5]
fallback gracefully if client cannot connect to ControlPath. ok djm@
- [email protected] 2005/04/28 10:17:56
[progressmeter.c ssh-keyscan.c]
add snprintf checks. ok djm@ markus@
- [email protected] 2005/05/02 21:13:22
[readpass.c]
missing {}
- [email protected] 2005/05/10 10:28:11
[ssh.c]
print nice error message for EADDRINUSE as well (ID sync only)
- [email protected] 2005/05/10 10:30:43
[ssh.c]
report real errors on fallback from ControlMaster=no to normal connect
- [email protected] 2005/05/16 15:30:51
[readconf.c servconf.c]
check return value from strdelim() for NULL (AddressFamily); mpech
- [email protected] 2005/05/19 02:39:55
[sshd_config.5]
sort config options, from grunk AT pestilenz.org; ok jmc@
- [email protected] 2005/05/19 02:40:52
[sshd_config]
whitespace nit, from grunk AT pestilenz.org
- [email protected] 2005/05/19 02:42:26
[includes.h]
fix cast, from grunk AT pestilenz.org
- [email protected] 2005/05/20 10:50:55
[ssh_config.5]
give a ProxyCommand example using nc(1), with and ok jmc@
- [email protected] 2005/05/20 11:23:32
[ssh_config.5]
oops - article and spacing;
- [email protected] 2005/05/23 22:44:01
[moduli.c ssh-keygen.c]
- removes signed/unsigned comparisons in moduli generation
- use strtonum instead of atoi where its easier
- check some strlcpy overflow and fatal instead of truncate
- [email protected] 2005/05/23 23:32:46
[cipher.c myproposal.h ssh.1 ssh_config.5 sshd_config.5]
add support for draft-harris-ssh-arcfour-fixes-02 improved arcfour modes;
ok markus@
- [email protected] 2005/05/24 02:05:09
[ssh-keygen.c]
some style nits from dmiller@, and use a fatal() instead of a printf()/exit
- [email protected] 2005/05/24 17:32:44
[atomicio.c atomicio.h authfd.c monitor_wrap.c msg.c scp.c sftp-client.c]
[ssh-keyscan.c sshconnect.c]
Switch atomicio to use a simpler interface; it now returns a size_t
(containing number of bytes read/written), and indicates error by
returning 0. EOF is signalled by errno==EPIPE.
Typical use now becomes:
if (atomicio(read, ..., len) != len)
err(1,"read");
ok deraadt@, cloder@, djm@
- (dtucker) [regress/reexec.sh] Add ${EXEEXT} so this test also works on
Cygwin.
- (dtucker) [auth-pam.c] Bug #1033: Fix warnings building with PAM on Linux:
warning: dereferencing type-punned pointer will break strict-aliasing rules
warning: passing arg 3 of `pam_get_item' from incompatible pointer type
The type-punned pointer fix is based on a patch from SuSE's rpm. ok djm@
- (dtucker) [configure.ac openbsd-compat/getrrsetbyname.c] Bug #1033: Provide
templates for _getshort and _getlong if missing to prevent compiler warnings
on Linux.
- (djm) [configure.ac openbsd-compat/Makefile.in]
[openbsd-compat/openbsd-compat.h openbsd-compat/strtonum.c]
Add strtonum(3) from OpenBSD libc, new code needs it.
Unfortunately Linux forces us to do a bizarre dance with compiler
options to get LLONG_MIN/MAX; Spotted by and ok dtucker@
20050524
- (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
[contrib/suse/openssh.spec] Update spec file versions to 4.1p1
@@ -9,7 +502,7 @@
- (dtucker) [openbsd-compat/bsd-cygwin_util.c] Ensure sufficient memory
allocation when retrieving core Windows environment. Add CYGWIN variable
to propagated variables. Patch from vinschen at redhat.com, ok djm@
- (djm) Release 4.1p1
- Release 4.1p1
20050524
- (djm) [openbsd-compat/readpassphrase.c] bz #950: Retry tcsetattr to ensure
@@ -2496,4 +2989,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
$Id: ChangeLog,v 1.3758.2.2 2005/05/25 12:24:56 djm Exp $
$Id: ChangeLog,v 1.3887 2005/09/01 09:10:48 djm Exp $
+2 -2
View File
@@ -1,14 +1,14 @@
# $FreeBSD$
# Shell code to remove FreeBSD tags before merging
grep -rl '\$Fre[e]BSD:' . >tags
grep -rl '\$Fre[e]BSD:' . | grep -v FREEBSD >tags
cat tags | while read f ; do
sed -i.orig -e '/\$Fre[e]BSD:/d' $f
done
# Shell + Perl code to add FreeBSD tags wherever an OpenBSD or Id tag occurs
cat tags |
xargs perl -n -i.orig -e 'print; s/\$(Id|OpenBSD): [^\$]*\$/\$Fre[e]BSD\$/ && print'
xargs perl -n -i.orig -e 'print; s/\$(Id|OpenBSD): [^\$]*/\$FreeBSD/ && print'
# Shell code to reexpand FreeBSD tags
cat tags | while read f ; do
+2
View File
@@ -204,6 +204,7 @@ OpenSSH contains no GPL code.
William Jones
Darren Tucker
Sun Microsystems
The SCO Group
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -255,6 +256,7 @@ OpenSSH contains no GPL code.
Damien Miller
Eric P. Allman
The Regents of the University of California
Constantin S. Svintsoff
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
+4 -4
View File
@@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.270 2005/02/25 23:12:38 dtucker Exp $
# $Id: Makefile.in,v 1.273 2005/05/29 07:22:29 dtucker Exp $
# uncomment if you run a non bourne compatable shell. Ie. csh
#SHELL = @SH@
@@ -66,8 +66,8 @@ LIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o buffer.o \
canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \
cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \
compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \
log.o match.o moduli.o mpaux.o nchan.o packet.o \
readpass.o rsa.o tildexpand.o ttymodes.o xmalloc.o \
log.o match.o moduli.o nchan.o packet.o \
readpass.o rsa.o ttymodes.o xmalloc.o \
atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \
monitor_fdpass.o rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o \
kexgex.o kexdhc.o kexgexc.o scard.o msg.o progressmeter.o dns.o \
@@ -190,7 +190,7 @@ ssh_prng_cmds.out: ssh_prng_cmds
$(PERL) $(srcdir)/fixprogs ssh_prng_cmds $(ENT); \
fi
# fake rule to stop make trying to compile moduli.o into a binary "modulo"
# fake rule to stop make trying to compile moduli.o into a binary "moduli.o"
moduli:
echo
+5 -4
View File
@@ -1,4 +1,4 @@
See http://www.openssh.com/txt/release-4.0 for the release notes.
See http://www.openssh.com/txt/release-4.2 for the release notes.
- A Japanese translation of this document and of the OpenSSH FAQ is
- available at http://www.unixuser.org/~haruyama/security/openssh/index.html
@@ -56,9 +56,10 @@ References -
[2] http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html
[3] http://www.gzip.org/zlib/
[4] http://www.openssl.org/
[5] http://www.kernel.org/pub/linux/libs/pam/ (PAM is standard on Solaris
and HP-UX 11)
[5] http://www.openpam.org
http://www.kernel.org/pub/linux/libs/pam/
(PAM also is standard on Solaris and HP-UX 11)
[6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9
[7] http://www.openssh.com/faq.html
$Id: README,v 1.57 2005/03/09 03:32:28 dtucker Exp $
$Id: README,v 1.60 2005/08/31 14:05:57 dtucker Exp $
+3 -3
View File
@@ -38,8 +38,8 @@ privsep user and chroot directory:
Privsep requires operating system support for file descriptor passing.
Compression will be disabled on systems without a working mmap MAP_ANON.
PAM-enabled OpenSSH is known to function with privsep on AIX, HP-UX
(including Trusted Mode), Linux and Solaris.
PAM-enabled OpenSSH is known to function with privsep on AIX, FreeBSD,
HP-UX (including Trusted Mode), Linux, NetBSD and Solaris.
On Cygwin, Tru64 Unix, OpenServer, and Unicos only the pre-authentication
part of privsep is supported. Post-authentication privsep is disabled
@@ -60,4 +60,4 @@ process 1005 is the sshd process listening for new connections.
process 6917 is the privileged monitor process, 6919 is the user owned
sshd process and 6921 is the shell process.
$Id: README.privsep,v 1.15 2004/10/06 10:09:32 dtucker Exp $
$Id: README.privsep,v 1.16 2005/06/04 23:21:41 djm Exp $
+2 -2
View File
@@ -57,7 +57,7 @@ disproportionate time to execute.
Tuning the random helper can be done by running ./ssh-random-helper in
very verbose mode ("-vvv") and identifying the commands that are taking
accessive amounts of time or hanging altogher. Any problem commands can
excessive amounts of time or hanging altogher. Any problem commands can
be modified or removed from ssh_prng_cmds.
The default entropy collector will timeout programs which take too long
@@ -92,4 +92,4 @@ If you are forced to use ssh-rand-helper consider still downloading
prngd/egd and configure OpenSSH using --with-prngd-port=xx or
--with-prngd-socket=xx (refer to INSTALL for more information).
$Id: WARNING.RNG,v 1.7 2004/12/06 11:40:11 dtucker Exp $
$Id: WARNING.RNG,v 1.8 2005/05/26 01:47:54 djm Exp $
+1 -7
View File
@@ -1,4 +1,4 @@
/* $Id: acconfig.h,v 1.181 2005/02/25 23:07:38 dtucker Exp $ */
/* $Id: acconfig.h,v 1.183 2005/07/07 10:33:36 dtucker Exp $ */
/* $FreeBSD$ */
/*
@@ -120,9 +120,6 @@
/* Define if you are on NeXT */
#undef HAVE_NEXT
/* Define if you are on NEWS-OS */
#undef HAVE_NEWS4
/* Define if you want to enable PAM support */
#undef USE_PAM
@@ -206,9 +203,6 @@
/* Define if you don't want to use lastlog in session.c */
#undef NO_SSH_LASTLOG
/* Define if have krb5_init_ets */
#undef KRB5_INIT_ETS
/* Define if you don't want to use utmp */
#undef DISABLE_UTMP
+64 -64
View File
@@ -1,4 +1,4 @@
/* $Id: acss.c,v 1.2 2004/02/06 04:22:43 dtucker Exp $ */
/* $Id: acss.c,v 1.3 2005/07/17 07:04:47 djm Exp $ */
/*
* Copyright (c) 2004 The OpenBSD project
*
@@ -24,37 +24,37 @@
/* decryption sbox */
static unsigned char sboxdec[] = {
0x33, 0x73, 0x3b, 0x26, 0x63, 0x23, 0x6b, 0x76,
0x3e, 0x7e, 0x36, 0x2b, 0x6e, 0x2e, 0x66, 0x7b,
0xd3, 0x93, 0xdb, 0x06, 0x43, 0x03, 0x4b, 0x96,
0xde, 0x9e, 0xd6, 0x0b, 0x4e, 0x0e, 0x46, 0x9b,
0x57, 0x17, 0x5f, 0x82, 0xc7, 0x87, 0xcf, 0x12,
0x5a, 0x1a, 0x52, 0x8f, 0xca, 0x8a, 0xc2, 0x1f,
0xd9, 0x99, 0xd1, 0x00, 0x49, 0x09, 0x41, 0x90,
0xd8, 0x98, 0xd0, 0x01, 0x48, 0x08, 0x40, 0x91,
0x3d, 0x7d, 0x35, 0x24, 0x6d, 0x2d, 0x65, 0x74,
0x3c, 0x7c, 0x34, 0x25, 0x6c, 0x2c, 0x64, 0x75,
0xdd, 0x9d, 0xd5, 0x04, 0x4d, 0x0d, 0x45, 0x94,
0xdc, 0x9c, 0xd4, 0x05, 0x4c, 0x0c, 0x44, 0x95,
0x59, 0x19, 0x51, 0x80, 0xc9, 0x89, 0xc1, 0x10,
0x58, 0x18, 0x50, 0x81, 0xc8, 0x88, 0xc0, 0x11,
0xd7, 0x97, 0xdf, 0x02, 0x47, 0x07, 0x4f, 0x92,
0xda, 0x9a, 0xd2, 0x0f, 0x4a, 0x0a, 0x42, 0x9f,
0x53, 0x13, 0x5b, 0x86, 0xc3, 0x83, 0xcb, 0x16,
0x5e, 0x1e, 0x56, 0x8b, 0xce, 0x8e, 0xc6, 0x1b,
0xb3, 0xf3, 0xbb, 0xa6, 0xe3, 0xa3, 0xeb, 0xf6,
0xbe, 0xfe, 0xb6, 0xab, 0xee, 0xae, 0xe6, 0xfb,
0x37, 0x77, 0x3f, 0x22, 0x67, 0x27, 0x6f, 0x72,
0x3a, 0x7a, 0x32, 0x2f, 0x6a, 0x2a, 0x62, 0x7f,
0xb9, 0xf9, 0xb1, 0xa0, 0xe9, 0xa9, 0xe1, 0xf0,
0xb8, 0xf8, 0xb0, 0xa1, 0xe8, 0xa8, 0xe0, 0xf1,
0x5d, 0x1d, 0x55, 0x84, 0xcd, 0x8d, 0xc5, 0x14,
0x5c, 0x1c, 0x54, 0x85, 0xcc, 0x8c, 0xc4, 0x15,
0xbd, 0xfd, 0xb5, 0xa4, 0xed, 0xad, 0xe5, 0xf4,
0xbc, 0xfc, 0xb4, 0xa5, 0xec, 0xac, 0xe4, 0xf5,
0x39, 0x79, 0x31, 0x20, 0x69, 0x29, 0x61, 0x70,
0x38, 0x78, 0x30, 0x21, 0x68, 0x28, 0x60, 0x71,
0xb7, 0xf7, 0xbf, 0xa2, 0xe7, 0xa7, 0xef, 0xf2,
0x33, 0x73, 0x3b, 0x26, 0x63, 0x23, 0x6b, 0x76,
0x3e, 0x7e, 0x36, 0x2b, 0x6e, 0x2e, 0x66, 0x7b,
0xd3, 0x93, 0xdb, 0x06, 0x43, 0x03, 0x4b, 0x96,
0xde, 0x9e, 0xd6, 0x0b, 0x4e, 0x0e, 0x46, 0x9b,
0x57, 0x17, 0x5f, 0x82, 0xc7, 0x87, 0xcf, 0x12,
0x5a, 0x1a, 0x52, 0x8f, 0xca, 0x8a, 0xc2, 0x1f,
0xd9, 0x99, 0xd1, 0x00, 0x49, 0x09, 0x41, 0x90,
0xd8, 0x98, 0xd0, 0x01, 0x48, 0x08, 0x40, 0x91,
0x3d, 0x7d, 0x35, 0x24, 0x6d, 0x2d, 0x65, 0x74,
0x3c, 0x7c, 0x34, 0x25, 0x6c, 0x2c, 0x64, 0x75,
0xdd, 0x9d, 0xd5, 0x04, 0x4d, 0x0d, 0x45, 0x94,
0xdc, 0x9c, 0xd4, 0x05, 0x4c, 0x0c, 0x44, 0x95,
0x59, 0x19, 0x51, 0x80, 0xc9, 0x89, 0xc1, 0x10,
0x58, 0x18, 0x50, 0x81, 0xc8, 0x88, 0xc0, 0x11,
0xd7, 0x97, 0xdf, 0x02, 0x47, 0x07, 0x4f, 0x92,
0xda, 0x9a, 0xd2, 0x0f, 0x4a, 0x0a, 0x42, 0x9f,
0x53, 0x13, 0x5b, 0x86, 0xc3, 0x83, 0xcb, 0x16,
0x5e, 0x1e, 0x56, 0x8b, 0xce, 0x8e, 0xc6, 0x1b,
0xb3, 0xf3, 0xbb, 0xa6, 0xe3, 0xa3, 0xeb, 0xf6,
0xbe, 0xfe, 0xb6, 0xab, 0xee, 0xae, 0xe6, 0xfb,
0x37, 0x77, 0x3f, 0x22, 0x67, 0x27, 0x6f, 0x72,
0x3a, 0x7a, 0x32, 0x2f, 0x6a, 0x2a, 0x62, 0x7f,
0xb9, 0xf9, 0xb1, 0xa0, 0xe9, 0xa9, 0xe1, 0xf0,
0xb8, 0xf8, 0xb0, 0xa1, 0xe8, 0xa8, 0xe0, 0xf1,
0x5d, 0x1d, 0x55, 0x84, 0xcd, 0x8d, 0xc5, 0x14,
0x5c, 0x1c, 0x54, 0x85, 0xcc, 0x8c, 0xc4, 0x15,
0xbd, 0xfd, 0xb5, 0xa4, 0xed, 0xad, 0xe5, 0xf4,
0xbc, 0xfc, 0xb4, 0xa5, 0xec, 0xac, 0xe4, 0xf5,
0x39, 0x79, 0x31, 0x20, 0x69, 0x29, 0x61, 0x70,
0x38, 0x78, 0x30, 0x21, 0x68, 0x28, 0x60, 0x71,
0xb7, 0xf7, 0xbf, 0xa2, 0xe7, 0xa7, 0xef, 0xf2,
0xba, 0xfa, 0xb2, 0xaf, 0xea, 0xaa, 0xe2, 0xff
};
@@ -95,38 +95,38 @@ static unsigned char sboxenc[] = {
};
static unsigned char reverse[] = {
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
};
/*
+9 -5
View File
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2005 Anil Madhavapeddy. All rights reserved.
* Copyright (c) 1995,1999 Theo de Raadt. All rights reserved.
* All rights reserved.
*
@@ -24,14 +25,14 @@
*/
#include "includes.h"
RCSID("$OpenBSD: atomicio.c,v 1.12 2003/07/31 15:50:16 avsm Exp $");
RCSID("$OpenBSD: atomicio.c,v 1.13 2005/05/24 17:32:43 avsm Exp $");
#include "atomicio.h"
/*
* ensure all of data on socket comes through. f==read || f==vwrite
*/
ssize_t
size_t
atomicio(f, fd, _s, n)
ssize_t (*f) (int, void *, size_t);
int fd;
@@ -39,7 +40,8 @@ atomicio(f, fd, _s, n)
size_t n;
{
char *s = _s;
ssize_t res, pos = 0;
size_t pos = 0;
ssize_t res;
while (n > pos) {
res = (f) (fd, s + pos, n - pos);
@@ -51,10 +53,12 @@ atomicio(f, fd, _s, n)
if (errno == EINTR || errno == EAGAIN)
#endif
continue;
return 0;
case 0:
return (res);
errno = EPIPE;
return pos;
default:
pos += res;
pos += (u_int)res;
}
}
return (pos);
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: atomicio.h,v 1.5 2003/06/28 16:23:06 deraadt Exp $ */
/* $OpenBSD: atomicio.h,v 1.6 2005/05/24 17:32:43 avsm Exp $ */
/*
* Copyright (c) 1995,1999 Theo de Raadt. All rights reserved.
@@ -28,6 +28,6 @@
/*
* Ensure all of data on socket comes through. f==read || f==vwrite
*/
ssize_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t);
size_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t);
#define vwrite (ssize_t (*)(int, void *, size_t))write
+4 -4
View File
@@ -1,4 +1,4 @@
/* $Id: audit.c,v 1.2 2005/02/08 10:52:48 dtucker Exp $ */
/* $Id: audit.c,v 1.3 2005/07/17 07:26:44 djm Exp $ */
/*
* Copyright (c) 2004, 2005 Darren Tucker. All rights reserved.
@@ -120,7 +120,7 @@ void
audit_connection_from(const char *host, int port)
{
debug("audit connection from %s port %d euid %d", host, port,
(int)geteuid());
(int)geteuid());
}
/*
@@ -147,7 +147,7 @@ audit_session_open(const char *ttyn)
const char *t = ttyn ? ttyn : "(no tty)";
debug("audit session open euid %d user %s tty name %s", geteuid(),
audit_username(), t);
audit_username(), t);
}
/*
@@ -163,7 +163,7 @@ audit_session_close(const char *ttyn)
const char *t = ttyn ? ttyn : "(no tty)";
debug("audit session close euid %d user %s tty name %s", geteuid(),
audit_username(), t);
audit_username(), t);
}
/*
+31 -26
View File
@@ -55,9 +55,6 @@ krb5_init(void *context)
problem = krb5_init_context(&authctxt->krb5_ctx);
if (problem)
return (problem);
#ifdef KRB5_INIT_ETS
krb5_init_ets(authctxt->krb5_ctx);
#endif
}
return (0);
}
@@ -68,9 +65,6 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
#ifndef HEIMDAL
krb5_creds creds;
krb5_principal server;
char ccname[40];
int tmpfd;
mode_t old_umask;
#endif
krb5_error_code problem;
krb5_ccache ccache = NULL;
@@ -147,26 +141,7 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
goto out;
}
snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid());
old_umask = umask(0177);
tmpfd = mkstemp(ccname + strlen("FILE:"));
umask(old_umask);
if (tmpfd == -1) {
logit("mkstemp(): %.100s", strerror(errno));
problem = errno;
goto out;
}
if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
logit("fchmod(): %.100s", strerror(errno));
close(tmpfd);
problem = errno;
goto out;
}
close(tmpfd);
problem = krb5_cc_resolve(authctxt->krb5_ctx, ccname, &authctxt->krb5_fwd_ccache);
problem = ssh_krb5_cc_gen(authctxt->krb5_ctx, &authctxt->krb5_fwd_ccache);
if (problem)
goto out;
@@ -235,4 +210,34 @@ krb5_cleanup_proc(Authctxt *authctxt)
}
}
#ifndef HEIMDAL
krb5_error_code
ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
int tmpfd, ret;
char ccname[40];
mode_t old_umask;
ret = snprintf(ccname, sizeof(ccname),
"FILE:/tmp/krb5cc_%d_XXXXXXXXXX", geteuid());
if (ret == -1 || ret >= sizeof(ccname))
return ENOMEM;
old_umask = umask(0177);
tmpfd = mkstemp(ccname + strlen("FILE:"));
umask(old_umask);
if (tmpfd == -1) {
logit("mkstemp(): %.100s", strerror(errno));
return errno;
}
if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
logit("fchmod(): %.100s", strerror(errno));
close(tmpfd);
return errno;
}
close(tmpfd);
return (krb5_cc_resolve(ctx, ccname, ccache));
}
#endif /* !HEIMDAL */
#endif /* KRB5 */
+30 -15
View File
@@ -47,7 +47,7 @@
/* Based on $xFreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */
#include "includes.h"
RCSID("$Id: auth-pam.c,v 1.122 2005/05/25 06:18:10 dtucker Exp $");
RCSID("$Id: auth-pam.c,v 1.126 2005/07/17 07:18:50 djm Exp $");
RCSID("$FreeBSD$");
#ifdef USE_PAM
@@ -57,6 +57,13 @@ RCSID("$FreeBSD$");
#include <pam/pam_appl.h>
#endif
/* OpenGroup RFC86.0 and XSSO specify no "const" on arguments */
#ifdef PAM_SUN_CODEBASE
# define sshpam_const /* Solaris, HP-UX, AIX */
#else
# define sshpam_const const /* LinuxPAM, OpenPAM */
#endif
#include "auth.h"
#include "auth-pam.h"
#include "buffer.h"
@@ -117,14 +124,14 @@ static struct pam_ctxt *cleanup_ctxt;
static int sshpam_thread_status = -1;
static mysig_t sshpam_oldsig;
static void
static void
sshpam_sigchld_handler(int sig)
{
signal(SIGCHLD, SIG_DFL);
if (cleanup_ctxt == NULL)
return; /* handler called after PAM cleanup, shouldn't happen */
if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, WNOHANG)
<= 0) {
<= 0) {
/* PAM thread has not exitted, privsep slave must have */
kill(cleanup_ctxt->pam_thread, SIGTERM);
if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0)
@@ -151,6 +158,7 @@ pthread_create(sp_pthread_t *thread, const void *attr __unused,
void *(*thread_start)(void *), void *arg)
{
pid_t pid;
struct pam_ctxt *ctx = arg;
sshpam_thread_status = -1;
switch ((pid = fork())) {
@@ -158,10 +166,14 @@ pthread_create(sp_pthread_t *thread, const void *attr __unused,
error("fork(): %s", strerror(errno));
return (-1);
case 0:
close(ctx->pam_psock);
ctx->pam_psock = -1;
thread_start(arg);
_exit(1);
default:
*thread = pid;
close(ctx->pam_csock);
ctx->pam_csock = -1;
sshpam_oldsig = signal(SIGCHLD, sshpam_sigchld_handler);
return (0);
}
@@ -301,7 +313,7 @@ import_environments(Buffer *b)
* Conversation function for authentication thread.
*/
static int
sshpam_thread_conv(int n, struct pam_message **msg,
sshpam_thread_conv(int n, sshpam_const struct pam_message **msg,
struct pam_response **resp, void *data)
{
Buffer buffer;
@@ -400,8 +412,10 @@ sshpam_thread(void *ctxtp)
char **env_from_pam;
u_int i;
const char *pam_user;
const char **ptr_pam_user = &pam_user;
pam_get_item(sshpam_handle, PAM_USER, (void **)&pam_user);
pam_get_item(sshpam_handle, PAM_USER,
(sshpam_const void **)ptr_pam_user);
environ[0] = NULL;
if (sshpam_authctxt != NULL) {
@@ -493,7 +507,7 @@ sshpam_thread_cleanup(void)
}
static int
sshpam_null_conv(int n, struct pam_message **msg,
sshpam_null_conv(int n, sshpam_const struct pam_message **msg,
struct pam_response **resp, void *data)
{
debug3("PAM: %s entering, %d messages", __func__, n);
@@ -503,7 +517,7 @@ sshpam_null_conv(int n, struct pam_message **msg,
static struct pam_conv null_conv = { sshpam_null_conv, NULL };
static int
sshpam_store_conv(int n, struct pam_message **msg,
sshpam_store_conv(int n, sshpam_const struct pam_message **msg,
struct pam_response **resp, void *data)
{
struct pam_response *reply;
@@ -572,11 +586,12 @@ sshpam_init(Authctxt *authctxt)
{
extern char *__progname;
const char *pam_rhost, *pam_user, *user = authctxt->user;
const char **ptr_pam_user = &pam_user;
if (sshpam_handle != NULL) {
/* We already have a PAM context; check if the user matches */
sshpam_err = pam_get_item(sshpam_handle,
PAM_USER, (void **)&pam_user);
PAM_USER, (sshpam_const void **)ptr_pam_user);
if (sshpam_err == PAM_SUCCESS && strcmp(user, pam_user) == 0)
return (0);
pam_end(sshpam_handle, sshpam_err);
@@ -766,7 +781,7 @@ sshpam_respond(void *ctx, u_int num, char **resp)
buffer_init(&buffer);
if (sshpam_authctxt->valid &&
(sshpam_authctxt->pw->pw_uid != 0 ||
options.permit_root_login == PERMIT_YES))
options.permit_root_login == PERMIT_YES))
buffer_put_cstring(&buffer, *resp);
else
buffer_put_cstring(&buffer, badpw);
@@ -839,7 +854,7 @@ do_pam_account(void)
sshpam_err = pam_acct_mgmt(sshpam_handle, 0);
debug3("PAM: %s pam_acct_mgmt = %d (%s)", __func__, sshpam_err,
pam_strerror(sshpam_handle, sshpam_err));
if (sshpam_err != PAM_SUCCESS && sshpam_err != PAM_NEW_AUTHTOK_REQD) {
sshpam_account_status = 0;
return (sshpam_account_status);
@@ -892,7 +907,7 @@ do_pam_setcred(int init)
}
static int
sshpam_tty_conv(int n, struct pam_message **msg,
sshpam_tty_conv(int n, sshpam_const struct pam_message **msg,
struct pam_response **resp, void *data)
{
char input[PAM_MAX_MSG_SIZE];
@@ -1051,7 +1066,7 @@ free_pam_environment(char **env)
* display.
*/
static int
sshpam_passwd_conv(int n, struct pam_message **msg,
sshpam_passwd_conv(int n, sshpam_const struct pam_message **msg,
struct pam_response **resp, void *data)
{
struct pam_response *reply;
@@ -1097,7 +1112,7 @@ sshpam_passwd_conv(int n, struct pam_message **msg,
*resp = reply;
return (PAM_SUCCESS);
fail:
fail:
for(i = 0; i < n; i++) {
if (reply[i].resp != NULL)
xfree(reply[i].resp);
@@ -1130,7 +1145,7 @@ sshpam_auth_passwd(Authctxt *authctxt, const char *password)
* information via timing (eg if the PAM config has a delay on fail).
*/
if (!authctxt->valid || (authctxt->pw->pw_uid == 0 &&
options.permit_root_login != PERMIT_YES))
options.permit_root_login != PERMIT_YES))
sshpam_password = badpw;
sshpam_err = pam_set_item(sshpam_handle, PAM_CONV,
@@ -1144,7 +1159,7 @@ sshpam_auth_passwd(Authctxt *authctxt, const char *password)
if (sshpam_err == PAM_SUCCESS && authctxt->valid) {
debug("PAM: password authentication accepted for %.100s",
authctxt->user);
return 1;
return 1;
} else {
debug("PAM: password authentication failed for %.100s: %s",
authctxt->valid ? authctxt->user : "an illegal user",
+3 -1
View File
@@ -36,7 +36,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: auth-passwd.c,v 1.33 2005/01/24 11:47:13 dtucker Exp $");
RCSID("$OpenBSD: auth-passwd.c,v 1.34 2005/07/19 15:32:26 otto Exp $");
RCSID("$FreeBSD$");
#include "packet.h"
@@ -164,6 +164,8 @@ sys_auth_passwd(Authctxt *authctxt, const char *password)
as = auth_usercheck(pw->pw_name, authctxt->style, "auth-ssh",
(char *)password);
if (as == NULL)
return (0);
if (auth_getstate(as) & AUTH_PWEXPIRED) {
auth_close(as);
disable_forwarding();
+2 -2
View File
@@ -13,7 +13,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: auth-rh-rsa.c,v 1.37 2003/11/04 08:54:09 djm Exp $");
RCSID("$OpenBSD: auth-rh-rsa.c,v 1.38 2005/07/17 07:17:54 djm Exp $");
#include "packet.h"
#include "uidswap.h"
@@ -86,7 +86,7 @@ auth_rhosts_rsa(Authctxt *authctxt, char *cuser, Key *client_host_key)
*/
verbose("Rhosts with RSA host authentication accepted for %.100s, %.100s on %.700s.",
pw->pw_name, cuser, chost);
pw->pw_name, cuser, chost);
packet_send_debug("Rhosts with RSA host authentication accepted.");
return 1;
}
+2 -2
View File
@@ -14,7 +14,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: auth-rhosts.c,v 1.32 2003/11/04 08:54:09 djm Exp $");
RCSID("$OpenBSD: auth-rhosts.c,v 1.33 2005/07/17 07:17:54 djm Exp $");
#include "packet.h"
#include "uidswap.h"
@@ -133,7 +133,7 @@ check_rhosts_file(const char *filename, const char *hostname,
/* If the entry was negated, deny access. */
if (negated) {
auth_debug_add("Matched negative entry in %.100s.",
filename);
filename);
return 0;
}
/* Accept authentication. */
+4 -2
View File
@@ -14,7 +14,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: auth-rsa.c,v 1.62 2004/12/11 01:48:56 dtucker Exp $");
RCSID("$OpenBSD: auth-rsa.c,v 1.63 2005/06/17 02:44:32 djm Exp $");
#include <openssl/rsa.h>
#include <openssl/md5.h>
@@ -205,6 +205,7 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) {
char *cp;
char *key_options;
int keybits;
/* Skip leading whitespace, empty and comment lines. */
for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
@@ -243,7 +244,8 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
continue;
/* check the real bits */
if (bits != BN_num_bits(key->rsa->n))
keybits = BN_num_bits(key->rsa->n);
if (keybits < 0 || bits != (u_int)keybits)
logit("Warning: %s, line %lu: keysize mismatch: "
"actual %d vs. announced %d.",
file, linenum, BN_num_bits(key->rsa->n), bits);
+2 -2
View File
@@ -23,7 +23,7 @@
*/
#include "includes.h"
RCSID("$Id: auth-shadow.c,v 1.6 2005/02/16 03:20:06 dtucker Exp $");
RCSID("$Id: auth-shadow.c,v 1.7 2005/07/17 07:04:47 djm Exp $");
#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
#include <shadow.h>
@@ -101,7 +101,7 @@ auth_shadow_pwexpired(Authctxt *ctxt)
#if defined(__hpux) && !defined(HAVE_SECUREWARE)
if (iscomsec()) {
struct pr_passwd *pr;
pr = getprpwnam((char *)user);
/* Test for Trusted Mode expiry disabled */
+1 -1
View File
@@ -56,7 +56,7 @@ skey_query(void *ctx, char **name, char **infotxt,
int len;
struct skey skey;
if (_compat_skeychallenge(&skey, authctxt->user, challenge,
if (_compat_skeychallenge(&skey, authctxt->user, challenge,
sizeof(challenge)) == -1)
return -1;
+26 -42
View File
@@ -23,7 +23,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: auth.c,v 1.58 2005/03/14 11:44:42 dtucker Exp $");
RCSID("$OpenBSD: auth.c,v 1.60 2005/06/17 02:44:32 djm Exp $");
RCSID("$FreeBSD$");
#ifdef HAVE_LOGIN_H
@@ -77,7 +77,7 @@ allowed_user(struct passwd * pw)
struct stat st;
const char *hostname = NULL, *ipaddr = NULL, *passwd = NULL;
char *shell;
int i;
u_int i;
#ifdef USE_SHADOW
struct spwd *spw = NULL;
#endif
@@ -98,7 +98,11 @@ allowed_user(struct passwd * pw)
/* grab passwd field for locked account check */
#ifdef USE_SHADOW
if (spw != NULL)
#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF)
passwd = get_iaf_password(pw);
#else
passwd = spw->sp_pwdp;
#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */
#else
passwd = pw->pw_passwd;
#endif
@@ -120,6 +124,9 @@ allowed_user(struct passwd * pw)
if (strstr(passwd, LOCKED_PASSWD_SUBSTR))
locked = 1;
#endif
#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF)
free(passwd);
#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */
if (locked) {
logit("User %.100s not allowed because account is locked",
pw->pw_name);
@@ -327,64 +334,41 @@ auth_root_allowed(char *method)
*
* This returns a buffer allocated by xmalloc.
*/
char *
expand_filename(const char *filename, struct passwd *pw)
static char *
expand_authorized_keys(const char *filename, struct passwd *pw)
{
Buffer buffer;
char *file;
const char *cp;
char *file, *ret;
/*
* Build the filename string in the buffer by making the appropriate
* substitutions to the given file name.
*/
buffer_init(&buffer);
for (cp = filename; *cp; cp++) {
if (cp[0] == '%' && cp[1] == '%') {
buffer_append(&buffer, "%", 1);
cp++;
continue;
}
if (cp[0] == '%' && cp[1] == 'h') {
buffer_append(&buffer, pw->pw_dir, strlen(pw->pw_dir));
cp++;
continue;
}
if (cp[0] == '%' && cp[1] == 'u') {
buffer_append(&buffer, pw->pw_name,
strlen(pw->pw_name));
cp++;
continue;
}
buffer_append(&buffer, cp, 1);
}
buffer_append(&buffer, "\0", 1);
file = percent_expand(filename, "h", pw->pw_dir,
"u", pw->pw_name, (char *)NULL);
/*
* Ensure that filename starts anchored. If not, be backward
* compatible and prepend the '%h/'
*/
file = xmalloc(MAXPATHLEN);
cp = buffer_ptr(&buffer);
if (*cp != '/')
snprintf(file, MAXPATHLEN, "%s/%s", pw->pw_dir, cp);
else
strlcpy(file, cp, MAXPATHLEN);
if (*file == '/')
return (file);
buffer_free(&buffer);
return file;
ret = xmalloc(MAXPATHLEN);
if (strlcpy(ret, pw->pw_dir, MAXPATHLEN) >= MAXPATHLEN ||
strlcat(ret, "/", MAXPATHLEN) >= MAXPATHLEN ||
strlcat(ret, file, MAXPATHLEN) >= MAXPATHLEN)
fatal("expand_authorized_keys: path too long");
xfree(file);
return (ret);
}
char *
authorized_keys_file(struct passwd *pw)
{
return expand_filename(options.authorized_keys_file, pw);
return expand_authorized_keys(options.authorized_keys_file, pw);
}
char *
authorized_keys_file2(struct passwd *pw)
{
return expand_filename(options.authorized_keys_file2, pw);
return expand_authorized_keys(options.authorized_keys_file2, pw);
}
/* return ok if key exists in sysfile or userfile */
+6 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: auth.h,v 1.50 2004/05/23 23:59:53 dtucker Exp $ */
/* $OpenBSD: auth.h,v 1.51 2005/06/06 11:20:36 djm Exp $ */
/* $FreeBSD$ */
/*
@@ -164,7 +164,6 @@ char *get_challenge(Authctxt *);
int verify_response(Authctxt *, const char *);
void abandon_challenge_response(Authctxt *);
char *expand_filename(const char *, struct passwd *);
char *authorized_keys_file(struct passwd *);
char *authorized_keys_file2(struct passwd *);
@@ -197,6 +196,11 @@ int sys_auth_passwd(Authctxt *, const char *);
#define SKEY_PROMPT "\nOPIE Password: "
#else
#define SKEY_PROMPT "\nS/Key Password: "
#if defined(KRB5) && !defined(HEIMDAL)
#include <krb5.h>
krb5_error_code ssh_krb5_cc_gen(krb5_context, krb5_ccache *);
#endif
#endif
#endif
+195 -133
View File
@@ -10,7 +10,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: auth1.c,v 1.59 2004/07/28 09:40:29 markus Exp $");
RCSID("$OpenBSD: auth1.c,v 1.62 2005/07/16 01:35:24 djm Exp $");
RCSID("$FreeBSD$");
#include "xmalloc.h"
@@ -32,28 +32,182 @@ RCSID("$FreeBSD$");
extern ServerOptions options;
extern Buffer loginmsg;
/*
* convert ssh auth msg type into description
*/
static int auth1_process_password(Authctxt *, char *, size_t);
static int auth1_process_rsa(Authctxt *, char *, size_t);
static int auth1_process_rhosts_rsa(Authctxt *, char *, size_t);
static int auth1_process_tis_challenge(Authctxt *, char *, size_t);
static int auth1_process_tis_response(Authctxt *, char *, size_t);
static char *client_user = NULL; /* Used to fill in remote user for PAM */
struct AuthMethod1 {
int type;
char *name;
int *enabled;
int (*method)(Authctxt *, char *, size_t);
};
const struct AuthMethod1 auth1_methods[] = {
{
SSH_CMSG_AUTH_PASSWORD, "password",
&options.password_authentication, auth1_process_password
},
{
SSH_CMSG_AUTH_RSA, "rsa",
&options.rsa_authentication, auth1_process_rsa
},
{
SSH_CMSG_AUTH_RHOSTS_RSA, "rhosts-rsa",
&options.rhosts_rsa_authentication, auth1_process_rhosts_rsa
},
{
SSH_CMSG_AUTH_TIS, "challenge-response",
&options.challenge_response_authentication,
auth1_process_tis_challenge
},
{
SSH_CMSG_AUTH_TIS_RESPONSE, "challenge-response",
&options.challenge_response_authentication,
auth1_process_tis_response
},
{ -1, NULL, NULL, NULL}
};
static const struct AuthMethod1
*lookup_authmethod1(int type)
{
int i;
for(i = 0; auth1_methods[i].name != NULL; i++)
if (auth1_methods[i].type == type)
return (&(auth1_methods[i]));
return (NULL);
}
static char *
get_authname(int type)
{
static char buf[1024];
switch (type) {
case SSH_CMSG_AUTH_PASSWORD:
return "password";
case SSH_CMSG_AUTH_RSA:
return "rsa";
case SSH_CMSG_AUTH_RHOSTS_RSA:
return "rhosts-rsa";
case SSH_CMSG_AUTH_RHOSTS:
return "rhosts";
case SSH_CMSG_AUTH_TIS:
case SSH_CMSG_AUTH_TIS_RESPONSE:
return "challenge-response";
const struct AuthMethod1 *a;
static char buf[64];
if ((a = lookup_authmethod1(type)) != NULL)
return (a->name);
snprintf(buf, sizeof(buf), "bad-auth-msg-%d", type);
return (buf);
}
static int
auth1_process_password(Authctxt *authctxt, char *info, size_t infolen)
{
int authenticated = 0;
char *password;
u_int dlen;
/*
* Read user password. It is in plain text, but was
* transmitted over the encrypted channel so it is
* not visible to an outside observer.
*/
password = packet_get_string(&dlen);
packet_check_eom();
/* Try authentication with the password. */
authenticated = PRIVSEP(auth_password(authctxt, password));
memset(password, 0, dlen);
xfree(password);
return (authenticated);
}
static int
auth1_process_rsa(Authctxt *authctxt, char *info, size_t infolen)
{
int authenticated = 0;
BIGNUM *n;
/* RSA authentication requested. */
if ((n = BN_new()) == NULL)
fatal("do_authloop: BN_new failed");
packet_get_bignum(n);
packet_check_eom();
authenticated = auth_rsa(authctxt, n);
BN_clear_free(n);
return (authenticated);
}
static int
auth1_process_rhosts_rsa(Authctxt *authctxt, char *info, size_t infolen)
{
int keybits, authenticated = 0;
u_int bits;
Key *client_host_key;
u_int ulen;
/*
* Get client user name. Note that we just have to
* trust the client; root on the client machine can
* claim to be any user.
*/
client_user = packet_get_string(&ulen);
/* Get the client host key. */
client_host_key = key_new(KEY_RSA1);
bits = packet_get_int();
packet_get_bignum(client_host_key->rsa->e);
packet_get_bignum(client_host_key->rsa->n);
keybits = BN_num_bits(client_host_key->rsa->n);
if (keybits < 0 || bits != (u_int)keybits) {
verbose("Warning: keysize mismatch for client_host_key: "
"actual %d, announced %d",
BN_num_bits(client_host_key->rsa->n), bits);
}
snprintf(buf, sizeof buf, "bad-auth-msg-%d", type);
return buf;
packet_check_eom();
authenticated = auth_rhosts_rsa(authctxt, client_user,
client_host_key);
key_free(client_host_key);
snprintf(info, infolen, " ruser %.100s", client_user);
return (authenticated);
}
static int
auth1_process_tis_challenge(Authctxt *authctxt, char *info, size_t infolen)
{
char *challenge;
if ((challenge = get_challenge(authctxt)) == NULL)
return (0);
debug("sending challenge '%s'", challenge);
packet_start(SSH_SMSG_AUTH_TIS_CHALLENGE);
packet_put_cstring(challenge);
xfree(challenge);
packet_send();
packet_write_wait();
return (-1);
}
static int
auth1_process_tis_response(Authctxt *authctxt, char *info, size_t infolen)
{
int authenticated = 0;
char *response;
u_int dlen;
response = packet_get_string(&dlen);
packet_check_eom();
authenticated = verify_response(authctxt, response);
memset(response, 'r', dlen);
xfree(response);
return (authenticated);
}
/*
@@ -64,14 +218,9 @@ static void
do_authloop(Authctxt *authctxt)
{
int authenticated = 0;
u_int bits;
Key *client_host_key;
BIGNUM *n;
char *client_user, *password;
char info[1024];
u_int dlen;
u_int ulen;
int prev, type = 0;
int prev = 0, type = 0;
const struct AuthMethod1 *meth;
debug("Attempting authentication for %s%.100s.",
authctxt->valid ? "" : "invalid user ", authctxt->user);
@@ -96,8 +245,6 @@ do_authloop(Authctxt *authctxt)
packet_send();
packet_write_wait();
client_user = NULL;
for (;;) {
/* default to fail */
authenticated = 0;
@@ -119,107 +266,21 @@ do_authloop(Authctxt *authctxt)
type != SSH_CMSG_AUTH_TIS_RESPONSE)
abandon_challenge_response(authctxt);
/* Process the packet. */
switch (type) {
case SSH_CMSG_AUTH_RHOSTS_RSA:
if (!options.rhosts_rsa_authentication) {
verbose("Rhosts with RSA authentication disabled.");
break;
}
/*
* Get client user name. Note that we just have to
* trust the client; root on the client machine can
* claim to be any user.
*/
client_user = packet_get_string(&ulen);
/* Get the client host key. */
client_host_key = key_new(KEY_RSA1);
bits = packet_get_int();
packet_get_bignum(client_host_key->rsa->e);
packet_get_bignum(client_host_key->rsa->n);
if (bits != BN_num_bits(client_host_key->rsa->n))
verbose("Warning: keysize mismatch for client_host_key: "
"actual %d, announced %d",
BN_num_bits(client_host_key->rsa->n), bits);
packet_check_eom();
authenticated = auth_rhosts_rsa(authctxt, client_user,
client_host_key);
key_free(client_host_key);
snprintf(info, sizeof info, " ruser %.100s", client_user);
break;
case SSH_CMSG_AUTH_RSA:
if (!options.rsa_authentication) {
verbose("RSA authentication disabled.");
break;
}
/* RSA authentication requested. */
if ((n = BN_new()) == NULL)
fatal("do_authloop: BN_new failed");
packet_get_bignum(n);
packet_check_eom();
authenticated = auth_rsa(authctxt, n);
BN_clear_free(n);
break;
case SSH_CMSG_AUTH_PASSWORD:
if (!options.password_authentication) {
verbose("Password authentication disabled.");
break;
}
/*
* Read user password. It is in plain text, but was
* transmitted over the encrypted channel so it is
* not visible to an outside observer.
*/
password = packet_get_string(&dlen);
packet_check_eom();
/* Try authentication with the password. */
authenticated = PRIVSEP(auth_password(authctxt, password));
memset(password, 0, strlen(password));
xfree(password);
break;
case SSH_CMSG_AUTH_TIS:
debug("rcvd SSH_CMSG_AUTH_TIS");
if (options.challenge_response_authentication == 1) {
char *challenge = get_challenge(authctxt);
if (challenge != NULL) {
debug("sending challenge '%s'", challenge);
packet_start(SSH_SMSG_AUTH_TIS_CHALLENGE);
packet_put_cstring(challenge);
xfree(challenge);
packet_send();
packet_write_wait();
continue;
}
}
break;
case SSH_CMSG_AUTH_TIS_RESPONSE:
debug("rcvd SSH_CMSG_AUTH_TIS_RESPONSE");
if (options.challenge_response_authentication == 1) {
char *response = packet_get_string(&dlen);
packet_check_eom();
authenticated = verify_response(authctxt, response);
memset(response, 'r', dlen);
xfree(response);
}
break;
default:
/*
* Any unknown messages will be ignored (and failure
* returned) during authentication.
*/
logit("Unknown message during authentication: type %d", type);
break;
if ((meth = lookup_authmethod1(type)) == NULL) {
logit("Unknown message during authentication: "
"type %d", type);
goto skip;
}
if (!*(meth->enabled)) {
verbose("%s authentication disabled.", meth->name);
goto skip;
}
authenticated = meth->method(authctxt, info, sizeof(info));
if (authenticated == -1)
continue; /* "postponed" */
#ifdef BSD_AUTH
if (authctxt->as) {
auth_close(authctxt->as);
@@ -239,7 +300,7 @@ do_authloop(Authctxt *authctxt)
#ifdef HAVE_CYGWIN
if (authenticated &&
!check_nt_auth(type == SSH_CMSG_AUTH_PASSWORD,
!check_nt_auth(type == SSH_CMSG_AUTH_PASSWORD,
authctxt->pw)) {
packet_disconnect("Authentication rejected for uid %d.",
authctxt->pw == NULL ? -1 : authctxt->pw->pw_uid);
@@ -248,8 +309,8 @@ do_authloop(Authctxt *authctxt)
#else
/* Special handling for root */
if (authenticated && authctxt->pw->pw_uid == 0 &&
!auth_root_allowed(get_authname(type))) {
authenticated = 0;
!auth_root_allowed(meth->name)) {
authenticated = 0;
# ifdef SSH_AUDIT_EVENTS
PRIVSEP(audit_event(SSH_LOGIN_ROOT_DENIED));
# endif
@@ -263,7 +324,7 @@ do_authloop(Authctxt *authctxt)
size_t len;
error("Access denied for user %s by PAM account "
"configuration", authctxt->user);
"configuration", authctxt->user);
len = buffer_len(&loginmsg);
buffer_append(&loginmsg, "\0", 1);
msg = buffer_ptr(&loginmsg);
@@ -277,6 +338,7 @@ do_authloop(Authctxt *authctxt)
}
#endif
skip:
/* Log before sending the reply */
auth_log(authctxt, authenticated, get_authname(type), info);
@@ -342,7 +404,7 @@ do_authentication(Authctxt *authctxt)
/*
* If we are not running as root, the user must have the same uid as
* the server. (Unless you are running Windows)
* the server.
*/
#ifndef HAVE_CYGWIN
if (!use_privsep && getuid() != 0 && authctxt->pw &&
+5 -6
View File
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
RCSID("$OpenBSD: auth2-chall.c,v 1.22 2005/01/19 13:11:47 dtucker Exp $");
RCSID("$OpenBSD: auth2-chall.c,v 1.24 2005/07/17 07:17:54 djm Exp $");
RCSID("$FreeBSD$");
#include "ssh2.h"
@@ -168,7 +168,7 @@ kbdint_next_device(KbdintAuthctxt *kbdintctxt)
kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL;
xfree(t);
debug2("kbdint_next_device: devices %s", kbdintctxt->devices ?
kbdintctxt->devices : "<empty>");
kbdintctxt->devices : "<empty>");
} while (kbdintctxt->devices && !kbdintctxt->device);
return kbdintctxt->device ? 1 : 0;
@@ -240,8 +240,7 @@ send_userauth_info_request(Authctxt *authctxt)
{
KbdintAuthctxt *kbdintctxt;
char *name, *instr, **prompts;
int i;
u_int *echo_on;
u_int i, *echo_on;
kbdintctxt = authctxt->kbdintctxt;
if (kbdintctxt->device->query(kbdintctxt->ctxt,
@@ -274,8 +273,8 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
{
Authctxt *authctxt = ctxt;
KbdintAuthctxt *kbdintctxt;
int i, authenticated = 0, res, len;
u_int nresp;
int authenticated = 0, res, len;
u_int i, nresp;
char **response = NULL, *method;
if (authctxt == NULL)
+4 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: auth2-gss.c,v 1.8 2004/06/21 17:36:31 avsm Exp $ */
/* $OpenBSD: auth2-gss.c,v 1.10 2005/07/17 07:17:54 djm Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -61,7 +61,7 @@ userauth_gssapi(Authctxt *authctxt)
int present;
OM_uint32 ms;
u_int len;
char *doid = NULL;
u_char *doid = NULL;
if (!authctxt->valid || authctxt->user == NULL)
return (0);
@@ -82,9 +82,8 @@ userauth_gssapi(Authctxt *authctxt)
present = 0;
doid = packet_get_string(&len);
if (len > 2 &&
doid[0] == SSH_GSS_OIDTYPE &&
doid[1] == len - 2) {
if (len > 2 && doid[0] == SSH_GSS_OIDTYPE &&
doid[1] == len - 2) {
goid.elements = doid + 2;
goid.length = len - 2;
gss_test_oid_set_member(&ms, &goid, supported,
+1 -1
View File
@@ -264,7 +264,7 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method)
packet_write_wait();
}
fatal("Access denied for user %s by PAM account "
"configuration", authctxt->user);
"configuration", authctxt->user);
}
}
#endif
+6 -6
View File
@@ -35,7 +35,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: authfd.c,v 1.64 2004/08/11 21:44:31 avsm Exp $");
RCSID("$OpenBSD: authfd.c,v 1.66 2005/06/17 02:44:32 djm Exp $");
#include <openssl/evp.h>
@@ -114,8 +114,7 @@ ssh_get_authentication_socket(void)
static int
ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply)
{
int l;
u_int len;
u_int l, len;
char buf[1024];
/* Get the length of the message, and format it in the buffer. */
@@ -149,8 +148,7 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply
l = len;
if (l > sizeof(buf))
l = sizeof(buf);
l = atomicio(read, auth->fd, buf, l);
if (l <= 0) {
if (atomicio(read, auth->fd, buf, l) != l) {
error("Error reading response from authentication socket.");
return 0;
}
@@ -303,6 +301,7 @@ ssh_get_first_identity(AuthenticationConnection *auth, char **comment, int versi
Key *
ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version)
{
int keybits;
u_int bits;
u_char *blob;
u_int blen;
@@ -323,7 +322,8 @@ ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int versio
buffer_get_bignum(&auth->identities, key->rsa->e);
buffer_get_bignum(&auth->identities, key->rsa->n);
*comment = buffer_get_string(&auth->identities, NULL);
if (bits != BN_num_bits(key->rsa->n))
keybits = BN_num_bits(key->rsa->n);
if (keybits < 0 || bits != (u_int)keybits)
logit("Warning: identity keysize mismatch: actual %d, announced %u",
BN_num_bits(key->rsa->n), bits);
break;
+9 -7
View File
@@ -36,7 +36,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: authfile.c,v 1.60 2004/12/11 01:48:56 dtucker Exp $");
RCSID("$OpenBSD: authfile.c,v 1.61 2005/06/17 02:44:32 djm Exp $");
#include <openssl/err.h>
#include <openssl/evp.h>
@@ -52,6 +52,7 @@ RCSID("$OpenBSD: authfile.c,v 1.60 2004/12/11 01:48:56 dtucker Exp $");
#include "authfile.h"
#include "rsa.h"
#include "misc.h"
#include "atomicio.h"
/* Version identification string for SSH v1 identity files. */
static const char authfile_id_string[] =
@@ -147,8 +148,8 @@ key_save_private_rsa1(Key *key, const char *filename, const char *passphrase,
buffer_free(&encrypted);
return 0;
}
if (write(fd, buffer_ptr(&encrypted), buffer_len(&encrypted)) !=
buffer_len(&encrypted)) {
if (atomicio(vwrite, fd, buffer_ptr(&encrypted),
buffer_len(&encrypted)) != buffer_len(&encrypted)) {
error("write to key file %s failed: %s", filename,
strerror(errno));
buffer_free(&encrypted);
@@ -236,7 +237,7 @@ key_load_public_rsa1(int fd, const char *filename, char **commentp)
Key *pub;
struct stat st;
char *cp;
int i;
u_int i;
size_t len;
if (fstat(fd, &st) < 0) {
@@ -253,7 +254,7 @@ key_load_public_rsa1(int fd, const char *filename, char **commentp)
buffer_init(&buffer);
cp = buffer_append_space(&buffer, len);
if (read(fd, cp, (size_t) len) != (size_t) len) {
if (atomicio(read, fd, cp, len) != len) {
debug("Read from key file %.200s failed: %.100s", filename,
strerror(errno));
buffer_free(&buffer);
@@ -322,7 +323,8 @@ static Key *
key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
char **commentp)
{
int i, check1, check2, cipher_type;
u_int i;
int check1, check2, cipher_type;
size_t len;
Buffer buffer, decrypted;
u_char *cp;
@@ -347,7 +349,7 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
buffer_init(&buffer);
cp = buffer_append_space(&buffer, len);
if (read(fd, cp, (size_t) len) != (size_t) len) {
if (atomicio(read, fd, cp, len) != len) {
debug("Read from key file %.200s failed: %.100s", filename,
strerror(errno));
buffer_free(&buffer);
+2 -2
View File
@@ -37,7 +37,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: bufaux.c,v 1.35 2005/03/10 22:01:05 deraadt Exp $");
RCSID("$OpenBSD: bufaux.c,v 1.36 2005/06/17 02:44:32 djm Exp $");
RCSID("$FreeBSD$");
#include <openssl/bn.h>
@@ -155,7 +155,7 @@ buffer_put_bignum2_ret(Buffer *buffer, const BIGNUM *value)
buf[0] = 0x00;
/* Get the value of in binary */
oi = BN_bn2bin(value, buf+1);
if (oi != bytes-1) {
if (oi < 0 || (u_int)oi != bytes - 1) {
error("buffer_put_bignum2_ret: BN_bn2bin() failed: "
"oi %d != bin_size %d", oi, bytes);
xfree(buf);
+5 -4
View File
@@ -12,7 +12,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: canohost.c,v 1.42 2005/02/18 03:05:53 djm Exp $");
RCSID("$OpenBSD: canohost.c,v 1.44 2005/06/17 02:44:32 djm Exp $");
#include "packet.h"
#include "xmalloc.h"
@@ -143,7 +143,8 @@ check_ip_options(int sock, char *ipaddr)
u_char options[200];
char text[sizeof(options) * 3 + 1];
socklen_t option_size;
int i, ipproto;
u_int i;
int ipproto;
struct protoent *ip;
if ((ip = getprotobyname("ip")) != NULL)
@@ -173,7 +174,7 @@ ipv64_normalise_mapped(struct sockaddr_storage *addr, socklen_t *len)
struct in_addr inaddr;
u_int16_t port;
if (addr->ss_family != AF_INET6 ||
if (addr->ss_family != AF_INET6 ||
!IN6_IS_ADDR_V4MAPPED(&a6->sin6_addr))
return;
@@ -346,7 +347,7 @@ get_sock_port(int sock, int local)
} else {
if (getpeername(sock, (struct sockaddr *)&from, &fromlen) < 0) {
debug("getpeername failed: %.100s", strerror(errno));
cleanup_exit(255);
return -1;
}
}
+60 -46
View File
@@ -39,7 +39,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: channels.c,v 1.214 2005/03/14 11:46:56 markus Exp $");
RCSID("$OpenBSD: channels.c,v 1.223 2005/07/17 07:17:54 djm Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -111,6 +111,9 @@ static int all_opens_permitted = 0;
/* Maximum number of fake X11 displays to try. */
#define MAX_DISPLAYS 1000
/* Saved X11 local (client) display. */
static char *x11_saved_display = NULL;
/* Saved X11 authentication protocol name. */
static char *x11_saved_proto = NULL;
@@ -727,8 +730,8 @@ channel_pre_open(Channel *c, fd_set * readset, fd_set * writeset)
FD_SET(c->wfd, writeset);
} else if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN) {
if (CHANNEL_EFD_OUTPUT_ACTIVE(c))
debug2("channel %d: obuf_empty delayed efd %d/(%d)",
c->self, c->efd, buffer_len(&c->extended));
debug2("channel %d: obuf_empty delayed efd %d/(%d)",
c->self, c->efd, buffer_len(&c->extended));
else
chan_obuf_empty(c);
}
@@ -894,7 +897,7 @@ static int
channel_decode_socks4(Channel *c, fd_set * readset, fd_set * writeset)
{
char *p, *host;
int len, have, i, found;
u_int len, have, i, found;
char username[256];
struct {
u_int8_t version;
@@ -979,7 +982,7 @@ channel_decode_socks5(Channel *c, fd_set * readset, fd_set * writeset)
} s5_req, s5_rsp;
u_int16_t dest_port;
u_char *p, dest_addr[255+1];
int i, have, found, nmethods, addrlen, af;
u_int have, i, found, nmethods, addrlen, af;
debug2("channel %d: decode socks5", c->self);
p = buffer_ptr(&c->input);
@@ -1075,7 +1078,8 @@ static void
channel_pre_dynamic(Channel *c, fd_set * readset, fd_set * writeset)
{
u_char *p;
int have, ret;
u_int have;
int ret;
have = buffer_len(&c->input);
c->delayed = 0;
@@ -1178,7 +1182,7 @@ port_open_helper(Channel *c, char *rtype)
int direct;
char buf[1024];
char *remote_ipaddr = get_peer_ipaddr(c->sock);
u_short remote_port = get_peer_port(c->sock);
int remote_port = get_peer_port(c->sock);
direct = (strcmp(rtype, "direct-tcpip") == 0);
@@ -1208,7 +1212,7 @@ port_open_helper(Channel *c, char *rtype)
}
/* originator host and port */
packet_put_cstring(remote_ipaddr);
packet_put_int(remote_port);
packet_put_int((u_int)remote_port);
packet_send();
} else {
packet_start(SSH_MSG_PORT_OPEN);
@@ -1809,8 +1813,8 @@ channel_output_poll(void)
* hack for extended data: delay EOF if EFD still in use.
*/
if (CHANNEL_EFD_INPUT_ACTIVE(c))
debug2("channel %d: ibuf_empty delayed efd %d/(%d)",
c->self, c->efd, buffer_len(&c->extended));
debug2("channel %d: ibuf_empty delayed efd %d/(%d)",
c->self, c->efd, buffer_len(&c->extended));
else
chan_ibuf_empty(c);
}
@@ -2195,11 +2199,11 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
if (host == NULL) {
error("No forward host name.");
return success;
return 0;
}
if (strlen(host) > SSH_CHANNEL_PATH_LEN - 1) {
error("Forward host name too long.");
return success;
return 0;
}
/*
@@ -2250,12 +2254,10 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
packet_disconnect("getaddrinfo: fatal error: %s",
gai_strerror(r));
} else {
verbose("channel_setup_fwd_listener: "
"getaddrinfo(%.64s): %s", addr, gai_strerror(r));
packet_send_debug("channel_setup_fwd_listener: "
error("channel_setup_fwd_listener: "
"getaddrinfo(%.64s): %s", addr, gai_strerror(r));
}
aitop = NULL;
return 0;
}
for (ai = aitop; ai; ai = ai->ai_next) {
@@ -2657,7 +2659,7 @@ channel_send_window_changes(void)
*/
int
x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
int single_connection, u_int *display_numberp)
int single_connection, u_int *display_numberp, int **chanids)
{
Channel *nc = NULL;
int display_number, sock;
@@ -2747,6 +2749,8 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
}
/* Allocate a channel for each socket. */
if (chanids != NULL)
*chanids = xmalloc(sizeof(**chanids) * (num_socks + 1));
for (n = 0; n < num_socks; n++) {
sock = socks[n];
nc = channel_new("x11 listener",
@@ -2754,7 +2758,11 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
0, "X11 inet listener", 1);
nc->single_connection = single_connection;
if (*chanids != NULL)
(*chanids)[n] = nc->self;
}
if (*chanids != NULL)
(*chanids)[n] = -1;
/* Return the display number for the DISPLAY environment variable. */
*display_numberp = display_number;
@@ -2952,19 +2960,27 @@ deny_input_open(int type, u_int32_t seq, void *ctxt)
* This should be called in the client only.
*/
void
x11_request_forwarding_with_spoofing(int client_session_id,
x11_request_forwarding_with_spoofing(int client_session_id, const char *disp,
const char *proto, const char *data)
{
u_int data_len = (u_int) strlen(data) / 2;
u_int i, value, len;
u_int i, value;
char *new_data;
int screen_number;
const char *cp;
u_int32_t rnd = 0;
cp = getenv("DISPLAY");
if (cp)
cp = strchr(cp, ':');
if (x11_saved_display == NULL)
x11_saved_display = xstrdup(disp);
else if (strcmp(disp, x11_saved_display) != 0) {
error("x11_request_forwarding_with_spoofing: different "
"$DISPLAY already forwarded");
return;
}
cp = disp;
if (disp)
cp = strchr(disp, ':');
if (cp)
cp = strchr(cp, '.');
if (cp)
@@ -2972,33 +2988,31 @@ x11_request_forwarding_with_spoofing(int client_session_id,
else
screen_number = 0;
/* Save protocol name. */
x11_saved_proto = xstrdup(proto);
/*
* Extract real authentication data and generate fake data of the
* same length.
*/
x11_saved_data = xmalloc(data_len);
x11_fake_data = xmalloc(data_len);
for (i = 0; i < data_len; i++) {
if (sscanf(data + 2 * i, "%2x", &value) != 1)
fatal("x11_request_forwarding: bad authentication data: %.100s", data);
if (i % 4 == 0)
rnd = arc4random();
x11_saved_data[i] = value;
x11_fake_data[i] = rnd & 0xff;
rnd >>= 8;
if (x11_saved_proto == NULL) {
/* Save protocol name. */
x11_saved_proto = xstrdup(proto);
/*
* Extract real authentication data and generate fake data
* of the same length.
*/
x11_saved_data = xmalloc(data_len);
x11_fake_data = xmalloc(data_len);
for (i = 0; i < data_len; i++) {
if (sscanf(data + 2 * i, "%2x", &value) != 1)
fatal("x11_request_forwarding: bad "
"authentication data: %.100s", data);
if (i % 4 == 0)
rnd = arc4random();
x11_saved_data[i] = value;
x11_fake_data[i] = rnd & 0xff;
rnd >>= 8;
}
x11_saved_data_len = data_len;
x11_fake_data_len = data_len;
}
x11_saved_data_len = data_len;
x11_fake_data_len = data_len;
/* Convert the fake data into hex. */
len = 2 * data_len + 1;
new_data = xmalloc(len);
for (i = 0; i < data_len; i++)
snprintf(new_data + 2 * i, len - 2 * i,
"%02x", (u_char) x11_fake_data[i]);
new_data = tohex(x11_fake_data, data_len);
/* Send the request packet. */
if (compat20) {
+5 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: channels.h,v 1.76 2005/03/01 10:09:52 djm Exp $ */
/* $OpenBSD: channels.h,v 1.79 2005/07/17 06:49:04 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -149,7 +149,7 @@ struct Channel {
buffer_len(&c->extended) > 0))
#define CHANNEL_EFD_OUTPUT_ACTIVE(c) \
(compat20 && c->extended_usage == CHAN_EXTENDED_WRITE && \
((c->efd != -1 && !(c->flags & (CHAN_EOF_RCVD|CHAN_CLOSE_RCVD))) || \
c->efd != -1 && (!(c->flags & (CHAN_EOF_RCVD|CHAN_CLOSE_RCVD)) || \
buffer_len(&c->extended) > 0))
/* channel management */
@@ -214,9 +214,10 @@ int channel_cancel_rport_listener(const char *, u_short);
/* x11 forwarding */
int x11_connect_display(void);
int x11_create_display_inet(int, int, int, u_int *);
int x11_create_display_inet(int, int, int, u_int *, int **);
void x11_input_open(int, u_int32_t, void *);
void x11_request_forwarding_with_spoofing(int, const char *, const char *);
void x11_request_forwarding_with_spoofing(int, const char *, const char *,
const char *);
void deny_input_open(int, u_int32_t, void *);
/* agent forwarding */
+3 -3
View File
@@ -17,7 +17,7 @@
#include "includes.h"
#include <openssl/evp.h>
RCSID("$Id: cipher-acss.c,v 1.2 2004/02/06 04:26:11 dtucker Exp $");
RCSID("$Id: cipher-acss.c,v 1.3 2005/07/17 07:04:47 djm Exp $");
#if !defined(EVP_CTRL_SET_ACSS_MODE) && (OPENSSL_VERSION_NUMBER >= 0x00907000L)
@@ -33,7 +33,7 @@ typedef struct {
#define EVP_CTRL_SET_ACSS_SUBKEY 0xff07
static int
acss_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
acss_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc)
{
acss_setkey(&data(ctx)->ks,key,enc,ACSS_DATA);
@@ -41,7 +41,7 @@ acss_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
}
static int
acss_ciph(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in,
acss_ciph(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in,
unsigned int inl)
{
acss(&data(ctx)->ks,inl,in,out);
+2 -2
View File
@@ -14,7 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "includes.h"
RCSID("$OpenBSD: cipher-ctr.c,v 1.5 2004/12/22 02:13:19 djm Exp $");
RCSID("$OpenBSD: cipher-ctr.c,v 1.6 2005/07/17 07:17:55 djm Exp $");
#include <openssl/evp.h>
@@ -95,7 +95,7 @@ ssh_aes_ctr_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
}
if (key != NULL)
AES_set_encrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8,
&c->aes_ctx);
&c->aes_ctx);
if (iv != NULL)
memcpy(c->aes_counter, iv, AES_BLOCK_SIZE);
return (1);
+40 -60
View File
@@ -35,7 +35,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: cipher.c,v 1.73 2005/01/23 10:18:12 djm Exp $");
RCSID("$OpenBSD: cipher.c,v 1.77 2005/07/16 01:35:24 djm Exp $");
#include "xmalloc.h"
#include "log.h"
@@ -43,25 +43,8 @@ RCSID("$OpenBSD: cipher.c,v 1.73 2005/01/23 10:18:12 djm Exp $");
#include <openssl/md5.h>
#if OPENSSL_VERSION_NUMBER < 0x00906000L
#define SSH_OLD_EVP
#define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data)
#endif
#if OPENSSL_VERSION_NUMBER < 0x00907000L
extern const EVP_CIPHER *evp_rijndael(void);
extern void ssh_rijndael_iv(EVP_CIPHER_CTX *, int, u_char *, u_int);
#endif
#if !defined(EVP_CTRL_SET_ACSS_MODE)
# if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
extern const EVP_CIPHER *evp_acss(void);
# define EVP_acss evp_acss
# define EVP_CTRL_SET_ACSS_MODE xxx /* used below */
# else
# define EVP_acss NULL /* Don't try to support ACSS on older OpenSSL */
# endif /* (OPENSSL_VERSION_NUMBER >= 0x00906000L) */
#endif /* !defined(EVP_CTRL_SET_ACSS_MODE) */
/* compatibility with old or broken OpenSSL versions */
#include "openbsd-compat/openssl-compat.h"
extern const EVP_CIPHER *evp_ssh1_bf(void);
extern const EVP_CIPHER *evp_ssh1_3des(void);
@@ -74,39 +57,32 @@ struct Cipher {
int number; /* for ssh1 only */
u_int block_size;
u_int key_len;
u_int discard_len;
const EVP_CIPHER *(*evptype)(void);
} ciphers[] = {
{ "none", SSH_CIPHER_NONE, 8, 0, EVP_enc_null },
{ "des", SSH_CIPHER_DES, 8, 8, EVP_des_cbc },
{ "3des", SSH_CIPHER_3DES, 8, 16, evp_ssh1_3des },
{ "blowfish", SSH_CIPHER_BLOWFISH, 8, 32, evp_ssh1_bf },
{ "none", SSH_CIPHER_NONE, 8, 0, 0, EVP_enc_null },
{ "des", SSH_CIPHER_DES, 8, 8, 0, EVP_des_cbc },
{ "3des", SSH_CIPHER_3DES, 8, 16, 0, evp_ssh1_3des },
{ "blowfish", SSH_CIPHER_BLOWFISH, 8, 32, 0, evp_ssh1_bf },
{ "3des-cbc", SSH_CIPHER_SSH2, 8, 24, EVP_des_ede3_cbc },
{ "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, EVP_bf_cbc },
{ "cast128-cbc", SSH_CIPHER_SSH2, 8, 16, EVP_cast5_cbc },
{ "arcfour", SSH_CIPHER_SSH2, 8, 16, EVP_rc4 },
#if OPENSSL_VERSION_NUMBER < 0x00907000L
{ "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, evp_rijndael },
{ "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, evp_rijndael },
{ "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, evp_rijndael },
{ "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, EVP_des_ede3_cbc },
{ "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, 0, EVP_bf_cbc },
{ "cast128-cbc", SSH_CIPHER_SSH2, 8, 16, 0, EVP_cast5_cbc },
{ "arcfour", SSH_CIPHER_SSH2, 8, 16, 0, EVP_rc4 },
{ "arcfour128", SSH_CIPHER_SSH2, 8, 16, 1536, EVP_rc4 },
{ "arcfour256", SSH_CIPHER_SSH2, 8, 32, 1536, EVP_rc4 },
{ "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, 0, EVP_aes_128_cbc },
{ "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, 0, EVP_aes_192_cbc },
{ "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc },
{ "[email protected]",
SSH_CIPHER_SSH2, 16, 32, evp_rijndael },
#else
{ "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, EVP_aes_128_cbc },
{ "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, EVP_aes_192_cbc },
{ "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
{ "[email protected]",
SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
SSH_CIPHER_SSH2, 16, 32, 0, EVP_aes_256_cbc },
{ "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, 0, evp_aes_128_ctr },
{ "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, 0, evp_aes_128_ctr },
{ "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, 0, evp_aes_128_ctr },
#ifdef USE_CIPHER_ACSS
{ "[email protected]", SSH_CIPHER_SSH2, 16, 5, 0, EVP_acss },
#endif
#if OPENSSL_VERSION_NUMBER >= 0x00905000L
{ "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, evp_aes_128_ctr },
{ "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, evp_aes_128_ctr },
{ "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, evp_aes_128_ctr },
#endif
#if defined(EVP_CTRL_SET_ACSS_MODE)
{ "[email protected]", SSH_CIPHER_SSH2, 16, 5, EVP_acss },
#endif
{ NULL, SSH_CIPHER_INVALID, 0, 0, NULL }
{ NULL, SSH_CIPHER_INVALID, 0, 0, 0, NULL }
};
/*--*/
@@ -222,8 +198,9 @@ cipher_init(CipherContext *cc, Cipher *cipher,
EVP_CIPHER *type;
#else
const EVP_CIPHER *type;
#endif
int klen;
#endif
u_char *junk, *discard;
if (cipher->number == SSH_CIPHER_DES) {
if (dowarn) {
@@ -261,7 +238,7 @@ cipher_init(CipherContext *cc, Cipher *cipher,
fatal("cipher_init: EVP_CipherInit failed for %s",
cipher->name);
klen = EVP_CIPHER_CTX_key_length(&cc->evp);
if (klen > 0 && keylen != klen) {
if (klen > 0 && keylen != (u_int)klen) {
debug2("cipher_init: set keylen (%d -> %d)", klen, keylen);
if (EVP_CIPHER_CTX_set_key_length(&cc->evp, keylen) == 0)
fatal("cipher_init: set keylen failed (%d -> %d)",
@@ -271,6 +248,17 @@ cipher_init(CipherContext *cc, Cipher *cipher,
fatal("cipher_init: EVP_CipherInit: set key failed for %s",
cipher->name);
#endif
if (cipher->discard_len > 0) {
junk = xmalloc(cipher->discard_len);
discard = xmalloc(cipher->discard_len);
if (EVP_Cipher(&cc->evp, discard, junk,
cipher->discard_len) == 0)
fatal("evp_crypt: EVP_Cipher failed during discard");
memset(discard, 0, cipher->discard_len);
xfree(junk);
xfree(discard);
}
}
void
@@ -278,23 +266,15 @@ cipher_crypt(CipherContext *cc, u_char *dest, const u_char *src, u_int len)
{
if (len % cc->cipher->block_size)
fatal("cipher_encrypt: bad plaintext length %d", len);
#ifdef SSH_OLD_EVP
EVP_Cipher(&cc->evp, dest, (u_char *)src, len);
#else
if (EVP_Cipher(&cc->evp, dest, (u_char *)src, len) == 0)
fatal("evp_crypt: EVP_Cipher failed");
#endif
}
void
cipher_cleanup(CipherContext *cc)
{
#ifdef SSH_OLD_EVP
EVP_CIPHER_CTX_cleanup(&cc->evp);
#else
if (EVP_CIPHER_CTX_cleanup(&cc->evp) == 0)
error("cipher_cleanup: EVP_CIPHER_CTX_cleanup failed");
#endif
}
/*
@@ -349,9 +329,9 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
case SSH_CIPHER_DES:
case SSH_CIPHER_BLOWFISH:
evplen = EVP_CIPHER_CTX_iv_length(&cc->evp);
if (evplen == 0)
if (evplen <= 0)
return;
if (evplen != len)
if ((u_int)evplen != len)
fatal("%s: wrong iv length %d != %d", __func__,
evplen, len);
#if OPENSSL_VERSION_NUMBER < 0x00907000L
+142 -11
View File
@@ -59,7 +59,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: clientloop.c,v 1.136 2005/03/10 22:01:05 deraadt Exp $");
RCSID("$OpenBSD: clientloop.c,v 1.141 2005/07/16 01:35:24 djm Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -140,6 +140,8 @@ int session_ident = -1;
struct confirm_ctx {
int want_tty;
int want_subsys;
int want_x_fwd;
int want_agent_fwd;
Buffer cmd;
char *term;
struct termios tio;
@@ -208,6 +210,109 @@ get_current_time(void)
return (double) tv.tv_sec + (double) tv.tv_usec / 1000000.0;
}
#define SSH_X11_PROTO "MIT-MAGIC-COOKIE-1"
void
client_x11_get_proto(const char *display, const char *xauth_path,
u_int trusted, char **_proto, char **_data)
{
char cmd[1024];
char line[512];
char xdisplay[512];
static char proto[512], data[512];
FILE *f;
int got_data = 0, generated = 0, do_unlink = 0, i;
char *xauthdir, *xauthfile;
struct stat st;
xauthdir = xauthfile = NULL;
*_proto = proto;
*_data = data;
proto[0] = data[0] = '\0';
if (xauth_path == NULL ||(stat(xauth_path, &st) == -1)) {
debug("No xauth program.");
} else {
if (display == NULL) {
debug("x11_get_proto: DISPLAY not set");
return;
}
/*
* Handle FamilyLocal case where $DISPLAY does
* not match an authorization entry. For this we
* just try "xauth list unix:displaynum.screennum".
* XXX: "localhost" match to determine FamilyLocal
* is not perfect.
*/
if (strncmp(display, "localhost:", 10) == 0) {
snprintf(xdisplay, sizeof(xdisplay), "unix:%s",
display + 10);
display = xdisplay;
}
if (trusted == 0) {
xauthdir = xmalloc(MAXPATHLEN);
xauthfile = xmalloc(MAXPATHLEN);
strlcpy(xauthdir, "/tmp/ssh-XXXXXXXXXX", MAXPATHLEN);
if (mkdtemp(xauthdir) != NULL) {
do_unlink = 1;
snprintf(xauthfile, MAXPATHLEN, "%s/xauthfile",
xauthdir);
snprintf(cmd, sizeof(cmd),
"%s -f %s generate %s " SSH_X11_PROTO
" untrusted timeout 1200 2>" _PATH_DEVNULL,
xauth_path, xauthfile, display);
debug2("x11_get_proto: %s", cmd);
if (system(cmd) == 0)
generated = 1;
}
}
snprintf(cmd, sizeof(cmd),
"%s %s%s list %s . 2>" _PATH_DEVNULL,
xauth_path,
generated ? "-f " : "" ,
generated ? xauthfile : "",
display);
debug2("x11_get_proto: %s", cmd);
f = popen(cmd, "r");
if (f && fgets(line, sizeof(line), f) &&
sscanf(line, "%*s %511s %511s", proto, data) == 2)
got_data = 1;
if (f)
pclose(f);
}
if (do_unlink) {
unlink(xauthfile);
rmdir(xauthdir);
}
if (xauthdir)
xfree(xauthdir);
if (xauthfile)
xfree(xauthfile);
/*
* If we didn't get authentication data, just make up some
* data. The forwarding code will check the validity of the
* response anyway, and substitute this data. The X11
* server, however, will ignore this fake data and use
* whatever authentication mechanisms it was using otherwise
* for the local connection.
*/
if (!got_data) {
u_int32_t rnd = 0;
logit("Warning: No xauth data; "
"using fake authentication data for X11 forwarding.");
strlcpy(proto, SSH_X11_PROTO, sizeof proto);
for (i = 0; i < 16; i++) {
if (i % 4 == 0)
rnd = arc4random();
snprintf(data + 2 * i, sizeof data - 2 * i, "%02x",
rnd & 0xff);
rnd >>= 8;
}
}
}
/*
* This is called when the interactive is entered. This checks if there is
* an EOF coming on stdin. We must check this explicitly, as select() does
@@ -528,6 +633,7 @@ static void
client_extra_session2_setup(int id, void *arg)
{
struct confirm_ctx *cctx = arg;
const char *display;
Channel *c;
int i;
@@ -536,6 +642,24 @@ client_extra_session2_setup(int id, void *arg)
if ((c = channel_lookup(id)) == NULL)
fatal("%s: no channel for id %d", __func__, id);
display = getenv("DISPLAY");
if (cctx->want_x_fwd && options.forward_x11 && display != NULL) {
char *proto, *data;
/* Get reasonable local authentication information. */
client_x11_get_proto(display, options.xauth_location,
options.forward_x11_trusted, &proto, &data);
/* Request forwarding with authentication spoofing. */
debug("Requesting X11 forwarding with authentication spoofing.");
x11_request_forwarding_with_spoofing(id, display, proto, data);
/* XXX wait for reply */
}
if (cctx->want_agent_fwd && options.forward_agent) {
debug("Requesting authentication agent forwarding.");
channel_request_start(id, "[email protected]", 0);
packet_send();
}
client_session2_setup(id, cctx->want_tty, cctx->want_subsys,
cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env,
client_subsystem_reply);
@@ -556,12 +680,12 @@ client_process_control(fd_set * readset)
{
Buffer m;
Channel *c;
int client_fd, new_fd[3], ver, i, allowed;
int client_fd, new_fd[3], ver, allowed;
socklen_t addrlen;
struct sockaddr_storage addr;
struct confirm_ctx *cctx;
char *cmd;
u_int len, env_len, command, flags;
u_int i, len, env_len, command, flags;
uid_t euid;
gid_t egid;
@@ -601,7 +725,7 @@ client_process_control(fd_set * readset)
buffer_free(&m);
return;
}
if ((ver = buffer_get_char(&m)) != 1) {
if ((ver = buffer_get_char(&m)) != SSHMUX_VER) {
error("%s: wrong client version %d", __func__, ver);
buffer_free(&m);
close(client_fd);
@@ -616,13 +740,15 @@ client_process_control(fd_set * readset)
switch (command) {
case SSHMUX_COMMAND_OPEN:
if (options.control_master == 2)
if (options.control_master == SSHCTL_MASTER_ASK ||
options.control_master == SSHCTL_MASTER_AUTO_ASK)
allowed = ask_permission("Allow shared connection "
"to %s? ", host);
/* continue below */
break;
case SSHMUX_COMMAND_TERMINATE:
if (options.control_master == 2)
if (options.control_master == SSHCTL_MASTER_ASK ||
options.control_master == SSHCTL_MASTER_AUTO_ASK)
allowed = ask_permission("Terminate shared connection "
"to %s? ", host);
if (allowed)
@@ -633,7 +759,7 @@ client_process_control(fd_set * readset)
buffer_clear(&m);
buffer_put_int(&m, allowed);
buffer_put_int(&m, getpid());
if (ssh_msg_send(client_fd, /* version */1, &m) == -1) {
if (ssh_msg_send(client_fd, SSHMUX_VER, &m) == -1) {
error("%s: client msg_send failed", __func__);
close(client_fd);
buffer_free(&m);
@@ -653,7 +779,7 @@ client_process_control(fd_set * readset)
buffer_clear(&m);
buffer_put_int(&m, allowed);
buffer_put_int(&m, getpid());
if (ssh_msg_send(client_fd, /* version */1, &m) == -1) {
if (ssh_msg_send(client_fd, SSHMUX_VER, &m) == -1) {
error("%s: client msg_send failed", __func__);
close(client_fd);
buffer_free(&m);
@@ -674,7 +800,7 @@ client_process_control(fd_set * readset)
buffer_free(&m);
return;
}
if ((ver = buffer_get_char(&m)) != 1) {
if ((ver = buffer_get_char(&m)) != SSHMUX_VER) {
error("%s: wrong client version %d", __func__, ver);
buffer_free(&m);
close(client_fd);
@@ -685,6 +811,8 @@ client_process_control(fd_set * readset)
memset(cctx, 0, sizeof(*cctx));
cctx->want_tty = (flags & SSHMUX_FLAG_TTY) != 0;
cctx->want_subsys = (flags & SSHMUX_FLAG_SUBSYS) != 0;
cctx->want_x_fwd = (flags & SSHMUX_FLAG_X11_FWD) != 0;
cctx->want_agent_fwd = (flags & SSHMUX_FLAG_AGENT_FWD) != 0;
cctx->term = buffer_get_string(&m, &len);
cmd = buffer_get_string(&m, &len);
@@ -718,7 +846,7 @@ client_process_control(fd_set * readset)
/* This roundtrip is just for synchronisation of ttymodes */
buffer_clear(&m);
if (ssh_msg_send(client_fd, /* version */1, &m) == -1) {
if (ssh_msg_send(client_fd, SSHMUX_VER, &m) == -1) {
error("%s: client msg_send failed", __func__);
close(client_fd);
close(new_fd[0]);
@@ -866,7 +994,10 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
u_char ch;
char *s;
for (i = 0; i < len; i++) {
if (len <= 0)
return (0);
for (i = 0; i < (u_int)len; i++) {
/* Get one character at a time. */
ch = buf[i];
+8 -1
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: clientloop.h,v 1.12 2004/11/07 00:01:46 djm Exp $ */
/* $OpenBSD: clientloop.h,v 1.14 2005/07/04 00:58:43 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -37,10 +37,15 @@
/* Client side main loop for the interactive session. */
int client_loop(int, int, int);
void client_x11_get_proto(const char *, const char *, u_int,
char **, char **);
void client_global_request_reply_fwd(int, u_int32_t, void *);
void client_session2_setup(int, int, int, const char *, struct termios *,
int, Buffer *, char **, dispatch_fn *);
/* Multiplexing protocol version */
#define SSHMUX_VER 1
/* Multiplexing control protocol flags */
#define SSHMUX_COMMAND_OPEN 1 /* Open new connection */
#define SSHMUX_COMMAND_ALIVE_CHECK 2 /* Check master is alive */
@@ -48,3 +53,5 @@ void client_session2_setup(int, int, int, const char *, struct termios *,
#define SSHMUX_FLAG_TTY (1) /* Request tty on open */
#define SSHMUX_FLAG_SUBSYS (1<<1) /* Subsystem request on open */
#define SSHMUX_FLAG_X11_FWD (1<<2) /* Request X11 forwarding */
#define SSHMUX_FLAG_AGENT_FWD (1<<3) /* Request agent forwarding */
+339 -251
View File
File diff suppressed because it is too large. Load diff
+55 -11
View File
@@ -1,6 +1,6 @@
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* $Id: acconfig.h,v 1.181 2005/02/25 23:07:38 dtucker Exp $ */
/* $Id: acconfig.h,v 1.183 2005/07/07 10:33:36 dtucker Exp $ */
/* $FreeBSD$ */
/*
@@ -121,9 +121,6 @@
/* Define if you are on NeXT */
/* #undef HAVE_NEXT */
/* Define if you are on NEWS-OS */
/* #undef HAVE_NEWS4 */
/* Define if you want to enable PAM support */
#define USE_PAM 1
@@ -207,9 +204,6 @@
/* Define if you don't want to use lastlog in session.c */
/* #undef NO_SSH_LASTLOG */
/* Define if have krb5_init_ets */
/* #undef KRB5_INIT_ETS */
/* Define if you don't want to use utmp */
/* #undef DISABLE_UTMP */
@@ -467,6 +461,18 @@
*/
/* #undef AIX_GETNAMEINFO_HACK */
/* getgroups(0,NULL) will return -1 */
/* #undef BROKEN_GETGROUPS */
/* ia_uinfo routines not supported by OS yet */
/* #undef BROKEN_LIBIAF */
/* Ultrix mmap can't map files */
/* #undef BROKEN_MMAP */
/* LynxOS has broken setvbuf() implementation */
/* #undef BROKEN_SETVBUF */
/* Define to 1 if the `getpgrp' function requires zero arguments. */
#define GETPGRP_VOID 1
@@ -476,6 +482,9 @@
/* Define to 1 if you have the `arc4random' function. */
#define HAVE_ARC4RANDOM 1
/* OpenBSD's gcc has sentinel */
/* #undef HAVE_ATTRIBUTE__SENTINEL__ */
/* Define to 1 if you have the `b64_ntop' function. */
/* #undef HAVE_B64_NTOP */
@@ -534,6 +543,14 @@
don't. */
/* #undef HAVE_DECL_SETAUTHDB */
/* Define to 1 if you have the declaration of `_getlong', and to 0 if you
don't. */
#define HAVE_DECL__GETLONG 0
/* Define to 1 if you have the declaration of `_getshort', and to 0 if you
don't. */
#define HAVE_DECL__GETSHORT 0
/* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
@@ -552,9 +569,6 @@
/* Define to 1 if you have the `endutxent' function. */
/* #undef HAVE_ENDUTXENT */
/* Define to 1 if you have the `fchdir' function. */
#define HAVE_FCHDIR 1
/* Define to 1 if you have the `fchmod' function. */
#define HAVE_FCHMOD 1
@@ -663,6 +677,9 @@
/* Define to 1 if you have the <gssapi_krb5.h> header file. */
/* #undef HAVE_GSSAPI_KRB5_H */
/* Define to 1 if you have the <iaf.h> header file. */
/* #undef HAVE_IAF_H */
/* Define to 1 if you have the <ia.h> header file. */
/* #undef HAVE_IA_H */
@@ -699,6 +716,9 @@
/* Define to 1 if you have the <libgen.h> header file. */
#define HAVE_LIBGEN_H 1
/* Define to 1 if you have the `iaf' library (-liaf). */
/* #undef HAVE_LIBIAF */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef HAVE_LIBNSL */
@@ -924,6 +944,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
@@ -951,6 +974,12 @@
/* Define to 1 if you have the `strsep' function. */
#define HAVE_STRSEP 1
/* Define to 1 if you have the `strtoll' function. */
#define HAVE_STRTOLL 1
/* Define to 1 if you have the `strtonum' function. */
/* #undef HAVE_STRTONUM */
/* Define to 1 if you have the `strtoul' function. */
#define HAVE_STRTOUL 1
@@ -1008,6 +1037,9 @@
/* Define to 1 if you have the <sys/strtio.h> header file. */
/* #undef HAVE_SYS_STRTIO_H */
/* Force use of sys/syslog.h on Ultrix */
/* #undef HAVE_SYS_SYSLOG_H */
/* Define to 1 if you have the <sys/sysmacros.h> header file. */
/* #undef HAVE_SYS_SYSMACROS_H */
@@ -1107,8 +1139,17 @@
/* Define to 1 if you have the `__b64_pton' function. */
#define HAVE___B64_PTON 1
/* max value of long long calculated by configure */
/* #undef LLONG_MAX */
/* min value of long long calculated by configure */
/* #undef LLONG_MIN */
/* Need setpgrp to acquire controlling tty */
/* #undef NEED_SETPRGP */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
#define PACKAGE_BUGREPORT "[email protected]"
/* Define to the full name of this package. */
#define PACKAGE_NAME "OpenSSH"
@@ -1146,6 +1187,9 @@
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Support passwords > 8 chars */
/* #undef UNIXWARE_LONG_PASSWORDS */
/* Use BSM audit module */
/* #undef USE_BSM_AUDIT */
+98 -38
View File
@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
timestamp='2003-08-18'
timestamp='2005-05-12'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +21,15 @@ timestamp='2003-08-18'
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to <[email protected]>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
@@ -70,7 +71,7 @@ Report bugs and patches to <[email protected]>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -83,11 +84,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit 0 ;;
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -99,7 +100,7 @@ while test $# -gt 0 ; do
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
exit ;;
* )
break ;;
@@ -118,7 +119,8 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -144,7 +146,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
-apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
@@ -230,13 +232,14 @@ case $basic_machine in
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32r | m68000 | m68k | m88k | mcore \
| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -261,12 +264,13 @@ case $basic_machine in
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
@@ -297,9 +301,9 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| bs2000-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
@@ -307,9 +311,9 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32r-* \
| m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -325,8 +329,9 @@ case $basic_machine in
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
@@ -334,15 +339,16 @@ case $basic_machine in
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
@@ -362,6 +368,9 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
@@ -379,6 +388,9 @@ case $basic_machine in
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -438,12 +450,27 @@ case $basic_machine in
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16c)
basic_machine=cr16c-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -466,6 +493,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
@@ -644,10 +675,6 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -728,10 +755,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -743,6 +766,10 @@ case $basic_machine in
basic_machine=or32-unknown
os=-coff
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
@@ -963,6 +990,10 @@ case $basic_machine in
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
@@ -1006,6 +1037,10 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
@@ -1036,6 +1071,9 @@ case $basic_machine in
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
@@ -1058,7 +1096,7 @@ case $basic_machine in
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b)
sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@@ -1131,19 +1169,20 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* | -skyos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1182,6 +1221,9 @@ case $os in
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
@@ -1203,6 +1245,9 @@ case $os in
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
@@ -1225,6 +1270,9 @@ case $os in
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
@@ -1261,6 +1309,9 @@ case $os in
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
-none)
;;
*)
@@ -1341,6 +1392,9 @@ case $basic_machine in
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
@@ -1473,9 +1527,15 @@ case $basic_machine in
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
@@ -1500,7 +1560,7 @@ case $basic_machine in
esac
echo $basic_machine$os
exit 0
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
+333 -70
View File
@@ -1,4 +1,4 @@
# $Id: configure.ac,v 1.260 2005/04/24 07:52:23 dtucker Exp $
# $Id: configure.ac,v 1.292 2005/08/31 16:59:49 tim Exp $
# $FreeBSD$
#
# Copyright (c) 1999-2004 Damien Miller
@@ -15,7 +15,7 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT(OpenSSH, Portable)
AC_INIT(OpenSSH, Portable, [email protected])
AC_CONFIG_SRCDIR([ssh.c])
AC_CONFIG_HEADER(config.h)
@@ -78,8 +78,94 @@ fi
AC_SUBST(LD)
AC_C_INLINE
AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
GCC_VER=`$CC --version`
case $GCC_VER in
1.*) ;;
2.8* | 2.9*) CFLAGS="$CFLAGS -Wsign-compare" ;;
2.*) ;;
*) CFLAGS="$CFLAGS -Wsign-compare" ;;
esac
if test -z "$have_llong_max"; then
# retry LLONG_MAX with -std=gnu99, needed on some Linuxes
unset ac_cv_have_decl_LLONG_MAX
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -std=gnu99"
AC_CHECK_DECL(LLONG_MAX,
[have_llong_max=1],
[CFLAGS="$saved_CFLAGS"],
[#include <limits.h>]
)
fi
fi
if test -z "$have_llong_max"; then
AC_MSG_CHECKING([for max value of long long])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
/* Why is this so damn hard? */
#ifdef __GNUC__
# undef __GNUC__
#endif
#define __USE_ISOC99
#include <limits.h>
#define DATA "conftest.llminmax"
int main(void) {
FILE *f;
long long i, llmin, llmax = 0;
if((f = fopen(DATA,"w")) == NULL)
exit(1);
#if defined(LLONG_MIN) && defined(LLONG_MAX)
fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
llmin = LLONG_MIN;
llmax = LLONG_MAX;
#else
fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
/* This will work on one's complement and two's complement */
for (i = 1; i > llmax; i <<= 1, i++)
llmax = i;
llmin = llmax + 1LL; /* wrap */
#endif
/* Sanity check */
if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
|| llmax - 1 > llmax) {
fprintf(f, "unknown unknown\n");
exit(2);
}
if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
exit(3);
exit(0);
}
]])],
[
llong_min=`$AWK '{print $1}' conftest.llminmax`
llong_max=`$AWK '{print $2}' conftest.llminmax`
AC_MSG_RESULT($llong_max)
AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
[max value of long long calculated by configure])
AC_MSG_CHECKING([for min value of long long])
AC_MSG_RESULT($llong_min)
AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL],
[min value of long long calculated by configure])
],
[
AC_MSG_RESULT(not found)
],
[
AC_MSG_WARN([cross compiling: not checking])
]
)
fi
AC_ARG_WITH(rpath,
@@ -182,26 +268,8 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
AC_DEFINE(BROKEN_SETREGID)
AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
;;
*-*-hpux10.26)
if test -z "$GCC"; then
CFLAGS="$CFLAGS -Ae"
fi
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
IPADDR_IN_DISPLAY=yes
AC_DEFINE(HAVE_SECUREWARE)
AC_DEFINE(USE_PIPES)
AC_DEFINE(LOGIN_NO_ENDOPT)
AC_DEFINE(LOGIN_NEEDS_UTMPX)
AC_DEFINE(LOCKED_PASSWD_STRING, "*")
AC_DEFINE(SPT_TYPE,SPT_PSTAT)
LIBS="$LIBS -lsec -lsecpw"
AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
disable_ptmx_check=yes
;;
*-*-hpux10*)
if test -z "$GCC"; then
CFLAGS="$CFLAGS -Ae"
fi
*-*-hpux*)
# first we define all of the options common to all HP-UX releases
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
IPADDR_IN_DISPLAY=yes
AC_DEFINE(USE_PIPES)
@@ -210,23 +278,33 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
AC_DEFINE(LOCKED_PASSWD_STRING, "*")
AC_DEFINE(SPT_TYPE,SPT_PSTAT)
LIBS="$LIBS -lsec"
AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
;;
*-*-hpux11*)
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
IPADDR_IN_DISPLAY=yes
AC_DEFINE(PAM_SUN_CODEBASE)
AC_DEFINE(USE_PIPES)
AC_DEFINE(LOGIN_NO_ENDOPT)
AC_DEFINE(LOGIN_NEEDS_UTMPX)
AC_DEFINE(DISABLE_UTMP)
AC_DEFINE(LOCKED_PASSWD_STRING, "*")
AC_DEFINE(SPT_TYPE,SPT_PSTAT)
AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
check_for_hpux_broken_getaddrinfo=1
check_for_conflicting_getspnam=1
LIBS="$LIBS -lsec"
AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
AC_CHECK_LIB(xnet, t_error, ,
AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
# next, we define all of the options specific to major releases
case "$host" in
*-*-hpux10*)
if test -z "$GCC"; then
CFLAGS="$CFLAGS -Ae"
fi
;;
*-*-hpux11*)
AC_DEFINE(PAM_SUN_CODEBASE)
AC_DEFINE(DISABLE_UTMP)
AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
check_for_hpux_broken_getaddrinfo=1
check_for_conflicting_getspnam=1
;;
esac
# lastly, we define options specific to minor releases
case "$host" in
*-*-hpux10.26)
AC_DEFINE(HAVE_SECUREWARE)
disable_ptmx_check=yes
LIBS="$LIBS -lsecpw"
;;
esac
;;
*-*-irix5*)
PATH="$PATH:/usr/etc"
@@ -270,7 +348,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
esac
;;
mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(HAVE_NEWS4)
AC_DEFINE(NEED_SETPRGP, [], [Need setpgrp to acquire controlling tty])
SONY=1
;;
*-*-netbsd*)
@@ -297,6 +375,9 @@ mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(USE_PIPES)
AC_DEFINE(BROKEN_SAVED_UIDS)
;;
*-*-openbsd*)
AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
;;
*-*-solaris*)
if test "x$withval" != "xno" ; then
need_dash_r=1
@@ -366,11 +447,19 @@ mips-sony-bsd|mips-sony-newsos4)
;;
# UnixWare 7.x, OpenUNIX 8
*-*-sysv5*)
check_for_libcrypt_later=1
AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars])
AC_DEFINE(USE_PIPES)
AC_DEFINE(SETEUID_BREAKS_SETUID)
AC_DEFINE(BROKEN_SETREUID)
AC_DEFINE(BROKEN_SETREGID)
AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
case "$host" in
*-*-sysv5SCO_SV*) # SCO OpenServer 6.x
TEST_SHELL=/u95/bin/sh
AC_DEFINE(BROKEN_LIBIAF, 1, [ia_uinfo routines not supported by OS yet])
;;
esac
;;
*-*-sysv*)
;;
@@ -469,6 +558,19 @@ mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(MISSING_HOWMANY)
AC_DEFINE(MISSING_FD_MASK)
;;
*-*-ultrix*)
AC_DEFINE(BROKEN_GETGROUPS, [], [getgroups(0,NULL) will return -1])
AC_DEFINE(BROKEN_MMAP, [], [Ultrix mmap can't map files])
AC_DEFINE(NEED_SETPRGP, [], [Need setpgrp to acquire controlling tty])
AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix])
;;
*-*-lynxos)
CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
AC_DEFINE(MISSING_HOWMANY)
AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation])
;;
esac
# Allow user to specify flags
@@ -508,6 +610,17 @@ AC_ARG_WITH(libs,
fi
]
)
AC_ARG_WITH(Werror,
[ --with-Werror Build main code with -Werror],
[
if test -n "$withval" && test "x$withval" != "xno"; then
werror_flags="-Werror"
if "x${withval}" != "xyes"; then
werror_flags="$withval"
fi
fi
]
)
AC_MSG_CHECKING(compiler and flags for sanity)
AC_RUN_IFELSE(
@@ -523,17 +636,67 @@ int main(){exit(0);}
[ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
)
# Checks for header files.
AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \
floatingpoint.h getopt.h glob.h ia.h lastlog.h limits.h login.h \
login_cap.h maillock.h ndir.h netdb.h netgroup.h \
netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \
sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \
sys/pstat.h sys/select.h sys/stat.h sys/stream.h \
sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \
time.h tmpdir.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
dnl Checks for header files.
AC_CHECK_HEADERS( \
bstring.h \
crypt.h \
dirent.h \
endian.h \
features.h \
floatingpoint.h \
getopt.h \
glob.h \
ia.h \
iaf.h \
lastlog.h \
limits.h \
login.h \
login_cap.h \
maillock.h \
ndir.h \
netdb.h \
netgroup.h \
netinet/in_systm.h \
pam/pam_appl.h \
paths.h \
pty.h \
readpassphrase.h \
rpc/types.h \
security/pam_appl.h \
shadow.h \
stddef.h \
stdint.h \
string.h \
strings.h \
sys/audit.h \
sys/bitypes.h \
sys/bsdtty.h \
sys/cdefs.h \
sys/dir.h \
sys/mman.h \
sys/ndir.h \
sys/prctl.h \
sys/pstat.h \
sys/select.h \
sys/stat.h \
sys/stream.h \
sys/stropts.h \
sys/strtio.h \
sys/sysmacros.h \
sys/time.h \
sys/timers.h \
sys/un.h \
time.h \
tmpdir.h \
ttyent.h \
unistd.h \
usersec.h \
util.h \
utime.h \
utmp.h \
utmpx.h \
vis.h \
)
# sys/ptms.h requires sys/stream.h to be included first on Solaris
AC_CHECK_HEADERS(sys/ptms.h, [], [], [
@@ -661,8 +824,8 @@ int main()
if (a == 1 && b == 1 && c >= 4)
exit(0);
/* 1.2.1.2 and up are OK */
if (v >= 1020102)
/* 1.2.3 and up are OK */
if (v >= 1020300)
exit(0);
exit(2);
@@ -676,7 +839,7 @@ Your reported zlib version has known security problems. It's possible your
vendor has fixed these problems without changing the version number. If you
are sure this is the case, you can disable the check by running
"./configure --without-zlib-version-check".
If you are in doubt, upgrade zlib to version 1.2.1.2 or greater.
If you are in doubt, upgrade zlib to version 1.2.3 or greater.
See http://www.gzip.org/zlib/ for details.])
else
AC_MSG_WARN([zlib version may have security problems])
@@ -912,6 +1075,21 @@ AC_ARG_WITH(libedit,
[ AC_MSG_ERROR(libedit not found) ],
[ -lcurses ]
)
AC_MSG_CHECKING(if libedit version is compatible)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[
#include <histedit.h>
int main(void)
{
int i = H_SETSIZE;
el_init("", NULL, NULL, NULL);
exit(0);
}
]])],
[ AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no)
AC_MSG_ERROR(libedit version is not compatible) ]
)
fi ]
)
@@ -940,6 +1118,9 @@ AC_ARG_WITH(audit,
AC_MSG_RESULT(debug)
AC_DEFINE(SSH_AUDIT_EVENTS, [], Use audit debugging module)
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([Unknown audit module $withval])
;;
@@ -947,19 +1128,87 @@ AC_ARG_WITH(audit,
)
dnl Checks for library functions. Please keep in alphabetical order
AC_CHECK_FUNCS(\
arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
setproctitle setregid setreuid setrlimit \
setsid setvbuf sigaction sigvec snprintf socketpair strerror \
strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
AC_CHECK_FUNCS( \
arc4random \
b64_ntop \
__b64_ntop \
b64_pton \
__b64_pton \
bcopy \
bindresvport_sa \
clock \
closefrom \
dirfd \
fchmod \
fchown \
freeaddrinfo \
futimes \
getaddrinfo \
getcwd \
getgrouplist \
getnameinfo \
getopt \
getpeereid \
_getpty \
getrlimit \
getttyent \
glob \
inet_aton \
inet_ntoa \
inet_ntop \
innetgr \
login_getcapbool \
md5_crypt \
memmove \
mkdtemp \
mmap \
ngetaddrinfo \
nsleep \
ogetaddrinfo \
openlog_r \
openpty \
prctl \
pstat \
readpassphrase \
realpath \
recvmsg \
rresvport_af \
sendmsg \
setdtablesize \
setegid \
setenv \
seteuid \
setgroups \
setlogin \
setpcred \
setproctitle \
setregid \
setreuid \
setrlimit \
setsid \
setvbuf \
sigaction \
sigvec \
snprintf \
socketpair \
strdup \
strerror \
strlcat \
strlcpy \
strmode \
strnvis \
strtonum \
strtoll \
strtoul \
sysconf \
tcgetpgrp \
truncate \
unsetenv \
updwtmpx \
utimes \
vhangup \
vsnprintf \
waitpid \
)
# IRIX has a const char return value for gai_strerror()
@@ -980,8 +1229,15 @@ str = gai_strerror(0);],[
AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
dnl Make sure prototypes are defined for these before using them.
AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
AC_CHECK_DECL(strsep,
[AC_CHECK_FUNCS(strsep)],
[],
[
#ifdef HAVE_STRING_H
# include <string.h>
#endif
])
dnl tcsendbreak might be a macro
AC_CHECK_DECL(tcsendbreak,
@@ -1505,6 +1761,7 @@ if test "x$check_for_libcrypt_later" = "x1"; then
AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
fi
AC_CHECK_LIB(iaf, ia_openinfo)
### Configure cryptographic random number support
@@ -2442,6 +2699,9 @@ int main()
AC_MSG_RESULT(no)])
])
AC_CHECK_FUNCS(_getshort _getlong)
AC_CHECK_DECLS([_getshort, _getlong], , ,
[#include <sys/types.h>
#include <arpa/nameser.h>])
AC_CHECK_MEMBER(HEADER.ad,
[AC_DEFINE(HAVE_HEADER_AD)],,
[#include <arpa/nameser.h>])
@@ -2545,7 +2805,6 @@ AC_ARG_WITH(kerberos5,
LIBS="$LIBS $K5LIBS"
AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
]
)
@@ -3184,6 +3443,10 @@ if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
LIBS=`echo $LIBS | sed 's/-ldl //'`
fi
dnl Adding -Werror to CFLAGS early prevents configure tests from running.
dnl Add now.
CFLAGS="$CFLAGS $werror_flags"
AC_EXEEXT
AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
scard/Makefile ssh_prng_cmds survey.sh])
+49 -2
View File
@@ -25,7 +25,7 @@
#ifndef _DEFINES_H
#define _DEFINES_H
/* $Id: defines.h,v 1.119 2005/02/20 10:01:49 dtucker Exp $ */
/* $Id: defines.h,v 1.127 2005/08/31 16:59:49 tim Exp $ */
/* Constants */
@@ -54,10 +54,24 @@ enum
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# else /* PATH_MAX */
# define MAXPATHLEN 64 /* Should be safe */
# define MAXPATHLEN 64
/* realpath uses a fixed buffer of size MAXPATHLEN, so force use of ours */
# ifndef BROKEN_REALPATH
# define BROKEN_REALPATH 1
# endif /* BROKEN_REALPATH */
# endif /* PATH_MAX */
#endif /* MAXPATHLEN */
#ifndef PATH_MAX
# ifdef _POSIX_PATH_MAX
# define PATH_MAX _POSIX_PATH_MAX
# endif
#endif
#ifndef MAXSYMLINKS
# define MAXSYMLINKS 5
#endif
#ifndef STDIN_FILENO
# define STDIN_FILENO 0
#endif
@@ -432,6 +446,10 @@ struct winsize {
# define __dead __attribute__((noreturn))
#endif
#if !defined(HAVE_ATTRIBUTE__SENTINEL__) && !defined(__sentinel__)
# define __sentinel__
#endif
/* *-*-nto-qnx doesn't define this macro in the system headers */
#ifdef MISSING_HOWMANY
# define howmany(x,y) (((x)+((y)-1))/(y))
@@ -567,6 +585,23 @@ struct winsize {
# define SSH_SYSFDMAX 10000
#endif
#if defined(__Lynx__)
/*
* LynxOS defines these in param.h which we do not want to include since
* it will also pull in a bunch of kernel definitions.
*/
# define ALIGNBYTES (sizeof(int) - 1)
# define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES)
/* Missing prototypes on LynxOS */
int snprintf (char *, size_t, const char *, ...);
int mkstemp (char *);
char *crypt (const char *, const char *);
int seteuid (uid_t);
int setegid (gid_t);
char *mkdtemp (char *);
int rresvport_af (int *, sa_family_t);
int innetgr (const char *, const char *, const char *, const char *);
#endif
/*
* Define this to use pipes instead of socketpairs for communicating with the
@@ -653,6 +688,10 @@ struct winsize {
# define CUSTOM_SYS_AUTH_PASSWD 1
#endif
#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF)
# define CUSTOM_SYS_AUTH_PASSWD 1
#endif
/* HP-UX 11.11 */
#ifdef BTMP_FILE
# define _PATH_BTMP BTMP_FILE
@@ -664,4 +703,12 @@ struct winsize {
/** end of login recorder definitions */
#ifdef BROKEN_GETGROUPS
# define getgroups(a,b) ((a)==0 && (b)==NULL ? NGROUPS_MAX : getgroups((a),(b)))
#endif
#if defined(HAVE_MMAP) && defined(BROKEN_MMAP)
# undef HAVE_MMAP
#endif
#endif /* _DEFINES_H */
+29 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: dns.c,v 1.10 2004/06/21 17:36:31 avsm Exp $ */
/* $OpenBSD: dns.c,v 1.12 2005/06/17 02:44:32 djm Exp $ */
/*
* Copyright (c) 2003 Wesley Griffin. All rights reserved.
@@ -43,7 +43,7 @@
#include "uuencode.h"
extern char *__progname;
RCSID("$OpenBSD: dns.c,v 1.10 2004/06/21 17:36:31 avsm Exp $");
RCSID("$OpenBSD: dns.c,v 1.12 2005/06/17 02:44:32 djm Exp $");
#ifndef LWRES
static const char *errset_text[] = {
@@ -142,6 +142,26 @@ dns_read_rdata(u_int8_t *algorithm, u_int8_t *digest_type,
return success;
}
/*
* Check if hostname is numerical.
* Returns -1 if hostname is numeric, 0 otherwise
*/
static int
is_numeric_hostname(const char *hostname)
{
struct addrinfo hints, *ai;
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_NUMERICHOST;
if (getaddrinfo(hostname, "0", &hints, &ai) == 0) {
freeaddrinfo(ai);
return -1;
}
return 0;
}
/*
* Verify the given hostname, address and host key using DNS.
@@ -151,7 +171,7 @@ int
verify_host_key_dns(const char *hostname, struct sockaddr *address,
const Key *hostkey, int *flags)
{
int counter;
u_int counter;
int result;
struct rrsetinfo *fingerprints = NULL;
@@ -171,6 +191,11 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address,
if (hostkey == NULL)
fatal("No key to look up!");
if (is_numeric_hostname(hostname)) {
debug("skipped DNS lookup for numerical hostname");
return -1;
}
result = getrrsetbyname(hostname, DNS_RDATACLASS_IN,
DNS_RDATATYPE_SSHFP, 0, &fingerprints);
if (result) {
@@ -249,7 +274,7 @@ export_dns_rr(const char *hostname, const Key *key, FILE *f, int generic)
u_char *rdata_digest;
u_int rdata_digest_len;
int i;
u_int i;
int success = 0;
if (dns_read_key(&rdata_pubkey_algorithm, &rdata_digest_type,
+3 -3
View File
@@ -45,7 +45,7 @@
* XXX: we should tell the child how many bytes we need.
*/
RCSID("$Id: entropy.c,v 1.48 2003/11/21 12:56:47 djm Exp $");
RCSID("$Id: entropy.c,v 1.49 2005/07/17 07:26:44 djm Exp $");
#ifndef OPENSSL_PRNG_ONLY
#define RANDOM_SEED_SIZE 48
@@ -114,8 +114,8 @@ seed_rng(void)
close(p[0]);
if (waitpid(pid, &ret, 0) == -1)
fatal("Couldn't wait for ssh-rand-helper completion: %s",
strerror(errno));
fatal("Couldn't wait for ssh-rand-helper completion: %s",
strerror(errno));
signal(SIGCHLD, old_sigchld);
/* We don't mind if the child exits upon a SIGPIPE */
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: gss-genr.c,v 1.3 2003/11/21 11:57:03 djm Exp $ */
/* $OpenBSD: gss-genr.c,v 1.4 2005/07/17 07:17:55 djm Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -78,8 +78,8 @@ ssh_gssapi_error(Gssctxt *ctxt)
}
char *
ssh_gssapi_last_error(Gssctxt *ctxt,
OM_uint32 *major_status, OM_uint32 *minor_status)
ssh_gssapi_last_error(Gssctxt *ctxt, OM_uint32 *major_status,
OM_uint32 *minor_status)
{
OM_uint32 lmin;
gss_buffer_desc msg = GSS_C_EMPTY_BUFFER;
+4 -31
View File
@@ -65,9 +65,6 @@ ssh_gssapi_krb5_init(void)
logit("Cannot initialize krb5 context");
return 0;
}
#ifdef KRB5_INIT_ETS
krb5_init_ets(krb_context);
#endif
return 1;
}
@@ -131,34 +128,10 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client)
return;
}
#else
{
int tmpfd;
char ccname[40];
mode_t old_umask;
snprintf(ccname, sizeof(ccname),
"FILE:/tmp/krb5cc_%d_XXXXXX", geteuid());
old_umask = umask(0177);
tmpfd = mkstemp(ccname + strlen("FILE:"));
umask(old_umask);
if (tmpfd == -1) {
logit("mkstemp(): %.100s", strerror(errno));
problem = errno;
return;
}
if (fchmod(tmpfd, S_IRUSR | S_IWUSR) == -1) {
logit("fchmod(): %.100s", strerror(errno));
close(tmpfd);
problem = errno;
return;
}
close(tmpfd);
if ((problem = krb5_cc_resolve(krb_context, ccname, &ccache))) {
logit("krb5_cc_resolve(): %.100s",
krb5_get_err_text(krb_context, problem));
return;
}
if ((problem = ssh_krb5_cc_gen(krb_context, &ccache))) {
logit("ssh_krb5_cc_gen(): %.100s",
krb5_get_err_text(krb_context, problem));
return;
}
#endif /* #ifdef HEIMDAL */
+16 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: gss-serv.c,v 1.5 2003/11/17 11:06:07 markus Exp $ */
/* $OpenBSD: gss-serv.c,v 1.8 2005/08/30 22:08:05 djm Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -134,7 +134,7 @@ ssh_gssapi_accept_ctx(Gssctxt *ctx, gss_buffer_desc *recv_tok,
static OM_uint32
ssh_gssapi_parse_ename(Gssctxt *ctx, gss_buffer_t ename, gss_buffer_t name)
{
char *tok;
u_char *tok;
OM_uint32 offset;
OM_uint32 oidl;
@@ -164,7 +164,7 @@ ssh_gssapi_parse_ename(Gssctxt *ctx, gss_buffer_t ename, gss_buffer_t name)
*/
if (tok[4] != 0x06 || tok[5] != oidl ||
ename->length < oidl+6 ||
!ssh_gssapi_check_oid(ctx,tok+6,oidl))
!ssh_gssapi_check_oid(ctx,tok+6,oidl))
return GSS_S_FAILURE;
offset = oidl+6;
@@ -267,7 +267,7 @@ ssh_gssapi_do_child(char ***envp, u_int *envsizep)
debug("Setting %s to %s", gssapi_client.store.envvar,
gssapi_client.store.envval);
child_set_env(envp, envsizep, gssapi_client.store.envvar,
gssapi_client.store.envval);
gssapi_client.store.envval);
}
}
@@ -275,13 +275,24 @@ ssh_gssapi_do_child(char ***envp, u_int *envsizep)
int
ssh_gssapi_userok(char *user)
{
OM_uint32 lmin;
if (gssapi_client.exportedname.length == 0 ||
gssapi_client.exportedname.value == NULL) {
debug("No suitable client data");
return 0;
}
if (gssapi_client.mech && gssapi_client.mech->userok)
return ((*gssapi_client.mech->userok)(&gssapi_client, user));
if ((*gssapi_client.mech->userok)(&gssapi_client, user))
return 1;
else {
/* Destroy delegated credentials if userok fails */
gss_release_buffer(&lmin, &gssapi_client.displayname);
gss_release_buffer(&lmin, &gssapi_client.exportedname);
gss_release_cred(&lmin, &gssapi_client.creds);
memset(&gssapi_client, 0, sizeof(ssh_gssapi_client));
return 0;
}
else
debug("ssh_gssapi_userok: Unknown GSSAPI mechanism");
return (0);
+2 -2
View File
@@ -36,7 +36,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: hostfile.c,v 1.34 2005/03/10 22:01:05 deraadt Exp $");
RCSID("$OpenBSD: hostfile.c,v 1.35 2005/07/27 10:39:03 dtucker Exp $");
#include <resolv.h>
#include <openssl/hmac.h>
@@ -315,7 +315,7 @@ add_host_to_hostfile(const char *filename, const char *host, const Key *key,
{
FILE *f;
int success = 0;
char *hashed_host;
char *hashed_host = NULL;
if (key == NULL)
return 1; /* XXX ? */
+10 -1
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: includes.h,v 1.18 2004/06/13 15:03:02 djm Exp $ */
/* $OpenBSD: includes.h,v 1.19 2005/05/19 02:42:26 djm Exp $ */
/* $FreeBSD$ */
/*
@@ -22,6 +22,7 @@ __RCSID(msg)
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
@@ -169,6 +170,10 @@ __RCSID(msg)
# include <ia.h>
#endif
#ifdef HAVE_IAF_H
# include <iaf.h>
#endif
#ifdef HAVE_TMPDIR_H
# include <tmpdir.h>
#endif
@@ -182,6 +187,10 @@ __RCSID(msg)
# include <kafs.h>
#endif
#if defined(HAVE_SYS_SYSLOG_H)
# include <sys/syslog.h>
#endif
/*
* On HP-UX 11.11, shadow.h and prot.h provide conflicting declarations
* of getspnam when _INCLUDE__STDC__ is defined, so we unset it here.
+23 -20
View File
@@ -23,7 +23,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: kex.c,v 1.60 2004/06/21 17:36:31 avsm Exp $");
RCSID("$OpenBSD: kex.c,v 1.64 2005/07/25 11:59:39 markus Exp $");
#include <openssl/crypto.h>
@@ -52,7 +52,7 @@ static void kex_choose_conf(Kex *);
static void
kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX])
{
int i;
u_int i;
buffer_clear(b);
/*
@@ -101,7 +101,7 @@ kex_buf2prop(Buffer *raw, int *first_kex_follows)
static void
kex_prop_free(char **proposal)
{
int i;
u_int i;
for (i = 0; i < PROPOSAL_MAX; i++)
xfree(proposal[i]);
@@ -150,7 +150,7 @@ kex_send_kexinit(Kex *kex)
{
u_int32_t rnd = 0;
u_char *cookie;
int i;
u_int i;
if (kex == NULL) {
error("kex_send_kexinit: no kex, cannot rekey");
@@ -183,8 +183,7 @@ void
kex_input_kexinit(int type, u_int32_t seq, void *ctxt)
{
char *ptr;
int dlen;
int i;
u_int i, dlen;
Kex *kex = (Kex *)ctxt;
debug("SSH2_MSG_KEXINIT received");
@@ -276,10 +275,12 @@ choose_comp(Comp *comp, char *client, char *server)
char *name = match_list(client, server, NULL);
if (name == NULL)
fatal("no matching comp found: client %s server %s", client, server);
if (strcmp(name, "zlib") == 0) {
comp->type = 1;
if (strcmp(name, "[email protected]") == 0) {
comp->type = COMP_DELAYED;
} else if (strcmp(name, "zlib") == 0) {
comp->type = COMP_ZLIB;
} else if (strcmp(name, "none") == 0) {
comp->type = 0;
comp->type = COMP_NONE;
} else {
fatal("unsupported comp %s", name);
}
@@ -343,9 +344,7 @@ kex_choose_conf(Kex *kex)
char **my, **peer;
char **cprop, **sprop;
int nenc, nmac, ncomp;
int mode;
int ctos; /* direction: if true client-to-server */
int need;
u_int mode, ctos, need;
int first_kex_follows, type;
my = kex_buf2prop(&kex->my, NULL);
@@ -395,7 +394,7 @@ kex_choose_conf(Kex *kex)
/* ignore the next message if the proposals do not match */
if (first_kex_follows && !proposals_match(my, peer) &&
!(datafellows & SSH_BUG_FIRSTKEX)) {
!(datafellows & SSH_BUG_FIRSTKEX)) {
type = packet_read();
debug2("skipping next packet (type %u)", type);
}
@@ -405,15 +404,19 @@ kex_choose_conf(Kex *kex)
}
static u_char *
derive_key(Kex *kex, int id, int need, u_char *hash, BIGNUM *shared_secret)
derive_key(Kex *kex, int id, u_int need, u_char *hash, BIGNUM *shared_secret)
{
Buffer b;
const EVP_MD *evp_md = EVP_sha1();
EVP_MD_CTX md;
char c = id;
int have;
u_int have;
int mdsz = EVP_MD_size(evp_md);
u_char *digest = xmalloc(roundup(need, mdsz));
u_char *digest;
if (mdsz < 0)
fatal("derive_key: mdsz < 0");
digest = xmalloc(roundup(need, mdsz));
buffer_init(&b);
buffer_put_bignum2(&b, shared_secret);
@@ -455,7 +458,7 @@ void
kex_derive_keys(Kex *kex, u_char *hash, BIGNUM *shared_secret)
{
u_char *keys[NKEYS];
int i, mode, ctos;
u_int i, mode, ctos;
for (i = 0; i < NKEYS; i++)
keys[i] = derive_key(kex, 'A'+i, kex->we_need, hash, shared_secret);
@@ -493,13 +496,13 @@ derive_ssh1_session_id(BIGNUM *host_modulus, BIGNUM *server_modulus,
EVP_DigestInit(&md, evp_md);
len = BN_num_bytes(host_modulus);
if (len < (512 / 8) || len > sizeof(nbuf))
if (len < (512 / 8) || (u_int)len > sizeof(nbuf))
fatal("%s: bad host modulus (len %d)", __func__, len);
BN_bn2bin(host_modulus, nbuf);
EVP_DigestUpdate(&md, nbuf, len);
len = BN_num_bytes(server_modulus);
if (len < (512 / 8) || len > sizeof(nbuf))
if (len < (512 / 8) || (u_int)len > sizeof(nbuf))
fatal("%s: bad server modulus (len %d)", __func__, len);
BN_bn2bin(server_modulus, nbuf);
EVP_DigestUpdate(&md, nbuf, len);
@@ -518,7 +521,7 @@ derive_ssh1_session_id(BIGNUM *host_modulus, BIGNUM *server_modulus,
void
dump_digest(char *msg, u_char *digest, int len)
{
int i;
u_int i;
fprintf(stderr, "%s\n", msg);
for (i = 0; i< len; i++) {
+8 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: kex.h,v 1.35 2004/06/13 12:53:24 djm Exp $ */
/* $OpenBSD: kex.h,v 1.37 2005/07/25 11:59:39 markus Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -35,6 +35,10 @@
#define KEX_DH14 "diffie-hellman-group14-sha1"
#define KEX_DHGEX "diffie-hellman-group-exchange-sha1"
#define COMP_NONE 0
#define COMP_ZLIB 1
#define COMP_DELAYED 2
enum kex_init_proposals {
PROPOSAL_KEX_ALGS,
PROPOSAL_SERVER_HOST_KEY_ALGS,
@@ -83,9 +87,9 @@ struct Mac {
char *name;
int enabled;
const EVP_MD *md;
int mac_len;
u_int mac_len;
u_char *key;
int key_len;
u_int key_len;
};
struct Comp {
int type;
@@ -101,7 +105,7 @@ struct Kex {
u_char *session_id;
u_int session_id_len;
Newkeys *newkeys[MODE_MAX];
int we_need;
u_int we_need;
int server;
char *name;
int hostkey_type;
+2 -2
View File
@@ -32,7 +32,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
RCSID("$OpenBSD: key.c,v 1.57 2004/10/29 23:57:05 djm Exp $");
RCSID("$OpenBSD: key.c,v 1.58 2005/06/17 02:44:32 djm Exp $");
#include <openssl/evp.h>
@@ -231,7 +231,7 @@ static char *
key_fingerprint_hex(u_char *dgst_raw, u_int dgst_raw_len)
{
char *retval;
int i;
u_int i;
retval = xmalloc(dgst_raw_len * 3 + 1);
retval[0] = '\0';
+20 -19
View File
@@ -165,7 +165,7 @@
# include <libutil.h>
#endif
RCSID("$Id: loginrec.c,v 1.67 2005/02/15 11:19:28 dtucker Exp $");
RCSID("$Id: loginrec.c,v 1.70 2005/07/17 07:26:44 djm Exp $");
RCSID("$FreeBSD$");
/**
@@ -363,7 +363,7 @@ login_init_entry(struct logininfo *li, int pid, const char *username,
strlcpy(li->username, username, sizeof(li->username));
pw = getpwnam(li->username);
if (pw == NULL) {
fatal("%s: Cannot find user \"%s\"", __func__,
fatal("%s: Cannot find user \"%s\"", __func__,
li->username);
}
li->uid = pw->pw_uid;
@@ -375,7 +375,7 @@ login_init_entry(struct logininfo *li, int pid, const char *username,
return (1);
}
/*
/*
* login_set_current_time(struct logininfo *) - set the current time
*
* Set the current time in a logininfo structure. This function is
@@ -444,8 +444,9 @@ login_write(struct logininfo *li)
wtmpx_write_entry(li);
#endif
#ifdef CUSTOM_SYS_AUTH_RECORD_LOGIN
if (li->type == LTYPE_LOGIN &&
!sys_auth_record_login(li->username,li->hostname,li->line, &loginmsg))
if (li->type == LTYPE_LOGIN &&
!sys_auth_record_login(li->username,li->hostname,li->line,
&loginmsg))
logit("Writing login record failed for %s", li->username);
#endif
#ifdef SSH_AUDIT_EVENTS
@@ -535,7 +536,7 @@ getlast_entry(struct logininfo *li)
* sure dst has enough space, if not just copy src (ugh)
*/
char *
line_fullname(char *dst, const char *src, int dstsize)
line_fullname(char *dst, const char *src, u_int dstsize)
{
memset(dst, '\0', dstsize);
if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5)))
@@ -559,7 +560,7 @@ line_stripname(char *dst, const char *src, int dstsize)
return (dst);
}
/*
/*
* line_abbrevname(): Return the abbreviated (usually four-character)
* form of the line (Just use the last <dstsize> characters of the
* full name.)
@@ -809,7 +810,7 @@ utmp_write_library(struct logininfo *li, struct utmp *ut)
}
# else /* UTMP_USE_LIBRARY */
/*
/*
* Write a utmp entry direct to the file
* This is a slightly modification of code in OpenBSD's login.c
*/
@@ -853,7 +854,7 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
return (0);
}
if (ret != pos) {
logit("%s: Couldn't seek to tty %d slot in %s",
logit("%s: Couldn't seek to tty %d slot in %s",
__func__, tty, UTMP_FILE);
return (0);
}
@@ -1053,7 +1054,7 @@ utmpx_write_entry(struct logininfo *li)
#ifdef USE_WTMP
/*
/*
* Write a wtmp entry direct to the end of the file
* This is a slight modification of code in OpenBSD's logwtmp.c
*/
@@ -1114,7 +1115,7 @@ wtmp_write_entry(struct logininfo *li)
}
/*
/*
* Notes on fetching login data from wtmp/wtmpx
*
* Logouts are usually recorded with (amongst other things) a blank
@@ -1158,12 +1159,12 @@ wtmp_get_entry(struct logininfo *li)
li->tv_sec = li->tv_usec = 0;
if ((fd = open(WTMP_FILE, O_RDONLY)) < 0) {
logit("%s: problem opening %s: %s", __func__,
logit("%s: problem opening %s: %s", __func__,
WTMP_FILE, strerror(errno));
return (0);
}
if (fstat(fd, &st) != 0) {
logit("%s: couldn't stat %s: %s", __func__,
logit("%s: couldn't stat %s: %s", __func__,
WTMP_FILE, strerror(errno));
close(fd);
return (0);
@@ -1178,7 +1179,7 @@ wtmp_get_entry(struct logininfo *li)
while (!found) {
if (atomicio(read, fd, &ut, sizeof(ut)) != sizeof(ut)) {
logit("%s: read of %s failed: %s", __func__,
logit("%s: read of %s failed: %s", __func__,
WTMP_FILE, strerror(errno));
close (fd);
return (0);
@@ -1236,7 +1237,7 @@ wtmpx_write(struct logininfo *li, struct utmpx *utx)
int fd, ret = 1;
if ((fd = open(WTMPX_FILE, O_WRONLY|O_APPEND, 0)) < 0) {
logit("%s: problem opening %s: %s", __func__,
logit("%s: problem opening %s: %s", __func__,
WTMPX_FILE, strerror(errno));
return (0);
}
@@ -1323,12 +1324,12 @@ wtmpx_get_entry(struct logininfo *li)
li->tv_sec = li->tv_usec = 0;
if ((fd = open(WTMPX_FILE, O_RDONLY)) < 0) {
logit("%s: problem opening %s: %s", __func__,
logit("%s: problem opening %s: %s", __func__,
WTMPX_FILE, strerror(errno));
return (0);
}
if (fstat(fd, &st) != 0) {
logit("%s: couldn't stat %s: %s", __func__,
logit("%s: couldn't stat %s: %s", __func__,
WTMPX_FILE, strerror(errno));
close(fd);
return (0);
@@ -1343,13 +1344,13 @@ wtmpx_get_entry(struct logininfo *li)
while (!found) {
if (atomicio(read, fd, &utx, sizeof(utx)) != sizeof(utx)) {
logit("%s: read of %s failed: %s", __func__,
logit("%s: read of %s failed: %s", __func__,
WTMPX_FILE, strerror(errno));
close (fd);
return (0);
}
/*
* Logouts are recorded as a blank username on a particular
* Logouts are recorded as a blank username on a particular
* line. So, we just need to find the username in struct utmpx
*/
if (wtmpx_islogin(li, &utx)) {
+2 -2
View File
@@ -35,7 +35,7 @@
#include <netinet/in.h>
#include <sys/socket.h>
/* RCSID("$Id: loginrec.h,v 1.9 2005/02/02 06:10:11 dtucker Exp $"); */
/* RCSID("$Id: loginrec.h,v 1.10 2005/06/19 00:19:44 djm Exp $"); */
/**
** you should use the login_* calls to work around platform dependencies
@@ -128,7 +128,7 @@ struct logininfo *login_get_lastlog(struct logininfo *li, const int uid);
unsigned int login_get_lastlog_time(const int uid);
/* produce various forms of the line filename */
char *line_fullname(char *dst, const char *src, int dstsize);
char *line_fullname(char *dst, const char *src, u_int dstsize);
char *line_stripname(char *dst, const char *src, int dstsize);
char *line_abbrevname(char *dst, const char *src, int dstsize);
+7 -4
View File
@@ -23,7 +23,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: mac.c,v 1.6 2003/09/18 13:02:21 miod Exp $");
RCSID("$OpenBSD: mac.c,v 1.7 2005/06/17 02:44:32 djm Exp $");
#include <openssl/hmac.h>
@@ -51,12 +51,15 @@ struct {
int
mac_init(Mac *mac, char *name)
{
int i;
int i, evp_len;
for (i = 0; macs[i].name; i++) {
if (strcmp(name, macs[i].name) == 0) {
if (mac != NULL) {
mac->md = (*macs[i].mdfunc)();
mac->key_len = mac->mac_len = EVP_MD_size(mac->md);
if ((evp_len = EVP_MD_size(mac->md)) <= 0)
fatal("mac %s len %d", name, evp_len);
mac->key_len = mac->mac_len = (u_int)evp_len;
if (macs[i].truncatebits != 0)
mac->mac_len = macs[i].truncatebits/8;
}
@@ -77,7 +80,7 @@ mac_compute(Mac *mac, u_int32_t seqno, u_char *data, int datalen)
if (mac->key == NULL)
fatal("mac_compute: no key");
if ((u_int)mac->mac_len > sizeof(m))
if (mac->mac_len > sizeof(m))
fatal("mac_compute: mac too long");
HMAC_Init(&c, mac->key, mac->key_len, mac->md);
PUT_32BIT(b, seqno);
+2 -2
View File
@@ -35,7 +35,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: match.c,v 1.19 2002/03/01 13:12:10 markus Exp $");
RCSID("$OpenBSD: match.c,v 1.20 2005/06/17 02:44:32 djm Exp $");
#include "match.h"
#include "xmalloc.h"
@@ -254,7 +254,7 @@ match_list(const char *client, const char *server, u_int *next)
ret = xstrdup(p);
if (next != NULL)
*next = (cp == NULL) ?
strlen(c) : cp - c;
strlen(c) : (u_int)(cp - c);
xfree(c);
xfree(s);
return ret;
+3
View File
@@ -140,6 +140,9 @@ function add(str) {
} else if(match(words[w],"^Dt$")) {
id=wtail()
next
} else if(match(words[w],"^Ox$")) {
add("OpenBSD")
skip=1
} else if(match(words[w],"^Os$")) {
add(".TH " id " \"" date "\" \"" wtail() "\"")
} else if(match(words[w],"^Sh$")) {
+127 -1
View File
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005 Damien Miller. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,7 +24,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: misc.c,v 1.29 2005/03/10 22:01:05 deraadt Exp $");
RCSID("$OpenBSD: misc.c,v 1.34 2005/07/08 09:26:18 dtucker Exp $");
#include "misc.h"
#include "log.h"
@@ -375,6 +376,114 @@ addargs(arglist *args, char *fmt, ...)
args->list[args->num] = NULL;
}
/*
* Expands tildes in the file name. Returns data allocated by xmalloc.
* Warning: this calls getpw*.
*/
char *
tilde_expand_filename(const char *filename, uid_t uid)
{
const char *path;
char user[128], ret[MAXPATHLEN];
struct passwd *pw;
u_int len, slash;
if (*filename != '~')
return (xstrdup(filename));
filename++;
path = strchr(filename, '/');
if (path != NULL && path > filename) { /* ~user/path */
slash = path - filename;
if (slash > sizeof(user) - 1)
fatal("tilde_expand_filename: ~username too long");
memcpy(user, filename, slash);
user[slash] = '\0';
if ((pw = getpwnam(user)) == NULL)
fatal("tilde_expand_filename: No such user %s", user);
} else if ((pw = getpwuid(uid)) == NULL) /* ~/path */
fatal("tilde_expand_filename: No such uid %d", uid);
if (strlcpy(ret, pw->pw_dir, sizeof(ret)) >= sizeof(ret))
fatal("tilde_expand_filename: Path too long");
/* Make sure directory has a trailing '/' */
len = strlen(pw->pw_dir);
if ((len == 0 || pw->pw_dir[len - 1] != '/') &&
strlcat(ret, "/", sizeof(ret)) >= sizeof(ret))
fatal("tilde_expand_filename: Path too long");
/* Skip leading '/' from specified path */
if (path != NULL)
filename = path + 1;
if (strlcat(ret, filename, sizeof(ret)) >= sizeof(ret))
fatal("tilde_expand_filename: Path too long");
return (xstrdup(ret));
}
/*
* Expand a string with a set of %[char] escapes. A number of escapes may be
* specified as (char *escape_chars, char *replacement) pairs. The list must
* be terminated by a NULL escape_char. Returns replaced string in memory
* allocated by xmalloc.
*/
char *
percent_expand(const char *string, ...)
{
#define EXPAND_MAX_KEYS 16
struct {
const char *key;
const char *repl;
} keys[EXPAND_MAX_KEYS];
u_int num_keys, i, j;
char buf[4096];
va_list ap;
/* Gather keys */
va_start(ap, string);
for (num_keys = 0; num_keys < EXPAND_MAX_KEYS; num_keys++) {
keys[num_keys].key = va_arg(ap, char *);
if (keys[num_keys].key == NULL)
break;
keys[num_keys].repl = va_arg(ap, char *);
if (keys[num_keys].repl == NULL)
fatal("percent_expand: NULL replacement");
}
va_end(ap);
if (num_keys >= EXPAND_MAX_KEYS)
fatal("percent_expand: too many keys");
/* Expand string */
*buf = '\0';
for (i = 0; *string != '\0'; string++) {
if (*string != '%') {
append:
buf[i++] = *string;
if (i >= sizeof(buf))
fatal("percent_expand: string too long");
buf[i] = '\0';
continue;
}
string++;
if (*string == '%')
goto append;
for (j = 0; j < num_keys; j++) {
if (strchr(keys[j].key, *string) != NULL) {
i = strlcat(buf, keys[j].repl, sizeof(buf));
if (i >= sizeof(buf))
fatal("percent_expand: string too long");
break;
}
}
if (j >= num_keys)
fatal("percent_expand: unknown key %%%c", *string);
}
return (xstrdup(buf));
#undef EXPAND_MAX_KEYS
}
/*
* Read an entire line from a public key file into a static buffer, discarding
* lines that exceed the buffer size. Returns 0 on success, -1 on failure.
@@ -397,3 +506,20 @@ read_keyfile_line(FILE *f, const char *filename, char *buf, size_t bufsz,
}
return -1;
}
char *
tohex(const u_char *d, u_int l)
{
char b[3], *r;
u_int i, hl;
hl = l * 2 + 1;
r = xmalloc(hl);
*r = '\0';
for (i = 0; i < l; i++) {
snprintf(b, sizeof(b), "%02x", d[i]);
strlcat(r, b, hl);
}
return (r);
}
+4 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: misc.h,v 1.21 2005/03/01 10:09:52 djm Exp $ */
/* $OpenBSD: misc.h,v 1.25 2005/07/14 04:00:43 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -24,6 +24,9 @@ char *hpdelim(char **);
char *cleanhostname(char *);
char *colon(char *);
long convtime(const char *);
char *tilde_expand_filename(const char *, uid_t);
char *percent_expand(const char *, ...) __attribute__((__sentinel__));
char *tohex(const u_char *, u_int);
struct passwd *pwcopy(struct passwd *);
@@ -35,10 +38,6 @@ struct arglist {
};
void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3)));
/* tildexpand.c */
char *tilde_expand_filename(const char *, uid_t);
/* readpass.c */
#define RP_ECHO 0x0001
+17 -16
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: moduli.c,v 1.10 2005/01/17 03:25:46 dtucker Exp $ */
/* $OpenBSD: moduli.c,v 1.12 2005/07/17 07:17:55 djm Exp $ */
/*
* Copyright 1994 Phil Karn <karn@qualcomm.com>
* Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@@ -112,22 +112,22 @@
#define TINY_NUMBER (1UL<<16)
/* Ensure enough bit space for testing 2*q. */
#define TEST_MAXIMUM (1UL<<16)
#define TEST_MINIMUM (QSIZE_MINIMUM + 1)
/* real TEST_MINIMUM (1UL << (SHIFT_WORD - TEST_POWER)) */
#define TEST_POWER (3) /* 2**n, n < SHIFT_WORD */
#define TEST_MAXIMUM (1UL<<16)
#define TEST_MINIMUM (QSIZE_MINIMUM + 1)
/* real TEST_MINIMUM (1UL << (SHIFT_WORD - TEST_POWER)) */
#define TEST_POWER (3) /* 2**n, n < SHIFT_WORD */
/* bit operations on 32-bit words */
#define BIT_CLEAR(a,n) ((a)[(n)>>SHIFT_WORD] &= ~(1L << ((n) & 31)))
#define BIT_SET(a,n) ((a)[(n)>>SHIFT_WORD] |= (1L << ((n) & 31)))
#define BIT_TEST(a,n) ((a)[(n)>>SHIFT_WORD] & (1L << ((n) & 31)))
#define BIT_CLEAR(a,n) ((a)[(n)>>SHIFT_WORD] &= ~(1L << ((n) & 31)))
#define BIT_SET(a,n) ((a)[(n)>>SHIFT_WORD] |= (1L << ((n) & 31)))
#define BIT_TEST(a,n) ((a)[(n)>>SHIFT_WORD] & (1L << ((n) & 31)))
/*
* Prime testing defines
*/
/* Minimum number of primality tests to perform */
#define TRIAL_MINIMUM (4)
#define TRIAL_MINIMUM (4)
/*
* Sieving data (XXX - move to struct)
@@ -144,7 +144,7 @@ static u_int32_t *LargeSieve, largewords, largetries, largenumbers;
static u_int32_t largebits, largememory; /* megabytes */
static BIGNUM *largebase;
int gen_candidates(FILE *, int, int, BIGNUM *);
int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);
int prime_test(FILE *, FILE *, u_int32_t, u_int32_t);
/*
@@ -241,19 +241,20 @@ sieve_large(u_int32_t s)
* The list is checked against small known primes (less than 2**30).
*/
int
gen_candidates(FILE *out, int memory, int power, BIGNUM *start)
gen_candidates(FILE *out, u_int32_t memory, u_int32_t power, BIGNUM *start)
{
BIGNUM *q;
u_int32_t j, r, s, t;
u_int32_t smallwords = TINY_NUMBER >> 6;
u_int32_t tinywords = TINY_NUMBER >> 6;
time_t time_start, time_stop;
int i, ret = 0;
u_int32_t i;
int ret = 0;
largememory = memory;
if (memory != 0 &&
(memory < LARGE_MINIMUM || memory > LARGE_MAXIMUM)) {
(memory < LARGE_MINIMUM || memory > LARGE_MAXIMUM)) {
error("Invalid memory amount (min %ld, max %ld)",
LARGE_MINIMUM, LARGE_MAXIMUM);
return (-1);
@@ -371,8 +372,8 @@ gen_candidates(FILE *out, int memory, int power, BIGNUM *start)
* fencepost errors, the last pass is skipped.
*/
for (smallbase = TINY_NUMBER + 3;
smallbase < (SMALL_MAXIMUM - TINY_NUMBER);
smallbase += TINY_NUMBER) {
smallbase < (SMALL_MAXIMUM - TINY_NUMBER);
smallbase += TINY_NUMBER) {
for (i = 0; i < tinybits; i++) {
if (BIT_TEST(TinySieve, i))
continue; /* 2*i+3 is composite */
@@ -548,7 +549,7 @@ prime_test(FILE *in, FILE *out, u_int32_t trials, u_int32_t generator_wanted)
* due to earlier inconsistencies in interpretation, check
* the proposed bit size.
*/
if (BN_num_bits(p) != (in_size + 1)) {
if ((u_int32_t)BN_num_bits(p) != (in_size + 1)) {
debug2("%10u: bit size %u mismatch", count_in, in_size);
continue;
}
+4 -4
View File
@@ -878,8 +878,8 @@ int
mm_answer_pam_query(int sock, Buffer *m)
{
char *name, *info, **prompts;
u_int num, *echo_on;
int i, ret;
u_int i, num, *echo_on;
int ret;
debug3("%s", __func__);
sshpam_authok = NULL;
@@ -912,8 +912,8 @@ int
mm_answer_pam_respond(int sock, Buffer *m)
{
char **resp;
u_int num;
int i, ret;
u_int i, num;
int ret;
debug3("%s", __func__);
sshpam_authok = NULL;
+12 -13
View File
@@ -25,7 +25,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: monitor_wrap.c,v 1.39 2004/07/17 05:31:41 dtucker Exp $");
RCSID("$OpenBSD: monitor_wrap.c,v 1.40 2005/05/24 17:32:43 avsm Exp $");
RCSID("$FreeBSD$");
#include <openssl/bn.h>
@@ -96,9 +96,9 @@ mm_request_send(int sock, enum monitor_reqtype type, Buffer *m)
PUT_32BIT(buf, mlen + 1);
buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */
if (atomicio(vwrite, sock, buf, sizeof(buf)) != sizeof(buf))
fatal("%s: write", __func__);
fatal("%s: write: %s", __func__, strerror(errno));
if (atomicio(vwrite, sock, buffer_ptr(m), mlen) != mlen)
fatal("%s: write", __func__);
fatal("%s: write: %s", __func__, strerror(errno));
}
void
@@ -106,24 +106,21 @@ mm_request_receive(int sock, Buffer *m)
{
u_char buf[4];
u_int msg_len;
ssize_t res;
debug3("%s entering", __func__);
res = atomicio(read, sock, buf, sizeof(buf));
if (res != sizeof(buf)) {
if (res == 0)
if (atomicio(read, sock, buf, sizeof(buf)) != sizeof(buf)) {
if (errno == EPIPE)
cleanup_exit(255);
fatal("%s: read: %ld", __func__, (long)res);
fatal("%s: read: %s", __func__, strerror(errno));
}
msg_len = GET_32BIT(buf);
if (msg_len > 256 * 1024)
fatal("%s: read: bad msg_len %d", __func__, msg_len);
buffer_clear(m);
buffer_append_space(m, msg_len);
res = atomicio(read, sock, buffer_ptr(m), msg_len);
if (res != msg_len)
fatal("%s: read: %ld != msg_len", __func__, (long)res);
if (atomicio(read, sock, buffer_ptr(m), msg_len) != msg_len)
fatal("%s: read: %s", __func__, strerror(errno));
}
void
@@ -768,7 +765,8 @@ mm_sshpam_query(void *ctx, char **name, char **info,
u_int *num, char ***prompts, u_int **echo_on)
{
Buffer m;
int i, ret;
u_int i;
int ret;
debug3("%s", __func__);
buffer_init(&m);
@@ -794,7 +792,8 @@ int
mm_sshpam_respond(void *ctx, u_int num, char **resp)
{
Buffer m;
int i, ret;
u_int i;
int ret;
debug3("%s", __func__);
buffer_init(&m);
Loaded 100 of 2025 files, more files were not shown because too many files have changed in this diff. Show more