svn commit: r251279 - head/usr.sbin/ppp
Author: brian Date: Sun Jun 2 23:56:38 2013 New Revision: 251279 URL: http://svnweb.freebsd.org/changeset/base/251279 Log: Move ppp.8.m4 back to ppp.8 and de-ifdef it. Requested by: joel MFC after:1 week Added: head/usr.sbin/ppp/ppp.8 - copied, changed from r251278, head/usr.sbin/ppp/ppp.8.m4 Deleted: head/usr.sbin/ppp/ppp.8.m4 Modified: head/usr.sbin/ppp/Makefile Modified: head/usr.sbin/ppp/Makefile == --- head/usr.sbin/ppp/Makefile Sun Jun 2 23:25:27 2013(r251278) +++ head/usr.sbin/ppp/Makefile Sun Jun 2 23:56:38 2013(r251279) @@ -44,13 +44,6 @@ M4FLAGS= LDADD= -lcrypt -lmd -lutil -lz DPADD= ${LIBCRYPT} ${LIBMD} ${LIBUTIL} ${LIBZ} -.SUFFIXES: .8 .8.m4 - -.8.m4.8: - m4 ${M4FLAGS} ${.IMPSRC} ${.TARGET} - -CLEANFILES= ppp.8 - .if defined(PPP_CONFDIR) !empty(PPP_CONFDIR) CFLAGS+=-DPPP_CONFDIR=\${PPP_CONFDIR}\ .endif Copied and modified: head/usr.sbin/ppp/ppp.8 (from r251278, head/usr.sbin/ppp/ppp.8.m4) == --- head/usr.sbin/ppp/ppp.8.m4 Sun Jun 2 23:25:27 2013(r251278, copy source) +++ head/usr.sbin/ppp/ppp.8 Sun Jun 2 23:56:38 2013(r251279) @@ -1,5 +1,3 @@ -changequote({,})dnl -changecom(,)dnl .\ .\ Copyright (c) 2001 Brian Somers br...@awfulhak.org .\ All rights reserved. @@ -65,10 +63,9 @@ This allows .Nm to act as a NAT or masquerading engine for all machines on an internal LAN. -ifdef({LOCALNAT},{},{Refer to +Refer to .Xr libalias 3 for details on the technical side of the NAT engine. -})dnl Refer to the .Sx NETWORK ADDRESS TRANSLATION (PACKET ALIASING) section of this manual page for details on how to configure NAT in @@ -313,14 +310,13 @@ An extension to PAP and CHAP, allows authentication information to be stored in a central or distributed database along with various per-user framed connection characteristics. -ifdef({LOCALRAD},{},{If +If .Xr libradius 3 is available at compile time, .Nm will use it to make .Em RADIUS requests when configured to do so. -})dnl .It Supports Proxy Arp. .Nm can be configured to make one or more proxy arp entries on behalf of @@ -3018,9 +3014,9 @@ The option can only be enabled if networ With this option enabled, .Nm will pass traffic for old interface addresses through the NAT -ifdef({LOCALNAT},{engine,},{engine +engine (see -.Xr libalias 3 ) ,}) +.Xr libalias 3 ) , resulting in the ability (in .Fl auto mode) to properly connect the process that caused the PPP link to @@ -3428,18 +3424,17 @@ you wish to map to specific machines beh .It nat deny_incoming yes|no If set to yes, this command will refuse all incoming packets where an aliasing link does not already exist. -ifdef({LOCALNAT},{},{Refer to the +Refer to the .Sx CONCEPTUAL BACKGROUND section of .Xr libalias 3 for a description of what an .Dq aliasing link is. -})dnl .Pp It should be noted under what circumstances an aliasing link is -ifdef({LOCALNAT},{created.},{created by -.Xr libalias 3 .}) +created by +.Xr libalias 3 . It may be necessary to further protect your network from outside connections using the .Dq set filter @@ -3524,12 +3519,11 @@ for example: This command tells .Nm to proxy certain connections, redirecting them to a given server. -ifdef({LOCALNAT},{},{Refer to the description of +Refer to the description of .Fn PacketAliasProxyRule in .Xr libalias 3 for details of the available commands. -})dnl .It nat punch_fw Op Ar base count This command tells .Nm @@ -3567,9 +3561,8 @@ if you want to support protocols such as connections to come from a well known port. .It nat target Op Ar address Set the given target address or clear it if no address is given. -The target address is used -ifdef({LOCALNAT},{},{by libalias })dnl -to specify how to NAT incoming packets by default. +The target address is used by libalias to specify how to NAT incoming packets +by default. If a target address is not set or if .Dq default is given, packets are not altered and are allowed to route to the internal @@ -3577,10 +3570,7 @@ network. .Pp The target address may be set to .Dq MYADDR , -in which case -ifdef({LOCALNAT},{all packets will be redirected}, -{libalias will redirect all packets}) -to the interface address. +in which case libalias will redirect all packets to the interface address. .It nat use_sockets yes|no When enabled, this option tells the network address translation engine to create a socket so that it can guarantee a correct incoming ftp data or @@ -6055,10 +6045,8 @@ This socket is used to pass links betwee .Xr kldload 2 , .Xr pipe 2 , .Xr socketpair 2 , -ifdef({LOCALNAT},{},{.Xr libalias 3 , -})dnl -ifdef({LOCALRAD},{},{.Xr libradius 3 , -})dnl +.Xr libalias 3 , +.Xr libradius 3 , .Xr syslog 3 , .Xr uucplock 3 , .Xr netgraph 4 , ___ svn-src-all@freebsd.org
Re: svn commit: r242074 - head/etc/rc.d
On Sat, Oct 27, 2012 at 03:57:07PM +0900, Hiroki Sato wrote: Brian Somers br...@freebsd.org wrote in 20121026235044.ga77...@thong.lan.awfulhak.org: br When I reboot and don't use -accept_rtadv (and leave br net.inet6.ip6.accept_rtadv set to zero), I repeatedly see this in br /var/log/messages: br br Oct 26 16:31:26 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface sk0. Ignored. br Oct 26 16:31:33 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface bridge0. Ignored. br Oct 26 16:31:42 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface sk0. Ignored. br Oct 26 16:31:49 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface bridge0. Ignored. br br This seems to be the problem. Because check_accept_rtadv() (in br rtadvd) reports the interface as being able to accept RAs (it finds br the ND6_IFF_ACCEPT_RTADV flag), it drops outgoing RAs and nothing br happens. Can you send me your /etc/rc.conf and /etc/sysctl.conf? I guess you are still using ipv6_enable=YES on 9.X. Sure (attached). I'm not sure what is supposed to change in rc.conf when upgrading from 8 to 9. There's nothing obvious that I can see... maybe I'm looking in the wrong place? http://www.freebsd.org/releases/9.0R/relnotes.html This issue seems to be with rtadvd (as per above). Eliding the return after the above non-zero lifetime message in rtadvd.c makes everything work again (without using ifconfig iface inet6 -accept_rtadv). -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org hostname=gw.lan.Awfulhak.org nisdomainname=Awfulhak.org firewall_enable=YES firewall_flags=-p /usr/bin/m4 firewall_type=/etc/firewall.rules firewall_quiet=YES #network_interfaces=fxp0 re0 lo0 bridge0 #network_interfaces=fxp1 sk0 lo0 bridge0 ifconfig_sk0=inet 172.16.0.1 netmask 0xff00 ifconfig_sk0_alias0=inet 172.16.0.23 netmask 0x ifconfig_lo0_alias0=inet 127.0.0.2 netmask 0x ifconfig_fxp0=DHCP #static_routes=upstairs #route_upstairs=172.16.2.128/25 172.16.2.34 ifconfig_fxp1=up vlans_sk0=167 ifconfig_sk0_167=up cloned_interfaces=bridge0 ifconfig_bridge0=addm sk0.167 addm fxp1 172.16.2.2 netmask 0xff80 bsdstats_enable=YES ipv6_enable=YES ipv6_gateway_enable=YES ipv6_ifconfig_sk0=2001:1938:27d:0:240:f4ff:feb1:1c85 prefixlen 64 ipv6_ifconfig_bridge0=2001:1938:27d:1:20d:61ff:fe45:2c3f prefixlen 64 rtadvd_enable=YES rtadvd_interfaces=sk0 bridge0 fsck_y_enable=YES natd_enable=YES natd_interface=fxp0 natd_flags=-f /etc/natd.conf rpcbind_enable=YES syslogd_enable=YES syslogd_flags=-ss dnscrypt_proxy_enable=YES dnscrypt_proxy_flags='-a 127.0.0.2' named_enable=YES rwhod_enable=YES amd_enable=YES amd_flags= nfs_client_enable=YES nfs_server_enable=YES mountd_enable=YES mountd_flags=-p 1007 rpc_lockd_enable=YES rpc_statd_enable=YES timed_flags=-F localhost nis_client_enable=YES nis_client_flags=-S $nisdomainname,172.16.0.1 -m nis_server_enable=YES nis_yppasswdd_enable=YES gateway_enable=YES cursor=destructive lpd_enable=YES lpd_flags=-lc dumpdev=/dev/ad0s1b clear_tmp_enable=YES ldconfig_paths_aout=NO sshd_enable=YES ntpd_enable=YES ntpd_sync_on_start=YES usbd_enable=YES snmpd_enable=YES snmpd_flags=-Lsd moused_enable=YES moused_type=ps/2 moused_port=/dev/psm0 sendmail_enable=YES inetd_enable=YES sixxs_aiccu_enable=YES cyrus_pwcheck_enable=YES #slapd_enable=YES #slapd_flags='-h ldapi://%2fvar%2frun%2fopenldap%2fldapi/ ldap://0.0.0.0/;' #slapd_sockets=/var/run/openldap/ldapi apache22_enable=YES apache22ssl_enable=YES dhcpd_enable=YES dhcpd_ifaces=sk0 bridge0 dhcpd_chuser_enable=NO mysql_enable=YES cyrus_imapd_enable=YES saslauthd_enable=YES saslauthd_flags=-a pam squid_enable=YES samba_enable=YES #winbindd_enable=YES #winbindd_flags=-d10 mt_daapd_enable=YES arpwatch_enable=YES arpwatch_interfaces=sk0 bridge0 cupsd_enable=YES nagios_enable=YES nsca_enable=YES sshblock_enable=YES saver=green # added by xorg-libraries port local_startup=/usr/local/etc/rc.d ddclient_enable=YES daily_ddclient_force_enable=YES spamd_enable=YES spamass_milter_enable=YES # $FreeBSD: stable/9/etc/sysctl.conf 112200 2003-03-13 18:43:50Z mux $ # # This file is read when going to multi-user and its contents piped thru # ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details. # kern.maxfilesperproc=1024 # Uncomment this to prevent users from seeing information about processes that # are being run under another UID. #security.bsd.see_other_uids=0 # I want to see firewall log messages in /var/log/security net.inet.ip.fw.verbose=1 pgpjN9HAdEmnU.pgp Description: PGP signature
Re: svn commit: r242074 - head/etc/rc.d
On Sat, Oct 27, 2012 at 05:01:39PM +0900, Hiroki Sato wrote: Hiroki Sato h...@freebsd.org wrote in 20121027.165129.351491404794553651@allbsd.org: hr Thank you. It is explained in section 3.2.4 in hr hr http://www.freebsd.org/releases/9.0R/relnotes-detailed.html#UPGRADE hr hr I think it will work as 8.X just after removing the ipv6_enable=YES hr line in your rc.conf, but after investigating the network.subr hr closely I found a bug in backward compatibility of ipv6_enable=YES on hr 9.X... Can you try the attached patch? This should fix the issue hr even if ipv6_enable=YES exists on a 9.X's rc.conf without a patch to hr rc.d/rtadvd. Gr, sorry. The previous patch was wrong. The correct one is attached to this mail. -- Hiroki Index: etc/network.subr === --- etc/network.subr (revision 242114) +++ etc/network.subr (working copy) @@ -109,7 +109,9 @@ # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - _ipv6_opts=${_ipv6_opts} accept_rtadv + if ! checkyesno ipv6_gateway_enable; then + _ipv6_opts=${_ipv6_opts} accept_rtadv + fi ;; esac @@ -488,7 +490,11 @@ # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - return 0 + if checkyesno ipv6_gateway_enable; then + return 1 + else + return 0 + fi ;; esac Yep, that fixes the issue. Everything works now both with and without ipv6_enable in rc.conf. Thanks for your help. It might be worth asking re@ if the above patch can be squeezed into 9.1 before the release? I'm also ok with backing the original /etc/rc.d/rtadvd change out if you prefer? Thanks again. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org pgpLB48uLcyQS.pgp Description: PGP signature
Re: svn commit: r242074 - head/etc/rc.d
On Fri, Oct 26, 2012 at 03:52:15AM +0900, Hiroki Sato wrote: Brian Somers br...@freebsd.org wrote in 20121025171827.ga59...@thong.lan.awfulhak.org: br After upgrading from 8-STABLE to 9-STABLE on Monday, IPv6 routing br advertisments were broken. Disabling accept (enabling send) appeared br to be necessary to get things up and running. br br As you say, net.inet6.ip6.accept_rtadv is set to zero (off, meaning br that we *can* send advertisments), so I don't now what the issue br is. Irrespective of this, I think it's useful to explicitly set br the interface to be able to send advertisments when running rtadvd br - just in case the sysctl is set to 1 elsewhere. br br Doing an ifconfig interface inet6 accept_rtadv after boot doesn't br seem to disable sending advertisments, so I'm finding it difficult br to test this remotely... testing is awkward when I'm not at home br as this machine is also suffering from the can't reboot issue!! br br I'll look into why the sysctl doesn't seem to behave as expected br when I get home this evening. In 9.X and later the meaning of net.inet6.ip6.accept_rtadv has been changed and the flag for whether receiving RAs or not is now in a per-IF basis. 9.0R release note says the following: | The sysctl(8) variable net.inet6.ip6.accept_rtadv has been | changed. It was a system-wide configuration knob which controlled | whether the system accepts ICMPv6 Router Advertisement messages or | not. In FreeBSD 9.0-RELEASE, this knob is converted into a | per-interface inet6 accept_rtadv ifconfig(8) option. Although the | sysctl(8) variable is available still in FreeBSD 9.0-RELEASE, it | now controls whether the per-interface option is set by default or | not. The default value is 0 (not accept the RA messages). So, by default RAs can be sent on any interface even if setting net.inet6.ip6.accept_rtadv=1 manually after a boot because no accept_rtadv per-IF flag is set. I guess this was a source of the confusion. I am not sure why setting accept_rtadv flag on an interface did not prevent from sending RAs in your case. It is not an intended behavior. If it is reproducible, please let me know. The release notes explains more details of IPv6 configuration migration from 8.X to 9.X. When I reboot and don't use -accept_rtadv (and leave net.inet6.ip6.accept_rtadv set to zero), I repeatedly see this in /var/log/messages: Oct 26 16:31:26 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface sk0. Ignored. Oct 26 16:31:33 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface bridge0. Ignored. Oct 26 16:31:42 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface sk0. Ignored. Oct 26 16:31:49 gw rtadvd[2879]: non-zero lifetime RA on RA receiving interface bridge0. Ignored. This seems to be the problem. Because check_accept_rtadv() (in rtadvd) reports the interface as being able to accept RAs (it finds the ND6_IFF_ACCEPT_RTADV flag), it drops outgoing RAs and nothing happens. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org pgp9NvdgWzf3f.pgp Description: PGP signature
svn commit: r242074 - head/etc/rc.d
Author: brian Date: Thu Oct 25 08:37:08 2012 New Revision: 242074 URL: http://svn.freebsd.org/changeset/base/242074 Log: Enable accept_rtadvd on interfaces running rtadvd. Without this, rtadvd runs but never advertises a default (IPv6) route. MFC after:1 week Modified: head/etc/rc.d/rtadvd Modified: head/etc/rc.d/rtadvd == --- head/etc/rc.d/rtadvdThu Oct 25 05:22:25 2012(r242073) +++ head/etc/rc.d/rtadvdThu Oct 25 08:37:08 2012(r242074) @@ -36,17 +36,24 @@ rtadvd_precmd() # case ${rtadvd_interfaces} in [Aa][Uu][Tt][Oo]|'') + command_args= for i in `list_net_interfaces`; do case $i in lo0)continue ;; esac if ipv6if $i; then - rtadvd_interfaces=${rtadvd_interfaces} ${i} + command_args=${command_args} ${i} fi done ;; + *) + command_args=${rtadvd_interfaces} + ;; esac - command_args=${rtadvd_interfaces} + + for iface in ${command_args}; do + ifconfig ${iface} inet6 -accept_rtadv + done # Enable Router Renumbering, unicast case # (use correct src/dst addr) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r242074 - head/etc/rc.d
On Thu, Oct 25, 2012 at 09:00:07PM +0900, Hiroki Sato wrote: Dimitry Andric d...@freebsd.org wrote in 50892486.9030...@freebsd.org: di On 2012-10-25 10:37, Brian Somers wrote: di ... di URL: http://svn.freebsd.org/changeset/base/242074 di di Log: di Enable accept_rtadvd on interfaces running rtadvd. di ... di + for iface in ${command_args}; do di + ifconfig ${iface} inet6 -accept_rtadv di + done di di The commit message says it enables accept_rtadv, the code actually di disables it. Which is correct? I assume the latter? Yes, the message should have read Enable sending router advertisments. Sorry, the exact opposite came out - the naming does my head in :-/ Enabling accept_rtadv should prevent rtadvd from sending RAs on the interface, so disabling it is a necessary step if one wants to send RAs. However, accept_rtadv is off by default in the current rc.d framework. Why forcibly disabling it is needed? After upgrading from 8-STABLE to 9-STABLE on Monday, IPv6 routing advertisments were broken. Disabling accept (enabling send) appeared to be necessary to get things up and running. As you say, net.inet6.ip6.accept_rtadv is set to zero (off, meaning that we *can* send advertisments), so I don't now what the issue is. Irrespective of this, I think it's useful to explicitly set the interface to be able to send advertisments when running rtadvd - just in case the sysctl is set to 1 elsewhere. Doing an ifconfig interface inet6 accept_rtadv after boot doesn't seem to disable sending advertisments, so I'm finding it difficult to test this remotely... testing is awkward when I'm not at home as this machine is also suffering from the can't reboot issue!! I'll look into why the sysctl doesn't seem to behave as expected when I get home this evening. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r238896 - head/usr.bin/script
Author: brian Date: Mon Jul 30 07:13:06 2012 New Revision: 238896 URL: http://svn.freebsd.org/changeset/base/238896 Log: Add d, p and r switches for recording script sessions with timing data and playing sessions back with or without time delays. PR: 114465 Submitted by: ighighi at gmail dot com MFC after:3 weeks Modified: head/usr.bin/script/script.1 head/usr.bin/script/script.c Modified: head/usr.bin/script/script.1 == --- head/usr.bin/script/script.1Mon Jul 30 06:00:31 2012 (r238895) +++ head/usr.bin/script/script.1Mon Jul 30 07:13:06 2012 (r238896) @@ -36,7 +36,7 @@ .Nd make typescript of terminal session .Sh SYNOPSIS .Nm -.Op Fl akq +.Op Fl adkpqr .Op Fl t Ar time .Op Ar file Op Ar command ... .Sh DESCRIPTION @@ -72,10 +72,20 @@ Append the output to or .Pa typescript , retaining the prior contents. +.It Fl d +When playing back a session with the +.Fl p +flag, don't sleep between records when playing back a timestamped session. .It Fl k Log keys sent to the program as well as output. +.It Fl p +Play back a session recorded with the +.Fl r +flag in real time. .It Fl q -Run in quiet mode, omit the start and stop status messages. +Run in quiet mode, omit the start, stop and command status messages. +.It Fl r +Record a session with input, output, and timestamping. .It Fl t Ar time Specify the interval at which the script output file will be flushed to disk, in seconds. @@ -151,6 +161,14 @@ The .Nm command appeared in .Bx 3.0 . +.Pp +The +.Fl d , +.Fl p +and +.Fl r +options first appeared in +.Nx 2.0 . .Sh BUGS The .Nm Modified: head/usr.bin/script/script.c == --- head/usr.bin/script/script.cMon Jul 30 06:00:31 2012 (r238895) +++ head/usr.bin/script/script.cMon Jul 30 07:13:06 2012 (r238896) @@ -46,6 +46,9 @@ static const char sccsid[] = @(#)script #include sys/stat.h #include sys/ioctl.h #include sys/time.h +#include sys/uio.h +#include sys/endian.h +#include sys/param.h #include err.h #include errno.h @@ -59,11 +62,21 @@ static const char sccsid[] = @(#)script #include termios.h #include unistd.h +#define DEF_BUF 65536 + +struct stamp { + uint64_t scr_len; /* amount of data */ + uint64_t scr_sec; /* time it arrived in seconds... */ + uint32_t scr_usec; /* ...and microseconds */ + uint32_t scr_direction; /* 'i', 'o', etc (also indicates endianness) */ +}; + static FILE *fscript; static int master, slave; static int child; static const char *fname; static int qflg, ttyflg; +static int usesleep, rawout; static struct termios tt; @@ -71,6 +84,9 @@ static void done(int) __dead2; static void doshell(char **); static void fail(void); static void finish(void); +static void record(FILE *, char *, size_t, int); +static void consume(FILE *, off_t, char *, int); +static void playback(FILE *) __dead2; static void usage(void); int @@ -79,7 +95,7 @@ main(int argc, char *argv[]) int cc; struct termios rtt, stt; struct winsize win; - int aflg, kflg, ch, n; + int aflg, kflg, pflg, ch, n; struct timeval tv, *tvp; time_t tvec, start; char obuf[BUFSIZ]; @@ -87,19 +103,32 @@ main(int argc, char *argv[]) fd_set rfd; int flushtime = 30; int readstdin; + int k; + + aflg = kflg = pflg = 0; + usesleep = 1; + rawout = 0; - aflg = kflg = 0; - while ((ch = getopt(argc, argv, aqkt:)) != -1) + while ((ch = getopt(argc, argv, adkpqrt:)) != -1) switch(ch) { case 'a': aflg = 1; break; - case 'q': - qflg = 1; + case 'd': + usesleep = 0; break; case 'k': kflg = 1; break; + case 'p': + pflg = 1; + break; + case 'q': + qflg = 1; + break; + case 'r': + rawout = 1; + break; case 't': flushtime = atoi(optarg); if (flushtime 0) @@ -119,9 +148,12 @@ main(int argc, char *argv[]) } else fname = typescript; - if ((fscript = fopen(fname, aflg ? a : w)) == NULL) + if ((fscript = fopen(fname, pflg ? r : aflg ? a : w)) == NULL) err(1, %s, fname); + if (pflg) + playback(fscript); + if ((ttyflg = isatty(STDIN_FILENO)) != 0) { if (tcgetattr(STDIN_FILENO, tt) == -1) err(1, tcgetattr); @@ -134,10 +166,23 @@
svn commit: r238897 - head/usr.bin/script
Author: brian Date: Mon Jul 30 08:06:00 2012 New Revision: 238897 URL: http://svn.freebsd.org/changeset/base/238897 Log: Mention when -d, -p and -r first hit FreeBSD. Bump the document date to when the change was made (rather than when the PR was submitted). Suggested by: pluknet Modified: head/usr.bin/script/script.1 Modified: head/usr.bin/script/script.1 == --- head/usr.bin/script/script.1Mon Jul 30 07:13:06 2012 (r238896) +++ head/usr.bin/script/script.1Mon Jul 30 08:06:00 2012 (r238897) @@ -28,7 +28,7 @@ .\@(#)script.18.1 (Berkeley) 6/6/93 .\ $FreeBSD$ .\ -.Dd September 28, 2011 +.Dd July 30, 2012 .Dt SCRIPT 1 .Os .Sh NAME @@ -168,7 +168,9 @@ The and .Fl r options first appeared in -.Nx 2.0 . +.Nx 2.0 +and were ported to +.Fx 10 . .Sh BUGS The .Nm ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r224292 - stable/8/sbin/natd
On Sun, Jul 24, 2011 at 06:03:02PM +, Maxim Sobolev wrote: Author: sobomax Date: Sun Jul 24 18:03:02 2011 New Revision: 224292 URL: http://svn.freebsd.org/changeset/base/224292 Log: MFC: 220736, 220806, 220808 If we can retrieve interface address sleep for one second and try again. This can happen during start-up, when natd starts before dhclient has a chance to receive IP address from the upstream provider. Do this only in background, dynamic mode. Reminded by:brian [.] Thanks :*) -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r224285 - stable/8/usr.sbin/ppp
Author: brian Date: Sun Jul 24 01:36:01 2011 New Revision: 224285 URL: http://svn.freebsd.org/changeset/base/224285 Log: MFC r218397: Add iface name and iface description commands. PR: 151400 Submitted by: Aragon Gouveia - aragon at phat dot za dot net Modified: stable/8/usr.sbin/ppp/bundle.c stable/8/usr.sbin/ppp/command.c stable/8/usr.sbin/ppp/iface.c stable/8/usr.sbin/ppp/iface.h stable/8/usr.sbin/ppp/log.c stable/8/usr.sbin/ppp/log.h stable/8/usr.sbin/ppp/main.c stable/8/usr.sbin/ppp/ppp.8.m4 Directory Properties: stable/8/usr.sbin/ppp/ (props changed) Modified: stable/8/usr.sbin/ppp/bundle.c == --- stable/8/usr.sbin/ppp/bundle.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/bundle.c Sun Jul 24 01:36:01 2011 (r224285) @@ -758,7 +758,7 @@ bundle_Create(const char *prefix, int ty return NULL; } - log_SetTun(bundle.unit); + log_SetTun(bundle.unit, NULL); ifname = strrchr(bundle.dev.Name, '/'); if (ifname == NULL) @@ -849,7 +849,7 @@ bundle_Create(const char *prefix, int ty bundle.links = datalink_Create(deflink, bundle, type); if (bundle.links == NULL) { log_Printf(LogALERT, Cannot create data link: %s\n, strerror(errno)); -iface_Destroy(bundle.iface); +iface_Free(bundle.iface); bundle.iface = NULL; close(bundle.dev.fd); return NULL; Modified: stable/8/usr.sbin/ppp/command.c == --- stable/8/usr.sbin/ppp/command.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/command.c Sun Jul 24 01:36:01 2011 (r224285) @@ -184,6 +184,7 @@ static int DeleteCommand(struct cmdargs static int NegotiateCommand(struct cmdargs const *); static int ClearCommand(struct cmdargs const *); static int RunListCommand(struct cmdargs const *); +static int IfaceNameCommand(struct cmdargs const *arg); static int IfaceAddCommand(struct cmdargs const *); static int IfaceDeleteCommand(struct cmdargs const *); static int IfaceClearCommand(struct cmdargs const *); @@ -823,6 +824,10 @@ static struct cmdtab const IfaceCommands Delete iface address, iface delete addr, (void *)1}, {NULL, delete!, IfaceDeleteCommand, LOCAL_AUTH, Delete iface address, iface delete addr, (void *)1}, + {name, NULL, IfaceNameCommand, LOCAL_AUTH, +Set iface name, iface name name, NULL}, + {description, NULL, iface_Descr, LOCAL_AUTH, +Set iface description, iface description text, NULL}, {show, NULL, iface_Show, LOCAL_AUTH, Show iface address(es), iface show, NULL}, {help, ?, HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH, @@ -3176,6 +3181,21 @@ RunListCommand(struct cmdargs const *arg } static int +IfaceNameCommand(struct cmdargs const *arg) +{ + int n = arg-argn; + + if (arg-argc != n + 1) +return -1; + + if (!iface_Name(arg-bundle-iface, arg-argv[n])) +return 1; + + log_SetTun(arg-bundle-unit, arg-bundle-iface-name); + return 0; +} + +static int IfaceAddCommand(struct cmdargs const *arg) { struct ncpaddr peer, addr; Modified: stable/8/usr.sbin/ppp/iface.c == --- stable/8/usr.sbin/ppp/iface.c Sat Jul 23 22:55:32 2011 (r224284) +++ stable/8/usr.sbin/ppp/iface.c Sun Jul 24 01:36:01 2011 (r224285) @@ -151,6 +151,7 @@ iface_Create(const char *name) return NULL; } iface-name = strdup(name); + iface-descr = NULL; iface-index = ifm-ifm_index; iface-flags = ifm-ifm_flags; iface-mtu = 0; @@ -369,6 +370,103 @@ iface_addr_Add(const char *name, struct return res != -1; } +int +iface_Name(struct iface *iface, const char *name) +{ + struct ifreq ifr; + int s; + char *newname; + + if ((newname = strdup(name)) == NULL) { +log_Printf(LogWARN, iface name: strdup failed: %s\n, strerror(errno)); +return 0; + } + + if ((s = ID0socket(PF_INET, SOCK_DGRAM, 0)) == -1) { +log_Printf(LogERROR, iface name: socket(): %s\n, strerror(errno)); +free(newname); +return 0; + } + + strlcpy(ifr.ifr_name, iface-name, sizeof(ifr.ifr_name)); + ifr.ifr_data = newname; + if (ID0ioctl(s, SIOCSIFNAME, (caddr_t)ifr) 0) { +log_Printf(LogWARN, iface name: ioctl(SIOCSIFNAME, %s - %s): %s\n, + name, newname, strerror(errno)); +free(newname); +return 0; + } + + free(iface-name); + iface-name = newname; + + return 1; +} + +int +iface_Descr(struct cmdargs const *arg) +{ + struct ifreq ifr; + struct iface *iface; + size_t sz, len; + int s, n, ifdescr_maxlen; + char *descr; + + sz = sizeof(int); + if (sysctlbyname(net.ifdescr_maxlen, ifdescr_maxlen, sz, NULL, 0) 0) { +log_Printf(LogERROR, iface descr: sysctl failed: %s\n, strerror(errno)); +return 1; + } + + if (ifdescr_maxlen 1) { +log_Printf(LogERROR,
svn commit: r218397 - head/usr.sbin/ppp
Author: brian Date: Mon Feb 7 11:18:18 2011 New Revision: 218397 URL: http://svn.freebsd.org/changeset/base/218397 Log: Add iface name and iface description commands. PR: 151400 Submitted by: Aragon Gouveia - aragon at phat dot za dot net with minor fixes MFC after:3 weeks Modified: head/usr.sbin/ppp/bundle.c head/usr.sbin/ppp/command.c head/usr.sbin/ppp/iface.c head/usr.sbin/ppp/iface.h head/usr.sbin/ppp/log.c head/usr.sbin/ppp/log.h head/usr.sbin/ppp/main.c head/usr.sbin/ppp/ppp.8.m4 Modified: head/usr.sbin/ppp/bundle.c == --- head/usr.sbin/ppp/bundle.c Mon Feb 7 11:13:28 2011(r218396) +++ head/usr.sbin/ppp/bundle.c Mon Feb 7 11:18:18 2011(r218397) @@ -758,7 +758,7 @@ bundle_Create(const char *prefix, int ty return NULL; } - log_SetTun(bundle.unit); + log_SetTun(bundle.unit, NULL); ifname = strrchr(bundle.dev.Name, '/'); if (ifname == NULL) @@ -849,7 +849,7 @@ bundle_Create(const char *prefix, int ty bundle.links = datalink_Create(deflink, bundle, type); if (bundle.links == NULL) { log_Printf(LogALERT, Cannot create data link: %s\n, strerror(errno)); -iface_Destroy(bundle.iface); +iface_Free(bundle.iface); bundle.iface = NULL; close(bundle.dev.fd); return NULL; Modified: head/usr.sbin/ppp/command.c == --- head/usr.sbin/ppp/command.c Mon Feb 7 11:13:28 2011(r218396) +++ head/usr.sbin/ppp/command.c Mon Feb 7 11:18:18 2011(r218397) @@ -184,6 +184,7 @@ static int DeleteCommand(struct cmdargs static int NegotiateCommand(struct cmdargs const *); static int ClearCommand(struct cmdargs const *); static int RunListCommand(struct cmdargs const *); +static int IfaceNameCommand(struct cmdargs const *arg); static int IfaceAddCommand(struct cmdargs const *); static int IfaceDeleteCommand(struct cmdargs const *); static int IfaceClearCommand(struct cmdargs const *); @@ -823,6 +824,10 @@ static struct cmdtab const IfaceCommands Delete iface address, iface delete addr, (void *)1}, {NULL, delete!, IfaceDeleteCommand, LOCAL_AUTH, Delete iface address, iface delete addr, (void *)1}, + {name, NULL, IfaceNameCommand, LOCAL_AUTH, +Set iface name, iface name name, NULL}, + {description, NULL, iface_Descr, LOCAL_AUTH, +Set iface description, iface description text, NULL}, {show, NULL, iface_Show, LOCAL_AUTH, Show iface address(es), iface show, NULL}, {help, ?, HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH, @@ -3176,6 +3181,21 @@ RunListCommand(struct cmdargs const *arg } static int +IfaceNameCommand(struct cmdargs const *arg) +{ + int n = arg-argn; + + if (arg-argc != n + 1) +return -1; + + if (!iface_Name(arg-bundle-iface, arg-argv[n])) +return 1; + + log_SetTun(arg-bundle-unit, arg-bundle-iface-name); + return 0; +} + +static int IfaceAddCommand(struct cmdargs const *arg) { struct ncpaddr peer, addr; Modified: head/usr.sbin/ppp/iface.c == --- head/usr.sbin/ppp/iface.c Mon Feb 7 11:13:28 2011(r218396) +++ head/usr.sbin/ppp/iface.c Mon Feb 7 11:18:18 2011(r218397) @@ -151,6 +151,7 @@ iface_Create(const char *name) return NULL; } iface-name = strdup(name); + iface-descr = NULL; iface-index = ifm-ifm_index; iface-flags = ifm-ifm_flags; iface-mtu = 0; @@ -369,6 +370,103 @@ iface_addr_Add(const char *name, struct return res != -1; } +int +iface_Name(struct iface *iface, const char *name) +{ + struct ifreq ifr; + int s; + char *newname; + + if ((newname = strdup(name)) == NULL) { +log_Printf(LogWARN, iface name: strdup failed: %s\n, strerror(errno)); +return 0; + } + + if ((s = ID0socket(PF_INET, SOCK_DGRAM, 0)) == -1) { +log_Printf(LogERROR, iface name: socket(): %s\n, strerror(errno)); +free(newname); +return 0; + } + + strlcpy(ifr.ifr_name, iface-name, sizeof(ifr.ifr_name)); + ifr.ifr_data = newname; + if (ID0ioctl(s, SIOCSIFNAME, (caddr_t)ifr) 0) { +log_Printf(LogWARN, iface name: ioctl(SIOCSIFNAME, %s - %s): %s\n, + name, newname, strerror(errno)); +free(newname); +return 0; + } + + free(iface-name); + iface-name = newname; + + return 1; +} + +int +iface_Descr(struct cmdargs const *arg) +{ + struct ifreq ifr; + struct iface *iface; + size_t sz, len; + int s, n, ifdescr_maxlen; + char *descr; + + sz = sizeof(int); + if (sysctlbyname(net.ifdescr_maxlen, ifdescr_maxlen, sz, NULL, 0) 0) { +log_Printf(LogERROR, iface descr: sysctl failed: %s\n, strerror(errno)); +return 1; + } + + if (ifdescr_maxlen 1) { +log_Printf(LogERROR, iface descr: sysctl net.ifdescr_maxlen 1\n); +return 1; + } + + sz = sizeof(char) * ifdescr_maxlen; + if ((descr = malloc(sz)) ==
svn commit: r217088 - stable/8/usr.sbin/newsyslog
Author: brian Date: Fri Jan 7 08:42:58 2011 New Revision: 217088 URL: http://svn.freebsd.org/changeset/base/217088 Log: MFC r216832: Make -S functional Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c == --- stable/8/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 08:34:12 2011 (r217087) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 08:42:58 2011 (r217088) @@ -599,7 +599,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, a:d:f:nrst:vCD:FNPR:)) != -1) + while ((ch = getopt(argc, argv, a:d:f:nrst:vCD:FNPR:S:)) != -1) switch (ch) { case 'a': archtodir++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r217089 - stable/7/usr.sbin/newsyslog
Author: brian Date: Fri Jan 7 08:45:56 2011 New Revision: 217089 URL: http://svn.freebsd.org/changeset/base/217089 Log: MFC r216832: Make -S functional Modified: stable/7/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/7/usr.sbin/newsyslog/ (props changed) Modified: stable/7/usr.sbin/newsyslog/newsyslog.c == --- stable/7/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 08:42:58 2011 (r217088) +++ stable/7/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 08:45:56 2011 (r217089) @@ -583,7 +583,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, a:d:f:nrsvCD:FNPR:)) != -1) + while ((ch = getopt(argc, argv, a:d:f:nrsvCD:FNPR:S:)) != -1) switch (ch) { case 'a': archtodir++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r217115 - releng/8.2/usr.sbin/newsyslog
Author: brian Date: Fri Jan 7 18:33:26 2011 New Revision: 217115 URL: http://svn.freebsd.org/changeset/base/217115 Log: MFC r216832: Make -S functional Approved by: re (kib) Modified: releng/8.2/usr.sbin/newsyslog/newsyslog.c Directory Properties: releng/8.2/usr.sbin/newsyslog/ (props changed) Modified: releng/8.2/usr.sbin/newsyslog/newsyslog.c == --- releng/8.2/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 18:32:03 2011 (r217114) +++ releng/8.2/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 18:33:26 2011 (r217115) @@ -599,7 +599,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, a:d:f:nrst:vCD:FNPR:)) != -1) + while ((ch = getopt(argc, argv, a:d:f:nrst:vCD:FNPR:S:)) != -1) switch (ch) { case 'a': archtodir++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r217116 - releng/7.4/usr.sbin/newsyslog
Author: brian Date: Fri Jan 7 18:34:09 2011 New Revision: 217116 URL: http://svn.freebsd.org/changeset/base/217116 Log: MFC r216832: Make -S functional Approved by: re (kib) Modified: releng/7.4/usr.sbin/newsyslog/newsyslog.c Directory Properties: releng/7.4/usr.sbin/newsyslog/ (props changed) Modified: releng/7.4/usr.sbin/newsyslog/newsyslog.c == --- releng/7.4/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 18:33:26 2011 (r217115) +++ releng/7.4/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 18:34:09 2011 (r217116) @@ -583,7 +583,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, a:d:f:nrsvCD:FNPR:)) != -1) + while ((ch = getopt(argc, argv, a:d:f:nrsvCD:FNPR:S:)) != -1) switch (ch) { case 'a': archtodir++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r216832 - head/usr.sbin/newsyslog
Author: brian Date: Fri Dec 31 01:10:42 2010 New Revision: 216832 URL: http://svn.freebsd.org/changeset/base/216832 Log: Make -S functional. MFC after:1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Fri Dec 31 00:46:30 2010 (r216831) +++ head/usr.sbin/newsyslog/newsyslog.c Fri Dec 31 01:10:42 2010 (r216832) @@ -599,7 +599,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, a:d:f:nrst:vCD:FNPR:)) != -1) + while ((ch = getopt(argc, argv, a:d:f:nrst:vCD:FNPR:S:)) != -1) switch (ch) { case 'a': archtodir++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r215953 - stable/8/sys/dev/asr
Author: brian Date: Sat Nov 27 21:18:08 2010 New Revision: 215953 URL: http://svn.freebsd.org/changeset/base/215953 Log: MFC r215843: Don't zero 'Info' after setting it up in the ASR_IOCTL_COMPAT case. Modified: stable/8/sys/dev/asr/asr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/mips/alchemy/ (props changed) stable/8/sys/mips/atheros/ (props changed) stable/8/sys/mips/cavium/ (props changed) stable/8/sys/mips/cavium/dev/ (props changed) stable/8/sys/mips/rmi/ (props changed) stable/8/sys/mips/rmi/dev/ (props changed) stable/8/sys/mips/sibyte/ (props changed) Modified: stable/8/sys/dev/asr/asr.c == --- stable/8/sys/dev/asr/asr.c Sat Nov 27 20:38:26 2010(r215952) +++ stable/8/sys/dev/asr/asr.c Sat Nov 27 21:18:08 2010(r215953) @@ -3708,9 +3708,9 @@ asr_ioctl(struct cdev *dev, u_long cmd, Info.drive1CMOS = j; Info.numDrives = *((char *)ptok(0x475)); -#endif /* ASR_IOCTL_COMPAT */ - +#else /* ASR_IOCTL_COMPAT */ bzero(Info, sizeof(Info)); +#endif /* ASR_IOCTL_COMPAT */ Info.processorFamily = ASR_sig.dsProcessorFamily; #if defined(__i386__) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r215842 - stable/7/sbin/natd
Author: brian Date: Thu Nov 25 21:42:36 2010 New Revision: 215842 URL: http://svn.freebsd.org/changeset/base/215842 Log: MF8: Don't abend if we get ENOMEM from sysctl(3). The data returned is sufficient Modified: stable/7/sbin/natd/natd.c Directory Properties: stable/7/sbin/natd/ (props changed) Modified: stable/7/sbin/natd/natd.c == --- stable/7/sbin/natd/natd.c Thu Nov 25 20:35:49 2010(r215841) +++ stable/7/sbin/natd/natd.c Thu Nov 25 21:42:36 2010(r215842) @@ -885,7 +885,7 @@ SetAliasAddressFromIfName(const char *if err(1, iflist-sysctl-estimate); if ((buf = malloc(needed)) == NULL) errx(1, malloc failed); - if (sysctl(mib, 6, buf, needed, NULL, 0) == -1) + if (sysctl(mib, 6, buf, needed, NULL, 0) == -1 errno != ENOMEM) err(1, iflist-sysctl-get); lim = buf + needed; /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r215778 - stable/7/sbin/growfs
Author: brian Date: Tue Nov 23 21:45:14 2010 New Revision: 215778 URL: http://svn.freebsd.org/changeset/base/215778 Log: MFC r197763, r198236, r212839 and r212886: Handle extending a filesystem into unzeroed storage. Modified: stable/7/sbin/growfs/Makefile stable/7/sbin/growfs/growfs.c Directory Properties: stable/7/sbin/growfs/ (props changed) Modified: stable/7/sbin/growfs/Makefile == --- stable/7/sbin/growfs/Makefile Tue Nov 23 21:42:26 2010 (r215777) +++ stable/7/sbin/growfs/Makefile Tue Nov 23 21:45:14 2010 (r215778) @@ -10,8 +10,6 @@ PROG= growfs SRCS= growfs.c MAN= growfs.8 -WARNS?=6 - .if defined(GFSDBG) SRCS+= debug.c .endif Modified: stable/7/sbin/growfs/growfs.c == --- stable/7/sbin/growfs/growfs.c Tue Nov 23 21:42:26 2010 (r215777) +++ stable/7/sbin/growfs/growfs.c Tue Nov 23 21:45:14 2010 (r215778) @@ -371,16 +371,16 @@ static void initcg(int cylno, time_t utime, int fso, unsigned int Nflag) { DBG_FUNC(initcg) - static void *iobuf; + static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; struct csum *cs; uint d, dupper, dlower; - if (iobuf == NULL (iobuf = malloc(sblock.fs_bsize)) == NULL) { + if (iobuf == NULL (iobuf = malloc(sblock.fs_bsize * 3)) == NULL) errx(37, panic: cannot allocate I/O buffer); - } + /* * Determine block bounds for cylinder group. * Allow space for super block summary information in first @@ -400,7 +400,8 @@ initcg(int cylno, time_t utime, int fso, acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg; + acg.cg_initediblk = sblock.fs_ipg 2 * INOPB(sblock) ? + sblock.fs_ipg : 2 * INOPB(sblock); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -451,7 +452,7 @@ initcg(int cylno, time_t utime, int fso, bzero(iobuf, sblock.fs_bsize); for (i = 0; i sblock.fs_ipg / INOPF(sblock); i += sblock.fs_frag) { - dp1 = (struct ufs1_dinode *)iobuf; + dp1 = (struct ufs1_dinode *)(void *)iobuf; #ifdef FSIRAND for (j = 0; j INOPB(sblock); j++) { dp1-di_gen = random(); @@ -533,11 +534,14 @@ initcg(int cylno, time_t utime, int fso, sblock.fs_cstotal.cs_nbfree += acg.cg_cs.cs_nbfree; sblock.fs_cstotal.cs_nifree += acg.cg_cs.cs_nifree; *cs = acg.cg_cs; + + memcpy(iobuf, acg, sblock.fs_cgsize); + memset(iobuf + sblock.fs_cgsize, '\0', + sblock.fs_bsize * 3 - sblock.fs_cgsize); + wtfs(fsbtodb(sblock, cgtod(sblock, cylno)), - sblock.fs_bsize, (char *)acg, fso, Nflag); - DBG_DUMP_CG(sblock, - new cg, - acg); + sblock.fs_bsize * 3, iobuf, fso, Nflag); + DBG_DUMP_CG(sblock, new cg, acg); DBG_LEAVE; return; @@ -2209,6 +2213,7 @@ main(int argc, char **argv) printf(Warning: %jd sector(s) cannot be allocated.\n, (intmax_t)fsbtodb(sblock, sblock.fs_size % sblock.fs_fpg)); sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg; + maxino -= sblock.fs_ipg; } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r215667 - stable/8/sbin/fdisk
Author: brian Date: Mon Nov 22 09:32:54 2010 New Revision: 215667 URL: http://svn.freebsd.org/changeset/base/215667 Log: MFC r212247 r212724 from head: Handle geli-encrypted root disk devices. Add support for identifying a journaled root filesystem. Fix support for identifying the given /dev/vinum/root example. Modified: stable/8/sbin/fdisk/fdisk.c Directory Properties: stable/8/sbin/fdisk/ (props changed) Modified: stable/8/sbin/fdisk/fdisk.c == --- stable/8/sbin/fdisk/fdisk.c Mon Nov 22 09:25:32 2010(r215666) +++ stable/8/sbin/fdisk/fdisk.c Mon Nov 22 09:32:54 2010(r215667) @@ -1461,6 +1461,8 @@ sanitize_partition(struct dos_partition * /dev/ad0s1a = /dev/ad0 * /dev/da0a = /dev/da0 * /dev/vinum/root = /dev/vinum/root + * A .eli part is removed if it exists (see geli(8)). + * A .journal ending is removed if it exists (see gjournal(8)). */ static char * get_rootdisk(void) @@ -1469,16 +1471,20 @@ get_rootdisk(void) regex_t re; #define NMATCHES 2 regmatch_t rm[NMATCHES]; - char *s; + char dev[PATH_MAX], *s; int rv; if (statfs(/, rootfs) == -1) err(1, statfs(\/\)); - if ((rv = regcomp(re, ^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?$, + if ((rv = regcomp(re, ^(/dev/[a-z/]+[0-9]*)([sp][0-9]+)?[a-h]?(\\.journal)?$, REG_EXTENDED)) != 0) errx(1, regcomp() failed (%d), rv); - if ((rv = regexec(re, rootfs.f_mntfromname, NMATCHES, rm, 0)) != 0) + strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); + if ((s = strstr(dev, .eli)) != NULL) + memmove(s, s+4, strlen(s + 4) + 1); + + if ((rv = regexec(re, dev, NMATCHES, rm, 0)) != 0) errx(1, mounted root fs resource doesn't match expectations (regexec returned %d), rv); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r215668 - stable/7/sbin/fdisk
Author: brian Date: Mon Nov 22 09:34:38 2010 New Revision: 215668 URL: http://svn.freebsd.org/changeset/base/215668 Log: MFC r212247 r212724 from head: Handle geli-encrypted root disk devices. Add support for identifying a journaled root filesystem. Fix support for identifying the given /dev/vinum/root example. Modified: stable/7/sbin/fdisk/fdisk.c Directory Properties: stable/7/sbin/fdisk/ (props changed) Modified: stable/7/sbin/fdisk/fdisk.c == --- stable/7/sbin/fdisk/fdisk.c Mon Nov 22 09:32:54 2010(r215667) +++ stable/7/sbin/fdisk/fdisk.c Mon Nov 22 09:34:38 2010(r215668) @@ -1492,6 +1492,8 @@ sanitize_partition(struct dos_partition * /dev/ad0s1a = /dev/ad0 * /dev/da0a = /dev/da0 * /dev/vinum/root = /dev/vinum/root + * A .eli part is removed if it exists (see geli(8)). + * A .journal ending is removed if it exists (see gjournal(8)). */ static char * get_rootdisk(void) @@ -1500,16 +1502,20 @@ get_rootdisk(void) regex_t re; #define NMATCHES 2 regmatch_t rm[NMATCHES]; - char *s; + char dev[PATH_MAX], *s; int rv; if (statfs(/, rootfs) == -1) err(1, statfs(\/\)); - if ((rv = regcomp(re, ^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?$, + if ((rv = regcomp(re, ^(/dev/[a-z/]+[0-9]*)([sp][0-9]+)?[a-h]?(\\.journal)?$, REG_EXTENDED)) != 0) errx(1, regcomp() failed (%d), rv); - if ((rv = regexec(re, rootfs.f_mntfromname, NMATCHES, rm, 0)) != 0) + strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); + if ((s = strstr(dev, .eli)) != NULL) + memmove(s, s+4, strlen(s + 4) + 1); + + if ((rv = regexec(re, dev, NMATCHES, rm, 0)) != 0) errx(1, mounted root fs resource doesn't match expectations (regexec returned %d), rv); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r214956 - in stable/8: sbin/growfs tools/regression/lib/msun tools/regression/sbin tools/regression/usr.bin/pkill tools/tools/ath/common tools/tools/termcap
Author: brian Date: Sun Nov 7 22:24:17 2010 New Revision: 214956 URL: http://svn.freebsd.org/changeset/base/214956 Log: MFC r197763 and r212839: Handle extending a filesystem into unzeroed storage. Added: stable/8/tools/regression/sbin/ - copied from r212839, head/tools/regression/sbin/ Modified: stable/8/sbin/growfs/growfs.c Directory Properties: stable/8/sbin/growfs/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/sbin/growfs/growfs.c == --- stable/8/sbin/growfs/growfs.c Sun Nov 7 21:57:57 2010 (r214955) +++ stable/8/sbin/growfs/growfs.c Sun Nov 7 22:24:17 2010 (r214956) @@ -371,16 +371,16 @@ static void initcg(int cylno, time_t utime, int fso, unsigned int Nflag) { DBG_FUNC(initcg) - static void *iobuf; + static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; struct csum *cs; uint d, dupper, dlower; - if (iobuf == NULL (iobuf = malloc(sblock.fs_bsize)) == NULL) { + if (iobuf == NULL (iobuf = malloc(sblock.fs_bsize * 3)) == NULL) errx(37, panic: cannot allocate I/O buffer); - } + /* * Determine block bounds for cylinder group. * Allow space for super block summary information in first @@ -400,7 +400,8 @@ initcg(int cylno, time_t utime, int fso, acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg; + acg.cg_initediblk = sblock.fs_ipg 2 * INOPB(sblock) ? + sblock.fs_ipg : 2 * INOPB(sblock); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -533,11 +534,14 @@ initcg(int cylno, time_t utime, int fso, sblock.fs_cstotal.cs_nbfree += acg.cg_cs.cs_nbfree; sblock.fs_cstotal.cs_nifree += acg.cg_cs.cs_nifree; *cs = acg.cg_cs; + + memcpy(iobuf, acg, sblock.fs_cgsize); + memset(iobuf + sblock.fs_cgsize, '\0', + sblock.fs_bsize * 3 - sblock.fs_cgsize); + wtfs(fsbtodb(sblock, cgtod(sblock, cylno)), - sblock.fs_bsize, (char *)acg, fso, Nflag); - DBG_DUMP_CG(sblock, - new cg, - acg); + sblock.fs_bsize * 3, iobuf, fso, Nflag); + DBG_DUMP_CG(sblock, new cg, acg); DBG_LEAVE; return; @@ -2209,6 +2213,7 @@ main(int argc, char **argv) printf(Warning: %jd sector(s) cannot be allocated.\n, (intmax_t)fsbtodb(sblock, sblock.fs_size % sblock.fs_fpg));
svn commit: r214957 - stable/8/sbin/growfs
Author: brian Date: Sun Nov 7 22:28:55 2010 New Revision: 214957 URL: http://svn.freebsd.org/changeset/base/214957 Log: MFC r198236 for now. Modified: stable/8/sbin/growfs/Makefile Directory Properties: stable/8/sbin/growfs/ (props changed) Modified: stable/8/sbin/growfs/Makefile == --- stable/8/sbin/growfs/Makefile Sun Nov 7 22:24:17 2010 (r214956) +++ stable/8/sbin/growfs/Makefile Sun Nov 7 22:28:55 2010 (r214957) @@ -10,8 +10,6 @@ PROG= growfs SRCS= growfs.c MAN= growfs.8 -WARNS?=6 - .if defined(GFSDBG) SRCS+= debug.c .endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r214958 - stable/8/sbin/growfs
Author: brian Date: Sun Nov 7 22:33:55 2010 New Revision: 214958 URL: http://svn.freebsd.org/changeset/base/214958 Log: MFC r212886 (by marcel): Unbreak the build on strong-aligned architectures. Modified: stable/8/sbin/growfs/growfs.c Directory Properties: stable/8/sbin/growfs/ (props changed) Modified: stable/8/sbin/growfs/growfs.c == --- stable/8/sbin/growfs/growfs.c Sun Nov 7 22:28:55 2010 (r214957) +++ stable/8/sbin/growfs/growfs.c Sun Nov 7 22:33:55 2010 (r214958) @@ -452,7 +452,7 @@ initcg(int cylno, time_t utime, int fso, bzero(iobuf, sblock.fs_bsize); for (i = 0; i sblock.fs_ipg / INOPF(sblock); i += sblock.fs_frag) { - dp1 = (struct ufs1_dinode *)iobuf; + dp1 = (struct ufs1_dinode *)(void *)iobuf; #ifdef FSIRAND for (j = 0; j INOPB(sblock); j++) { dp1-di_gen = random(); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r212955 - stable/8/sbin/dhclient
Author: brian Date: Tue Sep 21 07:43:56 2010 New Revision: 212955 URL: http://svn.freebsd.org/changeset/base/212955 Log: MFC r212253: Document how to use dhclient-{enter,exit}-hooks. PR: 149351 Modified: stable/8/sbin/dhclient/dhclient-script.8 Directory Properties: stable/8/sbin/dhclient/ (props changed) Modified: stable/8/sbin/dhclient/dhclient-script.8 == --- stable/8/sbin/dhclient/dhclient-script.8Tue Sep 21 07:03:53 2010 (r212954) +++ stable/8/sbin/dhclient/dhclient-script.8Tue Sep 21 07:43:56 2010 (r212955) @@ -38,7 +38,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 1, 1997 +.Dd September 6, 2010 .Dt DHCLIENT-SCRIPT 8 .Os .Sh NAME @@ -218,6 +218,29 @@ if it has reason to believe they are val If not, it should exit with a nonzero value. .El .Pp +Before taking action according to +.Va $reason , +.Nm +will check for the existence of +.Pa /etc/dhclient-enter-hooks . +If found, it will be sourced +.Pq see Xr sh 1 . +After taking action according to +.Va $reason , +.Nm +will check for the existence of +.Pa /etc/dhclient-exit-hooks . +If found, it will be sourced +.Pq see Xr sh 1 . +These hooks scripts can be used to dynamically modify the enviornment at +appropriate times during the DHCP negotiations. +For example, if the administrator wishes to disable alias IP numbers on +the DHCP interface, they might want to put the following in +.Pa /etc/dhclient-enter-hooks : +.Bd -literal -offset indent +[ .$reason = .PREINIT ] ifconfig $interface 0.0.0.0 +.Ed +.Pp The usual way to test a lease is to set up the network as with .Li REBIND (since this may be called to test more than one lease) and then ping @@ -239,6 +262,7 @@ but current scripts do not do this. .\ and bear the names of the operating systems on which they are intended .\ to work. .Sh SEE ALSO +.Xr sh 1 , .Xr dhclient.conf 5 , .Xr dhclient.leases 5 , .Xr dhclient 8 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r212956 - stable/7/sbin/dhclient
Author: brian Date: Tue Sep 21 07:44:40 2010 New Revision: 212956 URL: http://svn.freebsd.org/changeset/base/212956 Log: MFC r212253: Document how to use dhclient-{enter,exit}-hooks. PR: 149351 Modified: stable/7/sbin/dhclient/dhclient-script.8 Directory Properties: stable/7/sbin/dhclient/ (props changed) Modified: stable/7/sbin/dhclient/dhclient-script.8 == --- stable/7/sbin/dhclient/dhclient-script.8Tue Sep 21 07:43:56 2010 (r212955) +++ stable/7/sbin/dhclient/dhclient-script.8Tue Sep 21 07:44:40 2010 (r212956) @@ -38,7 +38,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 1, 1997 +.Dd September 6, 2010 .Dt DHCLIENT-SCRIPT 8 .Os .Sh NAME @@ -218,6 +218,29 @@ if it has reason to believe they are val If not, it should exit with a nonzero value. .El .Pp +Before taking action according to +.Va $reason , +.Nm +will check for the existence of +.Pa /etc/dhclient-enter-hooks . +If found, it will be sourced +.Pq see Xr sh 1 . +After taking action according to +.Va $reason , +.Nm +will check for the existence of +.Pa /etc/dhclient-exit-hooks . +If found, it will be sourced +.Pq see Xr sh 1 . +These hooks scripts can be used to dynamically modify the enviornment at +appropriate times during the DHCP negotiations. +For example, if the administrator wishes to disable alias IP numbers on +the DHCP interface, they might want to put the following in +.Pa /etc/dhclient-enter-hooks : +.Bd -literal -offset indent +[ .$reason = .PREINIT ] ifconfig $interface 0.0.0.0 +.Ed +.Pp The usual way to test a lease is to set up the network as with .Li REBIND (since this may be called to test more than one lease) and then ping @@ -239,6 +262,7 @@ but current scripts do not do this. .\ and bear the names of the operating systems on which they are intended .\ to work. .Sh SEE ALSO +.Xr sh 1 , .Xr dhclient.conf 5 , .Xr dhclient.leases 5 , .Xr dhclient 8 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r212886 - head/sbin/growfs
On Mon, 20 Sep 2010 16:55:57 +1000 (EST) Bruce Evans b...@optusnet.com.au wrote: On Mon, 20 Sep 2010, Marcel Moolenaar wrote: Log: Unbreak the build on strong-aligned architectures (arm, ia64). Casting from (char *) to (struct ufs1_dinode *) changes the alignment requirement of the pointer and GCC does not know that the pointer is adequately aligned (due to malloc(3)), and warns about it. Cast to (void *) first to by-pass the check. A previous version in which the pointer (iobuf) the correct type to begin with was better. It used to have type void *, but now has type caddr_t (whose existence is a bug), in order to abuse caddr_t by assuming that it is char * to do pointer arithmetic on it in 1 place (iobuf + sblock.fs_cgsize). The 7 other places where iobuf is used only assume that caddr_t is a pointer (or perhaps a [u]intptr_t). growfs has no other instances of caddr_t. Maybe iobuf ought to go back to being a void * with casting where the arithmetic happens. If it's changed, newfs/mkfs.c should probably change too. Is there some subtle difference that makes the casting ok in newfs/mkfs.c: dp1 = (struct ufs1_dinode *)(iobuf[start]); and not ok in growfs/growfs.c r212885: dp1 = (struct ufs1_dinode *)iobuf; or is it just ignored because WARNS is 3 for newfs and is defaulted to 6 for growfs? -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r212934 - in head: sbin/geom/class/eli tools/regression/geom_eli
Author: brian Date: Mon Sep 20 22:04:59 2010 New Revision: 212934 URL: http://svn.freebsd.org/changeset/base/212934 Log: Add a geli resize subcommand to resize encrypted filesystems prior to growing the filesystem. Refuse to attach providers where the metadata provider size is wrong. This makes post-boot attaches behave consistently with pre-boot attaches. Also refuse to restore metadata to a provider of the wrong size without the new -f switch. The new -f switch forces the metadata restoration despite the provider size, and updates the provider size in the restored metadata to the correct value. Helped by:pjd Reviewed by: pjd Added: head/tools/regression/geom_eli/resize.t (contents, props changed) Modified: head/sbin/geom/class/eli/geli.8 head/sbin/geom/class/eli/geom_eli.c Modified: head/sbin/geom/class/eli/geli.8 == --- head/sbin/geom/class/eli/geli.8 Mon Sep 20 21:38:52 2010 (r212933) +++ head/sbin/geom/class/eli/geli.8 Mon Sep 20 22:04:59 2010 (r212934) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd August 29, 2008 +.Dd September 20, 2010 .Dt GELI 8 .Os .Sh NAME @@ -111,10 +111,15 @@ utility: .Ar file .Nm .Cm restore -.Op Fl v +.Op Fl fv .Ar file .Ar prov .Nm +.Cm resize +.Op Fl v +.Fl s Ar oldsize +.Ar prov +.Nm .Cm clear .Op Fl v .Ar prov ... @@ -464,6 +469,34 @@ If specified, all currently attached pro Backup metadata from the given provider to the given file. .It Cm restore Restore metadata from the given file to the given provider. +.Bl -tag -width .Fl f +.It Fl f +Metadata contains the size of the provider to ensure that the correct +partition or slice is attached. +If an attempt is made to restore metadata to a provider that has a different +size, +.Nm +will refuse to restore the data unless the +.Fl f +switch is used. +If the partition or slice has been grown, the +.Cm resize +subcommand should be used rather than attempting to relocate the metadata +through +.Cm backup +and +.Cm restore . +.El +.It Cm resize +Inform +.Nm +that the provider has been resized. +The old metadata block is relocated to the correct position at the end of the +provider and the provider size is updated. +.Bl -tag -width .Fl s Ar oldsize +.It Fl s Ar oldsize +The size of the provider before it was resized. +.El .It Cm clear Clear metadata from the given providers. .It Cm dump @@ -665,6 +698,17 @@ geli: Cannot read metadata from /dev/da0 # geli attach /dev/da0 Enter passphrase: .Ed +.Pp +If an encrypted filesystem is extended, it is necessary to relocate and +update the metadata: +.Bd -literal -offset indent +# gpart create -s GPT ada0 +# gpart add -s 1g -t freebsd-ufs -i 1 ada0 +# geli init -K keyfile -P ada0p1 +# gpart resize -s 2g -i 1 ada0 +# geli resize -s 1g ada0p1 +# geli attach -k keyfile -p ada0p1 +.Ed .Sh DATA AUTHENTICATION .Nm can verify data integrity when an authentication algorithm is specified. Modified: head/sbin/geom/class/eli/geom_eli.c == --- head/sbin/geom/class/eli/geom_eli.c Mon Sep 20 21:38:52 2010 (r212933) +++ head/sbin/geom/class/eli/geom_eli.c Mon Sep 20 22:04:59 2010 (r212934) @@ -66,6 +66,7 @@ static void eli_delkey(struct gctl_req * static void eli_kill(struct gctl_req *req); static void eli_backup(struct gctl_req *req); static void eli_restore(struct gctl_req *req); +static void eli_resize(struct gctl_req *req); static void eli_clear(struct gctl_req *req); static void eli_dump(struct gctl_req *req); @@ -86,7 +87,8 @@ static int eli_backup_create(struct gctl * delkey [-afv] [-n keyno] prov * kill [-av] [prov ...] * backup [-v] prov file - * restore [-v] file prov + * restore [-fv] file prov + * resize [-v] -s oldsize prov * clear [-v] prov ... * dump [-v] prov ... */ @@ -197,8 +199,19 @@ struct g_command class_commands[] = { { backup, G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, [-v] prov file }, - { restore, G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, - [-v] file prov + { restore, G_FLAG_VERBOSE, eli_main, + { + { 'f', force, NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + [-fv] file prov + }, + { resize, G_FLAG_VERBOSE, eli_main, + { + { 's', oldsize, NULL, G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + [-v] -s oldsize prov }, { clear, G_FLAG_VERBOSE, eli_main, G_NULL_OPTS, [-v] prov ... @@ -264,6 +277,8 @@ eli_main(struct gctl_req *req, unsigned eli_backup(req); else if (strcmp(name, restore) == 0) eli_restore(req); + else if (strcmp(name, resize) == 0) + eli_resize(req); else if (strcmp(name, dump) == 0) eli_dump(req); else if
svn commit: r212839 - in head: sbin/growfs tools/regression/sbin tools/regression/sbin/growfs
Author: brian Date: Sun Sep 19 08:18:56 2010 New Revision: 212839 URL: http://svn.freebsd.org/changeset/base/212839 Log: Revise r197763 which fixes filesystem corruption when extending into un-zeroed storage. The original patch was questioned by Kirk as it forces the filesystem to do excessive work initialising inodes on first use, and was never MFC'd. This change mimics the newfs(8) approach of zeroing two blocks of inodes for each new cylinder group. Reviewed by: mckusick MFC after:3 weeks Added: head/tools/regression/sbin/ head/tools/regression/sbin/Makefile (contents, props changed) head/tools/regression/sbin/growfs/ head/tools/regression/sbin/growfs/Makefile (contents, props changed) head/tools/regression/sbin/growfs/regress.t (contents, props changed) Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c == --- head/sbin/growfs/growfs.c Sun Sep 19 05:42:29 2010(r212838) +++ head/sbin/growfs/growfs.c Sun Sep 19 08:18:56 2010(r212839) @@ -371,16 +371,16 @@ static void initcg(int cylno, time_t utime, int fso, unsigned int Nflag) { DBG_FUNC(initcg) - static void *iobuf; + static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; struct csum *cs; uint d, dupper, dlower; - if (iobuf == NULL (iobuf = malloc(sblock.fs_bsize)) == NULL) { + if (iobuf == NULL (iobuf = malloc(sblock.fs_bsize * 3)) == NULL) errx(37, panic: cannot allocate I/O buffer); - } + /* * Determine block bounds for cylinder group. * Allow space for super block summary information in first @@ -396,17 +396,12 @@ initcg(int cylno, time_t utime, int fso, dupper += howmany(sblock.fs_cssize, sblock.fs_fsize); cs = fscs[cylno]; memset(acg, 0, sblock.fs_cgsize); - /* -* Note that we do not set cg_initediblk at all. -* In this extension of a previous filesystem -* we have no inodes initialized for the cylinder -* group at all. The first access to that cylinder -* group will do the correct initialization. -*/ acg.cg_time = utime; acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; + acg.cg_initediblk = sblock.fs_ipg 2 * INOPB(sblock) ? + sblock.fs_ipg : 2 * INOPB(sblock); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -419,6 +414,7 @@ initcg(int cylno, time_t utime, int fso, acg.cg_time = 0; acg.cg_old_niblk = acg.cg_niblk; acg.cg_niblk = 0; + acg.cg_initediblk = 0; acg.cg_old_btotoff = start; acg.cg_old_boff = acg.cg_old_btotoff + sblock.fs_old_cpg * sizeof(int32_t); @@ -538,11 +534,14 @@ initcg(int cylno, time_t utime, int fso, sblock.fs_cstotal.cs_nbfree += acg.cg_cs.cs_nbfree; sblock.fs_cstotal.cs_nifree += acg.cg_cs.cs_nifree; *cs = acg.cg_cs; + + memcpy(iobuf, acg, sblock.fs_cgsize); + memset(iobuf + sblock.fs_cgsize, '\0', + sblock.fs_bsize * 3 - sblock.fs_cgsize); + wtfs(fsbtodb(sblock, cgtod(sblock, cylno)), - sblock.fs_bsize, (char *)acg, fso, Nflag); - DBG_DUMP_CG(sblock, - new cg, - acg); + sblock.fs_bsize * 3, iobuf, fso, Nflag); + DBG_DUMP_CG(sblock, new cg, acg); DBG_LEAVE; return; Added: head/tools/regression/sbin/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sbin/Makefile Sun Sep 19 08:18:56 2010 (r212839) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR=growfs + +.include bsd.subdir.mk Added: head/tools/regression/sbin/growfs/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sbin/growfs/Makefile Sun Sep 19 08:18:56 2010 (r212839) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +all test: + prove -vmw regress.t + +clean: Added: head/tools/regression/sbin/growfs/regress.t == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sbin/growfs/regress.t Sun Sep 19 08:18:56 2010 (r212839) @@ -0,0 +1,91 @@ +#! /usr/bin/perl +# +# $FreeBSD$ + +use strict; +use warnings; +use Test::More tests = 19; +use Fcntl qw(:DEFAULT :seek); + +use constant BLK = 512; +use constant BLKS_PER_MB = 2048; + +my $unit; +END { system mdconfig -du$unit
svn commit: r212845 - head/sys/geom/eli
Author: brian Date: Sun Sep 19 10:45:53 2010 New Revision: 212845 URL: http://svn.freebsd.org/changeset/base/212845 Log: Support attaching version 4 metadata Reviewed by: pjd Modified: head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.h == --- head/sys/geom/eli/g_eli.h Sun Sep 19 09:19:38 2010(r212844) +++ head/sys/geom/eli/g_eli.h Sun Sep 19 10:45:53 2010(r212845) @@ -228,8 +228,9 @@ eli_metadata_decode_v0(const u_char *dat return (EINVAL); return (0); } + static __inline int -eli_metadata_decode_v1v2v3(const u_char *data, struct g_eli_metadata *md) +eli_metadata_decode_v1v2v3v4(const u_char *data, struct g_eli_metadata *md) { MD5_CTX ctx; const u_char *p; @@ -266,7 +267,8 @@ eli_metadata_decode(const u_char *data, case 1: case 2: case 3: - error = eli_metadata_decode_v1v2v3(data, md); + case 4: + error = eli_metadata_decode_v1v2v3v4(data, md); break; default: error = EINVAL; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r212848 - in stable/8: bin/pax tools/regression/bin tools/regression/bin/pax tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/common tools/tools/termcap
Author: brian Date: Sun Sep 19 11:16:49 2010 New Revision: 212848 URL: http://svn.freebsd.org/changeset/base/212848 Log: MFC r211864,211963,211964,211965, don't mis-handle path names of 101 characters beginning with '/'. Added: stable/8/tools/regression/bin/Makefile - copied unchanged from r211964, head/tools/regression/bin/Makefile stable/8/tools/regression/bin/pax/ - copied from r211963, head/tools/regression/bin/pax/ Modified: stable/8/bin/pax/pax.1 stable/8/bin/pax/tar.c stable/8/tools/regression/bin/pax/Makefile Directory Properties: stable/8/bin/pax/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/bin/pax/pax.1 == --- stable/8/bin/pax/pax.1 Sun Sep 19 10:54:58 2010(r212847) +++ stable/8/bin/pax/pax.1 Sun Sep 19 11:16:49 2010(r212848) @@ -33,7 +33,7 @@ .\@(#)pax.1 8.4 (Berkeley) 4/18/94 .\ $FreeBSD$ .\ -.Dd July 3, 2004 +.Dd August 29, 2010 .Dt PAX 1 .Os .Sh NAME @@ -748,7 +748,9 @@ The extended tar interchange format spec .St -p1003.2 standard. The default blocksize for this format is 10240 bytes. -Pathnames stored by this format must be 250 characters or less in length. +Pathnames stored by this format must be 255 characters or less in length. +The directory part may be at most 155 characters and each path component +must be less than 100 characters. .El .Pp The Modified: stable/8/bin/pax/tar.c == --- stable/8/bin/pax/tar.c Sun Sep 19 10:54:58 2010(r212847) +++ stable/8/bin/pax/tar.c Sun Sep 19 11:16:49 2010(r212848) @@ -1086,7 +1086,7 @@ name_split(char *name, int len) */ if (len = TNMSZ) return(name); - if (len (TPFSZ + TNMSZ + 1)) + if (len TPFSZ + TNMSZ) return(NULL); /* @@ -1095,7 +1095,7 @@ name_split(char *name, int len) * to find the biggest piece to fit in the name field (or the smallest * prefix we can find) */ - start = name + len - TNMSZ - 1; + start = name + len - TNMSZ; while ((*start != '\0') (*start != '/')) ++start; Copied: stable/8/tools/regression/bin/Makefile (from r211964, head/tools/regression/bin/Makefile) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/Makefile Sun Sep 19 11:16:49 2010 (r212848, copy of r211964, head/tools/regression/bin/Makefile) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR=date mv pax sh + +.include bsd.subdir.mk Modified: stable/8/tools/regression/bin/pax/Makefile == --- head/tools/regression/bin/pax/Makefile Sun Aug 29 11:56:56
svn commit: r212849 - in stable/7: bin/pax tools/regression/bin tools/regression/bin/pax tools/tools/nanobsd
Author: brian Date: Sun Sep 19 11:22:22 2010 New Revision: 212849 URL: http://svn.freebsd.org/changeset/base/212849 Log: MFC r211864,211963,211964,211965, don't mis-handle path names of 101 characters beginning with '/'. Added: stable/7/tools/regression/bin/Makefile - copied unchanged from r211964, head/tools/regression/bin/Makefile stable/7/tools/regression/bin/pax/ - copied from r211963, head/tools/regression/bin/pax/ Modified: stable/7/bin/pax/pax.1 stable/7/bin/pax/tar.c stable/7/tools/regression/bin/pax/Makefile Directory Properties: stable/7/bin/pax/ (props changed) stable/7/tools/ (props changed) stable/7/tools/build/ (props changed) stable/7/tools/build/options/ (props changed) stable/7/tools/debugscripts/ (props changed) stable/7/tools/regression/atm/ (props changed) stable/7/tools/regression/bin/sh/ (props changed) stable/7/tools/regression/file/ (props changed) stable/7/tools/regression/file/flock/ (props changed) stable/7/tools/regression/usr.bin/ (props changed) stable/7/tools/regression/usr.bin/jot/ (props changed) stable/7/tools/regression/usr.bin/tr/ (props changed) stable/7/tools/sched/ (props changed) stable/7/tools/test/ (props changed) stable/7/tools/tools/aac/ (props changed) stable/7/tools/tools/crypto/ (props changed) stable/7/tools/tools/editing/ (props changed) stable/7/tools/tools/nanobsd/ (props changed) stable/7/tools/tools/nanobsd/FlashDevice.sub (props changed) stable/7/tools/tools/nanobsd/nanobsd.sh (props changed) stable/7/tools/tools/usb/ (props changed) Modified: stable/7/bin/pax/pax.1 == --- stable/7/bin/pax/pax.1 Sun Sep 19 11:16:49 2010(r212848) +++ stable/7/bin/pax/pax.1 Sun Sep 19 11:22:22 2010(r212849) @@ -33,7 +33,7 @@ .\@(#)pax.1 8.4 (Berkeley) 4/18/94 .\ $FreeBSD$ .\ -.Dd July 3, 2004 +.Dd August 29, 2010 .Dt PAX 1 .Os .Sh NAME @@ -748,7 +748,9 @@ The extended tar interchange format spec .St -p1003.2 standard. The default blocksize for this format is 10240 bytes. -Pathnames stored by this format must be 250 characters or less in length. +Pathnames stored by this format must be 255 characters or less in length. +The directory part may be at most 155 characters and each path component +must be less than 100 characters. .El .Pp The Modified: stable/7/bin/pax/tar.c == --- stable/7/bin/pax/tar.c Sun Sep 19 11:16:49 2010(r212848) +++ stable/7/bin/pax/tar.c Sun Sep 19 11:22:22 2010(r212849) @@ -1086,7 +1086,7 @@ name_split(char *name, int len) */ if (len = TNMSZ) return(name); - if (len (TPFSZ + TNMSZ + 1)) + if (len TPFSZ + TNMSZ) return(NULL); /* @@ -1095,7 +1095,7 @@ name_split(char *name, int len) * to find the biggest piece to fit in the name field (or the smallest * prefix we can find) */ - start = name + len - TNMSZ - 1; + start = name + len - TNMSZ; while ((*start != '\0') (*start != '/')) ++start; Copied: stable/7/tools/regression/bin/Makefile (from r211964, head/tools/regression/bin/Makefile) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/regression/bin/Makefile Sun Sep 19 11:22:22 2010 (r212849, copy of r211964, head/tools/regression/bin/Makefile) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR=date mv pax sh + +.include bsd.subdir.mk Modified: stable/7/tools/regression/bin/pax/Makefile == --- head/tools/regression/bin/pax/Makefile Sun Aug 29 11:56:56 2010 (r211963) +++ stable/7/tools/regression/bin/pax/Makefile Sun Sep 19 11:22:22 2010 (r212849) @@ -1,6 +1,6 @@ # $FreeBSD$ -test: +all test: prove -vmw regress.t clean: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r212724 - head/sbin/fdisk
Author: brian Date: Thu Sep 16 08:16:53 2010 New Revision: 212724 URL: http://svn.freebsd.org/changeset/base/212724 Log: Add support for identifying a journaled root filesystem. Fix support for identifying the given /dev/vinum/root example. MFC after:3 weeks Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c == --- head/sbin/fdisk/fdisk.c Thu Sep 16 07:56:34 2010(r212723) +++ head/sbin/fdisk/fdisk.c Thu Sep 16 08:16:53 2010(r212724) @@ -1462,6 +1462,7 @@ sanitize_partition(struct dos_partition * /dev/da0a = /dev/da0 * /dev/vinum/root = /dev/vinum/root * A .eli part is removed if it exists (see geli(8)). + * A .journal ending is removed if it exists (see gjournal(8)). */ static char * get_rootdisk(void) @@ -1476,7 +1477,7 @@ get_rootdisk(void) if (statfs(/, rootfs) == -1) err(1, statfs(\/\)); - if ((rv = regcomp(re, ^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?$, + if ((rv = regcomp(re, ^(/dev/[a-z/]+[0-9]*)([sp][0-9]+)?[a-h]?(\\.journal)?$, REG_EXTENDED)) != 0) errx(1, regcomp() failed (%d), rv); strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r212247 - head/sbin/fdisk
On Mon, 6 Sep 2010 08:41:42 +0200 Pawel Jakub Dawidek p...@freebsd.org wrote: On Mon, Sep 06, 2010 at 04:15:49AM +, Brian Somers wrote: Author: brian Date: Mon Sep 6 04:15:49 2010 New Revision: 212247 URL: http://svn.freebsd.org/changeset/base/212247 Log: Handle geli-encrypted root disk devices. [...] if ((rv = regcomp(re, ^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?$, REG_EXTENDED)) != 0) errx(1, regcomp() failed (%d), rv); - if ((rv = regexec(re, rootfs.f_mntfromname, NMATCHES, rm, 0)) != 0) + strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); + if ((s = strstr(dev, .eli)) != NULL) + memmove(s, s+4, strlen(s + 4) + 1); + + if ((rv = regexec(re, dev, NMATCHES, rm, 0)) != 0) errx(1, mounted root fs resource doesn't match expectations (regexec returned %d), rv); Your assumption that .eli can only be present at the end of provider name is incorrect. It can be eg. /dev/ad0s1a.eli.journal. Another problem is that in memmove you cut the first 4 characters, not the last 4 characters. I'm not sure, but can't you simply extend regular expression to: ^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?(\.eli)?$ You've lost me here. I remove .eli from the device name specifically so that we handle it being *anywhere* in the string. Your suggestion only handles it being at the end of the string. The memmove doesn't cut the first four characters, it cuts the .eli string doesn't it? -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
svn commit: r212253 - head/sbin/dhclient
Author: brian Date: Mon Sep 6 09:59:10 2010 New Revision: 212253 URL: http://svn.freebsd.org/changeset/base/212253 Log: Document dhclient-enter-hooks and dhclient-exit-hooks and mention how to configure dhclient to clear the interface of IP numbers prior to configuring it. PR: 149351 MFC after:2 weeks Modified: head/sbin/dhclient/dhclient-script.8 Modified: head/sbin/dhclient/dhclient-script.8 == --- head/sbin/dhclient/dhclient-script.8Mon Sep 6 07:35:13 2010 (r212252) +++ head/sbin/dhclient/dhclient-script.8Mon Sep 6 09:59:10 2010 (r212253) @@ -38,7 +38,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 1, 1997 +.Dd September 6, 2010 .Dt DHCLIENT-SCRIPT 8 .Os .Sh NAME @@ -218,6 +218,29 @@ if it has reason to believe they are val If not, it should exit with a nonzero value. .El .Pp +Before taking action according to +.Va $reason , +.Nm +will check for the existence of +.Pa /etc/dhclient-enter-hooks . +If found, it will be sourced +.Pq see Xr sh 1 . +After taking action according to +.Va $reason , +.Nm +will check for the existence of +.Pa /etc/dhclient-exit-hooks . +If found, it will be sourced +.Pq see Xr sh 1 . +These hooks scripts can be used to dynamically modify the enviornment at +appropriate times during the DHCP negotiations. +For example, if the administrator wishes to disable alias IP numbers on +the DHCP interface, they might want to put the following in +.Pa /etc/dhclient-enter-hooks : +.Bd -literal -offset indent +[ .$reason = .PREINIT ] ifconfig $interface 0.0.0.0 +.Ed +.Pp The usual way to test a lease is to set up the network as with .Li REBIND (since this may be called to test more than one lease) and then ping @@ -239,6 +262,7 @@ but current scripts do not do this. .\ and bear the names of the operating systems on which they are intended .\ to work. .Sh SEE ALSO +.Xr sh 1 , .Xr dhclient.conf 5 , .Xr dhclient.leases 5 , .Xr dhclient 8 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r212247 - head/sbin/fdisk
Author: brian Date: Mon Sep 6 04:15:49 2010 New Revision: 212247 URL: http://svn.freebsd.org/changeset/base/212247 Log: Handle geli-encrypted root disk devices. MFC after:2 weeks Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c == --- head/sbin/fdisk/fdisk.c Mon Sep 6 04:14:59 2010(r212246) +++ head/sbin/fdisk/fdisk.c Mon Sep 6 04:15:49 2010(r212247) @@ -1461,6 +1461,7 @@ sanitize_partition(struct dos_partition * /dev/ad0s1a = /dev/ad0 * /dev/da0a = /dev/da0 * /dev/vinum/root = /dev/vinum/root + * A .eli part is removed if it exists (see geli(8)). */ static char * get_rootdisk(void) @@ -1469,7 +1470,7 @@ get_rootdisk(void) regex_t re; #define NMATCHES 2 regmatch_t rm[NMATCHES]; - char *s; + char dev[PATH_MAX], *s; int rv; if (statfs(/, rootfs) == -1) @@ -1478,7 +1479,11 @@ get_rootdisk(void) if ((rv = regcomp(re, ^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?$, REG_EXTENDED)) != 0) errx(1, regcomp() failed (%d), rv); - if ((rv = regexec(re, rootfs.f_mntfromname, NMATCHES, rm, 0)) != 0) + strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); + if ((s = strstr(dev, .eli)) != NULL) + memmove(s, s+4, strlen(s + 4) + 1); + + if ((rv = regexec(re, dev, NMATCHES, rm, 0)) != 0) errx(1, mounted root fs resource doesn't match expectations (regexec returned %d), rv); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211963 - in head: bin/pax tools/regression/bin/pax
Author: brian Date: Sun Aug 29 11:56:56 2010 New Revision: 211963 URL: http://svn.freebsd.org/changeset/base/211963 Log: Correct an out-by-one error when earlying out ustar filenames that are too long. Filenames escaping this test are caught later on, so the bug doesn't cause any breakage. Document the correct ustar limitations in pax. As I have no access to the IEEE 1003.2 spec, I can only assume that the limitations imposed are in fact correct. Add regression tests for the filename limitations imposed by pax. MFC after:3 weeks Added: head/tools/regression/bin/pax/ head/tools/regression/bin/pax/Makefile (contents, props changed) head/tools/regression/bin/pax/regress.t (contents, props changed) Modified: head/bin/pax/pax.1 head/bin/pax/tar.c Modified: head/bin/pax/pax.1 == --- head/bin/pax/pax.1 Sun Aug 29 11:32:41 2010(r211962) +++ head/bin/pax/pax.1 Sun Aug 29 11:56:56 2010(r211963) @@ -748,7 +748,9 @@ The extended tar interchange format spec .St -p1003.2 standard. The default blocksize for this format is 10240 bytes. -Pathnames stored by this format must be 250 characters or less in length. +Pathnames stored by this format must be 255 characters or less in length. +The directory part may be at most 155 characters and each path component +must be less than 100 characters. .El .Pp The Modified: head/bin/pax/tar.c == --- head/bin/pax/tar.c Sun Aug 29 11:32:41 2010(r211962) +++ head/bin/pax/tar.c Sun Aug 29 11:56:56 2010(r211963) @@ -1086,7 +1086,7 @@ name_split(char *name, int len) */ if (len = TNMSZ) return(name); - if (len (TPFSZ + TNMSZ + 1)) + if (len TPFSZ + TNMSZ) return(NULL); /* Added: head/tools/regression/bin/pax/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/pax/Makefile Sun Aug 29 11:56:56 2010 (r211963) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +test: + prove -vmw regress.t + +clean: + rm -rf ustar-pathnames-[12] + rm -f ustar.ok ustar.fail* Added: head/tools/regression/bin/pax/regress.t == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/pax/regress.t Sun Aug 29 11:56:56 2010 (r211963) @@ -0,0 +1,91 @@ +#! /usr/bin/perl +# +# $FreeBSD$ + +use strict; +use warnings; + +use Test::More tests = 6; +use File::Path qw(rmtree mkpath); +use Cwd; + +my $n = 0; +sub create_file { +my $fn = shift; + +$n++; +(my $dir = $fn) =~ s,/[^/]+$,,; +mkpath $dir; +open my $fd, , $fn or die $fn: $!; +print $fd file $n\n; +} + + +ustar_pathnames: { SKIP: { +# Prove that pax breaks up ustar pathnames properly + +my $top = getcwd . /ustar-pathnames-1; +skip Current path is too long, 6 if length $top 92; +rmtree $top; +my $subdir = x . x x (92 - length $top); +my $work94 = $top/$subdir; +mkpath $work94;# $work is 94 characters long + +my $x49 = x x 49; +my $x50 = x x 50; +my $x60 = x x 60; +my $x95 = x x 95; + +my @paths = ( + $work94/x099, # 99 chars + $work94/xx100,# 100 chars + $work94/xxx101, # 101 chars + $work94/$x49/${x50}x199, # 199 chars + $work94/$x49/${x50}xx200, # 200 chars + $work94/$x49/${x50}xxx201,# 201 chars + $work94/$x60/${x95}254, # 254 chars + $work94/$x60/${x95}x255, # 255 chars +); + +my @l = map { length } @paths; + +my $n = 0; +create_file $_ for @paths; +system pax -wf ustar.ok $work94; +ok($? == 0, Wrote 'ustar.ok' containing files with lengths @l); + +(my $orig = $top) =~ s,1$,2,; +rmtree $orig; +rename $top, $orig; + +system pax -rf ustar.ok; +ok($? == 0, Restored 'ustar.ok' containing files with lengths @l); + +system diff -ru $orig $top; +ok($? == 0, Restored files are identical); + +rmtree $top; +rename $orig, $top; + +# 256 chars (with components 100 chars) should not work +push @paths, $work94/x$x60/${x95}x256; # 256 chars +push @l, length $paths[-1]; +create_file $paths[-1]; +system pax -wf ustar.fail1 $work94; +ok($?, Failed to write 'ustar.fail1' containing files with lengths @l); + +# Components with 100 chars shouldn't work +unlink $paths[-1]; +$paths[-1] = $work94/${x95}xc100;# 100 char filename +$l[-1] = length $paths[-1]; +create_file $paths[-1]; +system pax -wf ustar.fail2 $work94; +ok($?, Failed to write 'ustar.fail2' with a 100 char filename); + +
svn commit: r211964 - in head/tools/regression/bin: . pax
Author: brian Date: Sun Aug 29 12:14:53 2010 New Revision: 211964 URL: http://svn.freebsd.org/changeset/base/211964 Log: Add a Makefile for tools/regression/bin and support 'all' in pax/Makefile. MFC after:3 weeks Added: head/tools/regression/bin/Makefile (contents, props changed) Modified: head/tools/regression/bin/pax/Makefile Added: head/tools/regression/bin/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/Makefile Sun Aug 29 12:14:53 2010 (r211964) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR=date mv pax sh + +.include bsd.subdir.mk Modified: head/tools/regression/bin/pax/Makefile == --- head/tools/regression/bin/pax/Makefile Sun Aug 29 11:56:56 2010 (r211963) +++ head/tools/regression/bin/pax/Makefile Sun Aug 29 12:14:53 2010 (r211964) @@ -1,6 +1,6 @@ # $FreeBSD$ -test: +all test: prove -vmw regress.t clean: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211965 - head/bin/pax
Author: brian Date: Sun Aug 29 12:17:16 2010 New Revision: 211965 URL: http://svn.freebsd.org/changeset/base/211965 Log: Touch the man page date after updating the ustar limitations. MFC after:3 weeks Modified: head/bin/pax/pax.1 Modified: head/bin/pax/pax.1 == --- head/bin/pax/pax.1 Sun Aug 29 12:14:53 2010(r211964) +++ head/bin/pax/pax.1 Sun Aug 29 12:17:16 2010(r211965) @@ -33,7 +33,7 @@ .\@(#)pax.1 8.4 (Berkeley) 4/18/94 .\ $FreeBSD$ .\ -.Dd July 3, 2004 +.Dd August 29, 2010 .Dt PAX 1 .Os .Sh NAME ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211864 - head/bin/pax
Author: brian Date: Fri Aug 27 08:54:40 2010 New Revision: 211864 URL: http://svn.freebsd.org/changeset/base/211864 Log: Fix an off-by-one error where we try to split a path name that's more than 100 characters long and the 101th last character is a '/'. MFC after:3 weeks Modified: head/bin/pax/tar.c Modified: head/bin/pax/tar.c == --- head/bin/pax/tar.c Fri Aug 27 08:05:44 2010(r211863) +++ head/bin/pax/tar.c Fri Aug 27 08:54:40 2010(r211864) @@ -1095,7 +1095,7 @@ name_split(char *name, int len) * to find the biggest piece to fit in the name field (or the smallest * prefix we can find) */ - start = name + len - TNMSZ - 1; + start = name + len - TNMSZ; while ((*start != '\0') (*start != '/')) ++start; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211684 - head/sys/kern
On Mon, 23 Aug 2010 13:28:58 +0300 Kostik Belousov kostik...@gmail.com wrote: On Mon, Aug 23, 2010 at 05:33:31AM +, Brian Somers wrote: Author: brian Date: Mon Aug 23 05:33:31 2010 New Revision: 211684 URL: http://svn.freebsd.org/changeset/base/211684 Log: uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use the uio_offset adjustment instead to calculate a correct *len. Isn't this should be fixed in nfs instead ? Please note that the moral equivalent of the code is also present in compat/linux/linux_cwd.c: linux_getcwd_scandir(). I did not inspected other callers of VOP_READDIR. Without this change, we run off the end of the directory data we're reading and panic horribly for nfs filesystems. MFC after:1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c == --- head/sys/kern/vfs_default.c Mon Aug 23 05:33:20 2010 (r211683) +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010 (r211684) @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct if (error) return (error); - *off = uio.uio_offset; - *cpos = dirbuf; - *len = (dirbuflen - uio.uio_resid); + *len = uio.uio_offset - *off; + *off = uio.uio_offset; } dp = (struct dirent *)(*cpos); I'm looking into why uio_resid isn't being updated - it's a bit awkward as this is happening on a production box running 8.1 (just upgraded from 7), so it may take a few days. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
Re: svn commit: r211684 - head/sys/kern
On Wed, 25 Aug 2010 02:46:51 -0700 Brian Somers br...@freebsd.org wrote: On Mon, 23 Aug 2010 13:28:58 +0300 Kostik Belousov kostik...@gmail.com wrote: On Mon, Aug 23, 2010 at 05:33:31AM +, Brian Somers wrote: Author: brian Date: Mon Aug 23 05:33:31 2010 New Revision: 211684 URL: http://svn.freebsd.org/changeset/base/211684 Log: uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use the uio_offset adjustment instead to calculate a correct *len. Isn't this should be fixed in nfs instead ? Please note that the moral equivalent of the code is also present in compat/linux/linux_cwd.c: linux_getcwd_scandir(). I did not inspected other callers of VOP_READDIR. Without this change, we run off the end of the directory data we're reading and panic horribly for nfs filesystems. MFC after: 1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c == --- head/sys/kern/vfs_default.c Mon Aug 23 05:33:20 2010 (r211683) +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010 (r211684) @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct if (error) return (error); - *off = uio.uio_offset; - *cpos = dirbuf; - *len = (dirbuflen - uio.uio_resid); + *len = uio.uio_offset - *off; + *off = uio.uio_offset; } dp = (struct dirent *)(*cpos); I'm looking into why uio_resid isn't being updated - it's a bit awkward as this is happening on a production box running 8.1 (just upgraded from 7), so it may take a few days. Hmm, I've just seen a crash here with the new code (kgdb) p *len $2 = -35080 (kgdb) p uio.uio_offset $3 = 512 (kgdb) p uio.uio_resid $4 = 8192 So it looks like my fix is wrong (so much for real-world tests!). Note, the uio values above have survived on the stack from the first call to get_next_dirent() where *len was zero and we read the content of the directory. The directory file is 512 bytes and the crash happens when we run off the end of the 512 bytes read. (kgdb) p *(struct dirent *)(dirbuf + 512) $9 = {d_fileno = 680038892, d_reclen = 40, d_type = 12 '\f', d_namlen = 34 '', d_name = ?\206\210(\000\000\000\000\025\000\000 ?\206\210(\004\222\210((\000\f\?\206\210(\000\000\000\000\025\000\000 ?\206\210(\034\222\210((\000\f\?\206\210(\000\000\000\000\025\000\000 ?\206\210(4\222\210((\000\f\?\206\210(\000\000\000\000\025\000\000 \000\207\210(L\222\210((\000\f\\000\207\210(\000\000\000\000\025\000\000 \020\207\210(d\222\210((\000\f\\020\207\210(\000\000\000\000\025\000\000 \207\210(|\222\210((\000\f\ \207\210(\000\000\000\000\025\000\000 0\207\210(\224\222\210((\000\f\0\207\210(\000\000\000\000\025\000\000 @\207\210(?\222\210((\000\f\@\207\210(\000\000\000\000...} (kgdb) p *(struct dirent *)(dirbuf + 552) $10 = {d_fileno = 536870933, d_reclen = 34528, d_type = 136 '\210', d_namlen = 40 '(', d_name = \034\222\210((\000\f\?\206\210(\000\000\000\000\025\000\000 ?\206\210(4\222\210((\000\f\?\206\210(\000\000\000\000\025\000\000 \000\207\210(L\222\210((\000\f\\000\207\210(\000\000\000\000\025\000\000 \020\207\210(d\222\210((\000\f\\020\207\210(\000\000\000\000\025\000\000 \207\210(|\222\210((\000\f\ \207\210(\000\000\000\000\025\000\000 0\207\210(\224\222\210((\000\f\0\207\210(\000\000\000\000\025\000\000 @\207\210(?\222\210((\000\f\@\207\210(\000\000\000\000\025\000\000 P\207\210(?\222\210((\000\f\P\207\210(\000\000\000\000\025\000\000 `\207\210(?\222\210((\000\f\...} (kgdb) p dirbuf + 552 + 34528 $11 = 0xc8891908 Address 0xc8891908 out of bounds So we can see that we're falling off the end of the 512 bytes we read because *len never reaches zero as it's intended to. The bit I can't understand yet is how len reaches -35080. That number is minus the sum of all the directory reclens and the two garbage dirents that we read from dirbuf + 512 and dirbuf + 552. This seems to imply that when we actually did the readdir(), we set *len to zero and then immediately adjusted it before returning from get_next_dirent(). This is exactly the deduction that made me make the original change. Having said all that, I also have diagnostics in this kernel that should trigger if nfs_readdir() tries to return with inconsistent uio_offset and uio_resid values and I saw no diagnostics. This means that assuming I haven't fat fingered the diagnostics, I was just absolutely wrong about uio_resid not being adjusted. Hmm, so after all this, I know what the problem is: The first read of 512 bytes works fine and we iterate through the dirents 'till we hit the end. We then read again and get zero from readdir, but fail to handle this case. We then drop out of the if (*len == 0) part and start using garbage at dirbuf + 512, adjusting *len
svn commit: r211818 - head/sys/kern
Author: brian Date: Wed Aug 25 18:09:51 2010 New Revision: 211818 URL: http://svn.freebsd.org/changeset/base/211818 Log: If we read zero bytes from the directory, early out with ENOENT rather than forging ahead and interpreting garbage buffer content and dirent structures. This change backs out r211684 which was essentially a no-op. MFC after:1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c == --- head/sys/kern/vfs_default.c Wed Aug 25 16:23:50 2010(r211817) +++ head/sys/kern/vfs_default.c Wed Aug 25 18:09:51 2010(r211818) @@ -281,9 +281,13 @@ get_next_dirent(struct vnode *vp, struct if (error) return (error); - *cpos = dirbuf; - *len = uio.uio_offset - *off; *off = uio.uio_offset; + + *cpos = dirbuf; + *len = (dirbuflen - uio.uio_resid); + + if (*len == 0) + return (ENOENT); } dp = (struct dirent *)(*cpos); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211609 - head/tools/regression/bin/sh/builtins
On Mon, 23 Aug 2010 23:58:50 +0200, Jilles Tjoelker jil...@stack.nl wrote: [.] == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/break3.0Sun Aug 22 11:04:30 2010(r211609) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# We accept this and people might rely on it. +# However, various other shells do not accept it. + +f() { + break + echo bad1 +} + +while :; do + f + echo bad2 + exit 2 +done [.] Having said that, this behaviour is the same in bash except that bash will complain if it's asked to break when the context is wrong, perhaps we should complain too? [.] Warning messages to stderr mostly get lost in the noise, I don't really like them. I do not expect people to test for failure of break and continue, and bash even sets $? to 0 despite printing a warning. If this error is so important as to need an error message I think should abort the shell as well (via error(), so that command break will avoid aborting). Furthermore note that bash disables these warnings in POSIX mode. [.] I agree then, no error seems like the right thing to do. Thanks. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour !br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211609 - head/tools/regression/bin/sh/builtins
On Sun, 22 Aug 2010 11:04:30 + (UTC) Jilles Tjoelker jil...@freebsd.org wrote: Author: jilles Date: Sun Aug 22 11:04:30 2010 New Revision: 211609 URL: http://svn.freebsd.org/changeset/base/211609 Log: sh: Add a test for breaking from a loop outside the current function. It is unwise to rely on this but I'd like to know if this would break. Added: head/tools/regression/bin/sh/builtins/break3.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/break3.0 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/break3.0Sun Aug 22 11:04:30 2010(r211609) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# We accept this and people might rely on it. +# However, various other shells do not accept it. + +f() { + break + echo bad1 +} + +while :; do + f + echo bad2 + exit 2 +done This feature should be counted as a bug IMHO. How can f() possibly know whether there's a surrounding context to break from? Having said that, this behaviour is the same in bash except that bash will complain if it's asked to break when the context is wrong, perhaps we should complain too? $ bash -c 'f() { break; echo no break; }; for f in good bad; do echo $f; f; done' good $ sh -c 'f() { break; echo no break; }; for f in good bad; do echo $f; f; done' good $ bash -c 'f() { break; echo no break; }; f' bash: line 0: break: only meaningful in a `for', `while', or `until' loop no break $ bash -c 'f() { break 2/dev/null; echo no break; }; f' no break $ sh -c 'f() { break; echo no break; }; f' no break -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
svn commit: r211699 - stable/8/usr.sbin/newsyslog
Author: brian Date: Mon Aug 23 09:52:04 2010 New Revision: 211699 URL: http://svn.freebsd.org/changeset/base/211699 Log: MFC r210407: Add a -S switch to override syslogd's pidfile. Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 stable/8/usr.sbin/newsyslog/newsyslog.c stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 == --- stable/8/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 06:40:21 2010 (r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 09:52:04 2010 (r211699) @@ -17,7 +17,7 @@ .\ the suitability of this software for any purpose. It is .\ provided as is without express or implied warranty. .\ -.Dd January 19, 2010 +.Dd July 23, 2010 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -27,6 +27,7 @@ .Nm .Op Fl CFNPnrsv .Op Fl R Ar tagname +.Op Fl S Ar pidfile .Op Fl a Ar directory .Op Fl d Ar directory .Op Fl f Ar config_file @@ -215,6 +216,12 @@ Skipping the signal step will also mean will return faster, since .Nm normally waits a few seconds after any signal that is sent. +.It Fl S Ar pidfile +Use +.Ar pidfile +as +.Xr syslogd 8 Ns 's +pidfile. .El .Pp If additional command line arguments are given, Modified: stable/8/usr.sbin/newsyslog/newsyslog.c == --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 06:40:21 2010 (r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 09:52:04 2010 (r211699) @@ -186,6 +186,8 @@ char daytime[DAYTIME_LEN]; /* The curren * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ +const char *path_syslogpid = _PATH_SYSLOGPID; + static struct conf_entry *get_worklist(char **files); static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, struct conf_entry **glob_p, struct conf_entry **defconf_p); @@ -632,6 +634,9 @@ parse_args(int argc, char **argv) rotatereq++; requestor = strdup(optarg); break; + case 'S': + path_syslogpid = optarg; + break; case 'm': /* Used by OpenBSD for monitor mode */ default: usage(); @@ -724,7 +729,7 @@ usage(void) fprintf(stderr, usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n -[ [-R requestor] filename ... ]\n); +[-S pidfile] [ [-R requestor] filename ... ]\n); exit(1); } @@ -1318,7 +1323,7 @@ no_trimat: working-flags = ~CE_SIGNALGROUP; } if (needroot) - working-pid_file = strdup(_PATH_SYSLOGPID); + working-pid_file = strdup(path_syslogpid); } /* Modified: stable/8/usr.sbin/newsyslog/newsyslog.conf.5 == --- stable/8/usr.sbin/newsyslog/newsyslog.conf.5Mon Aug 23 06:40:21 2010(r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.conf.5Mon Aug 23 09:52:04 2010(r211699) @@ -21,7 +21,7 @@ .\ the suitability of this software for any purpose. It is .\ provided as is without express or implied warranty. .\ -.Dd November 27, 2006 +.Dd July 23, 2010 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -315,14 +315,17 @@ process ID or to find a group process ID flag was specified. If this field is present, a .Ar signal_number -is sent the process ID contained in this file. -If this field is not present, then a +is sent to the process ID contained in this file. +If this field is not present and the +.Cm N +flag has not been specified, then a .Dv SIGHUP signal will be sent to -.Xr syslogd 8 , -unless the -.Cm N -flag has been specified. +.Xr syslogd 8 +or to the process id found in the file specified by +.Xr newsyslog 8 Ns 's +.Fl S +switch. This field must start with .Ql / in order to be recognized properly. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211700 - stable/7/usr.sbin/newsyslog
Author: brian Date: Mon Aug 23 09:54:32 2010 New Revision: 211700 URL: http://svn.freebsd.org/changeset/base/211700 Log: MFC r210407: Add a -S switch to override syslogd's pidfile. Modified: stable/7/usr.sbin/newsyslog/newsyslog.8 stable/7/usr.sbin/newsyslog/newsyslog.c stable/7/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/7/usr.sbin/newsyslog/ (props changed) Modified: stable/7/usr.sbin/newsyslog/newsyslog.8 == --- stable/7/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 09:52:04 2010 (r211699) +++ stable/7/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 09:54:32 2010 (r211700) @@ -17,7 +17,7 @@ .\ the suitability of this software for any purpose. It is .\ provided as is without express or implied warranty. .\ -.Dd January 19, 2010 +.Dd July 23, 2010 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -27,6 +27,7 @@ .Nm .Op Fl CFNPnrsv .Op Fl R Ar tagname +.Op Fl S Ar pidfile .Op Fl a Ar directory .Op Fl d Ar directory .Op Fl f Ar config_file @@ -215,6 +216,12 @@ Skipping the signal step will also mean will return faster, since .Nm normally waits a few seconds after any signal that is sent. +.It Fl S Ar pidfile +Use +.Ar pidfile +as +.Xr syslogd 8 Ns 's +pidfile. .El .Pp If additional command line arguments are given, Modified: stable/7/usr.sbin/newsyslog/newsyslog.c == --- stable/7/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 09:52:04 2010 (r211699) +++ stable/7/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 09:54:32 2010 (r211700) @@ -186,6 +186,8 @@ char daytime[DAYTIME_LEN]; /* The curren * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ +const char *path_syslogpid = _PATH_SYSLOGPID; + static struct conf_entry *get_worklist(char **files); static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, struct conf_entry **glob_p, struct conf_entry **defconf_p); @@ -632,6 +634,9 @@ parse_args(int argc, char **argv) rotatereq++; requestor = strdup(optarg); break; + case 'S': + path_syslogpid = optarg; + break; case 'm': /* Used by OpenBSD for monitor mode */ default: usage(); @@ -724,7 +729,7 @@ usage(void) fprintf(stderr, usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n -[ [-R requestor] filename ... ]\n); +[-S pidfile] [ [-R requestor] filename ... ]\n); exit(1); } @@ -1318,7 +1323,7 @@ no_trimat: working-flags = ~CE_SIGNALGROUP; } if (needroot) - working-pid_file = strdup(_PATH_SYSLOGPID); + working-pid_file = strdup(path_syslogpid); } /* Modified: stable/7/usr.sbin/newsyslog/newsyslog.conf.5 == --- stable/7/usr.sbin/newsyslog/newsyslog.conf.5Mon Aug 23 09:52:04 2010(r211699) +++ stable/7/usr.sbin/newsyslog/newsyslog.conf.5Mon Aug 23 09:54:32 2010(r211700) @@ -21,7 +21,7 @@ .\ the suitability of this software for any purpose. It is .\ provided as is without express or implied warranty. .\ -.Dd November 27, 2006 +.Dd July 23, 2010 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -315,14 +315,17 @@ process ID or to find a group process ID flag was specified. If this field is present, a .Ar signal_number -is sent the process ID contained in this file. -If this field is not present, then a +is sent to the process ID contained in this file. +If this field is not present and the +.Cm N +flag has not been specified, then a .Dv SIGHUP signal will be sent to -.Xr syslogd 8 , -unless the -.Cm N -flag has been specified. +.Xr syslogd 8 +or to the process id found in the file specified by +.Xr newsyslog 8 Ns 's +.Fl S +switch. This field must start with .Ql / in order to be recognized properly. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211684 - head/sys/kern
Author: brian Date: Mon Aug 23 05:33:31 2010 New Revision: 211684 URL: http://svn.freebsd.org/changeset/base/211684 Log: uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use the uio_offset adjustment instead to calculate a correct *len. Without this change, we run off the end of the directory data we're reading and panic horribly for nfs filesystems. MFC after:1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c == --- head/sys/kern/vfs_default.c Mon Aug 23 05:33:20 2010(r211683) +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010(r211684) @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct if (error) return (error); - *off = uio.uio_offset; - *cpos = dirbuf; - *len = (dirbuflen - uio.uio_resid); + *len = uio.uio_offset - *off; + *off = uio.uio_offset; } dp = (struct dirent *)(*cpos); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210916 - stable/7/sbin/dhclient
Author: brian Date: Fri Aug 6 08:21:03 2010 New Revision: 210916 URL: http://svn.freebsd.org/changeset/base/210916 Log: MFC r209756: Log dhclient's reason for exiting and change the 10 second ignore-routing-messages dhclient-script timeout to be effective from script completion rather than from script start time. Ignore RTM_DELADDR and RTM_NEWADDR messages when the message contains no interface address (which should not happen) rather than exiting. Modified: stable/7/sbin/dhclient/dhclient.c Directory Properties: stable/7/sbin/dhclient/ (props changed) Modified: stable/7/sbin/dhclient/dhclient.c == --- stable/7/sbin/dhclient/dhclient.c Fri Aug 6 08:17:44 2010 (r210915) +++ stable/7/sbin/dhclient/dhclient.c Fri Aug 6 08:21:03 2010 (r210916) @@ -126,7 +126,7 @@ int fork_privchld(int, int); ((a) 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #defineADVANCE(x, n) (x += ROUNDUP((n)-sa_len)) -time_t scripttime; +static time_t scripttime; int findproto(char *cp, int n) @@ -204,7 +204,7 @@ disassoc(void *arg) void routehandler(struct protocol *p) { - char msg[2048]; + char msg[2048], *addr; struct rt_msghdr *rtm; struct if_msghdr *ifm; struct ifa_msghdr *ifam; @@ -224,13 +224,6 @@ routehandler(struct protocol *p) switch (rtm-rtm_type) { case RTM_NEWADDR: - /* -* XXX: If someone other than us adds our address, -* we should assume they are taking over from us, -* delete the lease record, and exit without modifying -* the interface. -*/ - break; case RTM_DELADDR: ifam = (struct ifa_msghdr *)rtm; @@ -243,7 +236,7 @@ routehandler(struct protocol *p) sa = get_ifa((char *)(ifam + 1), ifam-ifam_addrs); if (sa == NULL) - goto die; + break; if ((a.len = sizeof(struct in_addr)) sizeof(a.iabuf)) error(king bula sez: len mismatch); @@ -255,21 +248,42 @@ routehandler(struct protocol *p) if (addr_eq(a, l-address)) break; - if (l == NULL) /* deleted addr is not the one we set */ + if (l == NULL) /* added/deleted addr is not the one we set */ break; - goto die; + + addr = inet_ntoa(((struct sockaddr_in *)sa)-sin_addr); + if (rtm-rtm_type == RTM_NEWADDR) { + /* +* XXX: If someone other than us adds our address, +* should we assume they are taking over from us, +* delete the lease record, and exit without modifying +* the interface? +*/ + warning(My address (%s) was re-added, addr); + } else { + warning(My address (%s) was deleted, dhclient exiting, + addr); + goto die; + } + break; case RTM_IFINFO: ifm = (struct if_msghdr *)rtm; if (ifm-ifm_index != ifi-index) break; - if ((rtm-rtm_flags RTF_UP) == 0) + if ((rtm-rtm_flags RTF_UP) == 0) { + warning(Interface %s is down, dhclient exiting, + ifi-name); goto die; + } break; case RTM_IFANNOUNCE: ifan = (struct if_announcemsghdr *)rtm; if (ifan-ifan_what == IFAN_DEPARTURE - ifan-ifan_index == ifi-index) + ifan-ifan_index == ifi-index) { + warning(Interface %s is gone, dhclient exiting, + ifi-name); goto die; + } break; case RTM_IEEE80211: ifan = (struct if_announcemsghdr *)rtm; @@ -2110,8 +2124,6 @@ script_go(void) struct buf *buf; int ret; - scripttime = time(NULL); - hdr.code = IMSG_SCRIPT_GO; hdr.len = sizeof(struct imsg_hdr); @@ -2132,6 +2144,8 @@ script_go(void) error(received corrupted message); buf_read(privfd, ret, sizeof(ret)); + scripttime = time(NULL); + return (ret); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r210389 - in head: . share/mk tools/build/options usr.bin usr.bin/grep usr.bin/grep/nls
On Thu, 22 Jul 2010 19:11:57 + (UTC) Gabor Kovesdan ga...@freebsd.org wrote: Author: gabor Date: Thu Jul 22 19:11:57 2010 New Revision: 210389 URL: http://svn.freebsd.org/changeset/base/210389 Log: Add BSD grep to the base system and make it our default grep. Deliverables: Small and clean code (1,4 KSLOC vs GNU's 8,5 KSLOC), lower memory usage than GNU grep, GNU compatibility, BSD license. TODO: Performance is somewhat behind GNU grep but it is only significant for bigger searches. The reason is complex, the most important factor is that GNU grep uses lots of optimizations to improve the speed of the regex library. First, we need a modern regex library (practically by adopting TRE), add support for GNU-style non-standard regexes and then reevalute the performance issues and look for bottlenecks. In the meantime, for those, who need better performance, it is possible to build GNU grep by setting WITH_GNU_GREP. Approved by:delphij (mentor) Obtained from: OpenBSD (http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/grep/), freegrep (http://github.com/howardjp/freegrep) Sponsored by: Google SoC 2008 Portbuild tests run by: kris, pav, erwin Acknowledgements to:fjoe (as SoC 2008 mentor), everyone who helped in reviewing and testing Very nice!! -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
Re: svn commit: r210321 - head/lib/libelf
On Wed, 21 Jul 2010 19:51:49 +1000 (EST) Bruce Evans b...@optusnet.com.au wrote: On Wed, 21 Jul 2010, Alexey Dokuchaev wrote: On Wed, Jul 21, 2010 at 08:43:48AM +, Kai Wang wrote: Log: Remove a superfluous comment. Obtained from:elftoolchain MFC after:1 month (Just picking random of the similar commits): guys, please, try to uniformly align commit meta tags: It is perfectly aligned with tabs (and no 2-char commit mail indentation, and no N-char mailer quoting). Obtained from: somewhere MFC after: sometime Foo bar:baz qux ... Broken alignment considerably pessimizes commit log grasping, as it requires more post-processing work after reading it off. Do you mean for human grasping and automated post-processing? The automation should have no problems with the whitespace but might with the mailer quoting. tags should mean the part before the :. Aligning those by making them all of the same length would help. Alternatively, indenting commit mail sections with a tab rather than two spaces would preserve the visual alignment. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210106 - stable/8/bin/pkill
Author: brian Date: Thu Jul 15 07:14:57 2010 New Revision: 210106 URL: http://svn.freebsd.org/changeset/base/210106 Log: MFC r209924; Add -l to the synopsis Submitted by: jhell at dataix dot net Modified: stable/8/bin/pkill/pkill.1 Directory Properties: stable/8/bin/pkill/ (props changed) Modified: stable/8/bin/pkill/pkill.1 == --- stable/8/bin/pkill/pkill.1 Thu Jul 15 03:56:08 2010(r210105) +++ stable/8/bin/pkill/pkill.1 Thu Jul 15 07:14:57 2010(r210106) @@ -60,7 +60,7 @@ .Ar pattern ... .Nm pkill .Op Fl Ar signal -.Op Fl ILafinovx +.Op Fl ILafilnovx .Op Fl F Ar pidfile .Op Fl G Ar gid .Op Fl M Ar core ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209911 - stable/8/usr.bin/du
Author: brian Date: Sun Jul 11 21:47:38 2010 New Revision: 209911 URL: http://svn.freebsd.org/changeset/base/209911 Log: MFC r209362: Add a -t switch for masking output based on size. PR: 144192 Submitted by: gk Modified: stable/8/usr.bin/du/du.1 stable/8/usr.bin/du/du.c Directory Properties: stable/8/usr.bin/du/ (props changed) Modified: stable/8/usr.bin/du/du.1 == --- stable/8/usr.bin/du/du.1Sun Jul 11 21:12:42 2010(r209910) +++ stable/8/usr.bin/du/du.1Sun Jul 11 21:47:38 2010(r209911) @@ -42,7 +42,7 @@ .Nm .Op Fl A .Op Fl H | L | P -.Op Fl a | s | d Ar depth +.Op Fl a | s | d Ar depth | Fl t Ar threshold .Op Fl c .Op Fl l .Op Fl h | k | m | B Ar blocksize @@ -107,6 +107,14 @@ This option exists solely for conformanc Display an entry for each specified file. (Equivalent to .Fl d Li 0 ) +.It Fl t Ar threshold +Display only entries for which size exceeds +.Ar threshold . +If +.Ar threshold +is negative, display only entries for which size is less than the absolute +value of +.Ar threshold . .It Fl d Ar depth Display an entry for all files and directories .Ar depth Modified: stable/8/usr.bin/du/du.c == --- stable/8/usr.bin/du/du.cSun Jul 11 21:12:42 2010(r209910) +++ stable/8/usr.bin/du/du.cSun Jul 11 21:47:38 2010(r209911) @@ -90,6 +90,7 @@ main(int argc, char *argv[]) FTS *fts; FTSENT *p; off_t savednumber, curblocks; + off_t threshold, threshold_sign; int ftsoptions; int listall; int depth; @@ -106,12 +107,14 @@ main(int argc, char *argv[]) save = argv; ftsoptions = 0; savednumber = 0; + threshold = 0; + threshold_sign = 1; cblocksize = DEV_BSIZE; blocksize = 0; depth = INT_MAX; SLIST_INIT(ignores); - while ((ch = getopt(argc, argv, AB:HI:LPasd:chklmnrx)) != -1) + while ((ch = getopt(argc, argv, AB:HI:LPasd:chklmnrt:x)) != -1) switch (ch) { case 'A': Aflag = 1; @@ -179,6 +182,14 @@ main(int argc, char *argv[]) break; case 'r':/* Compatibility. */ break; + case 't' : + if (expand_number(optarg, threshold) != 0 || + threshold == 0) { + warnx(invalid threshold: %s, optarg); + usage(); + } else if (threshold 0) + threshold_sign = -1; + break; case 'x': ftsoptions |= FTS_XDEV; break; @@ -248,6 +259,10 @@ main(int argc, char *argv[]) blocksize /= DEV_BSIZE; } + if (threshold != 0) + threshold = howmany(threshold / DEV_BSIZE * cblocksize, + blocksize); + rval = 0; (void)signal(SIGINFO, siginfo); @@ -271,7 +286,9 @@ main(int argc, char *argv[]) p-fts_parent-fts_bignum += p-fts_bignum += curblocks; - if (p-fts_level = depth) { + if (p-fts_level = depth threshold = + threshold_sign * howmany(p-fts_bignum * + cblocksize, blocksize)) { if (hflag) { prthumanval(p-fts_bignum); (void)printf(\t%s\n, p-fts_path); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209912 - stable/8/bin/pkill
Author: brian Date: Sun Jul 11 21:50:05 2010 New Revision: 209912 URL: http://svn.freebsd.org/changeset/base/209912 Log: MFC r209363: Recognise the -l switch in pkill. PR: 143558 Submitted by: eitanadlerlist at gmail dot com Modified: stable/8/bin/pkill/pkill.1 stable/8/bin/pkill/pkill.c Directory Properties: stable/8/bin/pkill/ (props changed) Modified: stable/8/bin/pkill/pkill.1 == --- stable/8/bin/pkill/pkill.1 Sun Jul 11 21:47:38 2010(r209911) +++ stable/8/bin/pkill/pkill.1 Sun Jul 11 21:50:05 2010(r209912) @@ -163,14 +163,16 @@ The value matches processes not in jail. .It Fl l Long output. -Print the process name in addition to the process ID for each matching +For +.Nm pgrep , +print the process name in addition to the process ID for each matching process. If used in conjunction with .Fl f , print the process ID and the full argument list for each matching process. -This option can only be used with the -.Nm pgrep -command. +For +.Nm pkill , +display the kill command used for each process killed. .It Fl n Select only the newest (most recently started) of the matching processes. .It Fl o Modified: stable/8/bin/pkill/pkill.c == --- stable/8/bin/pkill/pkill.c Sun Jul 11 21:47:38 2010(r209911) +++ stable/8/bin/pkill/pkill.c Sun Jul 11 21:50:05 2010(r209912) @@ -133,7 +133,7 @@ main(int argc, char **argv) { char buf[_POSIX2_LINE_MAX], *mstr, **pargv, *p, *q, *pidfile; const char *execf, *coref; - int ancestors, debug_opt; + int ancestors, debug_opt, did_action; int i, ch, bestidx, rv, criteria, pidfromfile, pidfilelock; size_t jsz; int (*action)(const struct kinfo_proc *); @@ -246,8 +246,6 @@ main(int argc, char **argv) criteria = 1; break; case 'l': - if (!pgrep) - usage(); longfmt = 1; break; case 'n': @@ -529,16 +527,24 @@ main(int argc, char **argv) /* * Take the appropriate action for each matched process, if any. */ + did_action = 0; for (i = 0, rv = 0, kp = plist; i nproc; i++, kp++) { if (PSKIP(kp)) continue; if (selected[i]) { + if (longfmt !pgrep) { + did_action = 1; + printf(kill -%d %d\n, signum, kp-ki_pid); + } if (inverse) continue; } else if (!inverse) continue; rv |= (*action)(kp); } + if (!did_action !pgrep longfmt) + fprintf(stderr, + No matching processes belonging to you were found\n); exit(rv ? STATUS_MATCH : STATUS_NOMATCH); } @@ -551,7 +557,7 @@ usage(void) if (pgrep) ustr = [-LSfilnovx] [-d delim]; else - ustr = [-signal] [-ILfinovx]; + ustr = [-signal] [-ILfilnovx]; fprintf(stderr, usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209914 - stable/8/sbin/fsck_msdosfs
Author: brian Date: Sun Jul 11 22:00:40 2010 New Revision: 209914 URL: http://svn.freebsd.org/changeset/base/209914 Log: MFC r209364: Fix some (not all) style(9) and casting errors. PR: 209364 Submitted by: giffunip at tutopia dot com Obtained from:NetBSD Modified: stable/8/sbin/fsck_msdosfs/Makefile stable/8/sbin/fsck_msdosfs/boot.c stable/8/sbin/fsck_msdosfs/check.c stable/8/sbin/fsck_msdosfs/dir.c stable/8/sbin/fsck_msdosfs/fat.c Directory Properties: stable/8/sbin/fsck_msdosfs/ (props changed) Modified: stable/8/sbin/fsck_msdosfs/Makefile == --- stable/8/sbin/fsck_msdosfs/Makefile Sun Jul 11 21:57:18 2010 (r209913) +++ stable/8/sbin/fsck_msdosfs/Makefile Sun Jul 11 22:00:40 2010 (r209914) @@ -9,6 +9,6 @@ MAN=fsck_msdosfs.8 SRCS= main.c check.c boot.c fat.c dir.c fsutil.c CFLAGS+= -I${FSCK} -WARNS?=0 +WARNS?=2 .include bsd.prog.mk Modified: stable/8/sbin/fsck_msdosfs/boot.c == --- stable/8/sbin/fsck_msdosfs/boot.c Sun Jul 11 21:57:18 2010 (r209913) +++ stable/8/sbin/fsck_msdosfs/boot.c Sun Jul 11 22:00:40 2010 (r209914) @@ -48,13 +48,14 @@ readboot(int dosfs, struct bootblock *bo int ret = FSOK; int i; - if ((size_t)read(dosfs, block, sizeof block) != sizeof block) { + if (read(dosfs, block, sizeof block) != sizeof block) { perror(could not read boot block); return FSFATAL; } if (block[510] != 0x55 || block[511] != 0xaa) { - pfatal(Invalid signature in boot block: %02x%02x, block[511], block[510]); + pfatal(Invalid signature in boot block: %02x%02x, + block[511], block[510]); return FSFATAL; } @@ -72,8 +73,10 @@ readboot(int dosfs, struct bootblock *bo boot-bpbFATsmall = block[22] + (block[23] 8); boot-SecPerTrack = block[24] + (block[25] 8); boot-bpbHeads = block[26] + (block[27] 8); - boot-bpbHiddenSecs = block[28] + (block[29] 8) + (block[30] 16) + (block[31] 24); - boot-bpbHugeSectors = block[32] + (block[33] 8) + (block[34] 16) + (block[35] 24); + boot-bpbHiddenSecs = block[28] + (block[29] 8) + + (block[30] 16) + (block[31] 24); + boot-bpbHugeSectors = block[32] + (block[33] 8) + + (block[34] 16) + (block[35] 24); boot-FATsecs = boot-bpbFATsmall; @@ -97,10 +100,9 @@ readboot(int dosfs, struct bootblock *bo boot-bpbFSInfo = block[48] + (block[49] 8); boot-bpbBackup = block[50] + (block[51] 8); - if (lseek(dosfs, boot-bpbFSInfo * boot-bpbBytesPerSec, SEEK_SET) - != boot-bpbFSInfo * boot-bpbBytesPerSec - || read(dosfs, fsinfo, sizeof fsinfo) - != sizeof fsinfo) { + if (lseek(dosfs, boot-bpbFSInfo * boot-bpbBytesPerSec, + SEEK_SET) != boot-bpbFSInfo * boot-bpbBytesPerSec + || read(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { perror(could not read fsinfo block); return FSFATAL; } @@ -124,7 +126,8 @@ readboot(int dosfs, struct bootblock *bo fsinfo[0x3fc] = fsinfo[0x3fd] = 0; fsinfo[0x3fe] = 0x55; fsinfo[0x3ff] = 0xaa; - if (lseek(dosfs, boot-bpbFSInfo * boot-bpbBytesPerSec, SEEK_SET) + if (lseek(dosfs, boot-bpbFSInfo * + boot-bpbBytesPerSec, SEEK_SET) != boot-bpbFSInfo * boot-bpbBytesPerSec || write(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { @@ -144,7 +147,8 @@ readboot(int dosfs, struct bootblock *bo + (fsinfo[0x1ef] 24); } - if (lseek(dosfs, boot-bpbBackup * boot-bpbBytesPerSec, SEEK_SET) + if (lseek(dosfs, boot-bpbBackup * boot-bpbBytesPerSec, + SEEK_SET) != boot-bpbBackup * boot-bpbBytesPerSec || read(dosfs, backup, sizeof backup) != sizeof backup) { perror(could not read backup bootblock); @@ -172,11 +176,10 @@ readboot(int dosfs, struct bootblock *bo /* Check backup bpbFSInfo? XXX */ } - boot-ClusterOffset = (boot-bpbRootDirEnts * 32 + boot-bpbBytesPerSec - 1) - / boot-bpbBytesPerSec - + boot-bpbResSectors - + boot-bpbFATs * boot-FATsecs - - CLUST_FIRST * boot-bpbSecPerClust; +
Re: svn commit: r209914 - stable/8/sbin/fsck_msdosfs
On Sun, 11 Jul 2010 22:00:40 + (UTC) Brian Somers br...@freebsd.org wrote: Author: brian Date: Sun Jul 11 22:00:40 2010 New Revision: 209914 URL: http://svn.freebsd.org/changeset/base/209914 Log: MFC r209364: Fix some (not all) style(9) and casting errors. PR: 209364 Submitted by: giffunip at tutopia dot com Obtained from: NetBSD Oops, that would be PR 142384 -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
Re: svn commit: r209912 - stable/8/bin/pkill
Oops, thanks for the heads up. I've updated head and will merge the change back into 8 in three days. Chers. On Sun, 11 Jul 2010 20:52:33 -0400 jhell jh...@dataix.net wrote: On 07/11/2010 17:50, Brian Somers wrote: Author: brian Date: Sun Jul 11 21:50:05 2010 New Revision: 209912 URL: http://svn.freebsd.org/changeset/base/209912 Log: MFC r209363: Recognise the -l switch in pkill. PR: 143558 Submitted by: eitanadlerlist at gmail dot com Modified: stable/8/bin/pkill/pkill.1 stable/8/bin/pkill/pkill.c Directory Properties: stable/8/bin/pkill/ (props changed) pkill.1 seems to be missing this: Index: bin/pkill/pkill.1 === --- bin/pkill/pkill.1 (revision 209914) +++ bin/pkill/pkill.1 (working copy) @@ -60,7 +60,7 @@ .Ar pattern ... .Nm pkill .Op Fl Ar signal -.Op Fl ILafinovx +.Op Fl ILafilnovx .Op Fl F Ar pidfile .Op Fl G Ar gid .Op Fl M Ar core Regards, -- +-+-+-+-+-+ |j|h|e|l|l| +-+-+-+-+-+ -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
svn commit: r209756 - head/sbin/dhclient
Author: brian Date: Wed Jul 7 06:06:54 2010 New Revision: 209756 URL: http://svn.freebsd.org/changeset/base/209756 Log: When dhclient obtains a lease, it runs dhclient-script and expects it to configure the interface. When the script is complete, dhclient monitors the routing socket and will terminate if its address is deleted or if its interface is removed or brought down. Because the routing socket is already open when dhclient-script is run, dhclient ignores address deletions for 10 seconds after the script was run. If the address that will be obtained is already configured on the interface before dhclient starts, and if dhclient-script takes more than 10 seconds (perhaps due to dhclient-*-hooks latencies), on script completion, dhclient will immediately and silently exit when it sees the RTM_DELADDR routing message resulting from the script reassigning the address to the interface. This change logs dhclient's reason for exiting and also changes the 10 second timeout to be effective from completion of dhclient-script rather than from when it was started. We now ignore RTM_DELADDR and RTM_NEWADDR messages when the message contains no interface address (which should not happen) rather than exiting. Not reviewed by: brooks (timeout) MFC after:3 weeks Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c == --- head/sbin/dhclient/dhclient.c Wed Jul 7 04:06:38 2010 (r209755) +++ head/sbin/dhclient/dhclient.c Wed Jul 7 06:06:54 2010 (r209756) @@ -126,7 +126,7 @@ int fork_privchld(int, int); ((a) 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #defineADVANCE(x, n) (x += ROUNDUP((n)-sa_len)) -time_t scripttime; +static time_t scripttime; int findproto(char *cp, int n) @@ -204,7 +204,7 @@ disassoc(void *arg) void routehandler(struct protocol *p) { - char msg[2048]; + char msg[2048], *addr; struct rt_msghdr *rtm; struct if_msghdr *ifm; struct ifa_msghdr *ifam; @@ -224,13 +224,6 @@ routehandler(struct protocol *p) switch (rtm-rtm_type) { case RTM_NEWADDR: - /* -* XXX: If someone other than us adds our address, -* we should assume they are taking over from us, -* delete the lease record, and exit without modifying -* the interface. -*/ - break; case RTM_DELADDR: ifam = (struct ifa_msghdr *)rtm; @@ -243,7 +236,7 @@ routehandler(struct protocol *p) sa = get_ifa((char *)(ifam + 1), ifam-ifam_addrs); if (sa == NULL) - goto die; + break; if ((a.len = sizeof(struct in_addr)) sizeof(a.iabuf)) error(king bula sez: len mismatch); @@ -255,21 +248,42 @@ routehandler(struct protocol *p) if (addr_eq(a, l-address)) break; - if (l == NULL) /* deleted addr is not the one we set */ + if (l == NULL) /* added/deleted addr is not the one we set */ break; - goto die; + + addr = inet_ntoa(((struct sockaddr_in *)sa)-sin_addr); + if (rtm-rtm_type == RTM_NEWADDR) { + /* +* XXX: If someone other than us adds our address, +* should we assume they are taking over from us, +* delete the lease record, and exit without modifying +* the interface? +*/ + warning(My address (%s) was re-added, addr); + } else { + warning(My address (%s) was deleted, dhclient exiting, + addr); + goto die; + } + break; case RTM_IFINFO: ifm = (struct if_msghdr *)rtm; if (ifm-ifm_index != ifi-index) break; - if ((rtm-rtm_flags RTF_UP) == 0) + if ((rtm-rtm_flags RTF_UP) == 0) { + warning(Interface %s is down, dhclient exiting, + ifi-name); goto die; + } break; case RTM_IFANNOUNCE: ifan = (struct if_announcemsghdr *)rtm; if (ifan-ifan_what == IFAN_DEPARTURE - ifan-ifan_index == ifi-index) + ifan-ifan_index == ifi-index) { + warning(Interface %s is gone, dhclient exiting, + ifi-name); goto die; + } break; case
svn commit: r209561 - in stable/8: etc tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/common tools/tools/termcap tools/tools/tinybsd/conf/default tools/tools/tinybsd/conf/vpn
Author: brian Date: Mon Jun 28 06:59:57 2010 New Revision: 209561 URL: http://svn.freebsd.org/changeset/base/209561 Log: MFC r209331 at stable/8/etc and stable/8/tools; Remove vestiges of 'slip'. PR: 145648 Submitted by: alexbestms at wwu dot de and spam at rm-rf dot kiev dot ua Modified: stable/8/etc/login.conf stable/8/tools/tools/tinybsd/conf/default/TINYBSD stable/8/tools/tools/tinybsd/conf/vpn/TINYBSD Directory Properties: stable/8/etc/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/etc/login.conf == --- stable/8/etc/login.conf Mon Jun 28 04:54:16 2010(r209560) +++ stable/8/etc/login.conf Mon Jun 28 06:59:57 2010(r209561) @@ -228,7 +228,7 @@ russian|Russian Users Accounts:\ # # ## -## The dialer class should be used for a dialup PPP/SLIP accounts +## The dialer class should be used for a dialup PPP account ## Welcome messages/news suppressed ## #dialer:\ @@ -247,7 +247,7 @@ russian|Russian Users Accounts:\ # # ## -## Site full-time 24/7 PPP/SLIP connections +## Site full-time 24/7 PPP connection ## - no time accounting, restricted to access via dialin lines ## #site:\ @@ -306,11 +306,6 @@ russian|Russian Users Accounts:\ # :tc=subscriber: # # -#subslip|SLIP Subscriber Accounts:\ -# :tc=dialer:\ -# :tc=subscriber: -# -# #subshell|Shell Subscriber Accounts:\ # :tc=subscriber: # Modified: stable/8/tools/tools/tinybsd/conf/default/TINYBSD == --- stable/8/tools/tools/tinybsd/conf/default/TINYBSD Mon Jun 28 04:54:16 2010(r209560) +++ stable/8/tools/tools/tinybsd/conf/default/TINYBSD Mon Jun 28 06:59:57 2010(r209561) @@ -143,7 +143,6 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop# Network loopback device random # Entropy device device ether # Ethernet support -#devicesl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) Modified: stable/8/tools/tools/tinybsd/conf/vpn/TINYBSD == --- stable/8/tools/tools/tinybsd/conf/vpn/TINYBSD Mon Jun 28 04:54:16 2010(r209560) +++ stable/8/tools/tools/tinybsd/conf/vpn/TINYBSD Mon Jun 28 06:59:57 2010(r209561) @@ -133,7 +133,6 @@ device xe # Xircom pccard Ethernet device loop# Network loopback device random # Entropy device device ether # Ethernet support -#devicesl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc)
svn commit: r209562 - in stable/8/release: picobsd/floppy.tree/sbin scripts
Author: brian Date: Mon Jun 28 07:03:18 2010 New Revision: 209562 URL: http://svn.freebsd.org/changeset/base/209562 Log: MFC r209332: Shoot a stray cat! PR: 145447 Submitted by: u at netbeisser dot de Modified: stable/8/release/scripts/ports-install.sh Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) Modified: stable/8/release/scripts/ports-install.sh == --- stable/8/release/scripts/ports-install.sh Mon Jun 28 06:59:57 2010 (r209561) +++ stable/8/release/scripts/ports-install.sh Mon Jun 28 07:03:18 2010 (r209562) @@ -8,5 +8,5 @@ if [ `id -u` != 0 ]; then exit 1 fi echo Extracting ports tarball into ${DESTDIR}/usr -cat ports.tgz | tar --unlink -xpzf - -C ${DESTDIR}/usr +tar --unlink -xpzf ports.tgz -C ${DESTDIR}/usr exit 0 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209563 - stable/8/sys/boot/ficl
Author: brian Date: Mon Jun 28 07:15:30 2010 New Revision: 209563 URL: http://svn.freebsd.org/changeset/base/209563 Log: MFC r209361; Add a missing prototype PR: 145232 Submitted by: gcooper Modified: stable/8/sys/boot/ficl/ficl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/ficl/ficl.h == --- stable/8/sys/boot/ficl/ficl.h Mon Jun 28 07:03:18 2010 (r209562) +++ stable/8/sys/boot/ficl/ficl.h Mon Jun 28 07:15:30 2010 (r209563) @@ -757,6 +757,7 @@ voiddictAppendUNS (FICL_DICT *p int dictCellsAvail (FICL_DICT *pDict); int dictCellsUsed (FICL_DICT *pDict); voiddictCheck (FICL_DICT *pDict, FICL_VM *pVM, int n); +voiddictCheckThreshold(FICL_DICT* dp); FICL_DICT *dictCreate(unsigned nCELLS); FICL_DICT *dictCreateHashed(unsigned nCells, unsigned nHash); FICL_HASH *dictCreateWordlist(FICL_DICT *dp, int nBuckets); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209361 - head/sys/boot/ficl
Author: brian Date: Sun Jun 20 08:03:06 2010 New Revision: 209361 URL: http://svn.freebsd.org/changeset/base/209361 Log: Add a missing prototype PR: 145232 Submitted by: gcooper MFC after:1 week Modified: head/sys/boot/ficl/ficl.h Modified: head/sys/boot/ficl/ficl.h == --- head/sys/boot/ficl/ficl.h Sun Jun 20 06:52:10 2010(r209360) +++ head/sys/boot/ficl/ficl.h Sun Jun 20 08:03:06 2010(r209361) @@ -757,6 +757,7 @@ voiddictAppendUNS (FICL_DICT *p int dictCellsAvail (FICL_DICT *pDict); int dictCellsUsed (FICL_DICT *pDict); voiddictCheck (FICL_DICT *pDict, FICL_VM *pVM, int n); +voiddictCheckThreshold(FICL_DICT* dp); FICL_DICT *dictCreate(unsigned nCELLS); FICL_DICT *dictCreateHashed(unsigned nCells, unsigned nHash); FICL_HASH *dictCreateWordlist(FICL_DICT *dp, int nBuckets); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209362 - head/usr.bin/du
Author: brian Date: Sun Jun 20 08:27:03 2010 New Revision: 209362 URL: http://svn.freebsd.org/changeset/base/209362 Log: Add a -t switch for masking output that's above or below certain thresholds. This switch makes it a lot easier to locate problem areas when a process is threatening to consume all of your disk space. PR: 144192 Submitted by: gk MFC after:3 weeks Modified: head/usr.bin/du/du.1 head/usr.bin/du/du.c Modified: head/usr.bin/du/du.1 == --- head/usr.bin/du/du.1Sun Jun 20 08:03:06 2010(r209361) +++ head/usr.bin/du/du.1Sun Jun 20 08:27:03 2010(r209362) @@ -42,7 +42,7 @@ .Nm .Op Fl A .Op Fl H | L | P -.Op Fl a | s | d Ar depth +.Op Fl a | s | d Ar depth | Fl t Ar threshold .Op Fl c .Op Fl l .Op Fl h | k | m | B Ar blocksize @@ -107,6 +107,14 @@ This option exists solely for conformanc Display an entry for each specified file. (Equivalent to .Fl d Li 0 ) +.It Fl t Ar threshold +Display only entries for which size exceeds +.Ar threshold . +If +.Ar threshold +is negative, display only entries for which size is less than the absolute +value of +.Ar threshold . .It Fl d Ar depth Display an entry for all files and directories .Ar depth Modified: head/usr.bin/du/du.c == --- head/usr.bin/du/du.cSun Jun 20 08:03:06 2010(r209361) +++ head/usr.bin/du/du.cSun Jun 20 08:27:03 2010(r209362) @@ -90,6 +90,7 @@ main(int argc, char *argv[]) FTS *fts; FTSENT *p; off_t savednumber, curblocks; + off_t threshold, threshold_sign; int ftsoptions; int listall; int depth; @@ -106,12 +107,14 @@ main(int argc, char *argv[]) save = argv; ftsoptions = 0; savednumber = 0; + threshold = 0; + threshold_sign = 1; cblocksize = DEV_BSIZE; blocksize = 0; depth = INT_MAX; SLIST_INIT(ignores); - while ((ch = getopt(argc, argv, AB:HI:LPasd:chklmnrx)) != -1) + while ((ch = getopt(argc, argv, AB:HI:LPasd:chklmnrt:x)) != -1) switch (ch) { case 'A': Aflag = 1; @@ -179,6 +182,14 @@ main(int argc, char *argv[]) break; case 'r':/* Compatibility. */ break; + case 't' : + if (expand_number(optarg, threshold) != 0 || + threshold == 0) { + warnx(invalid threshold: %s, optarg); + usage(); + } else if (threshold 0) + threshold_sign = -1; + break; case 'x': ftsoptions |= FTS_XDEV; break; @@ -248,6 +259,10 @@ main(int argc, char *argv[]) blocksize /= DEV_BSIZE; } + if (threshold != 0) + threshold = howmany(threshold / DEV_BSIZE * cblocksize, + blocksize); + rval = 0; (void)signal(SIGINFO, siginfo); @@ -271,7 +286,9 @@ main(int argc, char *argv[]) p-fts_parent-fts_bignum += p-fts_bignum += curblocks; - if (p-fts_level = depth) { + if (p-fts_level = depth threshold = + threshold_sign * howmany(p-fts_bignum * + cblocksize, blocksize)) { if (hflag) { prthumanval(p-fts_bignum); (void)printf(\t%s\n, p-fts_path); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209363 - head/bin/pkill
Author: brian Date: Sun Jun 20 08:48:30 2010 New Revision: 209363 URL: http://svn.freebsd.org/changeset/base/209363 Log: Recognise the -l switch with pkill - list kill command(s) used. PR: 143558 Submitted by: eitanadlerlist at gmail dot com MFC after:3 weeks Modified: head/bin/pkill/pkill.1 head/bin/pkill/pkill.c Modified: head/bin/pkill/pkill.1 == --- head/bin/pkill/pkill.1 Sun Jun 20 08:27:03 2010(r209362) +++ head/bin/pkill/pkill.1 Sun Jun 20 08:48:30 2010(r209363) @@ -156,14 +156,16 @@ The value matches processes not in jail. .It Fl l Long output. -Print the process name in addition to the process ID for each matching +For +.Nm pgrep , +print the process name in addition to the process ID for each matching process. If used in conjunction with .Fl f , print the process ID and the full argument list for each matching process. -This option can only be used with the -.Nm pgrep -command. +For +.Nm pkill , +display the kill command used for each process killed. .It Fl n Select only the newest (most recently started) of the matching processes. .It Fl o Modified: head/bin/pkill/pkill.c == --- head/bin/pkill/pkill.c Sun Jun 20 08:27:03 2010(r209362) +++ head/bin/pkill/pkill.c Sun Jun 20 08:48:30 2010(r209363) @@ -128,7 +128,7 @@ main(int argc, char **argv) { char buf[_POSIX2_LINE_MAX], *mstr, **pargv, *p, *q, *pidfile; const char *execf, *coref; - int ancestors, debug_opt; + int ancestors, debug_opt, did_action; int i, ch, bestidx, rv, criteria, pidfromfile, pidfilelock; size_t jsz; int (*action)(const struct kinfo_proc *); @@ -242,8 +242,6 @@ main(int argc, char **argv) criteria = 1; break; case 'l': - if (!pgrep) - usage(); longfmt = 1; break; case 'n': @@ -530,16 +528,24 @@ main(int argc, char **argv) /* * Take the appropriate action for each matched process, if any. */ + did_action = 0; for (i = 0, rv = 0, kp = plist; i nproc; i++, kp++) { if (PSKIP(kp)) continue; if (selected[i]) { + if (longfmt !pgrep) { + did_action = 1; + printf(kill -%d %d\n, signum, kp-ki_pid); + } if (inverse) continue; } else if (!inverse) continue; rv |= (*action)(kp); } + if (!did_action !pgrep longfmt) + fprintf(stderr, + No matching processes belonging to you were found\n); exit(rv ? STATUS_MATCH : STATUS_NOMATCH); } @@ -552,7 +558,7 @@ usage(void) if (pgrep) ustr = [-LSfilnoqvx] [-d delim]; else - ustr = [-signal] [-ILfinovx]; + ustr = [-signal] [-ILfilnovx]; fprintf(stderr, usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209364 - head/sbin/fsck_msdosfs
Author: brian Date: Sun Jun 20 09:40:54 2010 New Revision: 209364 URL: http://svn.freebsd.org/changeset/base/209364 Log: Fix some style(9), although there's a lot more issues here. Fix some casting errors. PR: 142384 Submitted by: giffunip at tutopia dot com Obtained from:NetBSD MFC after:3 weeks Modified: head/sbin/fsck_msdosfs/Makefile head/sbin/fsck_msdosfs/boot.c head/sbin/fsck_msdosfs/check.c head/sbin/fsck_msdosfs/dir.c head/sbin/fsck_msdosfs/fat.c Modified: head/sbin/fsck_msdosfs/Makefile == --- head/sbin/fsck_msdosfs/Makefile Sun Jun 20 08:48:30 2010 (r209363) +++ head/sbin/fsck_msdosfs/Makefile Sun Jun 20 09:40:54 2010 (r209364) @@ -9,6 +9,6 @@ MAN=fsck_msdosfs.8 SRCS= main.c check.c boot.c fat.c dir.c fsutil.c CFLAGS+= -I${FSCK} -WARNS?=0 +WARNS?=2 .include bsd.prog.mk Modified: head/sbin/fsck_msdosfs/boot.c == --- head/sbin/fsck_msdosfs/boot.c Sun Jun 20 08:48:30 2010 (r209363) +++ head/sbin/fsck_msdosfs/boot.c Sun Jun 20 09:40:54 2010 (r209364) @@ -48,13 +48,14 @@ readboot(int dosfs, struct bootblock *bo int ret = FSOK; int i; - if ((size_t)read(dosfs, block, sizeof block) != sizeof block) { + if (read(dosfs, block, sizeof block) != sizeof block) { perror(could not read boot block); return FSFATAL; } if (block[510] != 0x55 || block[511] != 0xaa) { - pfatal(Invalid signature in boot block: %02x%02x, block[511], block[510]); + pfatal(Invalid signature in boot block: %02x%02x, + block[511], block[510]); return FSFATAL; } @@ -72,8 +73,10 @@ readboot(int dosfs, struct bootblock *bo boot-bpbFATsmall = block[22] + (block[23] 8); boot-SecPerTrack = block[24] + (block[25] 8); boot-bpbHeads = block[26] + (block[27] 8); - boot-bpbHiddenSecs = block[28] + (block[29] 8) + (block[30] 16) + (block[31] 24); - boot-bpbHugeSectors = block[32] + (block[33] 8) + (block[34] 16) + (block[35] 24); + boot-bpbHiddenSecs = block[28] + (block[29] 8) + + (block[30] 16) + (block[31] 24); + boot-bpbHugeSectors = block[32] + (block[33] 8) + + (block[34] 16) + (block[35] 24); boot-FATsecs = boot-bpbFATsmall; @@ -97,10 +100,9 @@ readboot(int dosfs, struct bootblock *bo boot-bpbFSInfo = block[48] + (block[49] 8); boot-bpbBackup = block[50] + (block[51] 8); - if (lseek(dosfs, boot-bpbFSInfo * boot-bpbBytesPerSec, SEEK_SET) - != boot-bpbFSInfo * boot-bpbBytesPerSec - || read(dosfs, fsinfo, sizeof fsinfo) - != sizeof fsinfo) { + if (lseek(dosfs, boot-bpbFSInfo * boot-bpbBytesPerSec, + SEEK_SET) != boot-bpbFSInfo * boot-bpbBytesPerSec + || read(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { perror(could not read fsinfo block); return FSFATAL; } @@ -124,7 +126,8 @@ readboot(int dosfs, struct bootblock *bo fsinfo[0x3fc] = fsinfo[0x3fd] = 0; fsinfo[0x3fe] = 0x55; fsinfo[0x3ff] = 0xaa; - if (lseek(dosfs, boot-bpbFSInfo * boot-bpbBytesPerSec, SEEK_SET) + if (lseek(dosfs, boot-bpbFSInfo * + boot-bpbBytesPerSec, SEEK_SET) != boot-bpbFSInfo * boot-bpbBytesPerSec || write(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { @@ -144,7 +147,8 @@ readboot(int dosfs, struct bootblock *bo + (fsinfo[0x1ef] 24); } - if (lseek(dosfs, boot-bpbBackup * boot-bpbBytesPerSec, SEEK_SET) + if (lseek(dosfs, boot-bpbBackup * boot-bpbBytesPerSec, + SEEK_SET) != boot-bpbBackup * boot-bpbBytesPerSec || read(dosfs, backup, sizeof backup) != sizeof backup) { perror(could not read backup bootblock); @@ -172,11 +176,10 @@ readboot(int dosfs, struct bootblock *bo /* Check backup bpbFSInfo? XXX */ } - boot-ClusterOffset = (boot-bpbRootDirEnts * 32 + boot-bpbBytesPerSec - 1) - / boot-bpbBytesPerSec - + boot-bpbResSectors - + boot-bpbFATs * boot-FATsecs - - CLUST_FIRST * boot-bpbSecPerClust; + boot-ClusterOffset = (boot-bpbRootDirEnts * 32 + +
svn commit: r209329 - head/sys/dev/agp
Author: brian Date: Sat Jun 19 08:42:29 2010 New Revision: 209329 URL: http://svn.freebsd.org/changeset/base/209329 Log: Add a missing linefeed PR: 147337 Submitted by: cyberleo at cyberleo dot net MFC after:1 week Modified: head/sys/dev/agp/agp_nvidia.c Modified: head/sys/dev/agp/agp_nvidia.c == --- head/sys/dev/agp/agp_nvidia.c Sat Jun 19 08:36:12 2010 (r209328) +++ head/sys/dev/agp/agp_nvidia.c Sat Jun 19 08:42:29 2010 (r209329) @@ -282,7 +282,7 @@ agp_nvidia_get_aperture(device_t dev) case 14: return (64 * 1024 * 1024); break; case 15: return (32 * 1024 * 1024); break; default: - device_printf(dev, Invalid aperture setting 0x%x, + device_printf(dev, Invalid aperture setting 0x%x\n, pci_read_config(dev, AGP_NVIDIA_0_APSIZE, 1)); return 0; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209331 - in head: etc tools/tools/tinybsd/conf/default tools/tools/tinybsd/conf/vpn
Author: brian Date: Sat Jun 19 09:21:34 2010 New Revision: 209331 URL: http://svn.freebsd.org/changeset/base/209331 Log: Remove vestiges of 'slip'. PR: 145648 Submitted by: alexbestms at wwu dot de and spam at rm-rf dot kiev dot ua MFC after:1 week Modified: head/etc/login.conf head/tools/tools/tinybsd/conf/default/TINYBSD head/tools/tools/tinybsd/conf/vpn/TINYBSD Modified: head/etc/login.conf == --- head/etc/login.conf Sat Jun 19 08:46:17 2010(r209330) +++ head/etc/login.conf Sat Jun 19 09:21:34 2010(r209331) @@ -228,7 +228,7 @@ russian|Russian Users Accounts:\ # # ## -## The dialer class should be used for a dialup PPP/SLIP accounts +## The dialer class should be used for a dialup PPP account ## Welcome messages/news suppressed ## #dialer:\ @@ -247,7 +247,7 @@ russian|Russian Users Accounts:\ # # ## -## Site full-time 24/7 PPP/SLIP connections +## Site full-time 24/7 PPP connection ## - no time accounting, restricted to access via dialin lines ## #site:\ @@ -306,11 +306,6 @@ russian|Russian Users Accounts:\ # :tc=subscriber: # # -#subslip|SLIP Subscriber Accounts:\ -# :tc=dialer:\ -# :tc=subscriber: -# -# #subshell|Shell Subscriber Accounts:\ # :tc=subscriber: # Modified: head/tools/tools/tinybsd/conf/default/TINYBSD == --- head/tools/tools/tinybsd/conf/default/TINYBSD Sat Jun 19 08:46:17 2010(r209330) +++ head/tools/tools/tinybsd/conf/default/TINYBSD Sat Jun 19 09:21:34 2010(r209331) @@ -143,7 +143,6 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop# Network loopback device random # Entropy device device ether # Ethernet support -#devicesl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) Modified: head/tools/tools/tinybsd/conf/vpn/TINYBSD == --- head/tools/tools/tinybsd/conf/vpn/TINYBSD Sat Jun 19 08:46:17 2010 (r209330) +++ head/tools/tools/tinybsd/conf/vpn/TINYBSD Sat Jun 19 09:21:34 2010 (r209331) @@ -133,7 +133,6 @@ device xe # Xircom pccard Ethernet device loop# Network loopback device random # Entropy device device ether # Ethernet support -#devicesl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209332 - head/release/scripts
Author: brian Date: Sat Jun 19 09:33:11 2010 New Revision: 209332 URL: http://svn.freebsd.org/changeset/base/209332 Log: Remove an unnecessary cat. PR: 145447 Submitted by: u at netbeisser dot de MFC after:1 week Modified: head/release/scripts/ports-install.sh Modified: head/release/scripts/ports-install.sh == --- head/release/scripts/ports-install.sh Sat Jun 19 09:21:34 2010 (r209331) +++ head/release/scripts/ports-install.sh Sat Jun 19 09:33:11 2010 (r209332) @@ -8,5 +8,5 @@ if [ `id -u` != 0 ]; then exit 1 fi echo Extracting ports tarball into ${DESTDIR}/usr -cat ports.tgz | tar --unlink -xpzf - -C ${DESTDIR}/usr +tar --unlink -xpzf ports.tgz -C ${DESTDIR}/usr exit 0 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209284 - stable/8/usr.bin/jot
Author: brian Date: Fri Jun 18 07:19:30 2010 New Revision: 209284 URL: http://svn.freebsd.org/changeset/base/209284 Log: MFC r208728 - Fix stuttering sequences and reverse ranges PR: 123635 Submitted by: Ulrich Spörlein, uqs at spoerlein dot net Modified: stable/8/usr.bin/jot/jot.1 stable/8/usr.bin/jot/jot.c Directory Properties: stable/8/usr.bin/jot/ (props changed) Modified: stable/8/usr.bin/jot/jot.1 == --- stable/8/usr.bin/jot/jot.1 Fri Jun 18 06:24:40 2010(r209283) +++ stable/8/usr.bin/jot/jot.1 Fri Jun 18 07:19:30 2010(r209284) @@ -32,7 +32,7 @@ .\@(#)jot.1 8.1 (Berkeley) 6/6/93 .\ $FreeBSD$ .\ -.Dd November 6, 2006 +.Dd June 2, 2010 .Dt JOT 1 .Os .Sh NAME @@ -167,6 +167,86 @@ The name derives in part from .Nm iota , a function in APL. +.Ss Rounding and truncation +The +.Nm +utility uses double precision floating point arithmetic internally. +Before printing a number, it is converted depending on the output +format used. +.Pp +If no output format is specified or the output format is a +floating point format +.Po +.Sq E , +.Sq G , +.Sq e , +.Sq f , +or +.Sq g +.Pc , +the value is rounded using the +.Xr printf 3 +function, taking into account the requested precision. +.Pp +If the output format is an integer format +.Po +.Sq D , +.Sq O , +.Sq U , +.Sq X , +.Sq c , +.Sq d , +.Sq i , +.Sq o , +.Sq u , +or +.Sq x +.Pc , +the value is converted to an integer value by truncation. +.Pp +As an illustration, consider the following command: +.Bd -literal -offset indent +$ jot 6 1 10 0.5 +1 +2 +2 +2 +3 +4 +.Ed +.Pp +By requesting an explicit precision of 1, the values generated before rounding +can be seen. +The .5 values are rounded down if the integer part is even, +up otherwise. +.Bd -literal -offset indent +$ jot -p 1 6 1 10 0.5 +1.0 +1.5 +2.0 +2.5 +3.0 +3.5 +.Ed +.Pp +By offsetting the values slightly, the values generated by the following +command are always rounded down: +.Bd -literal -offset indent +$ jot -p 0 6 .99 10 0.5 +1 +1 +2 +2 +3 +3 +.Ed +.Pp +Another way of achieving the same result is to force truncation by +specifying an integer format: +.Bd -literal -offset indent +$ jot -w %d 6 1 10 0.5 +.Ed +.Pp .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -201,9 +281,9 @@ the result of .Dl jot -w %ds/old/new/ 30 2 - 5 .Pp The stuttering sequence 9, 9, 8, 8, 7, etc.\ can be -produced by suitable choice of step size, +produced by truncating the output precision and a suitable choice of step size, as in -.Dl jot - 9 0 -.5 +.Dl jot -w %d - 9.5 0 -.5 .Pp and a file containing exactly 1024 bytes is created with .Dl jot -b x 512 block Modified: stable/8/usr.bin/jot/jot.c == --- stable/8/usr.bin/jot/jot.c Fri Jun 18 06:24:40 2010(r209283) +++ stable/8/usr.bin/jot/jot.c Fri Jun 18 07:19:30 2010(r209284) @@ -77,7 +77,7 @@ __FBSDID($FreeBSD$); #defineis_default(s) (*(s) == 0 || strcmp((s), -) == 0) static boolboring; -static int prec; +static int prec = -1; static boollongdata; static boolintdata; static boolchardata; @@ -128,7 +128,7 @@ main(int argc, char **argv) break; case 'p': prec = atoi(optarg); - if (prec = 0) + if (prec 0) errx(1, bad precision value); have_format = true; break; @@ -159,7 +159,7 @@ main(int argc, char **argv) if (!sscanf(argv[2], %lf, ender)) ender = argv[2][strlen(argv[2])-1]; mask |= HAVE_ENDER; - if (!prec) + if (prec 0) n = getprec(argv[2]); } /* FALLTHROUGH */ @@ -168,7 +168,7 @@ main(int argc, char **argv) if (!sscanf(argv[1], %lf, begin)) begin = argv[1][strlen(argv[1])-1]; mask |= HAVE_BEGIN; - if (!prec) + if (prec 0) prec = getprec(argv[1]); if (n prec) /* maximum precision */ prec = n; @@ -188,6 +188,10 @@ main(int argc, char **argv) argv[4]); } getformat(); + + if (prec == -1) + prec = 0; + while (mask)/* 4 bit mask has 1's where last 4 args were given */ switch (mask) { /* fill in the 0's by default or computation */ case HAVE_STEP: @@ -284,13 +288,16 @@ main(int argc, char **argv) if (!have_format prec == 0 begin = 0 begin divisor ender
Re: svn commit: r209221 - head/bin/sh
On Wed, 16 Jun 2010 03:30:45 +0200 Dag-Erling Smørgrav d...@des.no wrote: Jilles Tjoelker jil...@freebsd.org writes: Log: sh: Add filename completion. Wonderful! Now I'll never have to use csh again :) Is there a plan to change root's shell from csh to sh? If not, should there be? I've been doing this locally for 17 years. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r209086 - stable/8/bin/date
Author: brian Date: Sat Jun 12 02:00:15 2010 New Revision: 209086 URL: http://svn.freebsd.org/changeset/base/209086 Log: MFC r208795; additional date -v detail PR: 147354 Approved by: re (kib) Modified: stable/8/bin/date/date.1 Directory Properties: stable/8/bin/date/ (props changed) Modified: stable/8/bin/date/date.1 == --- stable/8/bin/date/date.1Sat Jun 12 01:45:29 2010(r209085) +++ stable/8/bin/date/date.1Sat Jun 12 02:00:15 2010(r209086) @@ -32,7 +32,7 @@ .\ @(#)date.1 8.3 (Berkeley) 4/28/95 .\ $FreeBSD$ .\ -.Dd June 2, 2007 +.Dd June 3, 2010 .Dt DATE 1 .Os .Sh NAME @@ -219,6 +219,14 @@ When the date is adjusted to a specific the resulting timezone will be set so that the date matches the earlier of the two times. .Pp +It is not possible to adjust a date to an invalid absolute day, so using +the switches +.Fl v No 31d Fl v No 12m +will simply fail five months of the year. +It is therefore usual to set the month before setting the day; using +.Fl v No 12m Fl v No 31d +always works. +.Pp Adjusting the date by months is inherently ambiguous because a month is a unit of variable length depending on the current date. This kind of date adjustment is applied in the most intuitive way. @@ -339,9 +347,9 @@ will display the last day of February in .Pp .Dl Tue Feb 29 03:18:00 GMT 2000 .Pp -So will do the command: +So will the command: .Pp -.Dl date -v30d -v3m -v0y -v-1m +.Dl date -v3m -v30d -v0y -v-1m .Pp because there is no such date as the 30th of February. .Pp ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r208936 - stable/8/lib/libthr/thread
Author: brian Date: Wed Jun 9 07:31:41 2010 New Revision: 208936 URL: http://svn.freebsd.org/changeset/base/208936 Log: MFC r197477 - clean up keys deleted via pthread_key_delete() PR: 135462 Approved by: re (kib) Nod timeout: davidxu Modified: stable/8/lib/libthr/thread/thr_spec.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_spec.c == --- stable/8/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:32 2010 (r208935) +++ stable/8/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:41 2010 (r208936) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread-specific[key].data = NULL; curthread-specific_data_count--; } + else if (curthread-specific[key].data != NULL) { + /* +* This can happen if the key is deleted via +* pthread_key_delete without first setting the value +* to NULL in all threads. POSIX says that the +* destructor is not invoked in this case. +*/ + curthread-specific[key].data = NULL; + curthread-specific_data_count--; + } /* -* If there is a destructore, call it +* If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r208937 - stable/7/lib/libthr/thread
Author: brian Date: Wed Jun 9 07:36:35 2010 New Revision: 208937 URL: http://svn.freebsd.org/changeset/base/208937 Log: MFC r197477 - clean up keys deleted via pthread_key_delete() PR: 135462 Modified: stable/7/lib/libthr/thread/thr_spec.c Directory Properties: stable/7/lib/libthr/ (props changed) Modified: stable/7/lib/libthr/thread/thr_spec.c == --- stable/7/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:41 2010 (r208936) +++ stable/7/lib/libthr/thread/thr_spec.c Wed Jun 9 07:36:35 2010 (r208937) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread-specific[key].data = NULL; curthread-specific_data_count--; } + else if (curthread-specific[key].data != NULL) { + /* +* This can happen if the key is deleted via +* pthread_key_delete without first setting the value +* to NULL in all threads. POSIX says that the +* destructor is not invoked in this case. +*/ + curthread-specific[key].data = NULL; + curthread-specific_data_count--; + } /* -* If there is a destructore, call it +* If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r208795 - head/bin/date
Author: brian Date: Fri Jun 4 06:56:58 2010 New Revision: 208795 URL: http://svn.freebsd.org/changeset/base/208795 Log: Explain that setting an absolute day value can fail and that the month should usually be set first when using -v. Adjust an example that sets the day to 30 before setting the month to 3 in accordance with this approach as the example would always fail in February! PR: 147354 MFC after:2 weeks Modified: head/bin/date/date.1 Modified: head/bin/date/date.1 == --- head/bin/date/date.1Fri Jun 4 06:35:36 2010(r208794) +++ head/bin/date/date.1Fri Jun 4 06:56:58 2010(r208795) @@ -32,7 +32,7 @@ .\ @(#)date.1 8.3 (Berkeley) 4/28/95 .\ $FreeBSD$ .\ -.Dd June 2, 2007 +.Dd June 3, 2010 .Dt DATE 1 .Os .Sh NAME @@ -219,6 +219,14 @@ When the date is adjusted to a specific the resulting timezone will be set so that the date matches the earlier of the two times. .Pp +It is not possible to adjust a date to an invalid absolute day, so using +the switches +.Fl v No 31d Fl v No 12m +will simply fail five months of the year. +It is therefore usual to set the month before setting the day; using +.Fl v No 12m Fl v No 31d +always works. +.Pp Adjusting the date by months is inherently ambiguous because a month is a unit of variable length depending on the current date. This kind of date adjustment is applied in the most intuitive way. @@ -339,9 +347,9 @@ will display the last day of February in .Pp .Dl Tue Feb 29 03:18:00 GMT 2000 .Pp -So will do the command: +So will the command: .Pp -.Dl date -v30d -v3m -v0y -v-1m +.Dl date -v3m -v30d -v0y -v-1m .Pp because there is no such date as the 30th of February. .Pp ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r208728 - in head: tools/regression/usr.bin/jot usr.bin/jot
Author: brian Date: Wed Jun 2 07:47:29 2010 New Revision: 208728 URL: http://svn.freebsd.org/changeset/base/208728 Log: Fix stuttering sequences and reverse ranges PR: 123635 Submitted by: Ulrich Spörlein, uqs at spoerlein dot net Added: head/tools/regression/usr.bin/jot/regress.rand1.out (contents, props changed) head/tools/regression/usr.bin/jot/regress.rand2.out (contents, props changed) head/tools/regression/usr.bin/jot/regress.stutter2.out (contents, props changed) Modified: head/tools/regression/usr.bin/jot/regress.sh head/usr.bin/jot/jot.1 head/usr.bin/jot/jot.c Added: head/tools/regression/usr.bin/jot/regress.rand1.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/jot/regress.rand1.out Wed Jun 2 07:47:29 2010(r208728) @@ -0,0 +1,10 @@ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 Added: head/tools/regression/usr.bin/jot/regress.rand2.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/jot/regress.rand2.out Wed Jun 2 07:47:29 2010(r208728) @@ -0,0 +1,10 @@ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 Modified: head/tools/regression/usr.bin/jot/regress.sh == --- head/tools/regression/usr.bin/jot/regress.shWed Jun 2 07:28:12 2010(r208727) +++ head/tools/regression/usr.bin/jot/regress.shWed Jun 2 07:47:29 2010(r208728) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo 1..57 +echo 1..60 REGRESSION_START($1) @@ -32,12 +32,15 @@ REGRESSION_TEST(`hddd2', `jot 30 - - -') REGRESSION_TEST(`dhhh2', `jot - 20 160 2') REGRESSION_TEST(`dhhd2', `jot - 20 160 -') REGRESSION_TEST(`ddhh2', `jot - - 160 2') +REGRESSION_TEST(`rand1', `jot -r 1 0 9 | sort -u') +REGRESSION_TEST(`rand2', `jot -r 1 9 0 | sort -u') REGRESSION_TEST(`n21', `jot 21 -1 1.00') REGRESSION_TEST(`ascii', `jot -c 128 0') REGRESSION_TEST(`xaa', `jot -w xa%c 26 a') REGRESSION_TEST(`yes', `jot -b yes 10') REGRESSION_TEST(`ed', `jot -w %ds/old/new/ 30 2 - 5') REGRESSION_TEST(`stutter', `jot - 9 0 -.5') +REGRESSION_TEST(`stutter2', `jot -w %d - 9.5 0 -.5') REGRESSION_TEST(`block', `jot -b x 512') REGRESSION_TEST(`tabs', `jot -s, - 10 132 4') REGRESSION_TEST(`grep', `jot -s -b . 80') Added: head/tools/regression/usr.bin/jot/regress.stutter2.out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/jot/regress.stutter2.out Wed Jun 2 07:47:29 2010(r208728) @@ -0,0 +1,20 @@ +9 +9 +8 +8 +7 +7 +6 +6 +5 +5 +4 +4 +3 +3 +2 +2 +1 +1 +0 +0 Modified: head/usr.bin/jot/jot.1 == --- head/usr.bin/jot/jot.1 Wed Jun 2 07:28:12 2010(r208727) +++ head/usr.bin/jot/jot.1 Wed Jun 2 07:47:29 2010(r208728) @@ -32,7 +32,7 @@ .\@(#)jot.1 8.1 (Berkeley) 6/6/93 .\ $FreeBSD$ .\ -.Dd February 19, 2010 +.Dd June 2, 2010 .Dt JOT 1 .Os .Sh NAME @@ -167,6 +167,86 @@ The name derives in part from .Nm iota , a function in APL. +.Ss Rounding and truncation +The +.Nm +utility uses double precision floating point arithmetic internally. +Before printing a number, it is converted depending on the output +format used. +.Pp +If no output format is specified or the output format is a +floating point format +.Po +.Sq E , +.Sq G , +.Sq e , +.Sq f , +or +.Sq g +.Pc , +the value is rounded using the +.Xr printf 3 +function, taking into account the requested precision. +.Pp +If the output format is an integer format +.Po +.Sq D , +.Sq O , +.Sq U , +.Sq X , +.Sq c , +.Sq d , +.Sq i , +.Sq o , +.Sq u , +or +.Sq x +.Pc , +the value is converted to an integer value by truncation. +.Pp +As an illustration, consider the following command: +.Bd -literal -offset indent +$ jot 6 1 10 0.5 +1 +2 +2 +2 +3 +4 +.Ed +.Pp +By requesting an explicit precision of 1, the values generated before rounding +can be seen. +The .5 values are rounded down if the integer part is even, +up otherwise. +.Bd -literal -offset indent +$ jot -p 1 6 1 10 0.5 +1.0 +1.5 +2.0 +2.5 +3.0 +3.5 +.Ed +.Pp +By offsetting the values slightly, the values generated by the following +command are always rounded down: +.Bd -literal -offset indent +$ jot -p 0 6 .99 10 0.5 +1 +1 +2 +2 +3 +3 +.Ed +.Pp +Another way of achieving the same result is to force truncation by +specifying an integer format: +.Bd -literal -offset indent +$ jot -w %d 6 1 10 0.5 +.Ed +.Pp .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -201,9 +281,9 @@ the result of .Dl jot -w %ds/old/new/ 30 2 - 5 .Pp The stuttering sequence 9, 9, 8, 8, 7, etc.\ can be -produced by suitable choice of step
svn commit: r196793 - stable/7/usr.sbin/ppp
Author: brian Date: Thu Sep 3 18:16:03 2009 New Revision: 196793 URL: http://svn.freebsd.org/changeset/base/196793 Log: MFC r196530: Document that ppp handles pipe(2) descriptors specially in -direct mode. Modified: stable/7/usr.sbin/ppp/ (props changed) stable/7/usr.sbin/ppp/ppp.8.m4 Modified: stable/7/usr.sbin/ppp/ppp.8.m4 == --- stable/7/usr.sbin/ppp/ppp.8.m4 Thu Sep 3 17:37:23 2009 (r196792) +++ stable/7/usr.sbin/ppp/ppp.8.m4 Thu Sep 3 18:16:03 2009 (r196793) @@ -27,7 +27,7 @@ changecom(,)dnl .\ .\ $FreeBSD$ .\ -.Dd May 24, 2007 +.Dd August 25, 2009 .Dt PPP 8 .Os .Sh NAME @@ -171,6 +171,17 @@ If callback is configured, will use the .Dq set device information when dialing back. +.Pp +When run in +.Fl direct +mode, +.Nm +will behave slightly differently if descriptor 0 was created by +.Xr pipe 2 . +As pipes are not bi-directional, ppp will redirect all writes to descriptor +1 (standard output), leaving only reads acting on descriptor 0. +No special action is taken if descriptor 0 was created by +.Xr socketpair 2 . .It Fl dedicated This option is designed for machines connected with a dedicated wire. @@ -6070,6 +6081,8 @@ This socket is used to pass links betwee .Xr tcpdump 1 , .Xr telnet 1 , .Xr kldload 2 , +.Xr pipe 2 , +.Xr socketpair 2 , ifdef({LOCALNAT},{},{.Xr libalias 3 , })dnl ifdef({LOCALRAD},{},{.Xr libradius 3 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r196639 - stable/8/usr.sbin/ppp
Author: brian Date: Sat Aug 29 04:15:37 2009 New Revision: 196639 URL: http://svn.freebsd.org/changeset/base/196639 Log: MFC r196530: Document that ppp handles pipe(2) descriptors specially in -direct mode. Approved by: re (kib) Modified: stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/ppp/ppp.8.m4 Modified: stable/8/usr.sbin/ppp/ppp.8.m4 == --- stable/8/usr.sbin/ppp/ppp.8.m4 Sat Aug 29 03:17:24 2009 (r196638) +++ stable/8/usr.sbin/ppp/ppp.8.m4 Sat Aug 29 04:15:37 2009 (r196639) @@ -27,7 +27,7 @@ changecom(,)dnl .\ .\ $FreeBSD$ .\ -.Dd May 24, 2007 +.Dd August 25, 2009 .Dt PPP 8 .Os .Sh NAME @@ -171,6 +171,17 @@ If callback is configured, will use the .Dq set device information when dialing back. +.Pp +When run in +.Fl direct +mode, +.Nm +will behave slightly differently if descriptor 0 was created by +.Xr pipe 2 . +As pipes are not bi-directional, ppp will redirect all writes to descriptor +1 (standard output), leaving only reads acting on descriptor 0. +No special action is taken if descriptor 0 was created by +.Xr socketpair 2 . .It Fl dedicated This option is designed for machines connected with a dedicated wire. @@ -6055,6 +6066,8 @@ This socket is used to pass links betwee .Xr tcpdump 1 , .Xr telnet 1 , .Xr kldload 2 , +.Xr pipe 2 , +.Xr socketpair 2 , ifdef({LOCALNAT},{},{.Xr libalias 3 , })dnl ifdef({LOCALRAD},{},{.Xr libradius 3 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r196576 - stable/8/usr.sbin/ppp
Author: brian Date: Thu Aug 27 07:07:38 2009 New Revision: 196576 URL: http://svn.freebsd.org/changeset/base/196576 Log: MFC: When ``ppp -direct'' is invoked by a program that uses pipe(2) to create stdin and stdout, don't blindly try to use stdin as a bi-directional channel. Instead, detect the pipe and set up a special exec handler that indirects write() calls through stdout. This fixes the problem where ``set device !ssh -e none host ppp -direct label'' no longer works with an openssh-5.2 server side as that version of openssh ignores the USE_PIPES config setting and *always* uses pipes (rather than socketpair) for stdin/stdout channels. Approved by: re (kib) Modified: stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/ppp/exec.c stable/8/usr.sbin/ppp/exec.h stable/8/usr.sbin/ppp/main.c stable/8/usr.sbin/ppp/physical.c Modified: stable/8/usr.sbin/ppp/exec.c == --- stable/8/usr.sbin/ppp/exec.cThu Aug 27 07:05:46 2009 (r196575) +++ stable/8/usr.sbin/ppp/exec.cThu Aug 27 07:07:38 2009 (r196576) @@ -35,7 +35,9 @@ #include stdio.h #include stdlib.h #include string.h +#include sysexits.h #include sys/wait.h +#include sys/stat.h #include sys/uio.h #include termios.h #include unistd.h @@ -63,24 +65,106 @@ #include cbcp.h #include datalink.h #include id.h +#include main.h #include exec.h -static struct device execdevice = { + +struct execdevice { + struct device dev; /* What struct physical knows about */ + int fd_out; /* output descriptor */ +}; + +#define device2exec(d) ((d)-type == EXEC_DEVICE ? (struct execdevice *)d : NULL) + +unsigned +exec_DeviceSize(void) +{ + return sizeof(struct execdevice); +} + +static void +exec_Free(struct physical *p) +{ + struct execdevice *dev = device2exec(p-handler); + + if (dev-fd_out != -1) +close(dev-fd_out); + free(dev); +} + +static void +exec_device2iov(struct device *d, struct iovec *iov, int *niov, + int maxiov __unused, int *auxfd, int *nauxfd) +{ + struct execdevice *dev; + int sz = physical_MaxDeviceSize(); + + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { +log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); +AbortProgram(EX_OSERR); + } + iov[*niov].iov_len = sz; + (*niov)++; + + dev = device2exec(d); + if (dev-fd_out = 0) { +*auxfd = dev-fd_out; +(*nauxfd)++; + } +} + +static int +exec_RemoveFromSet(struct physical *p, fd_set *r, fd_set *w, fd_set *e) +{ + struct execdevice *dev = device2exec(p-handler); + int sets; + + p-handler-removefromset = NULL; + sets = physical_RemoveFromSet(p, r, w, e); + p-handler-removefromset = exec_RemoveFromSet; + + if (dev-fd_out = 0) { +if (w FD_ISSET(dev-fd_out, w)) { + FD_CLR(dev-fd_out, w); + log_Printf(LogTIMER, %s: fdunset(w) %d\n, p-link.name, dev-fd_out); + sets++; +} +if (e FD_ISSET(dev-fd_out, e)) { + FD_CLR(dev-fd_out, e); + log_Printf(LogTIMER, %s: fdunset(e) %d\n, p-link.name, dev-fd_out); + sets++; +} + } + + return sets; +} + +static ssize_t +exec_Write(struct physical *p, const void *v, size_t n) +{ + struct execdevice *dev = device2exec(p-handler); + int fd = dev-fd_out == -1 ? p-fd : dev-fd_out; + + return write(fd, v, n); +} + +static struct device baseexecdevice = { EXEC_DEVICE, exec, 0, { CD_NOTREQUIRED, 0 }, NULL, + exec_RemoveFromSet, NULL, NULL, NULL, NULL, NULL, + exec_Free, NULL, - NULL, - NULL, - NULL, - NULL, + exec_Write, + exec_device2iov, NULL, NULL, NULL @@ -88,146 +172,238 @@ static struct device execdevice = { struct device * exec_iov2device(int type, struct physical *p, struct iovec *iov, -int *niov, int maxiov __unused, int *auxfd __unused, - int *nauxfd __unused) +int *niov, int maxiov __unused, int *auxfd, int *nauxfd) { if (type == EXEC_DEVICE) { -free(iov[(*niov)++].iov_base); -physical_SetupStack(p, execdevice.name, PHYSICAL_NOFORCE); -return execdevice; +struct execdevice *dev = (struct execdevice *)iov[(*niov)++].iov_base; + +dev = realloc(dev, sizeof *dev); /* Reduce to the correct size */ +if (dev == NULL) { + log_Printf(LogALERT, Failed to allocate memory: %d\n, + (int)(sizeof *dev)); + AbortProgram(EX_OSERR); +} + +if (*nauxfd) { + dev-fd_out = *auxfd; + (*nauxfd)--; +} else + dev-fd_out = -1; + +/* Refresh function pointers etc */ +memcpy(dev-dev, baseexecdevice, sizeof dev-dev); + +physical_SetupStack(p, dev-dev.name, PHYSICAL_NOFORCE); +return dev-dev; } return NULL; } +static int +exec_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n) +{ + struct physical *p = descriptor2physical(d); + struct
svn commit: r196577 - stable/7/usr.sbin/ppp
Author: brian Date: Thu Aug 27 07:10:57 2009 New Revision: 196577 URL: http://svn.freebsd.org/changeset/base/196577 Log: MFC: When realloc()ing device memory for transfer to another ppp process, don't continue to use the realloc()d pointer - it might have changed! Remove some stray diagnostics while I'm here. Modified: stable/7/usr.sbin/ppp/ (props changed) stable/7/usr.sbin/ppp/ether.c stable/7/usr.sbin/ppp/netgraph.c stable/7/usr.sbin/ppp/tty.c Modified: stable/7/usr.sbin/ppp/ether.c == --- stable/7/usr.sbin/ppp/ether.c Thu Aug 27 07:07:38 2009 (r196576) +++ stable/7/usr.sbin/ppp/ether.c Thu Aug 27 07:10:57 2009 (r196577) @@ -193,17 +193,18 @@ static void ether_device2iov(struct device *d, struct iovec *iov, int *niov, int maxiov __unused, int *auxfd, int *nauxfd) { - struct etherdevice *dev = device2ether(d); + struct etherdevice *dev; int sz = physical_MaxDeviceSize(); - iov[*niov].iov_base = realloc(d, sz); - if (iov[*niov].iov_base == NULL) { + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); AbortProgram(EX_OSERR); } iov[*niov].iov_len = sz; (*niov)++; + dev = device2ether(d); if (dev-cs = 0) { *auxfd = dev-cs; (*nauxfd)++; Modified: stable/7/usr.sbin/ppp/netgraph.c == --- stable/7/usr.sbin/ppp/netgraph.cThu Aug 27 07:07:38 2009 (r196576) +++ stable/7/usr.sbin/ppp/netgraph.cThu Aug 27 07:10:57 2009 (r196577) @@ -235,7 +235,6 @@ ng_Read(struct physical *p, void *v, siz { char hook[NG_HOOKSIZ]; -log_Printf(LogDEBUG, ng_Read\n); switch (p-dl-state) { case DATALINK_DIAL: case DATALINK_LOGIN: @@ -282,17 +281,18 @@ static void ng_device2iov(struct device *d, struct iovec *iov, int *niov, int maxiov __unused, int *auxfd, int *nauxfd) { - struct ngdevice *dev = device2ng(d); + struct ngdevice *dev; int sz = physical_MaxDeviceSize(); - iov[*niov].iov_base = realloc(d, sz); - if (iov[*niov].iov_base == NULL) { + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); AbortProgram(EX_OSERR); } iov[*niov].iov_len = sz; (*niov)++; + dev = device2ng(d); *auxfd = dev-cs; (*nauxfd)++; } Modified: stable/7/usr.sbin/ppp/tty.c == --- stable/7/usr.sbin/ppp/tty.c Thu Aug 27 07:07:38 2009(r196576) +++ stable/7/usr.sbin/ppp/tty.c Thu Aug 27 07:10:57 2009(r196577) @@ -384,7 +384,6 @@ UnloadLineDiscipline(struct physical *p) struct ttydevice *dev = device2tty(p-handler); if (isngtty(dev)) { -log_Printf(LogPHASE, back to speed %d\n, dev-real.speed); if (!physical_SetSpeed(p, dev-real.speed)) log_Printf(LogWARN, Couldn't reset tty speed to %d\n, dev-real.speed); dev-real.speed = 0; @@ -582,17 +581,19 @@ tty_device2iov(struct device *d, struct #endif ) { - struct ttydevice *dev = device2tty(d); + struct ttydevice *dev; int sz = physical_MaxDeviceSize(); - iov[*niov].iov_base = realloc(d, sz); - if (iov[*niov].iov_base == NULL) { + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); AbortProgram(EX_OSERR); } iov[*niov].iov_len = sz; (*niov)++; + dev = device2tty(d); + #ifndef NONETGRAPH if (dev-cs = 0) { *auxfd = dev-cs; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r196578 - stable/7/usr.sbin/ppp
Author: brian Date: Thu Aug 27 07:11:47 2009 New Revision: 196578 URL: http://svn.freebsd.org/changeset/base/196578 Log: MFC: When ``ppp -direct'' is invoked by a program that uses pipe(2) to create stdin and stdout, don't blindly try to use stdin as a bi-directional channel. Instead, detect the pipe and set up a special exec handler that indirects write() calls through stdout. This fixes the problem where ``set device !ssh -e none host ppp -direct label'' no longer works with an openssh-5.2 server side as that version of openssh ignores the USE_PIPES config setting and *always* uses pipes (rather than socketpair) for stdin/stdout channels. Modified: stable/7/usr.sbin/ppp/ (props changed) stable/7/usr.sbin/ppp/exec.c stable/7/usr.sbin/ppp/exec.h stable/7/usr.sbin/ppp/main.c stable/7/usr.sbin/ppp/physical.c Modified: stable/7/usr.sbin/ppp/exec.c == --- stable/7/usr.sbin/ppp/exec.cThu Aug 27 07:10:57 2009 (r196577) +++ stable/7/usr.sbin/ppp/exec.cThu Aug 27 07:11:47 2009 (r196578) @@ -35,7 +35,9 @@ #include stdio.h #include stdlib.h #include string.h +#include sysexits.h #include sys/wait.h +#include sys/stat.h #include sys/uio.h #include termios.h #include unistd.h @@ -63,24 +65,106 @@ #include cbcp.h #include datalink.h #include id.h +#include main.h #include exec.h -static struct device execdevice = { + +struct execdevice { + struct device dev; /* What struct physical knows about */ + int fd_out; /* output descriptor */ +}; + +#define device2exec(d) ((d)-type == EXEC_DEVICE ? (struct execdevice *)d : NULL) + +unsigned +exec_DeviceSize(void) +{ + return sizeof(struct execdevice); +} + +static void +exec_Free(struct physical *p) +{ + struct execdevice *dev = device2exec(p-handler); + + if (dev-fd_out != -1) +close(dev-fd_out); + free(dev); +} + +static void +exec_device2iov(struct device *d, struct iovec *iov, int *niov, + int maxiov __unused, int *auxfd, int *nauxfd) +{ + struct execdevice *dev; + int sz = physical_MaxDeviceSize(); + + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { +log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); +AbortProgram(EX_OSERR); + } + iov[*niov].iov_len = sz; + (*niov)++; + + dev = device2exec(d); + if (dev-fd_out = 0) { +*auxfd = dev-fd_out; +(*nauxfd)++; + } +} + +static int +exec_RemoveFromSet(struct physical *p, fd_set *r, fd_set *w, fd_set *e) +{ + struct execdevice *dev = device2exec(p-handler); + int sets; + + p-handler-removefromset = NULL; + sets = physical_RemoveFromSet(p, r, w, e); + p-handler-removefromset = exec_RemoveFromSet; + + if (dev-fd_out = 0) { +if (w FD_ISSET(dev-fd_out, w)) { + FD_CLR(dev-fd_out, w); + log_Printf(LogTIMER, %s: fdunset(w) %d\n, p-link.name, dev-fd_out); + sets++; +} +if (e FD_ISSET(dev-fd_out, e)) { + FD_CLR(dev-fd_out, e); + log_Printf(LogTIMER, %s: fdunset(e) %d\n, p-link.name, dev-fd_out); + sets++; +} + } + + return sets; +} + +static ssize_t +exec_Write(struct physical *p, const void *v, size_t n) +{ + struct execdevice *dev = device2exec(p-handler); + int fd = dev-fd_out == -1 ? p-fd : dev-fd_out; + + return write(fd, v, n); +} + +static struct device baseexecdevice = { EXEC_DEVICE, exec, 0, { CD_NOTREQUIRED, 0 }, NULL, + exec_RemoveFromSet, NULL, NULL, NULL, NULL, NULL, + exec_Free, NULL, - NULL, - NULL, - NULL, - NULL, + exec_Write, + exec_device2iov, NULL, NULL, NULL @@ -88,146 +172,238 @@ static struct device execdevice = { struct device * exec_iov2device(int type, struct physical *p, struct iovec *iov, -int *niov, int maxiov __unused, int *auxfd __unused, - int *nauxfd __unused) +int *niov, int maxiov __unused, int *auxfd, int *nauxfd) { if (type == EXEC_DEVICE) { -free(iov[(*niov)++].iov_base); -physical_SetupStack(p, execdevice.name, PHYSICAL_NOFORCE); -return execdevice; +struct execdevice *dev = (struct execdevice *)iov[(*niov)++].iov_base; + +dev = realloc(dev, sizeof *dev); /* Reduce to the correct size */ +if (dev == NULL) { + log_Printf(LogALERT, Failed to allocate memory: %d\n, + (int)(sizeof *dev)); + AbortProgram(EX_OSERR); +} + +if (*nauxfd) { + dev-fd_out = *auxfd; + (*nauxfd)--; +} else + dev-fd_out = -1; + +/* Refresh function pointers etc */ +memcpy(dev-dev, baseexecdevice, sizeof dev-dev); + +physical_SetupStack(p, dev-dev.name, PHYSICAL_NOFORCE); +return dev-dev; } return NULL; } +static int +exec_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n) +{ + struct physical *p = descriptor2physical(d); + struct execdevice *dev =
svn commit: r196513 - head/usr.sbin/ppp
Author: brian Date: Mon Aug 24 17:18:17 2009 New Revision: 196513 URL: http://svn.freebsd.org/changeset/base/196513 Log: When realloc()ing device memory for transfer to another ppp process, don't continue to use the realloc()d pointer - it might have changed! Remove some stray diagnostics while I'm here. MFC after:3 days Modified: head/usr.sbin/ppp/ether.c head/usr.sbin/ppp/netgraph.c head/usr.sbin/ppp/tty.c Modified: head/usr.sbin/ppp/ether.c == --- head/usr.sbin/ppp/ether.c Mon Aug 24 16:19:47 2009(r196512) +++ head/usr.sbin/ppp/ether.c Mon Aug 24 17:18:17 2009(r196513) @@ -193,17 +193,18 @@ static void ether_device2iov(struct device *d, struct iovec *iov, int *niov, int maxiov __unused, int *auxfd, int *nauxfd) { - struct etherdevice *dev = device2ether(d); + struct etherdevice *dev; int sz = physical_MaxDeviceSize(); - iov[*niov].iov_base = realloc(d, sz); - if (iov[*niov].iov_base == NULL) { + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); AbortProgram(EX_OSERR); } iov[*niov].iov_len = sz; (*niov)++; + dev = device2ether(d); if (dev-cs = 0) { *auxfd = dev-cs; (*nauxfd)++; Modified: head/usr.sbin/ppp/netgraph.c == --- head/usr.sbin/ppp/netgraph.cMon Aug 24 16:19:47 2009 (r196512) +++ head/usr.sbin/ppp/netgraph.cMon Aug 24 17:18:17 2009 (r196513) @@ -235,7 +235,6 @@ ng_Read(struct physical *p, void *v, siz { char hook[NG_HOOKSIZ]; -log_Printf(LogDEBUG, ng_Read\n); switch (p-dl-state) { case DATALINK_DIAL: case DATALINK_LOGIN: @@ -282,17 +281,18 @@ static void ng_device2iov(struct device *d, struct iovec *iov, int *niov, int maxiov __unused, int *auxfd, int *nauxfd) { - struct ngdevice *dev = device2ng(d); + struct ngdevice *dev; int sz = physical_MaxDeviceSize(); - iov[*niov].iov_base = realloc(d, sz); - if (iov[*niov].iov_base == NULL) { + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); AbortProgram(EX_OSERR); } iov[*niov].iov_len = sz; (*niov)++; + dev = device2ng(d); *auxfd = dev-cs; (*nauxfd)++; } Modified: head/usr.sbin/ppp/tty.c == --- head/usr.sbin/ppp/tty.c Mon Aug 24 16:19:47 2009(r196512) +++ head/usr.sbin/ppp/tty.c Mon Aug 24 17:18:17 2009(r196513) @@ -384,7 +384,6 @@ UnloadLineDiscipline(struct physical *p) struct ttydevice *dev = device2tty(p-handler); if (isngtty(dev)) { -log_Printf(LogPHASE, back to speed %d\n, dev-real.speed); if (!physical_SetSpeed(p, dev-real.speed)) log_Printf(LogWARN, Couldn't reset tty speed to %d\n, dev-real.speed); dev-real.speed = 0; @@ -582,17 +581,19 @@ tty_device2iov(struct device *d, struct #endif ) { - struct ttydevice *dev = device2tty(d); + struct ttydevice *dev; int sz = physical_MaxDeviceSize(); - iov[*niov].iov_base = realloc(d, sz); - if (iov[*niov].iov_base == NULL) { + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); AbortProgram(EX_OSERR); } iov[*niov].iov_len = sz; (*niov)++; + dev = device2tty(d); + #ifndef NONETGRAPH if (dev-cs = 0) { *auxfd = dev-cs; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r196514 - head/usr.sbin/ppp
Author: brian Date: Mon Aug 24 17:19:45 2009 New Revision: 196514 URL: http://svn.freebsd.org/changeset/base/196514 Log: When ``ppp -direct'' is invoked by a program that uses pipe(2) to create stdin and stdout, don't blindly try to use stdin as a bi-directional channel. Instead, detect the pipe and set up a special exec handler that indirects write() calls through stdout. This fixes the problem where ``set device !ssh -e none host ppp -direct label'' no longer works with an openssh-5.2 server side as that version of openssh ignores the USE_PIPES config setting and *always* uses pipes (rather than socketpair) for stdin/stdout channels. MFC after:3 days Modified: head/usr.sbin/ppp/exec.c head/usr.sbin/ppp/exec.h head/usr.sbin/ppp/main.c head/usr.sbin/ppp/physical.c Modified: head/usr.sbin/ppp/exec.c == --- head/usr.sbin/ppp/exec.cMon Aug 24 17:18:17 2009(r196513) +++ head/usr.sbin/ppp/exec.cMon Aug 24 17:19:45 2009(r196514) @@ -35,7 +35,9 @@ #include stdio.h #include stdlib.h #include string.h +#include sysexits.h #include sys/wait.h +#include sys/stat.h #include sys/uio.h #include termios.h #include unistd.h @@ -63,24 +65,106 @@ #include cbcp.h #include datalink.h #include id.h +#include main.h #include exec.h -static struct device execdevice = { + +struct execdevice { + struct device dev; /* What struct physical knows about */ + int fd_out; /* output descriptor */ +}; + +#define device2exec(d) ((d)-type == EXEC_DEVICE ? (struct execdevice *)d : NULL) + +unsigned +exec_DeviceSize(void) +{ + return sizeof(struct execdevice); +} + +static void +exec_Free(struct physical *p) +{ + struct execdevice *dev = device2exec(p-handler); + + if (dev-fd_out != -1) +close(dev-fd_out); + free(dev); +} + +static void +exec_device2iov(struct device *d, struct iovec *iov, int *niov, + int maxiov __unused, int *auxfd, int *nauxfd) +{ + struct execdevice *dev; + int sz = physical_MaxDeviceSize(); + + iov[*niov].iov_base = d = realloc(d, sz); + if (d == NULL) { +log_Printf(LogALERT, Failed to allocate memory: %d\n, sz); +AbortProgram(EX_OSERR); + } + iov[*niov].iov_len = sz; + (*niov)++; + + dev = device2exec(d); + if (dev-fd_out = 0) { +*auxfd = dev-fd_out; +(*nauxfd)++; + } +} + +static int +exec_RemoveFromSet(struct physical *p, fd_set *r, fd_set *w, fd_set *e) +{ + struct execdevice *dev = device2exec(p-handler); + int sets; + + p-handler-removefromset = NULL; + sets = physical_RemoveFromSet(p, r, w, e); + p-handler-removefromset = exec_RemoveFromSet; + + if (dev-fd_out = 0) { +if (w FD_ISSET(dev-fd_out, w)) { + FD_CLR(dev-fd_out, w); + log_Printf(LogTIMER, %s: fdunset(w) %d\n, p-link.name, dev-fd_out); + sets++; +} +if (e FD_ISSET(dev-fd_out, e)) { + FD_CLR(dev-fd_out, e); + log_Printf(LogTIMER, %s: fdunset(e) %d\n, p-link.name, dev-fd_out); + sets++; +} + } + + return sets; +} + +static ssize_t +exec_Write(struct physical *p, const void *v, size_t n) +{ + struct execdevice *dev = device2exec(p-handler); + int fd = dev-fd_out == -1 ? p-fd : dev-fd_out; + + return write(fd, v, n); +} + +static struct device baseexecdevice = { EXEC_DEVICE, exec, 0, { CD_NOTREQUIRED, 0 }, NULL, + exec_RemoveFromSet, NULL, NULL, NULL, NULL, NULL, + exec_Free, NULL, - NULL, - NULL, - NULL, - NULL, + exec_Write, + exec_device2iov, NULL, NULL, NULL @@ -88,146 +172,238 @@ static struct device execdevice = { struct device * exec_iov2device(int type, struct physical *p, struct iovec *iov, -int *niov, int maxiov __unused, int *auxfd __unused, - int *nauxfd __unused) +int *niov, int maxiov __unused, int *auxfd, int *nauxfd) { if (type == EXEC_DEVICE) { -free(iov[(*niov)++].iov_base); -physical_SetupStack(p, execdevice.name, PHYSICAL_NOFORCE); -return execdevice; +struct execdevice *dev = (struct execdevice *)iov[(*niov)++].iov_base; + +dev = realloc(dev, sizeof *dev); /* Reduce to the correct size */ +if (dev == NULL) { + log_Printf(LogALERT, Failed to allocate memory: %d\n, + (int)(sizeof *dev)); + AbortProgram(EX_OSERR); +} + +if (*nauxfd) { + dev-fd_out = *auxfd; + (*nauxfd)--; +} else + dev-fd_out = -1; + +/* Refresh function pointers etc */ +memcpy(dev-dev, baseexecdevice, sizeof dev-dev); + +physical_SetupStack(p, dev-dev.name, PHYSICAL_NOFORCE); +return dev-dev; } return NULL; } +static int +exec_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n) +{ + struct physical *p = descriptor2physical(d); + struct execdevice *dev = device2exec(p-handler); + int result = 0; + + if (w dev-fd_out = 0) { +FD_SET(dev-fd_out, w); +
svn commit: r196088 - stable/7/usr.sbin/ppp
Author: brian Date: Sun Aug 9 18:39:23 2009 New Revision: 196088 URL: http://svn.freebsd.org/changeset/base/196088 Log: MFC: Don't get stuck in an infinite loop comparing (short++ = maxshort) PR: 136893 Submitted by: Aragon Gouveia - aragon at phat dot za dot net (mostly) Modified: stable/7/usr.sbin/ppp/ (props changed) stable/7/usr.sbin/ppp/nat_cmd.c Modified: stable/7/usr.sbin/ppp/nat_cmd.c == --- stable/7/usr.sbin/ppp/nat_cmd.c Sun Aug 9 11:47:39 2009 (r196087) +++ stable/7/usr.sbin/ppp/nat_cmd.c Sun Aug 9 18:39:23 2009 (r196088) @@ -173,7 +173,7 @@ nat_RedirectPort(struct cmdargs const *a return -1; } -while (laliasport = haliasport) { +do { link = PacketAliasRedirectPort(localaddr, htons(llocalport), remoteaddr, htons(lremoteport), aliasaddr, htons(laliasport), @@ -185,10 +185,9 @@ nat_RedirectPort(struct cmdargs const *a return 1; } llocalport++; - laliasport++; if (hremoteport) lremoteport++; -} +} while (laliasport++ haliasport); return 0; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r196048 - stable/7/usr.sbin/ppp
Author: brian Date: Mon Aug 3 09:43:06 2009 New Revision: 196048 URL: http://svn.freebsd.org/changeset/base/196048 Log: MFC: Add a missing phrase. Submitted by: Jason McIntyre jmc at kerhand dot co dot uk Obtained from:OpenBSD Modified: stable/7/usr.sbin/ppp/ (props changed) stable/7/usr.sbin/ppp/ppp.8.m4 Modified: stable/7/usr.sbin/ppp/ppp.8.m4 == --- stable/7/usr.sbin/ppp/ppp.8.m4 Mon Aug 3 09:42:11 2009 (r196047) +++ stable/7/usr.sbin/ppp/ppp.8.m4 Mon Aug 3 09:43:06 2009 (r196048) @@ -5471,7 +5471,7 @@ keywords. .It RAD_FRAMED_IPV6_PREFIX If this attribute is supplied, the value is substituted for IPV6PREFIX in a command. -You may pass it to such as DHCPv6 for delegating an +You may pass it to an upper layer protocol such as DHCPv6 for delegating an IPv6 prefix to a peer. .It RAD_FRAMED_IPV6_ROUTE The received string is expected to be in the format ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r196049 - in stable/7: tools/regression/usr.bin/jot usr.bin/jot
Author: brian Date: Mon Aug 3 09:55:03 2009 New Revision: 196049 URL: http://svn.freebsd.org/changeset/base/196049 Log: MFC: Fix some uninitialised variables. PR: 136383 Submitted by: Ulrich Spoerlein - uqs at spoerlein dot net Added: stable/7/tools/regression/usr.bin/jot/regress..out - copied unchanged from r195443, head/tools/regression/usr.bin/jot/regress..out Modified: stable/7/tools/regression/usr.bin/jot/ (props changed) stable/7/tools/regression/usr.bin/jot/regress.sh stable/7/usr.bin/jot/ (props changed) stable/7/usr.bin/jot/jot.c Copied: stable/7/tools/regression/usr.bin/jot/regress..out (from r195443, head/tools/regression/usr.bin/jot/regress..out) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/regression/usr.bin/jot/regress..out Mon Aug 3 09:55:03 2009(r196049, copy of r195443, head/tools/regression/usr.bin/jot/regress..out) @@ -0,0 +1,100 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 Modified: stable/7/tools/regression/usr.bin/jot/regress.sh == --- stable/7/tools/regression/usr.bin/jot/regress.shMon Aug 3 09:43:06 2009(r196048) +++ stable/7/tools/regression/usr.bin/jot/regress.shMon Aug 3 09:55:03 2009(r196049) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo 1..56 +echo 1..57 REGRESSION_START($1) @@ -20,6 +20,7 @@ REGRESSION_TEST(`dhdd', `jot - 20 - -') REGRESSION_TEST(`ddhh', `jot - - 120 2') REGRESSION_TEST(`ddhd', `jot - - 120 -') REGRESSION_TEST(`dddh', `jot - - - 2') +REGRESSION_TEST(`', `jot - - - -') REGRESSION_TEST(`2', `jot 30 20 160 2') REGRESSION_TEST(`hhhd2', `jot 30 20 160 -') REGRESSION_TEST(`hhdh2', `jot 30 20 - 2') Modified: stable/7/usr.bin/jot/jot.c == --- stable/7/usr.bin/jot/jot.c Mon Aug 3 09:43:06 2009(r196048) +++ stable/7/usr.bin/jot/jot.c Mon Aug 3 09:55:03 2009(r196049) @@ -101,13 +101,13 @@ main(int argc, char **argv) int ch; int mask = 0; int n = 0; - double begin; + double begin = BEGIN_DEF; double divisor; - double ender; - double s; + double ender = ENDER_DEF; + double s = STEP_DEF; double x, y; longi; - longreps; + longreps = REPS_DEF; while ((ch = getopt(argc, argv, b:cnp:rs:w:)) != -1) switch (ch) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r196050 - stable/7/bin/ps
Author: brian Date: Mon Aug 3 09:58:46 2009 New Revision: 196050 URL: http://svn.freebsd.org/changeset/base/196050 Log: MFC: Add the -d switch to the usage message. Modified: stable/7/bin/ps/ (props changed) stable/7/bin/ps/ps.c Modified: stable/7/bin/ps/ps.c == --- stable/7/bin/ps/ps.cMon Aug 3 09:55:03 2009(r196049) +++ stable/7/bin/ps/ps.cMon Aug 3 09:58:46 2009(r196050) @@ -1331,7 +1331,7 @@ check_procfs(void) static void usage(void) { -#defineSINGLE_OPTS [-aCce OPT_LAZY_f HhjlmrSTuvwXxZ] +#defineSINGLE_OPTS [-aCcde OPT_LAZY_f HhjlmrSTuvwXxZ] (void)fprintf(stderr, %s\n%s\n%s\n%s\n, usage: ps SINGLE_OPTS [-O fmt | -o fmt] [-G gid[,gid...]], ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r195829 - stable/7/sys/dev/usb
On Thu, 23 Jul 2009 02:41:05 +0100 Bruce Simpson b...@incunabulum.net wrote: Hi all, I haven't updated the mergeinfo for this file, as the USB stack in HEAD has been completely replaced with the new USB stack. If this is desired, please let me know how to proceed -- I'm new to mergeinfo. When I used the following command to try to maintain the mergeinfo information, I got a very large list of revisions, not all of which look as though they should be merged for this file: % svn merge --record-only -c182138 $FSVN/head/sys/dev/usb/uipa...@182138 uipaq.c If I omit the @182138 from the above command, the resultant mergeinfo is empty. thanks, BMS P.S. I tested the code in this commit with an HP iPaq 2215 and it appears to work fine. It seems ok to me: br...@dev svn $ cd stable/7/sys br...@dev sys $ svn merge --record-only -c182138 ^/head/sys br...@dev sys $ svn diff Property changes on: . ___ Modified: svn:mergeinfo Merged /head/sys:r182138 Property changes on: contrib/pf ___ Modified: svn:mergeinfo Merged /head/sys/contrib/pf:r182138 br...@dev sys $ svn st M . M contrib/pf You should keep the mergeinfo on the sys directory, so the entire merge should really have been done as with the above command but without the --record-only - that would update the mergeinfo properties (as above) and patch uipaq.c in one commit. HTH. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
svn commit: r195830 - head/bin/ps
Author: brian Date: Thu Jul 23 10:20:12 2009 New Revision: 195830 URL: http://svn.freebsd.org/changeset/base/195830 Log: Add the -d switch to the usage message. Submitted by: Emil Mikulic - emil at dmr dot ath dot cx Approved by: re (kib) MFC after:1 week Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c == --- head/bin/ps/ps.cThu Jul 23 01:35:13 2009(r195829) +++ head/bin/ps/ps.cThu Jul 23 10:20:12 2009(r195830) @@ -1331,7 +1331,7 @@ check_procfs(void) static void usage(void) { -#defineSINGLE_OPTS [-aCce OPT_LAZY_f HhjlmrSTuvwXxZ] +#defineSINGLE_OPTS [-aCcde OPT_LAZY_f HhjlmrSTuvwXxZ] (void)fprintf(stderr, %s\n%s\n%s\n%s\n, usage: ps SINGLE_OPTS [-O fmt | -o fmt] [-G gid[,gid...]], ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r195829 - stable/7/sys/dev/usb
On Thu, 23 Jul 2009 20:03:38 +0100, Bruce Simpson b...@incunabulum.net wrote: Perhaps a purchase of the Subversion book is in my future. You can download the pdf for free - it's worth reading. IMHO the svn:mergeinfo idea is flawed. It doesn't handle hierarchies with mixed --depth values at all - it should at least handle merges to trees with non-infinity-depth nodes by duplicating the mergeinfo for each non-infinity-depth node from it's closest parent and not merging to the node. The observant committer would of course not commit such a thing (and would set their depth to infinity on these nodes first). -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour !br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r195772 - head/usr.sbin/ppp
Author: brian Date: Sun Jul 19 19:01:30 2009 New Revision: 195772 URL: http://svn.freebsd.org/changeset/base/195772 Log: Don't get stuck in an infinite loop comparing (short++ = maxshort) PR: 136893 Submitted by: Aragon Gouveia - aragon at phat dot za dot net (mostly) Approved by: re (kib) MFC after:3 weeks Modified: head/usr.sbin/ppp/nat_cmd.c Modified: head/usr.sbin/ppp/nat_cmd.c == --- head/usr.sbin/ppp/nat_cmd.c Sun Jul 19 18:37:20 2009(r195771) +++ head/usr.sbin/ppp/nat_cmd.c Sun Jul 19 19:01:30 2009(r195772) @@ -175,7 +175,7 @@ nat_RedirectPort(struct cmdargs const *a return -1; } -while (laliasport = haliasport) { +do { link = LibAliasRedirectPort(la, localaddr, htons(llocalport), remoteaddr, htons(lremoteport), aliasaddr, htons(laliasport), @@ -187,10 +187,9 @@ nat_RedirectPort(struct cmdargs const *a return 1; } llocalport++; - laliasport++; if (hremoteport) lremoteport++; -} +} while (laliasport++ haliasport); return 0; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r195756 - in stable/7: share/man/man8 usr.bin/ypcat usr.bin/ypmatch usr.bin/ypwhich usr.sbin/ypserv
Author: brian Date: Sat Jul 18 20:19:25 2009 New Revision: 195756 URL: http://svn.freebsd.org/changeset/base/195756 Log: MFC: Support shadow.byname and shadow.byuid maps, protecting them by insisting on privileged port access. Include /var/yp/Makefile.local if it exists and suggest using it to override /var/yp/Makefile behaviour. Modified: stable/7/share/man/man8/ (props changed) stable/7/share/man/man8/yp.8 stable/7/usr.bin/ypcat/ (props changed) stable/7/usr.bin/ypcat/ypcat.c stable/7/usr.bin/ypmatch/ (props changed) stable/7/usr.bin/ypmatch/ypmatch.c stable/7/usr.bin/ypwhich/ (props changed) stable/7/usr.bin/ypwhich/ypwhich.c stable/7/usr.sbin/ypserv/ (props changed) stable/7/usr.sbin/ypserv/Makefile.yp stable/7/usr.sbin/ypserv/yp_access.c stable/7/usr.sbin/ypserv/ypserv.8 Modified: stable/7/share/man/man8/yp.8 == --- stable/7/share/man/man8/yp.8Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/share/man/man8/yp.8Sat Jul 18 20:19:25 2009 (r195756) @@ -28,7 +28,7 @@ .\ from: @(#)yp.8 1.0 (deraadt) 4/26/93 .\ $FreeBSD$ .\ -.Dd April 5, 1993 +.Dd June 25, 2009 .Dt YP 8 .Os .Sh NAME @@ -310,9 +310,15 @@ The .Tn NIS .Pa Makefile .Pq Pa /var/yp/Makefile -will do this automatically if the administrator comments out the -line which says -.Dq Li NOPUSH=true +will do this automatically if the administrator creates +.Pa /var/yp/Makefile.local +and empties the +.Va NOPUSH +variable: +.Bd -literal -offset four +.Li NOPUSH= +.Ed +.Pp .Va ( NOPUSH is set to true by default because the default configuration is for a small network with only one @@ -394,9 +400,11 @@ To help prevent this, .Fx Ns 's .Tn NIS server handles the shadow password maps -.Pa ( master.passwd.byname +.Pa ( master.passwd.byname , +.Pa master.passwd.byuid , +.Pa shadow.byname and -.Pa master.passwd.byuid ) +.Pa shadow.byuid ) in a special way: the server will only provide access to these maps in response to requests that originate on privileged ports. Since only the super-user is allowed to bind to a privileged port, Modified: stable/7/usr.bin/ypcat/ypcat.c == --- stable/7/usr.bin/ypcat/ypcat.c Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.bin/ypcat/ypcat.c Sat Jul 18 20:19:25 2009 (r195756) @@ -52,6 +52,7 @@ struct ypalias { } ypaliases[] = { { passwd, passwd.byname }, { master.passwd, master.passwd.byname }, + { shadow, shadow.byname }, { group, group.byname }, { networks, networks.byaddr }, { hosts, hosts.byaddr }, Modified: stable/7/usr.bin/ypmatch/ypmatch.c == --- stable/7/usr.bin/ypmatch/ypmatch.c Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.bin/ypmatch/ypmatch.c Sat Jul 18 20:19:25 2009 (r195756) @@ -52,6 +52,7 @@ struct ypalias { } ypaliases[] = { { passwd, passwd.byname }, { master.passwd, master.passwd.byname }, + { shadow, shadow.byname }, { group, group.byname }, { networks, networks.byaddr }, { hosts, hosts.byname }, Modified: stable/7/usr.bin/ypwhich/ypwhich.c == --- stable/7/usr.bin/ypwhich/ypwhich.c Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.bin/ypwhich/ypwhich.c Sat Jul 18 20:19:25 2009 (r195756) @@ -64,6 +64,7 @@ struct ypalias { } ypaliases[] = { { passwd, passwd.byname }, { master.passwd, master.passwd.byname }, + { shadow, shadow.byname }, { group, group.byname }, { networks, networks.byaddr }, { hosts, hosts.byaddr }, Modified: stable/7/usr.sbin/ypserv/Makefile.yp == --- stable/7/usr.sbin/ypserv/Makefile.ypSat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.sbin/ypserv/Makefile.ypSat Jul 18 20:19:25 2009 (r195756) @@ -11,33 +11,40 @@ # This Makefile can be modified to support more NIS maps if desired. # -# If this machine is an NIS master, comment out this next line so -# that changes to the NIS maps can be propagated to the slave servers. -# (By default we assume that we are only serving a small domain with -# only one server.) +# If this machine is an NIS master, reset this variable (NOPUSH=) +# in Makefile.local so that changes to the NIS maps can be propagated to +# the slave servers. (By default we assume that we are only serving a +# small domain with only one server.) # NOPUSH = True +# If this machine does not wish to generate a linux-style shadow map +# from the master.passwd file, reset this variable (SHADOW=) in +# Makefile.local. +SHADOW = True + # If you
svn commit: r195758 - stable/7
Author: brian Date: Sat Jul 18 21:50:53 2009 New Revision: 195758 URL: http://svn.freebsd.org/changeset/base/195758 Log: Fix some typos. The changes only apply to UPDATING in stable/7. PR: 133110 Submitted by: Glen Barber - glen.j.barber at gmail Modified: stable/7/UPDATING Modified: stable/7/UPDATING == --- stable/7/UPDATING Sat Jul 18 20:19:53 2009(r195757) +++ stable/7/UPDATING Sat Jul 18 21:50:53 2009(r195758) @@ -143,13 +143,13 @@ portupgrade. The important thing to note is that the 82575 adapters were supported in the em driver in 7.0, but now needed - to be moved into igb, so if you have the effected cards + to be moved into igb, so if you have the affected cards be sure and make any script changes to follow the name change. - There are only 3 PCI ID's effected in this change: + There are only 3 PCI ID's affected in this change: 0x10A7, 0x10A9, and 0x10D6 - So you can know ahead of time if they will be effected, + So you can know ahead of time if they will be affected, these will now be supported in the igb driver. That driver will also support the new 82576 followon. @@ -161,7 +161,7 @@ portupgrade. 20080724: I have MFC'd in code to support multiple routing tables. - see the man pages setfib(1) and setfib(2). + See the man pages setfib(1) and setfib(2). This is a backwards compatible version, but to make use of it you need to compile your kernel with options ROUTETABLES=2 (or more up to 16). ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r195626 - in head: contrib/amd/amd contrib/ntp/scripts contrib/sendmail/cf/sh secure/lib/libcrypto sys/contrib/dev/acpica/compiler sys/dev/hptrr
On Sat, 11 Jul 2009 22:30:37 + (UTC) Colin Percival cperc...@freebsd.org wrote: Author: cperciva Date: Sat Jul 11 22:30:37 2009 New Revision: 195626 URL: http://svn.freebsd.org/changeset/base/195626 Log: Remove build timestamps from the following files: /boot/kernel/hptrr.ko /etc/mail/*.cf /lib/libcrypto.so.5 /usr/bin/ntpq /usr/sbin/amd /usr/sbin/iasl /usr/sbin/ntpd /usr/sbin/ntpdate /usr/sbin/ntpdc There does not appear to be any purpose to having these timestamps, and they have the irritating consequence that the aforementioned files will be different every time they are rebuilt. After this commit, the only remaining build timestamps are in the kernel, the boot loaders, /usr/include/osreldate.h (the year in the copyright notice), and lib*.a (the timestamps on all of the included .o files). Reviewed by:scottl (hptrr), gshapiro (sendmail), simon (openssl), roberto (ntp), jkim (acpica) Approved by:re (kib) This is a fantastic change. Our new-branch-per-project methodology @work made us implement this change locally. Another change that was necessary along the same lines was to remove any hostnames or path names that leak into object code, the most noticeable of which is of course one of the first kernel boot message lines. Are there plans to change kernel code and/or hostname/path name stuff? -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r195485 - in stable/7/sys: . contrib/pf kern
On Thu, 9 Jul 2009 22:35:18 +0200 Max Laier m...@love2party.net wrote: On Thursday 09 July 2009 19:31:26 Brian Somers wrote: On Thu, 9 Jul 2009 09:12:16 + (UTC), Konstantin Belousov k...@freebsd.org wrote: Author: kib Date: Thu Jul 9 09:12:16 2009 New Revision: 195485 URL: http://svn.freebsd.org/changeset/base/195485 Log: MFC r194993: In lf_iteratelocks_vnode, increment state-ls_threads around iterating of the vnode advisory lock list. This prevents deallocation of state while inside the loop. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_lockf.c Just picking on this commit Are the properties on stable/7/sys/contrib/pf intentional or should they merged into stable/7/sys (a no-op hopefully) and removed? No it shouldn't[*]. The problem is that contrib/pf is - as the path suggests - backed by contributed code and thus has vendor specific merge info. [*] That being said, I don't really care about the merge info in there - as it turns out, subversion's automerging capabilities are rather poor anyway and I can't see the benefit of the mergeinfo in dealing with vendor code. It's always easy enough to figure out the revisions you want merged and you don't really need the mergeinfo for that. OTOH, it is valuable meta-information that should be recorded - as I recall that's one reason why we switched to subversion in the first place. One way out - which I proposed several times before but never got feedback on - would be to change the hierarchies in vendor-sys to have an extra sys/contrib prefix (e.g. vendor-sys/pf/dist/*sys/contrib*/pf/...). This way we can record the mergeinfo in src/sys as well and get rid of the extra info in contrib/* I'd need some feedback from svn-savvy people to go this road, though. Before somebody asks why pf is the only offender - simply because it's the only sys/contrib source with a post-cvs merge of vendor code to the releng. Yes, I was thinking along the same lines. AFAICT this would work fine with the caveat that it may be necessary to import some vendor code in pieces. If for example a vendor distributed some-package/etc/config-file some-package/bin/program some-package/kernel/driver we might need to import it in two pieces so that we can maintain the contrib/some-package part of the hierarchy when merging sys/, even though the other two hierarchies can be merged directly into src/etc and usr.bin/program directly. However, the bit that I don't understand about the original commit and its update of the contrib/pf mergeinfo is why it's updated at all by svn - it just seems wrong. When I do: cd svn/stable/7/sys svn merge -c N ^/head/sys given that change N has nothing to do with pf, I don't understand why subversion updates stable/7/sys/contrib/pf's mergeinfo. Is the special thing about sys/contrib/pf just that it already has mergeinfo associated with it? And if so, why does that make it special. Surely having N in sys's mergeinfo implies that it's been merged to every part beneath sys. Having said all that, svn's --depth switch allows partially sparse tree checkouts, and it's always possible to svn revert part of a merge before committing. This implies that the only way svn could successfully maintain mergeinfo would be to store it at least against every node with a merged modification. Depending on how people branch and merge, this would become very unwieldy very quickly (certainly in other environments if not in ours (we would get away with it because we eventually forget about old branches)). So I guess I'm probably just re-iterating other people's suggestions that svn's merge capabilities are somewhat dysfunctional by design. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
Re: svn commit: r195485 - in stable/7/sys: . contrib/pf kern
On Thu, 9 Jul 2009 09:12:16 + (UTC), Konstantin Belousov k...@freebsd.org wrote: Author: kib Date: Thu Jul 9 09:12:16 2009 New Revision: 195485 URL: http://svn.freebsd.org/changeset/base/195485 Log: MFC r194993: In lf_iteratelocks_vnode, increment state-ls_threads around iterating of the vnode advisory lock list. This prevents deallocation of state while inside the loop. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_lockf.c Just picking on this commit Are the properties on stable/7/sys/contrib/pf intentional or should they merged into stable/7/sys (a no-op hopefully) and removed? -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour !br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r195443 - in head: tools/regression/usr.bin/jot usr.bin/jot
Author: brian Date: Wed Jul 8 10:16:16 2009 New Revision: 195443 URL: http://svn.freebsd.org/changeset/base/195443 Log: Fix some uninitialise variables. PR: 136383 Submitted by: Ulrich Spoerlein - uqs at spoerlein dot net Approved by: re (kib) MFC after:3 weeks Added: head/tools/regression/usr.bin/jot/regress..out (contents, props changed) Modified: head/tools/regression/usr.bin/jot/regress.sh head/usr.bin/jot/jot.c Added: head/tools/regression/usr.bin/jot/regress..out == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/jot/regress..out Wed Jul 8 10:16:16 2009(r195443) @@ -0,0 +1,100 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 Modified: head/tools/regression/usr.bin/jot/regress.sh == --- head/tools/regression/usr.bin/jot/regress.shWed Jul 8 06:07:51 2009(r195442) +++ head/tools/regression/usr.bin/jot/regress.shWed Jul 8 10:16:16 2009(r195443) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo 1..56 +echo 1..57 REGRESSION_START($1) @@ -20,6 +20,7 @@ REGRESSION_TEST(`dhdd', `jot - 20 - -') REGRESSION_TEST(`ddhh', `jot - - 120 2') REGRESSION_TEST(`ddhd', `jot - - 120 -') REGRESSION_TEST(`dddh', `jot - - - 2') +REGRESSION_TEST(`', `jot - - - -') REGRESSION_TEST(`2', `jot 30 20 160 2') REGRESSION_TEST(`hhhd2', `jot 30 20 160 -') REGRESSION_TEST(`hhdh2', `jot 30 20 - 2') Modified: head/usr.bin/jot/jot.c == --- head/usr.bin/jot/jot.c Wed Jul 8 06:07:51 2009(r195442) +++ head/usr.bin/jot/jot.c Wed Jul 8 10:16:16 2009(r195443) @@ -101,13 +101,13 @@ main(int argc, char **argv) int ch; int mask = 0; int n = 0; - double begin; + double begin = BEGIN_DEF; double divisor; - double ender; - double s; + double ender = ENDER_DEF; + double s = STEP_DEF; double x, y; longi; - longreps; + longreps = REPS_DEF; while ((ch = getopt(argc, argv, b:cnp:rs:w:)) != -1) switch (ch) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r195295 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf
On Thu, 2 Jul 2009 18:24:37 + (UTC), Ed Schouten e...@freebsd.org wrote: Author: ed Date: Thu Jul 2 18:24:37 2009 New Revision: 195295 URL: http://svn.freebsd.org/changeset/base/195295 Log: Enable POSIX semaphores on all non-embedded architectures by default. More applications (including Firefox) seem to depend on this nowadays, so not having this enabled by default is a bad idea. Proposed by:miwi Patch by: Florian Smeets flo kasimir com Approved by:re (kib) Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Do you plan to MFC this? I can see it irritating quite a few 7.2^H3 users... Cheers. -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour !br...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r195200 - in head/usr.sbin: . wake
On Wed, 1 Jul 2009 01:45:53 +0400 Stanislav Sedov s...@freebsd.org wrote: + p = (u_char *)pkt; + len = sizeof(pkt); + bw = 0; + while (len) { + if ((bw = write(bpf, pkt, sizeof(pkt))) == -1) + return -1; + len -= bw; + p += bw; + } + return 0; +} What the p pointer is used here for? I don't see any usage for it besides incrementing it in the loop. Am I missing something? The write() has two bugs. It should be write(bpf, p, len). -- Brian Somers br...@awfulhak.org Don't _EVER_ lose your sense of humour ! br...@freebsd.org signature.asc Description: PGP signature
svn commit: r195212 - head/usr.sbin/pkg_install/lib
Author: brian Date: Tue Jun 30 20:53:57 2009 New Revision: 195212 URL: http://svn.freebsd.org/changeset/base/195212 Log: Don't imply that only FTP urls are supported when we can't fetch a package. Approved by: re (kib) MFC after:3 weeks Modified: head/usr.sbin/pkg_install/lib/url.c Modified: head/usr.sbin/pkg_install/lib/url.c == --- head/usr.sbin/pkg_install/lib/url.c Tue Jun 30 20:53:56 2009 (r195211) +++ head/usr.sbin/pkg_install/lib/url.c Tue Jun 30 20:53:57 2009 (r195212) @@ -106,7 +106,7 @@ fileGetURL(const char *base, const char fetchDebug = (Verbose 0); if ((ftp = fetchGetURL(fname, Verbose ? v : NULL)) == NULL) { - printf(Error: FTP Unable to get %s: %s\n, + printf(Error: Unable to get %s: %s\n, fname, fetchLastErrString); return NULL; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r194968 - in head: share/man/man8 usr.bin/ypcat usr.bin/ypmatch usr.bin/ypwhich usr.sbin/ypserv
Author: brian Date: Thu Jun 25 16:15:39 2009 New Revision: 194968 URL: http://svn.freebsd.org/changeset/base/194968 Log: Support shadow.byname and shadow.byuid maps, protecting them by insisting on privileged port access. Include /var/yp/Makefile.local if it exists and suggest using it to override /var/yp/Makefile behaviour. Approved by: re (kib) MFC after:3 weeks Modified: head/share/man/man8/yp.8 head/usr.bin/ypcat/ypcat.c head/usr.bin/ypmatch/ypmatch.c head/usr.bin/ypwhich/ypwhich.c head/usr.sbin/ypserv/Makefile.yp head/usr.sbin/ypserv/yp_access.c head/usr.sbin/ypserv/ypserv.8 Modified: head/share/man/man8/yp.8 == --- head/share/man/man8/yp.8Thu Jun 25 16:10:04 2009(r194967) +++ head/share/man/man8/yp.8Thu Jun 25 16:15:39 2009(r194968) @@ -28,7 +28,7 @@ .\ from: @(#)yp.8 1.0 (deraadt) 4/26/93 .\ $FreeBSD$ .\ -.Dd April 5, 1993 +.Dd June 25, 2009 .Dt YP 8 .Os .Sh NAME @@ -310,9 +310,15 @@ The .Tn NIS .Pa Makefile .Pq Pa /var/yp/Makefile -will do this automatically if the administrator comments out the -line which says -.Dq Li NOPUSH=true +will do this automatically if the administrator creates +.Pa /var/yp/Makefile.local +and empties the +.Va NOPUSH +variable: +.Bd -literal -offset four +.Li NOPUSH= +.Ed +.Pp .Va ( NOPUSH is set to true by default because the default configuration is for a small network with only one @@ -394,9 +400,11 @@ To help prevent this, .Fx Ns 's .Tn NIS server handles the shadow password maps -.Pa ( master.passwd.byname +.Pa ( master.passwd.byname , +.Pa master.passwd.byuid , +.Pa shadow.byname and -.Pa master.passwd.byuid ) +.Pa shadow.byuid ) in a special way: the server will only provide access to these maps in response to requests that originate on privileged ports. Since only the super-user is allowed to bind to a privileged port, Modified: head/usr.bin/ypcat/ypcat.c == --- head/usr.bin/ypcat/ypcat.c Thu Jun 25 16:10:04 2009(r194967) +++ head/usr.bin/ypcat/ypcat.c Thu Jun 25 16:15:39 2009(r194968) @@ -52,6 +52,7 @@ struct ypalias { } ypaliases[] = { { passwd, passwd.byname }, { master.passwd, master.passwd.byname }, + { shadow, shadow.byname }, { group, group.byname }, { networks, networks.byaddr }, { hosts, hosts.byaddr }, Modified: head/usr.bin/ypmatch/ypmatch.c == --- head/usr.bin/ypmatch/ypmatch.c Thu Jun 25 16:10:04 2009 (r194967) +++ head/usr.bin/ypmatch/ypmatch.c Thu Jun 25 16:15:39 2009 (r194968) @@ -52,6 +52,7 @@ struct ypalias { } ypaliases[] = { { passwd, passwd.byname }, { master.passwd, master.passwd.byname }, + { shadow, shadow.byname }, { group, group.byname }, { networks, networks.byaddr }, { hosts, hosts.byname }, Modified: head/usr.bin/ypwhich/ypwhich.c == --- head/usr.bin/ypwhich/ypwhich.c Thu Jun 25 16:10:04 2009 (r194967) +++ head/usr.bin/ypwhich/ypwhich.c Thu Jun 25 16:15:39 2009 (r194968) @@ -64,6 +64,7 @@ struct ypalias { } ypaliases[] = { { passwd, passwd.byname }, { master.passwd, master.passwd.byname }, + { shadow, shadow.byname }, { group, group.byname }, { networks, networks.byaddr }, { hosts, hosts.byaddr }, Modified: head/usr.sbin/ypserv/Makefile.yp == --- head/usr.sbin/ypserv/Makefile.ypThu Jun 25 16:10:04 2009 (r194967) +++ head/usr.sbin/ypserv/Makefile.ypThu Jun 25 16:15:39 2009 (r194968) @@ -11,33 +11,40 @@ # This Makefile can be modified to support more NIS maps if desired. # -# If this machine is an NIS master, comment out this next line so -# that changes to the NIS maps can be propagated to the slave servers. -# (By default we assume that we are only serving a small domain with -# only one server.) +# If this machine is an NIS master, reset this variable (NOPUSH=) +# in Makefile.local so that changes to the NIS maps can be propagated to +# the slave servers. (By default we assume that we are only serving a +# small domain with only one server.) # NOPUSH = True +# If this machine does not wish to generate a linux-style shadow map +# from the master.passwd file, reset this variable (SHADOW=) in +# Makefile.local. +SHADOW = True + # If you want to use a FreeBSD NIS server to serve non-FreeBSD clients # (i.e. clients who expect the password field in the passwd maps to be -# valid) then uncomment this line. This will cause $YPDIR/passwd to -# be generated with valid password fields. This is insecure: FreeBSD -# normally only serves the