Commit Graph

133512 Commits

Author SHA1 Message Date
Warner Losh
6cf684e14a Remove USBGETSOFTC, USB_ATTACH_START, USB_DETACH_START and
USB_DECLARE_DRIVER_INIT from the usb network drivers.
2007-06-17 18:46:26 +00:00
Yaroslav Tykhiy
997c6eefd8 Add PAM support to cron(8). Now cron(8) will skip commands scheduled
by unavailable accounts, e.g., those locked, expired, not allowed in at
the moment by nologin(5), or whatever, depending on cron's pam.conf(5).
This applies to personal crontabs only, /etc/crontab is unaffected.

In other words, now the account management policy will apply to
commands scheduled by users via crontab(1) so that a user can no
longer use cron(8) to set up a delayed backdoor and run commands
during periods when the admin doesn't want him to.

The PAM check is done just before running a command, not when loading
a crontab, because accounts can get locked, expired, and re-enabled
any time with no changes to their crontabs.  E.g., imagine that you
provide a system with payed access, or better a cluster of such
systems with centralized account management via PAM.  When a user
pays for some days of access, you set his expire field respectively.
If the account expires before its owner pays more, its crontab
commands won't run until the next payment is made.  Then it'll be
enough to set the expire field in future for the commands to run
again.  And so on.

Document this change in the cron(8) manpage, which includes adding
a FILES section and touching the document date.

X-Security: should benefit as users have access to cron(8) by default
2007-06-17 17:25:53 +00:00
Poul-Henning Kamp
5e521fcd2e This is a forced (and belated) commit to record that these files
were repocopied from src/tools/tools/recoverdisk
2007-06-17 16:53:45 +00:00
Marius Strobl
93d9bc3c0a Remove unused softc. 2007-06-17 16:44:08 +00:00
Warner Losh
fc5d431363 Expand USB_MATCH_START 2007-06-17 16:24:49 +00:00
Ariff Abdullah
ad8612b97a Add sysctl/tunable "hw.snd.default_auto", which is useful (especially
for non-root users) to automatically assign default unit to a newly
attach device like USB audio.
2007-06-17 16:15:56 +00:00
Ariff Abdullah
f368584146 Reassign default unit to a valid unit, be it during attach or detach.
If nothing is available, set to something that is purely ridiculous
so the next valid attach will notice it.

Tested by:	chibis
2007-06-17 15:53:11 +00:00
Scott Long
846199b736 Fix a compile error from the last change. 2007-06-17 15:21:09 +00:00
Randall Stewart
b8a1761e07 o style(9) nit.
o shorten explainations which are over 80 columns in console.
	o group rows
	o clean up and change explanations a little bit.
Obtained from:	weongyo.jeong@gmail.com
2007-06-17 14:45:28 +00:00
Yaroslav Tykhiy
54dd7f5c36 Note PAM support in atrun(8).
Sort FILES section while there.
Touch document date.
2007-06-17 14:02:31 +00:00
Hidetoshi Shimokawa
37b996e901 Document hw.firewire.phydma_enable knob. 2007-06-17 10:40:25 +00:00
Hidetoshi Shimokawa
072d350754 Increase buffer size of DV stream to prevent buffer
overrun caused by long blocking of file I/O (i.e. zfs).

MFC after: 3 days
2007-06-17 10:20:55 +00:00
Warner Losh
2e447a2d92 Remove USB_DO_ATTACH 2007-06-17 07:34:34 +00:00
Warner Losh
7a86867fc0 Expand USB_DO_ATTACH inline.
Remove device_t dv, since it is no longer needed.
Add sizeof(device_t) to replace sizeof dv.
Change device_detach(dev) to device_detach(dev->subdevs[i]) since the type
of dev isn't right!  Not sure when this was introduced, but it likely would
lead to a crash on disconnect.

MFC After: 1 week
2007-06-17 07:33:59 +00:00
Nate Lawson
eb988b9d42 Use bus_dma to get a page in the first 4 GB. Since the physical address
of the magic string is passed in a 32-bit register, we can't use high
memory in the PAE case.  This also eliminates a use of vtophys().

Tested by:	Jeff Shimbo <jts767 / gmail.com>
MFC after:	1 week
2007-06-17 07:18:23 +00:00
Ariff Abdullah
082f63835c Flush remaining malloc() cleanups (M_NOWAIT -> M_WAITOK). 2007-06-17 06:10:43 +00:00
Scott Long
b50569b71d Prepare for future integration between CAM and newbus. xpt_bus_register
now takes a device_t to be the parent of the bus that is being created.
Most SIMs have been updated with a reasonable argument, but a few exceptions
just pass NULL for now.  This argument isn't used yet and the newbus
integration likely won't be ready until after 7.0-RELEASE.
2007-06-17 05:55:54 +00:00
Matt Jacob
6eb9bbf329 Initialize key to zero. 2007-06-17 04:40:33 +00:00
Matt Jacob
739c673c8d Try a cheap way to get around gcc4.2 believing that user arguments
to system calls can change across intervening functions.
2007-06-17 04:37:57 +00:00
Kip Macy
bb38cd2fbc - switch adapter and port lock over to using sx so that resources
can be allocated atomically
- add debug macros for printing lock initialization / teardown
- add buffers to port_info and adapter to allow each lock to have a
  unique name
- destroy mutexes initialized by cxgb_offload_init
- remove recursive calls to ADAPTER_LOCK
- move callout_drain calls so that they don't occur with the lock held
- ensure that only as many qsets as are needed are initialized and
  destroyed

MFC after: 3 days
Sponsored by: Chelsio Inc.
2007-06-17 04:33:38 +00:00
Matt Jacob
60a35d3afd Initialize mouse resolution to zero if converting from
OLD to NEW.
2007-06-17 04:32:18 +00:00
Matt Jacob
7fc02735f4 Check for pte being NULL in return from pmap_pte_pde- unlikely or
even impossible, but it's better ot have a panic and a quiesced
gcc4.2.
2007-06-17 04:27:45 +00:00
Matt Jacob
27705ac087 Initialize lastaddr to zero to make gcc4.2 happy. 2007-06-17 04:21:58 +00:00
Matt Jacob
0a49733cb9 Don't declare inline a function which isn't. 2007-06-17 04:19:05 +00:00
Matt Jacob
6bda842d77 Make sure object is NULL- there is a possible case where you could
fall through to it being used w/o being set. Put a break in the default
case.
2007-06-17 04:17:48 +00:00
Matt Jacob
9dae729081 Initialize reqpage to zero. 2007-06-17 04:14:27 +00:00
Matt Jacob
0add0b912e gcc4.2 somehow doesn't believe that finaldst can stay stable between
where it's initialized and where it's checked twice such that the
origingal destination address is saved. Make it happier and trim
things down a bit.
2007-06-17 04:12:21 +00:00
Matt Jacob
cce418d3bf Make gcc4.2 happy and zero save_ip for the unlikely (blackhole != 0)
codepath.
2007-06-17 04:07:11 +00:00
Randall Stewart
3f8d71d596 - Forced commit to update who actually did this code (I forgot
the obtained from in the original line)
Obtained from:	Weongyo Jeong (weongyo.jeong@gmail.com)
2007-06-17 01:57:08 +00:00
Randall Stewart
e42a0f5e72 - For sctp_input/sctp6_input add announcment when a packet arrives (debug)
- re-factor the packet drop in sctp_output a bit more, we don't need the
   trim after all, but the size calc is now corrected.
 - When a assoc is in the COOKIE-ECHO/COOKIE-WAIT state and the user
   closes, it should not matter if data is queued, the assoc should be
   purged.
 - In error leg a missing free_chunk when iph comes in NULL (should not
   happen but just in case).
2007-06-17 01:36:02 +00:00
Xin LI
9ba2645aa7 Fix build on arm: time_t on arm is 64 bits while long is
32 bits, so subsequent compile time assertion:

	sizeof inf->stat.st_mtime <= sizeof sec

Would fail because of that.  This change is suitable for
general consumption as well, but fix it in our local
patchset as we are near a code freeze.

Submitted by:	cognet
2007-06-17 00:43:50 +00:00
Matt Jacob
27d65ef267 Replace incorrect local OFFSET_OF macro with the correct and generic
offsetof macro.
2007-06-17 00:33:34 +00:00
Matt Jacob
fbdd20a1ae Simplification to quiet a gcc4.2 warning. Just by setting match.s_addr
to nonzero you fulfill the same function as the variable 'cmp'. so you
might as well zero match and test against it later.

Reviewed by:	timeout on review request
2007-06-17 00:31:24 +00:00
Marius Strobl
aa785996fd - Make better use of the global chosen, memory and mmu handles instead
of obtaining them over and over again and pretending we could do
  anything useful without them (for chosen this includes adding a
  declaration and initializing it in OF_init()).
- In OF_init() if obtaining the memory or mmu handle fails just call
  OF_exit() instead of panic() as the loader hasn't initialized the
  console at these early stages yet and trying to print out something
  causes a hang. With OF_exit() one at least has a change to get back
  to the OFW boot monitor and debug the problem.
- Fix OF_call_method() on 64-bit machines (this is a merge of
  sys/dev/ofw/openfirm.c rev 1.6).
- Replace OF_alloc_phys(), OF_claim_virt(), OF_map_phys() and
  OF_release_phys() in the MI part of the loader with wrappers around
  OF_call_method() in the sparc64. Beside the fact that they duplicate
  OF_call_method() the formers should never have been in the MI part
  of the loader as contrary to the OFW spec they use two-cell physical
  addresses.
- Remove unused functions which are also MD dupes of OF_call_method().
- In sys/boot/sparc64/loader/main.c add __func__ to panic strings as
  different functions use otherwise identical panic strings and make
  some of the panic strings a tad more user-friendly instead of just
  mentioning the name of the function that returned an unexpected
  result.
2007-06-17 00:17:15 +00:00
Andrew Gallatin
4d69a9d061 Also mark writecombine as enabled when PAT is used to enable
it rather than MTRRs.
2007-06-17 00:09:51 +00:00
Marius Strobl
1dfe405372 - Don't register the over-temperature and power-fail interrupt
handlers as filter/"fast" handlers so shutdown_nice() can
  acquire the process lock.
- Use bus_{read,write}_8() instead of bus_space_{read,write}_8()
  in order to get rid of sc_bushandle and sc_bustag in the softc.
- Remove the banal and outdated comment above sbus_filter_stub().
2007-06-16 23:49:41 +00:00
Marius Strobl
b42d5b0994 - Use the newly introduced pcib_mtx spin lock to lock psycho_ce(),
allowing it to be a filter/"fast" handler. Locking the interrupt
  handlers with a spin lock is mainly a requirement in schizo(4)
  but as we ought to register the spin lock anyway it should not
  hurt to take advantage of it in psycho(4).
- Pass both a driver_filter_t and a driver_intr_t argument to
  psycho_set_intr(), allowing to get rid of the FAST interrupt
  flag hack.
- Don't register the over-temperature interrupt handler as filter/
  "fast" handler so shutdown_nice() can acquire the process lock.
- Use bus_{read,write}_8() instead of bus_space_{read,write}_8()
  in order to get rid of sc_bushandle and sc_bustag in the softc.
- Correct the debug output for adjusting the subordinate bus number.
- Remove the banal and outdated above psycho_filter_stub().
- Fix some white space nits.
2007-06-16 23:46:41 +00:00
Robert Watson
7251b7863c Rather than passing SUSER_RUID into priv_check_cred() to specify when
a privilege is checked against the real uid rather than the effective
uid, instead decide which uid to use in priv_check_cred() based on the
privilege passed in.  We use the real uid for PRIV_MAXFILES,
PRIV_MAXPROC, and PRIV_PROC_LIMIT.  Remove the definition of
SUSER_RUID; there are now no flags defined for priv_check_cred().

Obtained from:	TrustedBSD Project
2007-06-16 23:41:43 +00:00
Warner Losh
fab38de2d3 only register a ithread handler if the card requests an ithread
handler.
2007-06-16 23:33:57 +00:00
Marius Strobl
79be8b5082 - Remove zstty spin lock for no longer existing zs(4).
- Move the rtc_mtx spin lock out from under #ifdef SMP as it's just
  not SMP-specific.
- Add a new spin lock pcib_mtx for locking "fast" interrupt handlers
  of host-to-PCI bridge drivers on sparc64.
2007-06-16 23:30:57 +00:00
Marius Strobl
e87137e133 - In gem_bitwait() check that the bit clears/was set in the content
of the register rather than in the offset describing the register.
- In gem_reset_rx() let gem_bitwait() check for the Rx reset bit
  rather than the Tx reset bit to clear.

Obtained from:	OpenBSD (same/similar bugs being fixed)
2007-06-16 23:27:59 +00:00
Marius Strobl
c6d76cdb21 - Add support for sending IPIs with USIII and greater sun4u CPUs.
These CPUs use an enhanced layout of the interrupt vector dispatch
  and dispatch status registers in order to allow sending IPIs to
  multiple targets simultaneously. Thus support for these CPUs was
  put in a newly added cheetah_ipi_selected(). This is intended to
  be pointed to by cpu_ipi_selected, which now is a function pointer,
  in order to avoid cpu_impl checks once booted. Alternatively it
  can point to spitfire_ipi_selected(), which was renamed from
  cpu_ipi_selected(). Consequently cpu_ipi_send() was also renamed
  to spitfire_ipi_send() (there's no need for a cheetah equivalent
  of this so far). Initialization of the cpu_ipi_selected pointer
  and other requirements is done in mp_init(), which was renamed
  from mp_tramp_alloc(), as cpu_mp_start() isn't called on UP
  systems while cpu_ipi_selected() is. As a side-effect this allows
  to make mp_tramp static to sys/sparc64/sparc64/mp_machdep.c.
  For the sake of avoiding #ifdef SMP and for keeping the history in
  place cheetah_ipi_selected() and spitfire_ipi_{selected,send}()
  where not put into/moved to sys/sparc64/sparc64/{cheetah,spitfire}.c
- Add some CTASSERTs and KASSERTs ensuring that MAXCPU doesn't
  exceed the data types we use to store the CPU bit fields or the
  number of USIII and greater CPUs supported by the current
  cheetah_ipi_selected() implementation (which for JBus-CPUs is
  only 4; that should be fine though as according to OpenSolaris
  there are no sun4u machines with more than 4 JBus-CPUs).
- In cpu_mp_start() don't enumerate and start more than MAXCPU CPUs
  as we can't handle more than that.
- In cpu_mp_start() check for upa-portid vs. portid depending on
  cpu_impl for consistency with nexus(4).
- In spitfire_ipi_selected() add KASSERTs ensuring that a CPU isn't
  told to IPI itself as sun4u CPUs just can't do that.
- In spitfire_ipi_send() do a MEMBAR #Sync after writing the
  interrupt vector data as we want to make sure the payload was
  actually written before we trigger the dispatch.
- In spitfire_ipi_send() also verify IDR_BUSY when checking whether
  the dispatch was successful as it has to be cleared for this to
  be the case.
- Remove some redundant variables.
2007-06-16 23:26:00 +00:00
Marius Strobl
fdfba0e5ff - Flesh out the support for the EBus variant which actually is the
RTC function of a National Semiconductor PC87317/PC97317. This
  consists of using the century register the same way Solaris does
  for compatibility reasons. Once there is a MD power(4) we'd also
  want to interface the APC (Advanced Power Control) functionality
  of the same chip function with it.
- Use a macro for the device description and take advantage of
  ISA_PNP_PROBE() setting the device description.
- Use the generated typedefs for the prototypes of the device
  interface functions.
2007-06-16 23:17:23 +00:00
Marius Strobl
40fa5858b1 Export mc146818_def_{read,write}() so the front-end can make use
of them if needed.
2007-06-16 23:10:00 +00:00
Marius Strobl
449b1a1f66 Remove the code for displaying the OFW hostid during boot for the
reasons outlined in the comment removed along with it, because the
OFW hostid has no real meaning for FreeBSD and mainly so the OFW
hostid is not confused with the FreeBSD hostid.
2007-06-16 23:07:53 +00:00
Marius Strobl
adc4099183 In OF_init() check the return value of OF_getprop().
Found with:	Coverity Prevent(tm)
CID:		679
2007-06-16 22:34:16 +00:00
Marius Strobl
838f76c0a9 - Restore the machine independency of sys/dev/ofw/openfirm.{c,h} by
moving OF_set_mmfsa_traptable() (SUNW,set-trap-table with the two
  arguments used here is specific to sun4v) to MD code.
- In sys/dev/ofw/openfirm.h remove prototypes for unimplemented
  functions and unused Solaris compatibility macros.
2007-06-16 22:30:38 +00:00
Marius Strobl
c54e7ea989 Move the gallant 12 x 22 font data from a .h to a .c so it doesn't need
to be compiled into every driver making use of it. Use a const instance
of struct gfb_font for this as the font isn't intended to be changed at
run-time and in order to accompany the font data with height and width
info.
2007-06-16 21:48:50 +00:00
Marius Strobl
555f163cd2 - Remove dupe and unused declarations and prototypes.
- Add missing prototypes.
- Define global variables not used outside of this module as static.
- Replace some outdated hard-coded functions names in panic strings
  with __func__.
- Fix some style(9) bugs.
2007-06-16 21:46:15 +00:00
Marius Strobl
7d62dd366b Sync the styles of sys/boot/ofw/libofw/openfirm.c and
sys/dev/ofw/openfirm.c with themselves, with each-other
and with style(9).
2007-06-16 21:38:04 +00:00