Commit Graph

488 Commits

Author SHA1 Message Date
christos 6536944397 eval arguments one more time so that quoting works. 2008-10-11 17:28:03 +00:00
apb 9b7231008d Move default route configuration after interface alias address
configuration, in case people have default routes over aliased
addresses.
2008-09-26 10:31:46 +00:00
apb c44f01fe5d remove an unecessary "eval" 2008-09-20 14:22:57 +00:00
apb 94f952dfe5 * Allow multiple commands in $ifconfig_xxN variables in rc.conf(5).
This may be done either by embedding newlines in the value,
  or by using semicolons to represent line breaks (but not both at once).
* Allow shell quoting insode $ifconfig_xxN variables or /etc/ifconfig.xxN
  files.  This allows something like ifconfig_wi0="ssid 'my network'; dhcp"
2008-09-20 12:12:38 +00:00
reed 2ae533f9b5 Use absolute path for various /sbin tools.
This is consistent with several other rc.d scripts
and fixes problem with /sbin not in PATH.

(Tested several times for over three weeks, but not all
parts of this code were used by me.)
2008-07-24 19:48:19 +00:00
yamt fff57c5525 merge yamt-pf42 branch.
(import newer pf from OpenBSD 4.2)

ok'ed by peter@.  requested by core@
2008-06-18 09:06:25 +00:00
joerg 32455b2087 Allow per-interface DHCP configuration using dhcpcd via
ifconfig_xxN=dhcp or a dhcp line in /etc/ifconfig.xxN.
2008-05-29 15:38:35 +00:00
plunky 486e4624e5 some changes to serial bluetooth host controller interfaces
btuartd(8) should be named btattach(8) for consistency
with other parts of NetBSD

make btattach(8) a single-use tool for less complexity

device specicific initialisation (from btuart(4)) is carried
out prior to activating the line discipline (in btattach(8)),
which simplifies the API somewhat and means that the user
tool and the kernel do not need to be kept in sync.

btuart(4) driver is much reduced; naming is made consistent
and all tsleep() and delay() are removed to userland
2008-04-15 11:17:47 +00:00
tron 634457e76e Print out a message explaining why the system is rebooting if the root
filesystem is modified by fsck(8).
2008-03-02 21:31:30 +00:00
tron 5acd6cb052 Don't try to shutdown amd(8) gracefully. It seems to cause problems for
more people than the old (also broken) behavior. This fixes PR bin/36506
and PR bin/38103.
2008-02-25 22:12:42 +00:00
christos 3a24c02f26 cleanup fsck error handling:
1. explain what each error means
2. remove 130 (128 + 2) which was presumably there because fsck_msdos did
   not handle SIGINT properly
2008-02-24 01:05:35 +00:00
reed f8fd203aa2 Add comment to point to manual page for details. 2008-01-31 15:21:32 +00:00
lukem 114e456e17 Ensure kdc starts after syslogd and ntpdate. 2008-01-16 23:58:26 +00:00
mjf d4a648c345 Implement a new magic string for magic symlinks, @ruid, which exapnds to the
real user id of the process and use this magic string for per-user tmp.
This should fix PR/35687

Kernel parts reviewed by wrstuden@
2007-12-04 22:09:01 +00:00
xtraeme 2026f84dc1 Only print the message if the command ran successfully. 2007-10-07 05:30:56 +00:00
xtraeme 4b431f1771 Update for the new configuration file format for envstat(8)
and the envsys framework.

The rc.d has been simplified vastly... the configuration file now
is more powerful than ever!
2007-10-07 04:19:06 +00:00
pavel d4b5db05c7 Add some magic (similar to the one in rc.d/sendmail introduced with 2.0
release) to not start postfix if $postfix is not explicitely set and
another mailer is selected in /etc/mailer.conf. Also print a warning if it
happens because the mailer in rc.conf is the removed sendmail.

This prevents starting two MTAs at once if one uses a custom MTA.

As proposed on tech-userlevel, approved by martin.
2007-08-27 10:59:05 +00:00
dyoung ea3cf9a639 Let an rc variable, sysdb=YES|NO, control the building of the system
databases.  Defaults to YES.
2007-08-26 23:55:50 +00:00
apb e2832b6345 Back out previous (which worked but made the code harder to understand),
and implement a different method of avoiding a "-0" result.
2007-08-25 07:07:39 +00:00
martin fe7b5be8b0 Cosmetics: print 0 instead of -0.
From Zafer Aydogan in PR bin/36831.
2007-08-24 17:02:32 +00:00
xtraeme 66c5665356 - Ignore lines with desc at start/stop time, this target must be used
manually.
- Ignore lines with rfact at stop time, they cannot be stopped.

Reported by wiz@.
2007-07-25 12:47:44 +00:00
plunky 2134bb0314 add requirement for bthcid since devices may need to authenticate 2007-07-23 18:06:56 +00:00
ad 96d0aa8e9b fixsb has done its job. 2007-07-14 21:20:31 +00:00
xtraeme bca6ba70fe Add the /etc/rc.d/envsys script required by envsys2. 2007-07-01 08:01:29 +00:00
christos a77bf0b003 check if the source exists, not that it is a file. Reported by
Blair Sadewitz
2007-05-16 01:24:42 +00:00
elad 6700cfccd6 Some Veriexec stuff that's been rotting in my tree for months.
Bug fixes:
  - Fix crash reported by Scott Ellis on current-users@.

  - Fix race conditions in enforcing the Veriexec rename and remove
    policies. These are NOT security issues.

  - Fix memory leak in rename handling when overwriting a monitored
    file.

  - Fix table deletion logic.

  - Don't prevent query requests if not in learning mode.


KPI updates:
  - fileassoc_table_run() now takes a cookie to pass to the callback.

  - veriexec_table_add() was removed, it is now done internally. As a
    result, there's no longer a need for VERIEXEC_TABLESIZE.

  - veriexec_report() was removed, it is now internal.

  - Perform sanity checks on the entry type, and enforce default type
    in veriexec_file_add() rather than in veriexecctl.

  - Add veriexec_flush(), used to delete all Veriexec tables, and
    veriexec_dump(), used to fill an array with all Veriexec entries.


New features:
  - Add a '-k' flag to veriexecctl, to keep the filenames in the kernel
    database. This allows Veriexec to produce slightly more accurate
    logs under certain circumstances. In the future, this can be either
    replaced by vnode->pathname translation, or combined with it.

  - Add a VERIEXEC_DUMP ioctl, to dump the entire Veriexec database.
    This can be used to recover a database if the file was lost.
    Example usage:

        # veriexecctl dump > /etc/signatures

    Note that only entries with the filename kept (that is, were loaded
    with the '-k' flag) will be dumped.

    Idea from Brett Lymn.

  - Add a VERIEXEC_FLUSH ioctl, to delete all Veriexec entries. Sample
    usage:

        # veriexecctl flush

  - Add a 'veriexec_flags' rc(8) variable, and make its default have
    the '-k' flag. On systems using the default signatures file
    (generaetd from running 'veriexecgen' with no arguments), this will
    use additional 32kb of kernel memory on average.

  - Add a '-e' flag to veriexecctl, to evaluate the fingerprint during
    load. This is done automatically for files marked as 'untrusted'.


Misc. stuff:
  - The code for veriexecctl was massively simplified as a result of
    eliminating the need for VERIEXEC_TABLESIZE, and now uses a single
    pass of the signatures file, making the loading somewhat faster.

  - Lots of minor fixes found using the (still under development)
    Veriexec regression testsuite.

  - Some of the messages Veriexec prints were improved.

  - Various documentation fixes.


All relevant man-pages were updated to reflect the above changes.

Binary compatibility with existing veriexecctl binaries is maintained.
2007-05-15 19:47:43 +00:00
christos a14fdbbe78 don't attempt to build the db file if the src file does not exist. 2007-05-13 17:23:56 +00:00
christos 2f776ce02e Move .db files for services and netgroup to /var/db per gimpy's request. 2007-05-10 17:45:50 +00:00
christos f3418d6240 - don't trash utmp{,x} needlessly
- also support netgroup services and password
- pretty print
2007-05-08 20:33:59 +00:00
tron e848cdf438 Terminate amd(8) gracefully during system shutdown.
This should avoid occasional problems with syncing or unmounting
filesystems on machines which use the automounter. Tested
successfully under NetBSD-i386 3.1_STABLE and 4.0_BETA2.
2007-04-23 14:27:30 +00:00
tron 01f7150efa The "routed" and "route6d" scripts must be run early during system startup
because they are part of the network initialization. Use similar
dependences as the "rtsold" script.

This should fix PR misc/36171.
2007-04-21 15:20:07 +00:00
apb 31edfc6f0f * Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process.  The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
  replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
2007-04-06 14:20:08 +00:00
mishka 833cf25850 Provide yet more functionality to wscons.conf's "setvar" (see
examples in the wscons.conf). Now, you have to specify wscons
control device and put variable name and parameter on separate
fields.

NB: changes ARE NOT backward compatible and config file must be
checked (but default config doesn't utilizing setvar).
2007-04-02 12:42:42 +00:00
plunky c6f8856e3c For sdpd(8), change default user/group from nobody/nobody to _sdpd/_sdpd 2007-03-18 15:53:54 +00:00
abs bde6709836 Ignore comment (starting with #) lines in mixerctl.conf 2007-03-16 22:30:22 +00:00
briggs d298894138 Install sys/dev/bluetooth/btuart.h.
Descend into and build/install usr.sbin/btuartd.
Install etc/rc.d/btuartd.
2007-02-20 21:29:08 +00:00
kiyohara 10abd6f2e2 Supprot Bluetooth HCI UART (H4) driver and daemon. 2007-02-20 16:53:20 +00:00
tron 8704d644d4 Remove unnessary "if [ X"$foo" ... ]" hack which is not necessary if
you quote things properly which this script does.
2007-02-15 13:27:35 +00:00
xtraeme da18ab0b5b * Use checkyesno rather than using a harcoded value.
* If per_user_tmp is disabled and /tmp equals to ${per_user_tmp_dir}/@uid,
  remove it and recreate it with proper permissions (1777).

This fixes the problem when per_user_tmp is enabled and will put /tmp
on its original state when it's disabled.
2007-02-15 08:47:38 +00:00
xtraeme 6092e365cb Add missing quotes in readlink to compare with ${per_user_tmp_dir}/@uid,
to avoid an error about missing operator.
2007-02-15 08:44:34 +00:00
reed b173114f5c Fix typo/mispelling in comment. 2007-02-10 19:40:58 +00:00
elad 97d944e80d Use 0555 for the real tmp dir for now. 2007-02-06 16:54:27 +00:00
elad d488983ed2 Only override /tmp if needed. From perry@. 2007-02-05 01:47:48 +00:00
xtraeme a5c172888b Use mkdir -p to create ${per_user_tmp_dir}, otherwise if /private (this is
the default) doesn't exist there won't be any error.
2007-02-04 18:28:26 +00:00
xtraeme 470eb9feca Install the perusertmp file. 2007-02-04 16:36:07 +00:00
elad 5e2e282f9c Add support for per-user /tmp.
Enabled via per_user_tmp in /etc/rc.conf (default off).

See security(8) and rc.conf(5) for more details.

Lots of input from thorpej@ & christos@, thanks!
2007-02-04 08:19:26 +00:00
christos 3353f7d077 goodbye uucp 2006-11-12 01:20:00 +00:00
elad 4c99077841 PR/31497: Robert Elz: rc.d/accounting should have KEYWORD: shutdown 2006-10-08 18:08:39 +00:00
elad debd0acd05 Back out previous. This was a dup of PR/29144 that was fixed differently.
Thanks to pavel@ for pointing out, okay oster@.
2006-10-07 23:08:03 +00:00
rpaulo 6080ffe830 PR 30716: rc.d/ntpd{,ate} precedes rc.d/rtsold. By Ed Hynan.
rc.d/rtsold should be in the same start up line as dhclient.
2006-10-07 21:41:41 +00:00
rpaulo 20c84defc6 PR 34692: wpa_supplicant script.
By Jukka Salmi.
2006-10-07 20:52:52 +00:00
rpaulo e3c4f7c039 PR 34692: wpa_supplicant script.
By Jukka Salmi.
2006-10-07 16:50:34 +00:00
elad 0141f6f58f PR/22340: Benedikt Meurer: cleartmp should honor ifile on LFS
Patch applied, thanks!
2006-10-07 07:01:21 +00:00
riz 7338f92d29 Trap SIGINT so that if fsck is interrupted by ^C, we drop into single-user
mode.  Fixes misc/29822 from der Mouse, fix from Arnaud Lacombe with
comment rework by me.
2006-10-07 04:11:23 +00:00
sketch de3bf5da0e Tidy output so it matches other rc scripts. 2006-10-01 15:17:51 +00:00
plunky 4f1cbddc12 update to bluetooth device attachment:
remove pseudo-device btdev(4) and inherent limitations

add bthub(4) which autoconfigures at bluetooth controllers as they
are enabled. bluetooth devices now attach here.

btdevctl(8) and its cache is updated to handle new semantics

etc/rc.d/btdevctl is updated to configure devices from a list
in /etc/bluetooth/btdevctl.conf
2006-09-10 15:45:55 +00:00
christos 156b02eae7 make postconf configurable 2006-09-07 15:26:08 +00:00
christos 4f593623cc - find the correct newaliases program from postconf
(suggested by Geert Hendrickx)
- only check for hash files.
2006-09-07 14:16:55 +00:00
christos e32e513967 Find the alias file name from the postfix configuration. From our anonymous
user.
2006-09-05 22:10:51 +00:00
plunky 99a7113fbc Fix typo in variable name 2006-08-14 18:55:18 +00:00
plunky 885b13c515 rename btcontrol(8) as btdevctl(8) to make it fit with the NetBSD naming
scheme for control programs. This fixes pr 34051.
2006-08-13 09:03:21 +00:00
dyoung 08605a2dd4 Per lukem's request, revert previous change which skipped installation
of /etc/rc.d/ipfilter and family if MKIPFILTER=no.  As lukem points
out, skipping installation of etc/rc.d/ scripts is not inconsistent
with other optional components, such as pf, x11, etc.
2006-08-07 02:08:47 +00:00
dyoung 50097c84af Only install ipfilter, ipfs, ipmon, and ipnat if MKIPFILTER=no. 2006-08-05 17:26:14 +00:00
tron fdeefd9c3e Bluetooth fixes by Iain Hibbert:
Create "/etc/rc.d/btcontrol" to attach bluetooth devices at boot.
2006-07-26 11:14:55 +00:00
gdamore a5c89047c0 Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.)  This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
2006-06-19 15:44:33 +00:00
christos 8ab9b7b454 PR/33760: dieter roelants: a default install can't send mail due to
missing aliases.db
2006-06-18 14:05:34 +00:00
rpaulo 9637f337f2 s/mountall/mountcritremote/
Noticed by Jukka Salmi.
2006-06-02 01:06:16 +00:00
christos ace25de76c Remove sendmail (approved by core) 2006-05-30 00:40:22 +00:00
simonb c1cf826a2c In the rc.d file list, start a new line for each first letter of
the rc.d scripts.  Indent by an extra tab to match indentation of
usr.sbin/postinstall/postinstall
2006-05-14 15:43:54 +00:00
rpaulo b70b378d36 add missing files 2006-04-30 19:57:07 +00:00
rpaulo 80cb906203 Add a script to start irdaattach on boot. 2006-04-30 15:18:19 +00:00
rpaulo 32cb3ed274 Remove wrong comment. 2006-04-30 13:00:04 +00:00
rpaulo 6971718ee3 rc script to control hostapd. 2006-04-30 12:54:26 +00:00
blymn f79b447e34 Fix rtc offset calculation for timezones that are not integral hours. 2006-04-26 09:57:01 +00:00
hubertf 831546110a When switching the /etc/etc.current symlink, make it relative to /etc,
not absolute.

This affects an update with sysinst, which will try to look at
/targetroot/etc/fstab, which points to /etc/etc.whatever, which is
not there during the upgrade, and results in all (/targetroot)/etc
files getting nuked!
2006-04-23 23:26:26 +00:00
agc 2235f2dadf Add distribution entries and supporting files for the iSCSI target. 2006-02-08 19:02:58 +00:00
peter 3c194e239e Add an extra argument to "setvar" to indicate whether a keyboard,
display or mouse variable should be changed. This is backwards compatible
with the old setvar style: if the argument is not specified, it defaults
to `keyboard'.
2005-12-13 21:46:47 +00:00
christos 6491f15ca3 fix migration problems:
1. missing slash created namedb127 files in the dest dir.
2. /etc/named.conf was not getting migrated.
2005-11-29 21:07:25 +00:00
rpaulo 7acb962baa RFC 3879 deprecated the IPv6 site-local prefix (fec0::/10):
* remove all references to $ip6sitelocal and output a warning
    message if the variable is defined.
    * introduce $ip6uniquelocal (defaults to 'NO') that will control the
    behaviour of the system when $ip6mode is ``router'' (i.e. fc00::/7
    will not be routed if the variable is ``NO'') as per RFC 4193.

Thanks to Jonathan A. Kollasch for pointing this out in PR 32152.
2005-11-24 17:28:45 +00:00
elad 07a01daf00 Load Veriexec signatures after mountall. Use veriexec_strict and
veriexec_verbose to set strict level and verbose level in rc.conf.
Defaults are 0.
2005-10-15 23:26:30 +00:00
elad 78df0b1930 Revert previous commit; I'll find a better solution. 2005-10-11 21:36:11 +00:00
elad d8980923a4 We need mountall here. 2005-10-11 21:24:09 +00:00
peter 9c1da17e90 pf needs to be started after the network is up, because some pf rules
derive IP address(es) from the interface (e.g "... from any to fxp0").
This however, creates window for possible attacks from the network.

Implement the solution proposed by YAMAMOTO Takashi:
Add /etc/defaults/pf.boot.conf and load it with the /etc/rc.d/pf_boot
script before starting the network. People who don't like the default
rules can override it with their own /etc/pf.boot.conf.
The default rules have been obtained from OpenBSD.

No objections on: tech-security
2005-08-23 12:12:56 +00:00
peter ad9c34ce5c Changes suggested by lukem:
1. Order pf to start before the network is configured.

2. If the pf_rules cannot be found at boot time, abort the boot (from the
   ipfilter script).
2005-08-10 13:52:05 +00:00
peter c9c458f33c Add command_args="-D" to the ftpd rc.d script. This flag is always needed
when running ftpd as daemon and it will now automatically be appended to the
command line, even if ftpd_flags doesn't have it.

Suggested by Alan Barrett and Luke Mewburn, thanks.
2005-08-09 14:59:33 +00:00
peter 9cfba4bb75 Add a note telling that ftpd_flags should always contain "-D".
Suggested by lukem@.
2005-08-08 00:19:37 +00:00
peter d0b18db569 Allow to change the location of the pf ruleset with the variable $pf_rules. 2005-08-07 01:03:39 +00:00
peter f74a86ef4f Add the new ftpd rc.d script. 2005-08-04 22:32:44 +00:00
peter 7eb092e6c3 Add rc.d support for standalone ftpd, suggested by perry@. 2005-08-04 22:28:17 +00:00
christos 0e7146df89 Improve on the migration bit. Check if files are different, and if not,
remove the source and leave a symlink behind. Otherwise, let the user know.
2005-07-17 21:28:45 +00:00
christos a2663103c5 Copy and link files to allow a chrooted named to start-up automatically. 2005-07-17 16:30:57 +00:00
symka 87283c876e PR/29317: ifconfig.if does not allow parameters with spaces
OKeyd by christos@
2005-06-28 13:36:40 +00:00
elad faffb35d60 Run veriexec before securelevel and sysctl scripts. Suggested by Nino Dehne. 2005-06-15 18:49:40 +00:00
cjs 2dc0814b72 Make ifaliases_lo0 in rc.conf work just like other interfaces (instead of
being ignored). Also, when configuring aliases set as ifaliases_xxN,
print out the interface name and the alias address.
2005-04-26 10:28:29 +00:00
blymn 8387760ed1 Rototill of the verified exec functionality.
* We now use hash tables instead of a list to store the in kernel
    fingerprints.
  * Fingerprint methods handling has been made more flexible, it is now
    even simpler to add new methods.
  * the loader no longer passes in magic numbers representing the
    fingerprint method so veriexecctl is not longer kernel specific.
  * fingerprint methods can be tailored out using options in the kernel
    config file.
  * more fingerprint methods added - rmd160, sha256/384/512
  * veriexecctl can now report the fingerprint methods supported by the
    running kernel.
  * regularised the naming of some portions of veriexec.
2005-04-20 13:44:45 +00:00
lukem 8232ca0162 Tweaks for the move of postinstall from /etc to /usr/sbin 2005-04-17 23:12:40 +00:00
lukem c0372ca1ef ypserv(8) doesn't need the domainname(1) set -- it will serve any maps
present under /var/yp/<somedomain>/<map> -- so don't require it.
Thanks to Chuck Cranor for the suggestion.
2005-04-01 23:25:29 +00:00
tron 878fa2f707 Replace hardcoded "/var/run/named.pid" with ${pidfile}. 2005-03-17 18:44:09 +00:00
peter 80f533ce07 Do a "flush all" when disabling pf. This also changes the restart case
to do a "flush all", while the reload case will only reload the rules without
flushing anything.

Suggested by Miles Nordin.
2005-03-15 18:22:03 +00:00
lukem f198807ca5 Explicitly REQUIRE mountcritremote, since this uses awk. 2005-03-15 12:06:12 +00:00