PERFORCE change 114067 for review

Warner Losh imp at FreeBSD.org
Mon Feb 5 18:19:59 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=114067

Change 114067 by imp at imp_paco-paco on 2007/02/05 18:19:38

	IFC @114060

Affected files ...

.. //depot/projects/arm/src/etc/periodic/security/800.loginfail#2 integrate
.. //depot/projects/arm/src/lib/libarchive/archive_read.c#8 integrate
.. //depot/projects/arm/src/lib/libarchive/archive_read_support_compression_none.c#7 integrate
.. //depot/projects/arm/src/sbin/ifconfig/af_inet6.c#3 integrate
.. //depot/projects/arm/src/sbin/ifconfig/ifconfig.8#11 integrate
.. //depot/projects/arm/src/sbin/init/init.c#2 integrate
.. //depot/projects/arm/src/sbin/mount/Makefile#2 integrate
.. //depot/projects/arm/src/sbin/mount/mount.c#5 integrate
.. //depot/projects/arm/src/sbin/quotacheck/quotacheck.c#4 integrate
.. //depot/projects/arm/src/share/man/man4/altq.4#4 integrate
.. //depot/projects/arm/src/share/man/man4/aue.4#3 integrate
.. //depot/projects/arm/src/share/man/man4/bce.4#5 integrate
.. //depot/projects/arm/src/share/man/man4/ipw.4#3 integrate
.. //depot/projects/arm/src/share/man/man4/iwi.4#2 integrate
.. //depot/projects/arm/src/share/man/man4/man4.arm/npe.4#2 integrate
.. //depot/projects/arm/src/share/man/man4/ral.4#3 integrate
.. //depot/projects/arm/src/share/man/man4/tap.4#2 integrate
.. //depot/projects/arm/src/share/man/man4/tun.4#3 integrate
.. //depot/projects/arm/src/share/man/man4/ubsa.4#3 integrate
.. //depot/projects/arm/src/share/man/man4/udav.4#2 integrate
.. //depot/projects/arm/src/share/man/man4/ural.4#3 integrate
.. //depot/projects/arm/src/share/man/man5/quota.user.5#2 integrate
.. //depot/projects/arm/src/share/syscons/keymaps/hr.iso.kbd#2 integrate
.. //depot/projects/arm/src/sys/arm/arm/pmap.c#31 integrate
.. //depot/projects/arm/src/sys/arm/at91/if_ate.c#69 integrate
.. //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#28 integrate
.. //depot/projects/arm/src/sys/boot/common/loader.8#7 integrate
.. //depot/projects/arm/src/sys/boot/forth/loader.conf#12 integrate
.. //depot/projects/arm/src/sys/conf/files#62 integrate
.. //depot/projects/arm/src/sys/conf/kmod.mk#14 integrate
.. //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#32 integrate
.. //depot/projects/arm/src/sys/dev/ata/ata-pci.c#9 integrate
.. //depot/projects/arm/src/sys/dev/ata/ata-pci.h#18 integrate
.. //depot/projects/arm/src/sys/dev/atkbdc/psm.c#6 integrate
.. //depot/projects/arm/src/sys/dev/pccard/pccard.c#5 integrate
.. //depot/projects/arm/src/sys/dev/sound/pcm/ac97_patch.c#4 integrate
.. //depot/projects/arm/src/sys/dev/sound/pcm/ac97_patch.h#4 integrate
.. //depot/projects/arm/src/sys/dev/usb/if_aue.c#11 integrate
.. //depot/projects/arm/src/sys/dev/usb/ubsa.c#4 integrate
.. //depot/projects/arm/src/sys/dev/usb/uhub.c#4 integrate
.. //depot/projects/arm/src/sys/dev/usb/uipaq.c#2 integrate
.. //depot/projects/arm/src/sys/dev/usb/usb_subr.c#12 integrate
.. //depot/projects/arm/src/sys/dev/usb/usbdevs#25 integrate
.. //depot/projects/arm/src/sys/dev/usb/uvisor.c#6 integrate
.. //depot/projects/arm/src/sys/kern/kern_conf.c#9 integrate
.. //depot/projects/arm/src/sys/kern/subr_firmware.c#8 integrate
.. //depot/projects/arm/src/sys/kern/uipc_socket.c#31 integrate
.. //depot/projects/arm/src/sys/net/if_tap.c#10 integrate
.. //depot/projects/arm/src/sys/net/if_tun.c#9 integrate
.. //depot/projects/arm/src/sys/net80211/ieee80211_input.c#14 integrate
.. //depot/projects/arm/src/sys/netinet/in.c#7 integrate
.. //depot/projects/arm/src/sys/netinet/ip_fastfwd.c#8 integrate
.. //depot/projects/arm/src/sys/netinet/ip_fw2.c#27 integrate
.. //depot/projects/arm/src/sys/netinet/ip_input.c#15 integrate
.. //depot/projects/arm/src/sys/netinet6/ah_core.c#4 integrate
.. //depot/projects/arm/src/sys/netinet6/nd6.c#13 integrate
.. //depot/projects/arm/src/sys/sys/conf.h#7 integrate
.. //depot/projects/arm/src/sys/sys/lock.h#9 integrate
.. //depot/projects/arm/src/sys/ufs/ffs/ffs_rawread.c#5 integrate
.. //depot/projects/arm/src/sys/ufs/ufs/ufs_quota.c#13 integrate
.. //depot/projects/arm/src/sys/vm/vm_contig.c#12 integrate
.. //depot/projects/arm/src/sys/vm/vm_page.c#24 integrate
.. //depot/projects/arm/src/sys/vm/vm_pageq.c#11 integrate
.. //depot/projects/arm/src/sys/vm/vm_zeroidle.c#9 integrate
.. //depot/projects/arm/src/tools/regression/netinet/ipsockopt/ipsockopt.c#2 integrate
.. //depot/projects/arm/src/usr.bin/ctags/C.c#2 integrate
.. //depot/projects/arm/src/usr.bin/ctags/fortran.c#2 integrate
.. //depot/projects/arm/src/usr.bin/ctags/tree.c#2 integrate
.. //depot/projects/arm/src/usr.bin/getent/getent.c#2 integrate
.. //depot/projects/arm/src/usr.bin/ncplist/ncplist.c#2 integrate
.. //depot/projects/arm/src/usr.bin/ncplogin/ncplogin.c#2 integrate
.. //depot/projects/arm/src/usr.bin/quota/quota.c#4 integrate
.. //depot/projects/arm/src/usr.sbin/apmd/apmd.c#2 integrate
.. //depot/projects/arm/src/usr.sbin/apmd/contrib/pccardq.c#2 integrate
.. //depot/projects/arm/src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c#4 integrate
.. //depot/projects/arm/src/usr.sbin/edquota/edquota.8#2 integrate
.. //depot/projects/arm/src/usr.sbin/edquota/edquota.c#3 integrate
.. //depot/projects/arm/src/usr.sbin/mountd/mountd.8#2 integrate
.. //depot/projects/arm/src/usr.sbin/mountd/mountd.c#5 integrate
.. //depot/projects/arm/src/usr.sbin/pciconf/Makefile#2 integrate
.. //depot/projects/arm/src/usr.sbin/pciconf/cap.c#1 branch
.. //depot/projects/arm/src/usr.sbin/pciconf/pciconf.8#2 integrate
.. //depot/projects/arm/src/usr.sbin/pciconf/pciconf.c#2 integrate
.. //depot/projects/arm/src/usr.sbin/pciconf/pciconf.h#1 branch
.. //depot/projects/arm/src/usr.sbin/quotaon/quotaon.c#3 integrate
.. //depot/projects/arm/src/usr.sbin/repquota/repquota.c#2 integrate

Differences ...

==== //depot/projects/arm/src/etc/periodic/security/800.loginfail#2 (text+ko) ====

@@ -24,7 +24,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/etc/periodic/security/800.loginfail,v 1.6 2006/03/05 15:45:38 matteo Exp $
+# $FreeBSD: src/etc/periodic/security/800.loginfail,v 1.7 2007/02/05 16:36:25 jdp Exp $
 #
 
 # Show login failures
@@ -59,7 +59,7 @@
     [Yy][Ee][Ss])
 	echo ""
 	echo "${host} login failures:"
-	n=$(catmsgs | grep -ia "^$yesterday.*(fail|invalid|bad|illegal)" |
+	n=$(catmsgs | egrep -ia "^$yesterday.*(fail|invalid|bad|illegal)" |
 	    tee /dev/stderr | wc -l)
 	[ $n -gt 0 ] && rc=1 || rc=0;;
     *)	rc=0;;

==== //depot/projects/arm/src/lib/libarchive/archive_read.c#8 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.28 2007/02/01 06:18:16 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.29 2007/02/05 16:30:40 cperciva Exp $");
 
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
@@ -65,10 +65,8 @@
 	unsigned char	*nulls;
 
 	a = (struct archive *)malloc(sizeof(*a));
-	if (a == NULL) {
-		archive_set_error(a, ENOMEM, "Can't allocate archive object");
+	if (a == NULL)
 		return (NULL);
-	}
 	memset(a, 0, sizeof(*a));
 
 	a->user_uid = geteuid();

==== //depot/projects/arm/src/lib/libarchive/archive_read_support_compression_none.c#7 (text+ko) ====

@@ -24,7 +24,7 @@
  */
 
 #include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.13 2007/01/09 08:05:55 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.14 2007/02/05 16:30:40 cperciva Exp $");
 
 #include <assert.h>
 #ifdef HAVE_ERRNO_H
@@ -301,7 +301,11 @@
 	/*
 	 * If a client_skipper was provided, try that first.
 	 */
+#if ARCHIVE_API_VERSION < 2
 	if ((a->client_skipper != NULL) && (request < SSIZE_MAX)) {
+#else
+	if (a->client_skipper != NULL) {
+#endif
 		bytes_skipped = (a->client_skipper)(a, a->client_data,
 		    request);
 		if (bytes_skipped < 0) {	/* error */
@@ -333,7 +337,8 @@
 		if (bytes_read == 0) {
 			/* We hit EOF before we satisfied the skip request. */
 			archive_set_error(a, ARCHIVE_ERRNO_MISC,
-			    "Truncated input file (need to skip %d bytes)", (int)request);
+			    "Truncated input file (need to skip %jd bytes)",
+			    (intmax_t)request);
 			return (ARCHIVE_FATAL);
 		}
 		assert(bytes_read >= 0); /* precondition for cast below */

==== //depot/projects/arm/src/sbin/ifconfig/af_inet6.c#3 (text+ko) ====

@@ -29,7 +29,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/ifconfig/af_inet6.c,v 1.4 2006/09/25 18:20:56 bms Exp $";
+  "$FreeBSD: src/sbin/ifconfig/af_inet6.c,v 1.5 2007/02/03 03:40:33 bms Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -515,7 +515,7 @@
 	.af_settunnel	= in6_set_tunnel,
 	.af_difaddr	= SIOCDIFADDR_IN6,
 	.af_aifaddr	= SIOCAIFADDR_IN6,
-	.af_ridreq	= &in6_ridreq,
+	.af_ridreq	= &in6_addreq,
 	.af_addreq	= &in6_addreq,
 };
 

==== //depot/projects/arm/src/sbin/ifconfig/ifconfig.8#11 (text+ko) ====

@@ -26,9 +26,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
-.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.131 2007/01/20 00:56:49 marius Exp $
+.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.133 2007/02/04 16:48:56 bms Exp $
 .\"
-.Dd January 20, 2007
+.Dd February 4, 2007
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -1567,6 +1567,62 @@
 .Sh NOTES
 The media selection system is relatively new and only some drivers support
 it (or have need for it).
+.Sh EXAMPLES
+Assign the IPv4 address
+.Li 192.0.2.10 ,
+with a network mask of
+.Li 255.255.255.0 ,
+to the interface
+.Li fxp0 :
+.Dl # ifconfig fxp0 inet 192.0.2.10 netmask 255.255.255.0
+.Pp
+Add the IPv4 address
+.Li 192.0.2.45 ,
+with the CIDR network prefix
+.Li /28 ,
+to the interface
+.Li ed0 ,
+using
+.Cm add
+as a synonym for the canonical form of the option
+.Cm alias :
+.Dl # ifconfig ed0 inet 192.0.2.45/28 add
+.Pp
+Remove the IPv4 address
+.Li 192.0.2.45
+from the interface
+.Li ed0 :
+.Dl # ifconfig ed0 inet 192.0.2.45 -alias
+.Pp
+Add the IPv6 address
+.Li 2001:DB8:DBDB::123/48
+to the interface
+.Li em0 :
+.Dl # ifconfig em0 inet6 2001:db8:bdbd::123 prefixlen 48 alias
+Note that lower case hexadecimal IPv6 addresses are acceptable.
+.Pp
+Remove the IPv6 address added in the above example,
+using the
+.Li /
+character as shorthand for the network prefix,
+and using
+.Cm delete
+as a synonym for the canonical form of the option
+.Fl alias :
+.Dl # ifconfig em0 inet6 2001:db8:bdbd::123/48 delete
+.Pp
+Configure the interface
+.Li xl0 ,
+to use 100baseTX, full duplex Ethernet media options:
+.Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex
+.Pp
+Create the software network interface
+.Li gif1 :
+.Dl # ifconfig gif1 create
+.Pp
+Destroy the software network interface
+.Li gif1 :
+.Dl # ifconfig gif1 destroy
 .Sh DIAGNOSTICS
 Messages indicating the specified interface does not exist, the
 requested address is unknown, or the user is not privileged and

==== //depot/projects/arm/src/sbin/init/init.c#2 (text+ko) ====

@@ -41,7 +41,7 @@
 static char sccsid[] = "@(#)init.c	8.1 (Berkeley) 7/15/93";
 #endif
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/init/init.c,v 1.62 2006/06/08 14:04:36 kib Exp $";
+  "$FreeBSD: src/sbin/init/init.c,v 1.63 2007/02/04 06:33:13 imp Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -55,6 +55,7 @@
 #include <db.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <kenv.h>
 #include <libutil.h>
 #include <paths.h>
 #include <signal.h>
@@ -121,6 +122,8 @@
 state_func_t catatonia(void);
 state_func_t death(void);
 
+state_func_t run_script(const char *);
+
 enum { AUTOBOOT, FASTBOOT } runcom_mode = AUTOBOOT;
 #define FALSE	0
 #define TRUE	1
@@ -131,9 +134,11 @@
 int devfs;
 
 void transition(state_t);
-state_t requested_transition = runcom;
+state_t requested_transition;
 
 void setctty(const char *);
+const char *get_shell(void);
+void write_stderr(const char *message);
 
 typedef struct init_session {
 	int	se_index;		/* index of entry in ttys file */
@@ -187,6 +192,8 @@
 int
 main(int argc, char *argv[])
 {
+	state_t initial_transition = runcom;
+	char kenv_value[PATH_MAX];
 	int c;
 	struct sigaction sa;
 	sigset_t mask;
@@ -262,7 +269,7 @@
 			devfs = 1;
 			break;
 		case 's':
-			requested_transition = single_user;
+			initial_transition = single_user;
 			break;
 		case 'f':
 			runcom_mode = FASTBOOT;
@@ -275,6 +282,63 @@
 	if (optind != argc)
 		warning("ignoring excess arguments");
 
+	/*
+	 * We catch or block signals rather than ignore them,
+	 * so that they get reset on exec.
+	 */
+	handle(badsys, SIGSYS, 0);
+	handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV,
+	       SIGBUS, SIGXCPU, SIGXFSZ, 0);
+	handle(transition_handler, SIGHUP, SIGINT, SIGTERM, SIGTSTP,
+		SIGUSR1, SIGUSR2, 0);
+	handle(alrm_handler, SIGALRM, 0);
+	sigfillset(&mask);
+	delset(&mask, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS,
+		SIGXCPU, SIGXFSZ, SIGHUP, SIGINT, SIGTERM, SIGTSTP, SIGALRM, 
+		SIGUSR1, SIGUSR2, 0);
+	sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0);
+	sigemptyset(&sa.sa_mask);
+	sa.sa_flags = 0;
+	sa.sa_handler = SIG_IGN;
+	(void) sigaction(SIGTTIN, &sa, (struct sigaction *)0);
+	(void) sigaction(SIGTTOU, &sa, (struct sigaction *)0);
+
+	/*
+	 * Paranoia.
+	 */
+	close(0);
+	close(1);
+	close(2);
+
+	if (kenv(KENV_GET, "init_script", kenv_value, sizeof(kenv_value)) > 0) {
+		state_func_t next_transition;
+
+		if ((next_transition = run_script(kenv_value)) != 0)
+			initial_transition = (state_t) next_transition;
+	}
+
+	if (kenv(KENV_GET, "init_chroot", kenv_value, sizeof(kenv_value)) > 0) {
+		if (chdir(kenv_value) != 0 || chroot(".") != 0)
+			warning("Can't chroot to %s: %m", kenv_value);
+	}
+
+	/*
+	 * Additional check if devfs needs to be mounted:
+	 * If "/" and "/dev" have the same device number,
+	 * then it hasn't been mounted yet.
+	 */
+	if (!devfs) {
+		struct stat stst;
+		dev_t root_devno;
+
+		stat("/", &stst);
+		root_devno = stst.st_dev;
+		if (stat("/dev", &stst) != 0)
+			warning("Can't stat /dev: %m");
+		else if (stst.st_dev == root_devno)
+			devfs++;
+	}
+
 	if (devfs) {
 		struct iovec iov[4];
 		char *s;
@@ -312,37 +376,9 @@
 	}
 
 	/*
-	 * We catch or block signals rather than ignore them,
-	 * so that they get reset on exec.
-	 */
-	handle(badsys, SIGSYS, 0);
-	handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV,
-	       SIGBUS, SIGXCPU, SIGXFSZ, 0);
-	handle(transition_handler, SIGHUP, SIGINT, SIGTERM, SIGTSTP,
-		SIGUSR1, SIGUSR2, 0);
-	handle(alrm_handler, SIGALRM, 0);
-	sigfillset(&mask);
-	delset(&mask, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS,
-		SIGXCPU, SIGXFSZ, SIGHUP, SIGINT, SIGTERM, SIGTSTP, SIGALRM, 
-		SIGUSR1, SIGUSR2, 0);
-	sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0);
-	sigemptyset(&sa.sa_mask);
-	sa.sa_flags = 0;
-	sa.sa_handler = SIG_IGN;
-	(void) sigaction(SIGTTIN, &sa, (struct sigaction *)0);
-	(void) sigaction(SIGTTOU, &sa, (struct sigaction *)0);
-
-	/*
-	 * Paranoia.
-	 */
-	close(0);
-	close(1);
-	close(2);
-
-	/*
 	 * Start the state machine.
 	 */
-	transition(requested_transition);
+	transition(initial_transition);
 
 	/*
 	 * Should never reach here.
@@ -558,6 +594,23 @@
 	}
 }
 
+const char *
+get_shell(void)
+{
+	static char kenv_value[PATH_MAX];
+
+	if (kenv(KENV_GET, "init_shell", kenv_value, sizeof(kenv_value)) > 0)
+		return kenv_value;
+	else
+		return _PATH_BSHELL;
+}
+
+void
+write_stderr(const char *message)
+{
+	write(STDERR_FILENO, message, strlen(message));
+}
+
 /*
  * Bring the system up single user.
  */
@@ -567,7 +620,7 @@
 	pid_t pid, wpid;
 	int status;
 	sigset_t mask;
-	const char *shell = _PATH_BSHELL;
+	const char *shell;
 	char *argv[2];
 #ifdef SECURE
 	struct ttyent *typ;
@@ -589,6 +642,8 @@
 		_exit(0);
 	}
 
+	shell = get_shell();
+
 	if ((pid = fork()) == 0) {
 		/*
 		 * Start the single user session.
@@ -605,7 +660,7 @@
 		pp = getpwnam("root");
 		if (typ && (typ->ty_status & TTY_SECURE) == 0 &&
 		    pp && *pp->pw_passwd) {
-			write(STDERR_FILENO, banner, sizeof banner - 1);
+			write_stderr(banner);
 			for (;;) {
 				clear = getpass("Password:");
 				if (clear == 0 || *clear == '\0')
@@ -626,10 +681,10 @@
 			char *cp = altshell;
 			int num;
 
-#define	SHREQUEST \
-	"Enter full pathname of shell or RETURN for " _PATH_BSHELL ": "
-			(void)write(STDERR_FILENO,
-			    SHREQUEST, sizeof(SHREQUEST) - 1);
+#define	SHREQUEST "Enter full pathname of shell or RETURN for "
+			write_stderr(SHREQUEST);
+			write_stderr(shell);
+			write_stderr(": ");
 			while ((num = read(STDIN_FILENO, cp, 1)) != -1 &&
 			    num != 0 && *cp != '\n' && cp < &altshell[127])
 					cp++;
@@ -718,11 +773,35 @@
 state_func_t
 runcom(void)
 {
+	state_func_t next_transition;
+
+	if ((next_transition = run_script(_PATH_RUNCOM)) != 0)
+		return next_transition;
+
+	runcom_mode = AUTOBOOT;		/* the default */
+	/* NB: should send a message to the session logger to avoid blocking. */
+	logwtmp("~", "reboot", "");
+	return (state_func_t) read_ttys;
+}
+
+/*
+ * Run a shell script.
+ * Returns 0 on success, otherwise the next transition to enter:
+ *  - single_user if fork/execv/waitpid failed, or if the script
+ *    terminated with a signal or exit code != 0.
+ *  - death if a SIGTERM was delivered to init(8).
+ */
+state_func_t
+run_script(const char *script)
+{
 	pid_t pid, wpid;
 	int status;
 	char *argv[4];
+	const char *shell;
 	struct sigaction sa;
 
+	shell = get_shell();
+
 	if ((pid = fork()) == 0) {
 		sigemptyset(&sa.sa_mask);
 		sa.sa_flags = 0;
@@ -733,11 +812,10 @@
 		setctty(_PATH_CONSOLE);
 
 		char _sh[]	 	= "sh";
-		char _path_runcom[]	= _PATH_RUNCOM;
 		char _autoboot[]	= "autoboot";
 
 		argv[0] = _sh;
-		argv[1] = _path_runcom;
+		argv[1] = __DECONST(char *, script);
 		argv[2] = runcom_mode == AUTOBOOT ? _autoboot : 0;
 		argv[3] = 0;
 
@@ -746,14 +824,13 @@
 #ifdef LOGIN_CAP
 		setprocresources(RESOURCE_RC);
 #endif
-		execv(_PATH_BSHELL, argv);
-		stall("can't exec %s for %s: %m", _PATH_BSHELL, _PATH_RUNCOM);
+		execv(shell, argv);
+		stall("can't exec %s for %s: %m", shell, script);
 		_exit(1);	/* force single user mode */
 	}
 
 	if (pid == -1) {
-		emergency("can't fork for %s on %s: %m",
-			_PATH_BSHELL, _PATH_RUNCOM);
+		emergency("can't fork for %s on %s: %m", shell, script);
 		while (waitpid(-1, (int *) 0, WNOHANG) > 0)
 			continue;
 		sleep(STALL_TIMEOUT);
@@ -772,13 +849,13 @@
 				return (state_func_t) death;
 			if (errno == EINTR)
 				continue;
-			warning("wait for %s on %s failed: %m; going to single user mode",
-				_PATH_BSHELL, _PATH_RUNCOM);
+			warning("wait for %s on %s failed: %m; going to "
+			    "single user mode", shell, script);
 			return (state_func_t) single_user;
 		}
 		if (wpid == pid && WIFSTOPPED(status)) {
 			warning("init: %s on %s stopped, restarting\n",
-				_PATH_BSHELL, _PATH_RUNCOM);
+				shell, script);
 			kill(pid, SIGCONT);
 			wpid = -1;
 		}
@@ -795,18 +872,15 @@
 	}
 
 	if (!WIFEXITED(status)) {
-		warning("%s on %s terminated abnormally, going to single user mode",
-			_PATH_BSHELL, _PATH_RUNCOM);
+		warning("%s on %s terminated abnormally, going to single "
+		    "user mode", shell, script);
 		return (state_func_t) single_user;
 	}
 
 	if (WEXITSTATUS(status))
 		return (state_func_t) single_user;
 
-	runcom_mode = AUTOBOOT;		/* the default */
-	/* NB: should send a message to the session logger to avoid blocking. */
-	logwtmp("~", "reboot", "");
-	return (state_func_t) read_ttys;
+	return (state_func_t) 0;
 }
 
 /*
@@ -1465,6 +1539,7 @@
 	int shutdowntimeout;
 	size_t len;
 	char *argv[4];
+	const char *shell;
 	struct sigaction sa;
 	struct stat sb;
 
@@ -1477,6 +1552,8 @@
 	if (stat(_PATH_RUNDOWN, &sb) == -1 && errno == ENOENT)
 		return 0;
 
+	shell = get_shell();
+
 	if ((pid = fork()) == 0) {
 		int	fd;
 
@@ -1517,14 +1594,13 @@
 #ifdef LOGIN_CAP
 		setprocresources(RESOURCE_RC);
 #endif
-		execv(_PATH_BSHELL, argv);
-		warning("can't exec %s for %s: %m", _PATH_BSHELL, _PATH_RUNDOWN);
+		execv(shell, argv);
+		warning("can't exec %s for %s: %m", shell, _PATH_RUNDOWN);
 		_exit(1);	/* force single user mode */
 	}
 
 	if (pid == -1) {
-		emergency("can't fork for %s on %s: %m",
-			_PATH_BSHELL, _PATH_RUNDOWN);
+		emergency("can't fork for %s on %s: %m", shell, _PATH_RUNDOWN);
 		while (waitpid(-1, (int *) 0, WNOHANG) > 0)
 			continue;
 		sleep(STALL_TIMEOUT);
@@ -1548,20 +1624,20 @@
 		if (clang == 1) {
 			/* we were waiting for the sub-shell */
 			kill(wpid, SIGTERM);
-			warning("timeout expired for %s on %s: %m; going to single user mode",
-				_PATH_BSHELL, _PATH_RUNDOWN);
+			warning("timeout expired for %s on %s: %m; going to "
+			    "single user mode", shell, _PATH_RUNDOWN);
 			return -1;
 		}
 		if (wpid == -1) {
 			if (errno == EINTR)
 				continue;
-			warning("wait for %s on %s failed: %m; going to single user mode",
-				_PATH_BSHELL, _PATH_RUNDOWN);
+			warning("wait for %s on %s failed: %m; going to "
+			    "single user mode", shell, _PATH_RUNDOWN);
 			return -1;
 		}
 		if (wpid == pid && WIFSTOPPED(status)) {
 			warning("init: %s on %s stopped, restarting\n",
-				_PATH_BSHELL, _PATH_RUNDOWN);
+				shell, _PATH_RUNDOWN);
 			kill(pid, SIGCONT);
 			wpid = -1;
 		}
@@ -1584,8 +1660,8 @@
 	}
 
 	if (!WIFEXITED(status)) {
-		warning("%s on %s terminated abnormally, going to single user mode",
-			_PATH_BSHELL, _PATH_RUNDOWN);
+		warning("%s on %s terminated abnormally, going to "
+		    "single user mode", shell, _PATH_RUNDOWN);
 		return -2;
 	}
 

==== //depot/projects/arm/src/sbin/mount/Makefile#2 (text+ko) ====

@@ -1,5 +1,5 @@
 #	@(#)Makefile	8.6 (Berkeley) 5/8/95
-# $FreeBSD: src/sbin/mount/Makefile,v 1.18 2005/11/23 23:22:56 rodrigc Exp $
+# $FreeBSD: src/sbin/mount/Makefile,v 1.19 2007/02/02 23:58:10 pjd Exp $
 
 PROG=	mount
 SRCS=	mount.c mount_fs.c getmntopts.c vfslist.c
@@ -7,4 +7,7 @@
 MAN=	mount.8
 # We do NOT install the getmntopts.3 man page.
 
+DPADD=	${LIBUTIL}
+LDADD=	-lutil
+
 .include <bsd.prog.mk>

==== //depot/projects/arm/src/sbin/mount/mount.c#5 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)mount.c	8.25 (Berkeley) 5/8/95";
 #endif
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/mount/mount.c,v 1.92 2006/11/14 01:07:42 rodrigc Exp $";
+  "$FreeBSD: src/sbin/mount/mount.c,v 1.93 2007/02/02 23:58:10 pjd Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -58,6 +58,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <libutil.h>
 
 #include "extern.h"
 #include "mntopts.h"
@@ -204,14 +205,33 @@
 	return (ret);
 }
 
+static void
+restart_mountd(void)
+{
+	struct pidfh *pfh;
+	pid_t mountdpid; 
+
+	pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &mountdpid);
+	if (pfh != NULL) {
+		/* Mountd is not running. */
+		pidfile_remove(pfh);
+		return;
+	}
+	if (errno != EEXIST) {
+		/* Cannot open pidfile for some reason. */
+		return;
+	}
+	/* We have mountd(8) PID in mountdpid varible, let's signal it. */
+	if (kill(mountdpid, SIGHUP) == -1)
+		err(1, "signal mountd");
+}
+
 int
 main(int argc, char *argv[])
 {
 	const char *mntfromname, **vfslist, *vfstype;
 	struct fstab *fs;
 	struct statfs *mntbuf;
-	FILE *mountdfp;
-	pid_t pid;
 	int all, ch, i, init_flags, late, mntsize, rval, have_fstab, ro;
 	char *cp, *ep, *options;
 
@@ -411,15 +431,10 @@
 
 	/*
 	 * If the mount was successfully, and done by root, tell mountd the
-	 * good news.  Pid checks are probably unnecessary, but don't hurt.
+	 * good news.
 	 */
-	if (rval == 0 && getuid() == 0 &&
-	    (mountdfp = fopen(_PATH_MOUNTDPID, "r")) != NULL) {
-		if (fscanf(mountdfp, "%d", &pid) == 1 &&
-		     pid > 0 && kill(pid, SIGHUP) == -1 && errno != ESRCH)
-			err(1, "signal mountd");
-		(void)fclose(mountdfp);
-	}
+	if (rval == 0 && getuid() == 0)
+		restart_mountd();
 
 	exit(rval);
 }

==== //depot/projects/arm/src/sbin/quotacheck/quotacheck.c#4 (text+ko) ====

@@ -42,13 +42,14 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/quotacheck/quotacheck.c,v 1.29 2007/01/23 02:13:00 mpp Exp $");
+__FBSDID("$FreeBSD: src/sbin/quotacheck/quotacheck.c,v 1.32 2007/02/04 06:33:14 mpp Exp $");
 
 /*
  * Fix up / report on disk quotas & usage
  */
 #include <sys/param.h>
 #include <sys/disklabel.h>
+#include <sys/mount.h>
 #include <sys/stat.h>
 
 #include <ufs/ufs/dinode.h>
@@ -488,13 +489,13 @@
 		 * Reset time limit if have a soft limit and were
 		 * previously under it, but are now over it.
 		 */
-		if (dqbuf.dqb_bsoftlimit &&
+		if (dqbuf.dqb_bsoftlimit && id != 0 &&
 		    dqbuf.dqb_curblocks < dqbuf.dqb_bsoftlimit &&
 		    fup->fu_curblocks >= dqbuf.dqb_bsoftlimit)
 			dqbuf.dqb_btime = 0;
-		if (dqbuf.dqb_isoftlimit &&
-		    dqbuf.dqb_curblocks < dqbuf.dqb_isoftlimit &&
-		    fup->fu_curblocks >= dqbuf.dqb_isoftlimit)
+		if (dqbuf.dqb_isoftlimit && id != 0 &&
+		    dqbuf.dqb_curinodes < dqbuf.dqb_isoftlimit &&
+		    fup->fu_curinodes >= dqbuf.dqb_isoftlimit)
 			dqbuf.dqb_itime = 0;
 		dqbuf.dqb_curinodes = fup->fu_curinodes;
 		dqbuf.dqb_curblocks = fup->fu_curblocks;
@@ -587,14 +588,15 @@
 {
 	char *opt;
 	char *cp;
+	struct statfs sfb;
 	static char initname, usrname[100], grpname[100];
 	static char buf[BUFSIZ];
 
 	if (!initname) {
-		(void)snprintf(usrname, sizeof(usrname),
-		    "%s%s", qfextension[USRQUOTA], qfname);
-		(void)snprintf(grpname, sizeof(grpname),
-		    "%s%s", qfextension[GRPQUOTA], qfname);
+		(void)snprintf(usrname, sizeof(usrname), "%s%s",
+		    qfextension[USRQUOTA], qfname);
+		(void)snprintf(grpname, sizeof(grpname), "%s%s",
+		    qfextension[GRPQUOTA], qfname);
 		initname = 1;
 	}
 	strcpy(buf, fs->fs_mntops);
@@ -611,10 +613,19 @@
 	if (cp)
 		*qfnamep = cp;
 	else {
-		(void)snprintf(buf, sizeof(buf),
-		    "%s/%s.%s", fs->fs_file, qfname, qfextension[type]);
+		(void)snprintf(buf, sizeof(buf), "%s/%s.%s", fs->fs_file,
+		    qfname, qfextension[type]);
 		*qfnamep = buf;
 	}
+	if (statfs(fs->fs_file, &sfb) != 0) {
+		warn("cannot statfs mount point %s", fs->fs_file);
+		return (0);
+	}
+	if (strcmp(fs->fs_file, sfb.f_mntonname)) {
+		warnx("%s not mounted for %s quotas", fs->fs_file,
+		    type == USRQUOTA ? "user" : "group");
+		return (0);
+	}
 	return (1);
 }
 

==== //depot/projects/arm/src/share/man/man4/altq.4#4 (text+ko) ====

@@ -23,9 +23,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/altq.4,v 1.24 2006/12/13 08:55:20 brueffer Exp $
+.\" $FreeBSD: src/share/man/man4/altq.4,v 1.27 2007/02/03 13:53:22 mlaier Exp $
 .\"
-.Dd December 13, 2006
+.Dd February 3, 2007
 .Dt ALTQ 4
 .Os
 .Sh NAME
@@ -117,7 +117,9 @@
 They have been applied to the following hardware drivers:
 .Xr an 4 ,
 .Xr ath 4 ,
+.Xr aue 4 ,
 .Xr awi 4 ,
+.Xr bce 4 ,
 .Xr bfe 4 ,
 .Xr bge 4 ,
 .Xr dc 4 ,
@@ -127,11 +129,15 @@
 .Xr ep 4 ,
 .Xr fxp 4 ,
 .Xr hme 4 ,
+.Xr ipw 4 ,
+.Xr iwi 4 ,
 .Xr le 4 ,
 .Xr msk 4 ,
 .Xr mxge 4 ,
 .Xr my 4 ,
+.Xr npe 4 ,
 .Xr nve 4 ,
+.Xr ral 4 ,
 .Xr re 4 ,
 .Xr rl 4 ,
 .Xr sf 4 ,
@@ -139,6 +145,8 @@
 .Xr sk 4 ,
 .Xr ste 4 ,
 .Xr stge 4 ,
+.Xr udav 4 ,
+.Xr ural 4 ,
 .Xr vr 4 ,
 .Xr wi 4 ,
 and

==== //depot/projects/arm/src/share/man/man4/aue.4#3 (text+ko) ====

@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/aue.4,v 1.25 2006/10/07 17:58:50 flz Exp $
+.\" $FreeBSD: src/share/man/man4/aue.4,v 1.26 2007/02/03 19:29:31 brueffer Exp $
 .\"
 .Dd October 7, 2006
 .Dt AUE 4
@@ -185,6 +185,7 @@
 The driver failed to allocate an mbuf for the receiver ring.
 .El
 .Sh SEE ALSO
+.Xr altq 4 ,
 .Xr arp 4 ,
 .Xr miibus 4 ,
 .Xr netintro 4 ,

==== //depot/projects/arm/src/share/man/man4/bce.4#5 (text) ====

@@ -26,7 +26,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/bce.4,v 1.5 2006/12/14 16:40:57 mpp Exp $
+.\" $FreeBSD: src/share/man/man4/bce.4,v 1.6 2007/02/03 19:29:31 brueffer Exp $
 .\"
 .Dd December 2, 2006
 .Dt BCE 4
@@ -286,6 +286,7 @@
 If the problem continues replace the controller.
 .El
 .Sh SEE ALSO
+.Xr altq 4 ,
 .Xr arp 4 ,
 .Xr miibus 4 ,
 .Xr netintro 4 ,

==== //depot/projects/arm/src/share/man/man4/ipw.4#3 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/ipw.4,v 1.13 2006/07/28 08:43:49 brueffer Exp $
+.\" $FreeBSD: src/share/man/man4/ipw.4,v 1.14 2007/02/03 19:29:31 brueffer Exp $
 .\"
 .Dd July 28, 2006
 .Os
@@ -119,6 +119,7 @@
 This should not happen.
 .El
 .Sh SEE ALSO
+.Xr altq 4 ,
 .Xr an 4 ,
 .Xr ath 4 ,
 .Xr iwi 4 ,

==== //depot/projects/arm/src/share/man/man4/iwi.4#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/iwi.4,v 1.15 2006/07/17 18:56:27 mnag Exp $
+.\" $FreeBSD: src/share/man/man4/iwi.4,v 1.16 2007/02/03 19:29:31 brueffer Exp $
 .\"
 .Dd July 17, 2006
 .Os
@@ -124,6 +124,7 @@
 This should not happen.
 .El
 .Sh SEE ALSO
+.Xr altq 4 ,
 .Xr an 4 ,
 .Xr ath 4 ,
 .Xr ipw 4 ,

==== //depot/projects/arm/src/share/man/man4/man4.arm/npe.4#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" (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: src/share/man/man4/man4.arm/npe.4,v 1.1 2006/12/05 16:57:10 ru Exp $
+.\" $FreeBSD: src/share/man/man4/man4.arm/npe.4,v 1.2 2007/02/03 20:02:29 brueffer Exp $
 .\"
 .Dd December 4, 2006
 .Dt NPE 4 arm
@@ -132,6 +132,7 @@
 Other diagnostics exist and are not listed here;
 they should be self-explanatory.
 .Sh SEE ALSO
+.Xr altq 4 ,
 .Xr arp 4 ,
 .Xr miibus 4 ,

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list