svn commit: r284014 - head/sys/net80211

2015-06-04 Thread Adrian Chadd
Author: adrian
Date: Fri Jun  5 06:49:08 2015
New Revision: 284014
URL: https://svnweb.freebsd.org/changeset/base/284014

Log:
  For now, just default to presenting "found" channels as 11g, not 11b.
  
  The intel 7260 driver under development requires this - the scans come
  in as normal frames but with the frequency provided.  The correct method
  is to have the driver provide flags (so we can determine if it's 11b
  or 11g); this will have to do in the meantime.
  
  Without this, the channel found is 11b, and no ERP (ie "11g") bits
  are negotiated with the AP.
  
  This allows the 7260 in 2ghz mode to operate in 11bg, rather than
  just 11b.
  
  Tested:
  
  * intel 7260 driver, 11bg channels

Modified:
  head/sys/net80211/ieee80211.c

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Fri Jun  5 06:46:11 2015
(r284013)
+++ head/sys/net80211/ieee80211.c   Fri Jun  5 06:49:08 2015
(r284014)
@@ -1081,7 +1081,7 @@ ieee80211_lookup_channel_rxstatus(struct
/* Determine a band */
/* XXX should be done by the driver? */
if (rxs->c_freq < 3000) {
-   flags = IEEE80211_CHAN_B;
+   flags = IEEE80211_CHAN_G;
} else {
flags = IEEE80211_CHAN_A;
}
___
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: r284013 - head/sys/cam/ctl

2015-06-04 Thread Alexander Motin
Author: mav
Date: Fri Jun  5 06:46:11 2015
New Revision: 284013
URL: https://svnweb.freebsd.org/changeset/base/284013

Log:
  Allow setting only WWNN or only WWPN.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Fri Jun  5 06:23:03 2015(r284012)
+++ head/sys/cam/ctl/scsi_ctl.c Fri Jun  5 06:46:11 2015(r284013)
@@ -1657,16 +1657,24 @@ ctlfe_onoffline(void *arg, int online)
 * down to the SIM.  Otherwise, record what the SIM
 * has reported.
 */
-   if ((bus_softc->port.wwnn != 0)
-&& (bus_softc->port.wwpn != 0)) {
+   if (bus_softc->port.wwnn != 0 && bus_softc->port.wwnn
+   != ccb->knob.xport_specific.fc.wwnn) {
ccb->knob.xport_specific.fc.wwnn =
-   bus_softc->port.wwnn;
-   ccb->knob.xport_specific.fc.wwpn =
-   bus_softc->port.wwpn;
+   bus_softc->port.wwnn;
set_wwnn = 1;
} else {
ctl_port_set_wwns(&bus_softc->port,
true, ccb->knob.xport_specific.fc.wwnn,
+   false, 0);
+   }
+   if (bus_softc->port.wwpn != 0 && bus_softc->port.wwpn
+!= ccb->knob.xport_specific.fc.wwpn) {
+   ccb->knob.xport_specific.fc.wwpn =
+   bus_softc->port.wwpn;
+   set_wwnn = 1;
+   } else {
+   ctl_port_set_wwns(&bus_softc->port,
+   false, 0,
true, ccb->knob.xport_specific.fc.wwpn);
}
 #endif /* RANDOM_WWNN */
___
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: r284012 - head/sys/dev/pci

2015-06-04 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jun  5 06:23:03 2015
New Revision: 284012
URL: https://svnweb.freebsd.org/changeset/base/284012

Log:
  Disable VGA PCI interrupts until a chipset driver is loaded for VGA
  PCI devices. Else unhandled display adapter interrupts might freeze
  the CPU or consume a lot of CPU.
  
  PR:   156596
  MFC after:1 week

Modified:
  head/sys/dev/pci/vga_pci.c

Modified: head/sys/dev/pci/vga_pci.c
==
--- head/sys/dev/pci/vga_pci.c  Fri Jun  5 06:06:07 2015(r284011)
+++ head/sys/dev/pci/vga_pci.c  Fri Jun  5 06:23:03 2015(r284012)
@@ -126,6 +126,13 @@ vga_pci_is_boot_display(device_t dev)
if ((config & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) == 0)
return (0);
 
+   /*
+* Disable interrupts until a chipset driver is loaded for
+* this PCI device. Else unhandled display adapter interrupts
+* might freeze the CPU.
+*/
+   pci_write_config(dev, PCIR_COMMAND, config | PCIM_CMD_INTxDIS, 2);
+
/* This video card is the boot display: record its unit number. */
vga_pci_default_unit = unit;
device_set_flags(dev, 1);
___
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: r284011 - head/sys/dev/usb

2015-06-04 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jun  5 06:06:07 2015
New Revision: 284011
URL: https://svnweb.freebsd.org/changeset/base/284011

Log:
  Don't wait forever for USB data to be flushed.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/usb_dev.c

Modified: head/sys/dev/usb/usb_dev.c
==
--- head/sys/dev/usb/usb_dev.c  Fri Jun  5 02:22:04 2015(r284010)
+++ head/sys/dev/usb/usb_dev.c  Fri Jun  5 06:06:07 2015(r284011)
@@ -830,7 +830,8 @@ usb_fifo_close(struct usb_fifo *f, int f
(!f->flag_iserror)) {
/* wait until all data has been written */
f->flag_sleeping = 1;
-   err = cv_wait_sig(&f->cv_io, f->priv_mtx);
+   err = cv_timedwait_sig(&f->cv_io, f->priv_mtx,
+   USB_MS_TO_TICKS(USB_DEFAULT_TIMEOUT));
if (err) {
DPRINTF("signal received\n");
break;
___
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: r284010 - head/release/tools

2015-06-04 Thread Glen Barber
On Fri, Jun 05, 2015 at 02:22:05AM +, Glen Barber wrote:
> Author: gjb
> Date: Fri Jun  5 02:22:04 2015
> New Revision: 284010
> URL: https://svnweb.freebsd.org/changeset/base/284010
> 
> Log:
>   Work around a potential bug in pw(8) when '-m' is specified.
>   According to the manual page, '-m' should create the user home
>   directory, however rigorous testing suggests it does not, and
>   it is unclear if this is an implementation or expectation issue.
>   

MFC after:  I figure out WTF is going on here...

Glen



pgpWT8OFEJjND.pgp
Description: PGP signature


svn commit: r284010 - head/release/tools

2015-06-04 Thread Glen Barber
Author: gjb
Date: Fri Jun  5 02:22:04 2015
New Revision: 284010
URL: https://svnweb.freebsd.org/changeset/base/284010

Log:
  Work around a potential bug in pw(8) when '-m' is specified.
  According to the manual page, '-m' should create the user home
  directory, however rigorous testing suggests it does not, and
  it is unclear if this is an implementation or expectation issue.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/tools/arm.subr

Modified: head/release/tools/arm.subr
==
--- head/release/tools/arm.subr Fri Jun  5 00:46:49 2015(r284009)
+++ head/release/tools/arm.subr Fri Jun  5 02:22:04 2015(r284010)
@@ -82,7 +82,7 @@ arm_create_user() {
# and set the default password for the 'root' user to 'root'.
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
groupadd freebsd -g 1001
-   chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home
+   chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home/freebsd
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
useradd freebsd \
-m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 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: r284009 - in stable/10: etc/rc.d share/man/man7

2015-06-04 Thread Colin Percival
Author: cperciva
Date: Fri Jun  5 00:46:49 2015
New Revision: 284009
URL: https://svnweb.freebsd.org/changeset/base/284009

Log:
  MFC r273955,274060,274164: Add /etc/rc.d/growfs script.

Added:
  stable/10/etc/rc.d/growfs
 - copied, changed from r273955, head/etc/rc.d/growfs
  stable/10/share/man/man7/growfs.7
 - copied unchanged from r273955, head/share/man/man7/growfs.7
Modified:
  stable/10/etc/rc.d/Makefile
  stable/10/share/man/man7/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/etc/rc.d/Makefile
==
--- stable/10/etc/rc.d/Makefile Fri Jun  5 00:39:34 2015(r284008)
+++ stable/10/etc/rc.d/Makefile Fri Jun  5 00:46:49 2015(r284009)
@@ -37,6 +37,7 @@ FILES=DAEMON \
geli \
geli2 \
gptboot \
+   growfs \
gssd \
${_hcsecd} \
hostid \

Copied and modified: stable/10/etc/rc.d/growfs (from r273955, 
head/etc/rc.d/growfs)
==
--- head/etc/rc.d/growfsSun Nov  2 00:11:25 2014(r273955, copy 
source)
+++ stable/10/etc/rc.d/growfs   Fri Jun  5 00:46:49 2015(r284009)
@@ -35,9 +35,7 @@
 # and have it work on essentially any size drive.
 #
 # TODO: Figure out where this should really be ordered.
-# I suspect it should go just after fsck but before mountcritlocal
-# but it's hard to tell for sure because of the bug described
-# below.
+# I suspect it should go just after fsck but before mountcritlocal.
 # 
 
 . /etc/rc.subr
@@ -49,20 +47,20 @@ rcvar="growfs_enable"
 
 growfs_start ()
 {
-echo "Growing root partition to fill device"
-rootdev=$(df / | tail -n 1 | awk '{ sub("/dev/", "", $1); print $1 }')
-if [ x"$rootdev" = x"${rootdev%/*}" ]; then
-   # raw device
-   rawdev="$rootdev"
-else
-   rawdev=$(glabel status | awk '$1 == "'"$rootdev"'" { print $3 }')
-   if [ x"$rawdev" = x"" ]; then
-   echo "Can't figure out device for: $rootdev"
-   return
+   echo "Growing root partition to fill device"
+   rootdev=$(df / | tail -n 1 | awk '{ sub("/dev/", "", $1); print $1 }')
+   if [ x"$rootdev" = x"${rootdev%/*}" ]; then
+   # raw device
+   rawdev="$rootdev"
+   else
+   rawdev=$(glabel status | awk '$1 == "'"$rootdev"'" { print $3 
}')
+   if [ x"$rawdev" = x"" ]; then
+   echo "Can't figure out device for: $rootdev"
+   return
+   fi
fi
-fi
 
-sysctl -b kern.geom.conftxt | awk '
+   sysctl -b kern.geom.conftxt | awk '
 {
lvl=$1
device[lvl] = $3
@@ -91,7 +89,7 @@ growfs_start ()
exit 0
}
 }' dev="$rawdev"
-growfs -y /dev/"$rootdev"
+   growfs -y /dev/"$rootdev"
 }
 
 load_rc_config $name

Modified: stable/10/share/man/man7/Makefile
==
--- stable/10/share/man/man7/Makefile   Fri Jun  5 00:39:34 2015
(r284008)
+++ stable/10/share/man/man7/Makefile   Fri Jun  5 00:46:49 2015
(r284009)
@@ -14,6 +14,7 @@ MAN=  adding_user.7 \
environ.7 \
ffs.7 \
firewall.7 \
+   growfs.7 \
hier.7 \
hostname.7 \
intro.7 \

Copied: stable/10/share/man/man7/growfs.7 (from r273955, 
head/share/man/man7/growfs.7)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/share/man/man7/growfs.7   Fri Jun  5 00:46:49 2015
(r284009, copy of r273955, head/share/man/man7/growfs.7)
@@ -0,0 +1,64 @@
+.\" Copyright 2014 John-Mark Gurney
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRA

svn commit: r284008 - stable/10/bin/pax

2015-06-04 Thread Xin LI
Author: delphij
Date: Fri Jun  5 00:39:34 2015
New Revision: 284008
URL: https://svnweb.freebsd.org/changeset/base/284008

Log:
  MFC r283257:
  
  Eliminate unneeded includes.

Modified:
  stable/10/bin/pax/ar_subs.c
  stable/10/bin/pax/buf_subs.c
  stable/10/bin/pax/cache.c
  stable/10/bin/pax/cpio.c
  stable/10/bin/pax/file_subs.c
  stable/10/bin/pax/gen_subs.c
  stable/10/bin/pax/getoldopt.c
  stable/10/bin/pax/pat_rep.c
  stable/10/bin/pax/pax.c
  stable/10/bin/pax/sel_subs.c
  stable/10/bin/pax/tar.c
  stable/10/bin/pax/tty_subs.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/bin/pax/ar_subs.c
==
--- stable/10/bin/pax/ar_subs.c Fri Jun  5 00:37:46 2015(r284007)
+++ stable/10/bin/pax/ar_subs.c Fri Jun  5 00:39:34 2015(r284008)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include "pax.h"
 #include "extern.h"
 

Modified: stable/10/bin/pax/buf_subs.c
==
--- stable/10/bin/pax/buf_subs.cFri Jun  5 00:37:46 2015
(r284007)
+++ stable/10/bin/pax/buf_subs.cFri Jun  5 00:39:34 2015
(r284008)
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "pax.h"
 #include "extern.h"

Modified: stable/10/bin/pax/cache.c
==
--- stable/10/bin/pax/cache.c   Fri Jun  5 00:37:46 2015(r284007)
+++ stable/10/bin/pax/cache.c   Fri Jun  5 00:39:34 2015(r284008)
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "pax.h"
 #include "cache.h"

Modified: stable/10/bin/pax/cpio.c
==
--- stable/10/bin/pax/cpio.cFri Jun  5 00:37:46 2015(r284007)
+++ stable/10/bin/pax/cpio.cFri Jun  5 00:39:34 2015(r284008)
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include "pax.h"
 #include "cpio.h"
 #include "extern.h"

Modified: stable/10/bin/pax/file_subs.c
==
--- stable/10/bin/pax/file_subs.c   Fri Jun  5 00:37:46 2015
(r284007)
+++ stable/10/bin/pax/file_subs.c   Fri Jun  5 00:39:34 2015
(r284008)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include "pax.h"
 #include "options.h"
 #include "extern.h"

Modified: stable/10/bin/pax/gen_subs.c
==
--- stable/10/bin/pax/gen_subs.cFri Jun  5 00:37:46 2015
(r284007)
+++ stable/10/bin/pax/gen_subs.cFri Jun  5 00:39:34 2015
(r284008)
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include "pax.h"
 #include "extern.h"

Modified: stable/10/bin/pax/getoldopt.c
==
--- stable/10/bin/pax/getoldopt.c   Fri Jun  5 00:37:46 2015
(r284007)
+++ stable/10/bin/pax/getoldopt.c   Fri Jun  5 00:39:34 2015
(r284008)
@@ -19,8 +19,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "pax.h"
-#include "extern.h"
+int getoldopt(int, char **, const char *);
 
 int
 getoldopt(int argc, char **argv, const char *optstring)

Modified: stable/10/bin/pax/pat_rep.c
==
--- stable/10/bin/pax/pat_rep.c Fri Jun  5 00:37:46 2015(r284007)
+++ stable/10/bin/pax/pat_rep.c Fri Jun  5 00:39:34 2015(r284008)
@@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #ifdef NET2_REGEX
 #include 
 #else

Modified: stable/10/bin/pax/pax.c
==
--- stable/10/bin/pax/pax.c Fri Jun  5 00:37:46 2015(r284007)
+++ stable/10/bin/pax/pax.c Fri Jun  5 00:39:34 2015(r284008)
@@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include "pax.h"
 #include "extern.h"
 static int gen_init(void);

Modified: stable/10/bin/pax/sel_subs.c
==
--- stable/10/bin/pax/sel_subs.cFri Jun  5 00:37:46 2015
(r284007)
+++ stable/10/bin/pax/sel_subs.cFri Jun  5 00:39:34 2015
(r284008)
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "pax.h"
 #include "sel_subs.h"

Modified: stable/10/bin/pax/tar.c
==
--- stable/10/bin/pax/tar.c Fri Jun  5 00:37:46 201

svn commit: r284007 - head/sys/dev/cxgbe

2015-06-04 Thread Navdeep Parhar
Author: np
Date: Fri Jun  5 00:37:46 2015
New Revision: 284007
URL: https://svnweb.freebsd.org/changeset/base/284007

Log:
  cxgbe: set the minimum burst size when fetching fl buffers to 128B for
  netmap rx queues too.  This should have gone in as part of r283858.

Modified:
  head/sys/dev/cxgbe/t4_netmap.c

Modified: head/sys/dev/cxgbe/t4_netmap.c
==
--- head/sys/dev/cxgbe/t4_netmap.c  Fri Jun  5 00:35:17 2015
(r284006)
+++ head/sys/dev/cxgbe/t4_netmap.c  Fri Jun  5 00:37:46 2015
(r284007)
@@ -297,7 +297,7 @@ alloc_nm_rxq_hwq(struct port_info *pi, s
(fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) |
(black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0));
c.fl0dcaen_to_fl0cidxfthresh =
-   htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) |
+   htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) |
V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B));
c.fl0size = htobe16(na->num_rx_desc / 8 + spg_len / EQ_ESIZE);
c.fl0addr = htobe64(nm_rxq->fl_ba);
___
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: r284006 - stable/10/sys/dev/ahci

2015-06-04 Thread Alexander Motin
Author: mav
Date: Fri Jun  5 00:35:17 2015
New Revision: 284006
URL: https://svnweb.freebsd.org/changeset/base/284006

Log:
  MFC r283936: Restore AHCI quirks printing as base16.
  
  smh@ at r278034 made it base17, that is somewhat odd. :)

Modified:
  stable/10/sys/dev/ahci/ahci.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/ahci/ahci.h
==
--- stable/10/sys/dev/ahci/ahci.h   Fri Jun  5 00:28:38 2015
(r284005)
+++ stable/10/sys/dev/ahci/ahci.h   Fri Jun  5 00:35:17 2015
(r284006)
@@ -576,7 +576,7 @@ enum ahci_err_type {
 #define AHCI_Q_1MSI0x0002
 
 #define AHCI_Q_BIT_STRING  \
-   "\021"  \
+   "\020"  \
"\001NOFORCE"   \
"\002NOPMP" \
"\003NONCQ" \
___
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: r284005 - stable/10/release

2015-06-04 Thread Glen Barber
Author: gjb
Date: Fri Jun  5 00:28:38 2015
New Revision: 284005
URL: https://svnweb.freebsd.org/changeset/base/284005

Log:
  MFC r283919:
Remove trailing tabs to avoid spamming stdout with long lines.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/release/Makefile.ec2
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/release/Makefile.ec2
==
--- stable/10/release/Makefile.ec2  Thu Jun  4 23:11:24 2015
(r284004)
+++ stable/10/release/Makefile.ec2  Fri Jun  5 00:28:38 2015
(r284005)
@@ -51,9 +51,9 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
@echo "--"
@false
 .endif
-   /usr/local/bin/bsdec2-image-upload ${PUBLISH}   \
-   ${.OBJDIR}/ec2.raw  \
-   "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}"   \
-   "${TYPE} ${REVISION}-${BRANCH}-${TARGET}"   \
+   /usr/local/bin/bsdec2-image-upload ${PUBLISH} \
+   ${.OBJDIR}/ec2.raw \
+   "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
+   "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE}
@touch ${.TARGET}
___
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: r284004 - head/release/tools

2015-06-04 Thread Glen Barber
Author: gjb
Date: Thu Jun  4 23:11:24 2015
New Revision: 284004
URL: https://svnweb.freebsd.org/changeset/base/284004

Log:
  Make sure /home exists within the DESTDIR before creating the
  'freebsd' user account.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/tools/arm.subr

Modified: head/release/tools/arm.subr
==
--- head/release/tools/arm.subr Thu Jun  4 23:07:21 2015(r284003)
+++ head/release/tools/arm.subr Thu Jun  4 23:11:24 2015(r284004)
@@ -82,6 +82,7 @@ arm_create_user() {
# and set the default password for the 'root' user to 'root'.
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
groupadd freebsd -g 1001
+   chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
useradd freebsd \
-m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 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: r284003 - head/sys/net80211

2015-06-04 Thread Adrian Chadd
Author: adrian
Date: Thu Jun  4 23:07:21 2015
New Revision: 284003
URL: https://svnweb.freebsd.org/changeset/base/284003

Log:
  Some hostap setups may result in raw frames being transmitted with
  no parameters set.  So, don't unconditionally call things.
  
  Thanks to jkim@ for pointing this out!
  
  MFC after:2 weeks
  Sponsored by: Norse Corp, Inc.

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==
--- head/sys/net80211/ieee80211_output.cThu Jun  4 22:11:39 2015
(r284002)
+++ head/sys/net80211/ieee80211_output.cThu Jun  4 23:07:21 2015
(r284003)
@@ -525,7 +525,8 @@ ieee80211_raw_output(struct ieee80211vap
 * they'll have to be added - so fail the transmit if
 * they can't be.
 */
-   (void) ieee80211_add_xmit_params(m, params);
+   if (params)
+   (void) ieee80211_add_xmit_params(m, params);
 
return (ic->ic_raw_xmit(ni, m, params));
 }
___
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: r284002 - in stable/10: share/mk sys/conf

2015-06-04 Thread Warner Losh
Author: imp
Date: Thu Jun  4 22:11:39 2015
New Revision: 284002
URL: https://svnweb.freebsd.org/changeset/base/284002

Log:
  MFC: Merge more of the dtb machinery
  
  Merge 278459,278460,278461,278462 which define DTBDIR and other things
  needed for install to work. Although the commit in head kinda fixed
  install_as_user, it's unknown if that works in 10.x (it didn't the last
  time I tried).

Modified:
  stable/10/share/mk/bsd.own.mk
  stable/10/sys/conf/dtb.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.own.mk
==
--- stable/10/share/mk/bsd.own.mk   Thu Jun  4 21:54:46 2015
(r284001)
+++ stable/10/share/mk/bsd.own.mk   Thu Jun  4 22:11:39 2015
(r284002)
@@ -143,6 +143,10 @@ KMODDIR?=  /boot/kernel
 KMODOWN?=  ${BINOWN}
 KMODGRP?=  ${BINGRP}
 KMODMODE?= ${BINMODE}
+DTBDIR?=   /boot/dtb
+DTBOWN?=   root
+DTBGRP?=   wheel
+DTBMODE?=  444
 
 LIBDIR?=   /usr/lib
 LIBCOMPATDIR?= /usr/lib/compat
@@ -683,7 +687,7 @@ _uid!=  id -u
 USER!= id -un
 .endif
 _gid!= id -gn
-.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
+.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE
 $xOWN= ${USER}
 $xGRP= ${_gid}
 .endfor

Modified: stable/10/sys/conf/dtb.mk
==
--- stable/10/sys/conf/dtb.mk   Thu Jun  4 21:54:46 2015(r284001)
+++ stable/10/sys/conf/dtb.mk   Thu Jun  4 22:11:39 2015(r284002)
@@ -45,7 +45,6 @@ SYSDIR=   ${_dir}
 
 .PATH: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/boot/fdt/dts/${MACHINE}
 
-DTBDIR?=/boot/dtb
 DTB=${DTS:R:S/$/.dtb/}
 
 all: ${DTB}
@@ -64,6 +63,10 @@ CLEANFILES+=${_dts:R:S/$/.dtb/}
 realinstall: _dtbinstall
 .ORDER: beforeinstall _kmodinstall
 _dtbinstall:
+# Need to create this because installkernel doesn't invoke mtree with 
BSD.root.mtree
+# to make sure the tree is setup properly. This may break ownership of 
${DTBDIR}
+# for no-root build.
+   mkdir -p ${DESTDIR}${DTBDIR}
 .for _dtb in ${DTB}
${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR}
___
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: r284001 - head/lib/libc/string

2015-06-04 Thread Jilles Tjoelker
Author: jilles
Date: Thu Jun  4 21:54:46 2015
New Revision: 284001
URL: https://svnweb.freebsd.org/changeset/base/284001

Log:
  strchr(3): Mdoc fixes.

Modified:
  head/lib/libc/string/strchr.3

Modified: head/lib/libc/string/strchr.3
==
--- head/lib/libc/string/strchr.3   Thu Jun  4 21:07:27 2015
(r284000)
+++ head/lib/libc/string/strchr.3   Thu Jun  4 21:54:46 2015
(r284001)
@@ -113,10 +113,12 @@ and
 .Fn strrchr
 conform to
 .St -isoC .
-The
+The function
 .Fn strchrnul
-is a GNU extension .
-.Sh History
+is a
+.Tn GNU
+extension.
+.Sh HISTORY
 The
 .Fn strchrnul
 function first appeared in glibc 2.1.1 and was added in
___
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: r284000 - head/tests/sys/kern

2015-06-04 Thread John Baldwin
Author: jhb
Date: Thu Jun  4 21:07:27 2015
New Revision: 284000
URL: https://svnweb.freebsd.org/changeset/base/284000

Log:
  Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processes
  of the main test process.
  
  Differential Revision:https://reviews.freebsd.org/D2664
  Reviewed by:  ngie (previous version)

Modified:
  head/tests/sys/kern/ptrace_test.c

Modified: head/tests/sys/kern/ptrace_test.c
==
--- head/tests/sys/kern/ptrace_test.c   Thu Jun  4 20:36:16 2015
(r283999)
+++ head/tests/sys/kern/ptrace_test.c   Thu Jun  4 21:07:27 2015
(r284000)
@@ -34,11 +34,33 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 /*
+ * A variant of ATF_REQUIRE that is suitable for use in child
+ * processes.  This only works if the parent process is tripped up by
+ * the early exit and fails some requirement itself.
+ */
+#defineCHILD_REQUIRE(exp) do { 
\
+   if (!(exp)) \
+   child_fail_require(__FILE__, __LINE__,  \
+   #exp " not met");   \
+   } while (0)
+
+static void __dead2
+child_fail_require(const char *file, int line, const char *str)
+{
+   char buf[128];
+
+   snprintf(buf, sizeof(buf), "%s:%d: %s\n", file, line, str);
+   write(2, buf, strlen(buf));
+   _exit(32);
+}
+
+/*
  * Verify that a parent debugger process "sees" the exit of a debugged
  * process exactly once when attached via PT_TRACE_ME.
  */
@@ -51,7 +73,7 @@ ATF_TC_BODY(ptrace__parent_wait_after_tr
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
/* Child process. */
-   ATF_REQUIRE(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+   CHILD_REQUIRE(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
 
/* Trigger a stop. */
raise(SIGSTOP);
@@ -100,7 +122,7 @@ ATF_TC_BODY(ptrace__parent_wait_after_at
close(cpipe[0]);
 
/* Wait for the parent to attach. */
-   ATF_REQUIRE(read(cpipe[1], &c, sizeof(c)) == 0);
+   CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == 0);
 
exit(1);
}
@@ -154,7 +176,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft
close(cpipe[0]);
 
/* Wait for parent to be ready. */
-   ATF_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c));
+   CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c));
 
exit(1);
}
@@ -167,25 +189,25 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft
/* Debugger process. */
close(dpipe[0]);
 
-   ATF_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1);
+   CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1);
 
wpid = waitpid(child, &status, 0);
-   ATF_REQUIRE(wpid == child);
-   ATF_REQUIRE(WIFSTOPPED(status));
-   ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+   CHILD_REQUIRE(wpid == child);
+   CHILD_REQUIRE(WIFSTOPPED(status));
+   CHILD_REQUIRE(WSTOPSIG(status) == SIGSTOP);
 
-   ATF_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1);
+   CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1);
 
/* Signal parent that debugger is attached. */
-   ATF_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c));
+   CHILD_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c));
 
/* Wait for parent's failed wait. */
-   ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0);
+   CHILD_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0);
 
wpid = waitpid(child, &status, 0);
-   ATF_REQUIRE(wpid == child);
-   ATF_REQUIRE(WIFEXITED(status));
-   ATF_REQUIRE(WEXITSTATUS(status) == 1);
+   CHILD_REQUIRE(wpid == child);
+   CHILD_REQUIRE(WIFEXITED(status));
+   CHILD_REQUIRE(WEXITSTATUS(status) == 1);
 
exit(0);
}
@@ -268,7 +290,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft
close(cpipe[0]);
 
/* Wait for parent to be ready. */
-   ATF_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c));
+   CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c));
 
exit(1);
}
@@ -284,32 +306,32 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft
 * Fork again and drop the debugger parent so that the
 * debugger is not a child of the main parent.
 */
-   ATF_REQUIRE((fpid = fork()) != -1);
+   CHILD_REQUIRE((fpid = fork()) != -1);
if (fpi

svn commit: r283999 - head/sys/dev/drm

2015-06-04 Thread John Baldwin
Author: jhb
Date: Thu Jun  4 20:36:16 2015
New Revision: 283999
URL: https://svnweb.freebsd.org/changeset/base/283999

Log:
  Remove compatibility shims for FreeBSD versions older than 8.0.

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_agpsupport.c
  head/sys/dev/drm/drm_bufs.c
  head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm/drm_irq.c
  head/sys/dev/drm/i915_drv.c
  head/sys/dev/drm/mach64_drv.c
  head/sys/dev/drm/mga_drv.c
  head/sys/dev/drm/r128_drv.c
  head/sys/dev/drm/radeon_drv.c
  head/sys/dev/drm/savage_drv.c
  head/sys/dev/drm/sis_drv.c
  head/sys/dev/drm/tdfx_drv.c

Modified: head/sys/dev/drm/drmP.h
==
--- head/sys/dev/drm/drmP.h Thu Jun  4 19:41:15 2015(r283998)
+++ head/sys/dev/drm/drmP.h Thu Jun  4 20:36:16 2015(r283999)
@@ -51,9 +51,7 @@ struct drm_file;
 #include 
 #include 
 #include 
-#if __FreeBSD_version >= 70
 #include 
-#endif
 #include 
 #include 
 #include 
@@ -94,11 +92,7 @@ struct drm_file;
 #include 
 #include 
 #include 
-#if __FreeBSD_version >= 84
 #include 
-#else /* __FreeBSD_version >= 84 */
-#include 
-#endif /* __FreeBSD_version >= 84 */
 #include 
 #include 
 #include 
@@ -227,11 +221,7 @@ enum {
 
 #define PAGE_ALIGN(addr) round_page(addr)
 /* DRM_SUSER returns true if the user is superuser */
-#if __FreeBSD_version >= 70
 #define DRM_SUSER(p)   (priv_check(p, PRIV_DRIVER) == 0)
-#else
-#define DRM_SUSER(p)   (suser(p) == 0)
-#endif
 #define DRM_AGP_FIND_DEVICE()  agp_find_device()
 #define DRM_MTRR_WCMDF_WRITECOMBINE
 #define jiffiesticks

Modified: head/sys/dev/drm/drm_agpsupport.c
==
--- head/sys/dev/drm/drm_agpsupport.c   Thu Jun  4 19:41:15 2015
(r283998)
+++ head/sys/dev/drm/drm_agpsupport.c   Thu Jun  4 20:36:16 2015
(r283999)
@@ -38,50 +38,15 @@ __FBSDID("$FreeBSD$");
 
 #include "dev/drm/drmP.h"
 
-#if __FreeBSD_version >= 84
 #include 
-#else /* __FreeBSD_version >= 84 */
-#include 
-#endif /* __FreeBSD_version >= 84 */
 #include 
 
 /* Returns 1 if AGP or 0 if not. */
 static int
 drm_device_find_capability(struct drm_device *dev, int cap)
 {
-#if __FreeBSD_version >= 602102
 
return (pci_find_cap(dev->device, cap, NULL) == 0);
-#else
-   /* Code taken from agp.c.  IWBNI that was a public interface. */
-   u_int32_t status;
-   u_int8_t ptr, next;
-
-   /*
-* Check the CAP_LIST bit of the PCI status register first.
-*/
-   status = pci_read_config(dev->device, PCIR_STATUS, 2);
-   if (!(status & 0x10))
-   return 0;
-
-   /*
-* Traverse the capabilities list.
-*/
-   for (ptr = pci_read_config(dev->device, AGP_CAPPTR, 1);
-ptr != 0;
-ptr = next) {
-   u_int32_t capid = pci_read_config(dev->device, ptr, 4);
-   next = AGP_CAPID_GET_NEXT_PTR(capid);
-
-   /*
-* If this capability entry ID is cap, then we are done.
-*/
-   if (AGP_CAPID_GET_CAP_ID(capid) == cap)
-   return 1;
-   }
-
-   return 0;
-#endif
 }
 
 int drm_device_is_agp(struct drm_device *dev)

Modified: head/sys/dev/drm/drm_bufs.c
==
--- head/sys/dev/drm/drm_bufs.c Thu Jun  4 19:41:15 2015(r283998)
+++ head/sys/dev/drm/drm_bufs.c Thu Jun  4 20:36:16 2015(r283999)
@@ -1066,15 +1066,9 @@ int drm_mapbufs(struct drm_device *dev, 
}
 
vaddr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ);
-#if __FreeBSD_version >= 600023
retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ |
VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
dev->devnode, foff);
-#else
-   retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ |
-   VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC,
-   SLIST_FIRST(&dev->devnode->si_hlist), foff);
-#endif
if (retcode)
goto done;
 

Modified: head/sys/dev/drm/drm_drv.c
==
--- head/sys/dev/drm/drm_drv.c  Thu Jun  4 19:41:15 2015(r283998)
+++ head/sys/dev/drm/drm_drv.c  Thu Jun  4 20:36:16 2015(r283999)
@@ -161,19 +161,8 @@ int drm_probe(device_t kdev, drm_pci_id_
 {
drm_pci_id_list_t *id_entry;
int vendor, device;
-#if __FreeBSD_version < 700010
-   device_t realdev;
-
-   if (!strcmp(device_get_name(kdev), "drmsub"))
-   realdev = device_get_parent(kdev);
-   else
-   realdev = kdev;
-   vendor = pci_get_vendor(realdev);
-   device = pci_get_device(realdev);
-#else
vendor = pci_get_vendor(kdev);
device = pci_get_device

svn commit: r283998 - in head/sys: dev/drm dev/drm2 fs/devfs kern sys vm

2015-06-04 Thread John Baldwin
Author: jhb
Date: Thu Jun  4 19:41:15 2015
New Revision: 283998
URL: https://svnweb.freebsd.org/changeset/base/283998

Log:
  Add a new file operations hook for mmap operations.  File type-specific
  logic is now placed in the mmap hook implementation rather than requiring
  it to be placed in sys/vm/vm_mmap.c.  This hook allows new file types to
  support mmap() as well as potentially allowing mmap() for existing file
  types that do not currently support any mapping.
  
  The vm_mmap() function is now split up into two functions.  A new
  vm_mmap_object() function handles the "back half" of vm_mmap() and accepts
  a referenced VM object to map rather than a (handle, handle_type) tuple.
  vm_mmap() is now reduced to converting a (handle, handle_type) tuple to a
  a VM object and then calling vm_mmap_object() to handle the actual mapping.
  The vm_mmap() function remains for use by other parts of the kernel
  (e.g. device drivers and exec) but now only supports mapping vnodes,
  character devices, and anonymous memory.
  
  The mmap() system call invokes vm_mmap_object() directly with a NULL object
  for anonymous mappings.  For mappings using a file descriptor, the
  descriptors fo_mmap() hook is invoked instead.  The fo_mmap() hook is
  responsible for performing type-specific checks and adjustments to
  arguments as well as possibly modifying mapping parameters such as flags
  or the object offset.  The fo_mmap() hook routines then call
  vm_mmap_object() to handle the actual mapping.
  
  The fo_mmap() hook is optional.  If it is not set, then fo_mmap() will
  fail with ENODEV.  A fo_mmap() hook is implemented for regular files,
  character devices, and shared memory objects (created via shm_open()).
  
  While here, consistently use the VM_PROT_* constants for the vm_prot_t
  type for the 'prot' variable passed to vm_mmap() and vm_mmap_object()
  as well as the vm_mmap_vnode() and vm_mmap_cdev() helper routines.
  Previously some places were using the mmap()-specific PROT_* constants
  instead.  While this happens to work because PROT_xx == VM_PROT_xx,
  using VM_PROT_* is more correct.
  
  Differential Revision:https://reviews.freebsd.org/D2658
  Reviewed by:  alc (glanced over), kib
  MFC after:1 month
  Sponsored by: Chelsio

Modified:
  head/sys/dev/drm/drm_bufs.c
  head/sys/dev/drm2/drm_bufs.c
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/kern/subr_uio.c
  head/sys/kern/uipc_shm.c
  head/sys/kern/vfs_vnops.c
  head/sys/sys/file.h
  head/sys/sys/mman.h
  head/sys/vm/vm_extern.h
  head/sys/vm/vm_mmap.c

Modified: head/sys/dev/drm/drm_bufs.c
==
--- head/sys/dev/drm/drm_bufs.c Thu Jun  4 19:18:58 2015(r283997)
+++ head/sys/dev/drm/drm_bufs.c Thu Jun  4 19:41:15 2015(r283998)
@@ -1067,12 +1067,12 @@ int drm_mapbufs(struct drm_device *dev, 
 
vaddr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ);
 #if __FreeBSD_version >= 600023
-   retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE,
-   VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
+   retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ |
+   VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
dev->devnode, foff);
 #else
-   retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE,
-   VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC,
+   retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ |
+   VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC,
SLIST_FIRST(&dev->devnode->si_hlist), foff);
 #endif
if (retcode)

Modified: head/sys/dev/drm2/drm_bufs.c
==
--- head/sys/dev/drm2/drm_bufs.cThu Jun  4 19:18:58 2015
(r283997)
+++ head/sys/dev/drm2/drm_bufs.cThu Jun  4 19:41:15 2015
(r283998)
@@ -1635,12 +1635,12 @@ int drm_mapbufs(struct drm_device *dev, 
goto done;
}
retcode = vm_mmap(&vms->vm_map, &virtual, map->size,
-   PROT_READ | PROT_WRITE, VM_PROT_ALL,
+   VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL,
MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
file_priv->minor->device, token);
} else {
retcode = vm_mmap(&vms->vm_map, &virtual, 
dma->byte_count,
-   PROT_READ | PROT_WRITE, VM_PROT_ALL,
+   VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL,
MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
file_priv->minor->device, 0);
}

Modified: head/sys/fs/devfs/devfs_vnops.c
==
--- head/sys/fs/devfs/devfs_vnops.c Thu Jun  4 19:

svn commit: r283997 - head/bin/chmod

2015-06-04 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Jun  4 19:18:58 2015
New Revision: 283997
URL: https://svnweb.freebsd.org/changeset/base/283997

Log:
  Change directory permissions in pre-order.
  In this order, it won't try to recurse into a directory for which
  it doesn't have permission, before changing that permission.
  This follows an existing behavior in other BSDs, linux, OS X.
  
  Obtained from:NetBSD

Modified:
  head/bin/chmod/chmod.c

Modified: head/bin/chmod/chmod.c
==
--- head/bin/chmod/chmod.c  Thu Jun  4 19:11:56 2015(r283996)
+++ head/bin/chmod/chmod.c  Thu Jun  4 19:18:58 2015(r283997)
@@ -162,14 +162,16 @@ done: argv += optind;
atflag = AT_SYMLINK_NOFOLLOW;
 
switch (p->fts_info) {
-   case FTS_D: /* Change it at FTS_DP. */
+   case FTS_D:
if (!Rflag)
fts_set(ftsp, p, FTS_SKIP);
-   continue;
+   break;
case FTS_DNR:   /* Warn, chmod. */
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
+   case FTS_DP:/* Already changed at FTS_D. */
+   continue;
case FTS_ERR:   /* Warn, continue. */
case FTS_NS:
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
___
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: r283994 - head/sys/net80211

2015-06-04 Thread Adrian Chadd
Author: adrian
Date: Thu Jun  4 17:54:41 2015
New Revision: 283994
URL: https://svnweb.freebsd.org/changeset/base/283994

Log:
  Tag outbound raw 802.11 frames with both the node and an mbuf tag
  with the transmit params.
  
  This allows raw 802.11 frames to be queued in the driver if necessary,
  rather than requiring it to be direct-dispatched into the hardware.
  
  Tested:
  
  * ath(4), STA mode
  * iwn(4), STA mode
  
  MFC after:2 weeks
  Sponsored by: Norse Corp, Inc.

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==
--- head/sys/net80211/ieee80211_output.cThu Jun  4 17:05:51 2015
(r283993)
+++ head/sys/net80211/ieee80211_output.cThu Jun  4 17:54:41 2015
(r283994)
@@ -508,6 +508,25 @@ ieee80211_raw_output(struct ieee80211vap
 {
struct ieee80211com *ic = vap->iv_ic;
 
+   /*
+* Set node - the caller has taken a reference, so ensure
+* that the mbuf has the same node value that
+* it would if it were going via the normal path.
+*/
+   m->m_pkthdr.rcvif = (void *)ni;
+
+   /*
+* Attempt to add bpf transmit parameters.
+*
+* For now it's ok to fail; the raw_xmit api still takes
+* them as an option.
+*
+* Later on when ic_raw_xmit() has params removed,
+* they'll have to be added - so fail the transmit if
+* they can't be.
+*/
+   (void) ieee80211_add_xmit_params(m, params);
+
return (ic->ic_raw_xmit(ni, m, params));
 }
 
___
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: r283992 - head/release/arm

2015-06-04 Thread Glen Barber
Author: gjb
Date: Thu Jun  4 16:33:29 2015
New Revision: 283992
URL: https://svnweb.freebsd.org/changeset/base/283992

Log:
  Fix a whitespace nit.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/arm/BEAGLEBONE.conf

Modified: head/release/arm/BEAGLEBONE.conf
==
--- head/release/arm/BEAGLEBONE.confThu Jun  4 16:32:16 2015
(r283991)
+++ head/release/arm/BEAGLEBONE.confThu Jun  4 16:33:29 2015
(r283992)
@@ -23,7 +23,7 @@ arm_install_uboot() {
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
-   chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO  ${FATMOUNT}/MLO
+   chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
___
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: r283991 - head/release/arm

2015-06-04 Thread Glen Barber
Author: gjb
Date: Thu Jun  4 16:32:16 2015
New Revision: 283991
URL: https://svnweb.freebsd.org/changeset/base/283991

Log:
  Add initial support for building images for the Duovero Gumstix
  board.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/release/arm/GUMSTIX.conf   (contents, props changed)

Added: head/release/arm/GUMSTIX.conf
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/release/arm/GUMSTIX.conf   Thu Jun  4 16:32:16 2015
(r283991)
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+EMBEDDEDBUILD=1
+EMBEDDED_TARGET="arm"
+EMBEDDED_TARGET_ARCH="armv6"
+EMBEDDEDPORTS="sysutils/u-boot-duovero"
+KERNEL="GUMSTIX"
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x8800"
+IMAGE_SIZE="1G"
+PART_SCHEME="MBR"
+FAT_SIZE="2m"
+FAT_TYPE="12"
+MD_ARGS="-x 63 -y 255"
+NODOC=1
+
+arm_install_uboot() {
+   UBOOT_DIR="/usr/local/share/u-boot/u-boot-duovero"
+   FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+   UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
+   chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
+   chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+   chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
+   chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
+   chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
+   chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
+   chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
+   sync
+   umount_loop ${CHROOTDIR}/${FATMOUNT}
+   umount_loop ${CHROOTDIR}/${UFSMOUNT}
+   chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+   chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
+   
+   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: r283990 - in stable/10/sys/dev/mpr: . mpi

2015-06-04 Thread Stephen McConnell
Author: slm
Date: Thu Jun  4 16:27:18 2015
New Revision: 283990
URL: https://svnweb.freebsd.org/changeset/base/283990

Log:
  MFC: r283661
  - Updated all files with 2015 Avago copyright, and updated LSI's copyright
dates.
  
  - Changed all of the PCI device strings from LSI to Avago Technologies (LSI).
  
  - Added a sysctl variable to control how StartStopUnit behavior works. User 
can
select to spin down disks based on if disk is SSD or HDD.
  
  - Inquiry data is required to tell if a disk will support SSU at shutdown or
not. Due to the addition of mprssas_async, which gets Advanced Info but not
Inquiry data, the setting of supports_SSU was moved to the
mprsas_scsiio_complete function, which snoops for any Inquiry commands. And,
since disks are shutdown as a target and not a LUN, this process was
simplified by basing it on targets and not LUNs.
  
  - Added a sysctl variable that sets the amount of time to retry after sending 
a
failed SATA ID command. This helps with some bad disks and large disks that
require a lot of time to spin up. Part of this change was to add a callout 
to
handle timeouts with the SATA ID command. The callout function is called
mprsas_ata_id_timeout(). (Fixes PR 191348)
  
  - Changed the way resets work by allowing I/O to continue to devices that are
not currently under a reset condition. This uses devq's instead of simq's 
and
makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a 
function
called mprsas_prepare_tm().
  
  - Some changes were made to reduce code duplication when getting a SAS address
for a SATA disk.
  
  - Fixed some formatting and whitespace.
  
  - Bump version of mpr driver to 9.255.01.00-fbsd
  
  PR:   191348

Modified:
  stable/10/sys/dev/mpr/mpi/mpi2.h
  stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h
  stable/10/sys/dev/mpr/mpi/mpi2_hbd.h
  stable/10/sys/dev/mpr/mpi/mpi2_history.txt
  stable/10/sys/dev/mpr/mpi/mpi2_init.h
  stable/10/sys/dev/mpr/mpi/mpi2_ioc.h
  stable/10/sys/dev/mpr/mpi/mpi2_ra.h
  stable/10/sys/dev/mpr/mpi/mpi2_raid.h
  stable/10/sys/dev/mpr/mpi/mpi2_sas.h
  stable/10/sys/dev/mpr/mpi/mpi2_targ.h
  stable/10/sys/dev/mpr/mpi/mpi2_tool.h
  stable/10/sys/dev/mpr/mpi/mpi2_type.h
  stable/10/sys/dev/mpr/mpr.c
  stable/10/sys/dev/mpr/mpr_config.c
  stable/10/sys/dev/mpr/mpr_ioctl.h
  stable/10/sys/dev/mpr/mpr_mapping.c
  stable/10/sys/dev/mpr/mpr_mapping.h
  stable/10/sys/dev/mpr/mpr_pci.c
  stable/10/sys/dev/mpr/mpr_sas.c
  stable/10/sys/dev/mpr/mpr_sas.h
  stable/10/sys/dev/mpr/mpr_sas_lsi.c
  stable/10/sys/dev/mpr/mpr_user.c
  stable/10/sys/dev/mpr/mprvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mpr/mpi/mpi2.h
==
--- stable/10/sys/dev/mpr/mpi/mpi2.hThu Jun  4 15:02:05 2015
(r283989)
+++ stable/10/sys/dev/mpr/mpi/mpi2.hThu Jun  4 16:27:18 2015
(r283990)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2.h

Modified: stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h
==
--- stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h   Thu Jun  4 15:02:05 2015
(r283989)
+++ stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h   Thu Jun  4 16:27:18 2015
(r283990)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_cnfg.h

Modified: stable/10/sys/dev/mpr/mpi/mpi2_hbd.h
==
--- stable/10/sys/dev/mpr/mpi/mpi2_hbd.hThu Jun  4 15:02:05 2015
(r283989)
+++ stable/10/sys/dev/mpr/mpi/mpi2_hbd.hThu Jun  4 16:27:18 2015
(r283990)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyri

Re: svn commit: r283986 - head/sys/net80211

2015-06-04 Thread Adrian Chadd
oops, sorry! Thanks Andrew!



-a


On 4 June 2015 at 03:55, Andrew Turner  wrote:
> Author: andrew
> Date: Thu Jun  4 10:55:36 2015
> New Revision: 283986
> URL: https://svnweb.freebsd.org/changeset/base/283986
>
> Log:
>   Fix the build by hiding ieee80211_add_xmit_params and
>   ieee80211_get_xmit_params from userspace.
>
> Modified:
>   head/sys/net80211/ieee80211_freebsd.h
>
> Modified: head/sys/net80211/ieee80211_freebsd.h
> ==
> --- head/sys/net80211/ieee80211_freebsd.h   Thu Jun  4 08:05:44 2015  
>   (r283985)
> +++ head/sys/net80211/ieee80211_freebsd.h   Thu Jun  4 10:55:36 2015  
>   (r283986)
> @@ -610,6 +610,7 @@ struct ieee80211_bpf_params {
> uint8_t ibp_rate3;  /* series 4 IEEE tx rate */
>  };
>
> +#ifdef _KERNEL
>  struct ieee80211_tx_params {
> struct ieee80211_bpf_params params;
>  };
> @@ -617,6 +618,7 @@ int ieee80211_add_xmit_params(struct mbu
> const struct ieee80211_bpf_params *);
>  intieee80211_get_xmit_params(struct mbuf *m,
> struct ieee80211_bpf_params *);
> +#endif /* _KERNEL */
>
>  /*
>   * Malloc API.  Other BSD operating systems have slightly
>
___
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: r283989 - head/etc

2015-06-04 Thread Glen Barber
Author: gjb
Date: Thu Jun  4 15:02:05 2015
New Revision: 283989
URL: https://svnweb.freebsd.org/changeset/base/283989

Log:
  Re-implement endian-aware services_mkdb(8) in the 'distribute'
  target.  This effectively reverts r261142, which reverted both
  r261031 and r261044.
  
  Prodded by:   jhb
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu Jun  4 12:46:56 2015(r283988)
+++ head/etc/Makefile   Thu Jun  4 15:02:05 2015(r283989)
@@ -207,6 +207,8 @@ distribution:
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
${BIN1} ${DESTDIR}/etc; \
cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
+   services_mkdb ${CAP_MKDB_ENDIAN} -q -o 
${DESTDIR}/var/db/services.db \
+   ${DESTDIR}/etc/services; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
${BIN2} ${DESTDIR}/etc; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
___
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: r283988 - head/sys/netinet

2015-06-04 Thread Michael Tuexen
Author: tuexen
Date: Thu Jun  4 12:46:56 2015
New Revision: 283988
URL: https://svnweb.freebsd.org/changeset/base/283988

Log:
  Export a pointer to the SCTP socket. This is needed to add SCTP support
  to sockstat.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_sysctl.c
  head/sys/netinet/sctp_uio.h

Modified: head/sys/netinet/sctp_sysctl.c
==
--- head/sys/netinet/sctp_sysctl.c  Thu Jun  4 12:35:00 2015
(r283987)
+++ head/sys/netinet/sctp_sysctl.c  Thu Jun  4 12:46:56 2015
(r283988)
@@ -418,6 +418,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HAND
xinpcb.total_recvs = inp->total_recvs;
xinpcb.total_nospaces = inp->total_nospaces;
xinpcb.fragmentation_point = inp->sctp_frag_point;
+   xinpcb.socket = inp->sctp_socket;
so = inp->sctp_socket;
if ((so == NULL) ||
(inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) {

Modified: head/sys/netinet/sctp_uio.h
==
--- head/sys/netinet/sctp_uio.h Thu Jun  4 12:35:00 2015(r283987)
+++ head/sys/netinet/sctp_uio.h Thu Jun  4 12:46:56 2015(r283988)
@@ -1165,7 +1165,12 @@ struct xsctp_inpcb {
uint16_t local_port;
uint16_t qlen;
uint16_t maxqlen;
-   uint32_t extra_padding[31]; /* future */
+   void *socket;
+#if defined(__LP64__)
+   uint32_t extra_padding[29]; /* future */
+#else
+   uint32_t extra_padding[30]; /* future */
+#endif
 };
 
 struct xsctp_tcb {
___
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: r283987 - stable/10/sys/fs/nfsclient

2015-06-04 Thread Rick Macklem
Author: rmacklem
Date: Thu Jun  4 12:35:00 2015
New Revision: 283987
URL: https://svnweb.freebsd.org/changeset/base/283987

Log:
  MFC: r283273
  The NFS client wasn't handling getdirentries(2) requests for sizes
  that are not an exact multiple of DIRBLKSIZ correctly. Fortunately
  readdir(3) always uses an exact multiple of DIRBLKSIZ, so few applications
  were affected. This patch fixes this problem by reducing the size
  of the directory read to an exact multiple of DIRBLKSIZ.

Modified:
  stable/10/sys/fs/nfsclient/nfs_clvnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c
==
--- stable/10/sys/fs/nfsclient/nfs_clvnops.cThu Jun  4 10:55:36 2015
(r283986)
+++ stable/10/sys/fs/nfsclient/nfs_clvnops.cThu Jun  4 12:35:00 2015
(r283987)
@@ -2211,7 +2211,7 @@ nfs_readdir(struct vop_readdir_args *ap)
struct vnode *vp = ap->a_vp;
struct nfsnode *np = VTONFS(vp);
struct uio *uio = ap->a_uio;
-   ssize_t tresid;
+   ssize_t tresid, left;
int error = 0;
struct vattr vattr;

@@ -2240,6 +2240,17 @@ nfs_readdir(struct vop_readdir_args *ap)
}
 
/*
+* NFS always guarantees that directory entries don't straddle
+* DIRBLKSIZ boundaries.  As such, we need to limit the size
+* to an exact multiple of DIRBLKSIZ, to avoid copying a partial
+* directory entry.
+*/
+   left = uio->uio_resid % DIRBLKSIZ;
+   if (left == uio->uio_resid)
+   return (EINVAL);
+   uio->uio_resid -= left;
+
+   /*
 * Call ncl_bioread() to do the real work.
 */
tresid = uio->uio_resid;
@@ -2250,6 +2261,9 @@ nfs_readdir(struct vop_readdir_args *ap)
if (ap->a_eofflag != NULL)
*ap->a_eofflag = 1;
}
+   
+   /* Add the partial DIRBLKSIZ (left) back in. */
+   uio->uio_resid += left;
return (error);
 }
 
___
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: r283986 - head/sys/net80211

2015-06-04 Thread Andrew Turner
Author: andrew
Date: Thu Jun  4 10:55:36 2015
New Revision: 283986
URL: https://svnweb.freebsd.org/changeset/base/283986

Log:
  Fix the build by hiding ieee80211_add_xmit_params and
  ieee80211_get_xmit_params from userspace.

Modified:
  head/sys/net80211/ieee80211_freebsd.h

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Thu Jun  4 08:05:44 2015
(r283985)
+++ head/sys/net80211/ieee80211_freebsd.h   Thu Jun  4 10:55:36 2015
(r283986)
@@ -610,6 +610,7 @@ struct ieee80211_bpf_params {
uint8_t ibp_rate3;  /* series 4 IEEE tx rate */
 };
 
+#ifdef _KERNEL
 struct ieee80211_tx_params {
struct ieee80211_bpf_params params;
 };
@@ -617,6 +618,7 @@ int ieee80211_add_xmit_params(struct mbu
const struct ieee80211_bpf_params *);
 intieee80211_get_xmit_params(struct mbuf *m,
struct ieee80211_bpf_params *);
+#endif /* _KERNEL */
 
 /*
  * Malloc API.  Other BSD operating systems have slightly
___
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: r283974 - head/lib/libugidfw

2015-06-04 Thread Marcelo Araujo
2015-06-04 16:29 GMT+08:00 NGie Cooper :

> On Thu, Jun 4, 2015 at 12:41 AM, Konstantin Belousov
>  wrote:
> ...
> >> - size = sizeof(rule);
> >>   error = sysctl(name, len, NULL, NULL, &rule, 0);
> > This is very strange chunk.  I suspect that the intent was to have 'size'
> > as the sixth argument to the sysctl(3) call, or just have sizeof(rule)
> > instead of 0.
>
> Agreed.
>

Agreed too, I have open another review request, because I have double check
and there are some missing prototypes too.


Best,
-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
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: r283974 - head/lib/libugidfw

2015-06-04 Thread NGie Cooper
On Thu, Jun 4, 2015 at 12:41 AM, Konstantin Belousov
 wrote:
...
>> - size = sizeof(rule);
>>   error = sysctl(name, len, NULL, NULL, &rule, 0);
> This is very strange chunk.  I suspect that the intent was to have 'size'
> as the sixth argument to the sysctl(3) call, or just have sizeof(rule)
> instead of 0.

Agreed.
___
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: r283985 - head/etc

2015-06-04 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512



On 6/4/15 01:05, Baptiste Daroussin wrote:
> Author: bapt Date: Thu Jun  4 08:05:44 2015 New Revision: 283985 
> URL: https://svnweb.freebsd.org/changeset/base/283985
> 
> Log: After r283981 it is no more needed to specify endianness when
> generating the passwd database

Thanks!

Cheers,
-BEGIN PGP SIGNATURE-

iQIcBAEBCgAGBQJVcAhNAAoJEJW2GBstM+ns53UP/AjxAY4vzjM8ZsBh+GkxjTht
ePJtOF5SnCsG6ATQQ7x9zr+55Uwq9qidbaIbkf9V+3I8N5VPoOSbHmRHvj7aFRd3
IivJzO+WE4tSFfUbJcz6NaEtOAu0qUEsh4si/lD7LyFUhIxRsIi9wxVXZr/U5ZbS
8QC4iRsSCBAGBc+sWsaG0iwJPzaHKSJkHGTXUqXA8mpuko1SM0htNriX/bdb856V
qMFmCnLScEKd7JiOx7ndbXT5PGdDVTr3U2hvKDX4gx3II9yg4BZlBGGz1HFvcKno
WAwPng3hKe+KHEhVbDZri5rngwUn0ZitGBFKxOXjPPpEJr/+yGybchM3mAA8N3gh
BRSrOzAsf+Q9LC530tmbU/neMm9Dh2i2OYNeeyoy8S01D71H54kBSY0J/82WEI91
sxCtFzPIEJjezOxqeK4d1YUwCKzWT9ISbsfsgmnLcx8dKEkGIHfnwJClic5szoE/
1dSz6CA1HmNAOA/7TegU1UfqIqwK2C4QFjtSzzmmiZvncv7MmMYiZdZUZ5eHTp7w
yuiAG3GpYBaEcJYlsakIE06JQx+ktS1PswHSGY2TiLIIEIyuAPcYPMH8mY+EtjoI
nEzfIQB/pwyo+T3bTLzAKnHnvdY+Cp4uXezh1s0Of/zkYrpNjOhj6zOLM5axwiT4
Mpv1SFb02rx2zmX9PEze
=AyfO
-END PGP SIGNATURE-
___
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: r283969 - head/lib/libutil

2015-06-04 Thread Baptiste Daroussin
On Thu, Jun 04, 2015 at 12:52:58AM -0700, Xin Li wrote:
> 
> 
> On 6/3/15 22:21, Baptiste Daroussin wrote:
> > On Wed, Jun 03, 2015 at 03:43:46PM -0700, Xin Li wrote:
> >> On 06/03/15 14:58, Baptiste Daroussin wrote:
> >>> On Thu, Jun 04, 2015 at 12:51:46AM +0300, Sergey Kandaurov
> >>> wrote:
>  On 3 June 2015 at 23:48, Baptiste Daroussin
>   wrote:
> > Author: bapt Date: Wed Jun  3 20:48:28 2015 New Revision: 
> > 283969 URL:
> > https://svnweb.freebsd.org/changeset/base/283969
> > 
> > Log: Add a pw_mkdb2(3) function which does the same thing
> > as pw_mkdb(3) except it takes a new argument allowing to
> > specify the endianness of the database to generate
> > 
>  
>  Why not change pw_mkdb()? Is it used outside of the project?
>  
> >>> Because that would change the ABI of libutil and it is not a 
> >>> private library aka we are supposed to maintain ABI
> >>> compatibility as we do not know if it is used or not externally
> >>> to the project. I care about the ABI because I have made this
> >>> change in order to use it in pw(8) and MFC it to stable/10
> >>> before 10.2.
> >>> 
> >>> libutil is not versionned so this is the only way to not break
> >>> the ABI. Except if someone has a better idea than I do.
> >> 
> >> Looking at r113596, pwd_mkdb(8) was changed to generate both
> >> legacy (version 3, endianness sensitive) and new (version 4,
> >> machine independent) formats.
> >> 
> >> Now, after 12 years, is it still sensible to generate legacy
> >> format db entries?  Maybe we should just disable the generation
> >> by default and eventually remove the ability to generate them?
> >> 
> > 
> > That could be an option, in this case we could add a -l (legacy)
> > option to pwd_mkdb to allow the users to generate the db in legacy
> > format and drop support support for legacy format in all other
> > tools. Meaning I can revert pw_mkdb2(3)
> 
> Well, I think the pw_mkdb2(3) should be reverted, because the base
> system libraries are not using the legacy format when new formatted
> entries are present (which is true for databases generated on FreeBSD
> 5+); and if they do, that shall be seen as a bug and we should fix
> these libraries.
> 
> I have committed r283981-r283983 to implement the default change and
> the -l option.
> 
done, thank you!

Bapt


pgpXOllnoMmIB.pgp
Description: PGP signature


svn commit: r283985 - head/etc

2015-06-04 Thread Baptiste Daroussin
Author: bapt
Date: Thu Jun  4 08:05:44 2015
New Revision: 283985
URL: https://svnweb.freebsd.org/changeset/base/283985

Log:
  After r283981 it is no more needed to specify endianness when generating the
  passwd database

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu Jun  4 08:00:11 2015(r283984)
+++ head/etc/Makefile   Thu Jun  4 08:05:44 2015(r283985)
@@ -188,13 +188,10 @@ distribute:
 .include 
 .if ${TARGET_ENDIANNESS} == "1234"
 CAP_MKDB_ENDIAN?= -l
-PWD_MKDB_ENDIAN?= -L
 .elif ${TARGET_ENDIANNESS} == "4321"
 CAP_MKDB_ENDIAN?= -b
-PWD_MKDB_ENDIAN?= -B
 .else
 CAP_MKDB_ENDIAN?=
-PWD_MKDB_ENDIAN?=
 .endif
 
 .if defined(NO_ROOT)
@@ -220,8 +217,7 @@ distribution:
 .if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
 .endif
-   pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
-   ${DESTDIR}/etc/master.passwd
+   pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
 .if defined(NO_ROOT)
( \
echo "./etc/login.conf.db type=file mode=0644 uname=root 
gname=wheel"; \
___
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: r283984 - head/lib/libutil

2015-06-04 Thread Baptiste Daroussin
Author: bapt
Date: Thu Jun  4 08:00:11 2015
New Revision: 283984
URL: https://svnweb.freebsd.org/changeset/base/283984

Log:
  revert r283969,283970 not needed anymore after r283981

Modified:
  head/lib/libutil/Makefile
  head/lib/libutil/libutil.h
  head/lib/libutil/pw_util.3
  head/lib/libutil/pw_util.c

Modified: head/lib/libutil/Makefile
==
--- head/lib/libutil/Makefile   Thu Jun  4 07:37:09 2015(r283983)
+++ head/lib/libutil/Makefile   Thu Jun  4 08:00:11 2015(r283984)
@@ -78,7 +78,6 @@ MLINKS+=pw_util.3 pw_copy.3 \
pw_util.3 pw_make.3 \
pw_util.3 pw_make_v7.3 \
pw_util.3 pw_mkdb.3 \
-   pw_util.3 pw_mkdb2.3 \
pw_util.3 pw_lock.3 \
pw_util.3 pw_scan.3 \
pw_util.3 pw_tempname.3 \

Modified: head/lib/libutil/libutil.h
==
--- head/lib/libutil/libutil.h  Thu Jun  4 07:37:09 2015(r283983)
+++ head/lib/libutil/libutil.h  Thu Jun  4 08:00:11 2015(r283984)
@@ -144,9 +144,6 @@ char*fparseln(FILE *_fp, size_t *_len, 
 #endif
 
 #ifdef _PWD_H_
-#define PWDB_NATIVE 0
-#define PWDB_LE 1
-#define PWDB_BE 2
 intpw_copy(int _ffd, int _tfd, const struct passwd *_pw,
struct passwd *_old_pw);
 struct passwd
@@ -158,7 +155,6 @@ int pw_init(const char *_dir, const char
 char   *pw_make(const struct passwd *_pw);
 char   *pw_make_v7(const struct passwd *_pw);
 intpw_mkdb(const char *_user);
-intpw_mkdb2(const char *_user, int endian);
 intpw_lock(void);
 struct passwd *
pw_scan(const char *_line, int _flags);

Modified: head/lib/libutil/pw_util.3
==
--- head/lib/libutil/pw_util.3  Thu Jun  4 07:37:09 2015(r283983)
+++ head/lib/libutil/pw_util.3  Thu Jun  4 08:00:11 2015(r283984)
@@ -37,7 +37,6 @@
 .Nm pw_make ,
 .Nm pw_make_v7 ,
 .Nm pw_mkdb ,
-.Nm pw_mkdb2 ,
 .Nm pw_lock ,
 .Nm pw_scan ,
 .Nm pw_tempname ,
@@ -67,8 +66,6 @@
 .Ft int
 .Fn pw_mkdb "const char *user"
 .Ft int
-.Fn pw_mkdb "const char *user" "int endian"
-.Ft int
 .Fn pw_lock "void"
 .Ft "struct passwd *"
 .Fn pw_scan "const char *line" "int flags"
@@ -228,30 +225,11 @@ function regenerates the password databa
 .Xr pwd_mkdb 8 .
 If
 .Fa user
-is set, only the record corresponding to that user will be updated.
+only the record corresponding to that user will be updated.
 The
 .Fn pw_mkdb
 function returns 0 in case of success and -1 in case of failure.
 .Pp
-.Fn pw_mkdb2
-function regenerates the password database by running
-.Xr pwd_mkdb 8 .
-If
-.Fa user
-is set, only the record corresponding to that user will be updated.
-.Pp
-The
-.Fa endian
-variable can take the following values
-.Bl -tag -width PWDB_NATIVE
-.It Dv PWDB_NATIVE
-The database will be generated in host native endianness.
-.It Dv PWDB_LE
-The database will be generated in Little-endian.
-.It Dv PWDB_BE
-The database will be generated in Big-endian.
-.El
-.Pp
 The
 .Fn pw_lock
 function locks the master password file.

Modified: head/lib/libutil/pw_util.c
==
--- head/lib/libutil/pw_util.c  Thu Jun  4 07:37:09 2015(r283983)
+++ head/lib/libutil/pw_util.c  Thu Jun  4 08:00:11 2015(r283984)
@@ -242,36 +242,14 @@ pw_tmp(int mfd)
return (tfd);
 }
 
-int
-pw_mkdb(const char *user)
-{
-
-   return (pw_mkdb2(user, PWDB_NATIVE));
-}
-
 /*
  * Regenerate the password database.
  */
 int
-pw_mkdb2(const char *user, int endian)
+pw_mkdb(const char *user)
 {
int pstat;
pid_t pid;
-   const char *arg;
-
-   switch (endian) {
-   case PWDB_NATIVE:
-   arg = "-p";
-   break;
-   case PWDB_LE:
-   arg = "-pL";
-   break;
-   case PWDB_BE:
-   arg = "-pB";
-   break;
-   default:
-   return (-1);
-   }
 
(void)fflush(stderr);
switch ((pid = fork())) {
@@ -280,10 +258,10 @@ pw_mkdb2(const char *user, int endian)
case 0:
/* child */
if (user == NULL)
-   execl(_PATH_PWD_MKDB, "pwd_mkdb", arg,
+   execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
"-d", passwd_dir, tempname, (char *)NULL);
else
-   execl(_PATH_PWD_MKDB, "pwd_mkdb", arg,
+   execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
"-d", passwd_dir, "-u", user, tempname,
(char *)NULL);
_exit(1);
___
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: r283969 - head/lib/libutil

2015-06-04 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512



On 6/3/15 22:21, Baptiste Daroussin wrote:
> On Wed, Jun 03, 2015 at 03:43:46PM -0700, Xin Li wrote:
>> On 06/03/15 14:58, Baptiste Daroussin wrote:
>>> On Thu, Jun 04, 2015 at 12:51:46AM +0300, Sergey Kandaurov
>>> wrote:
 On 3 June 2015 at 23:48, Baptiste Daroussin
  wrote:
> Author: bapt Date: Wed Jun  3 20:48:28 2015 New Revision: 
> 283969 URL:
> https://svnweb.freebsd.org/changeset/base/283969
> 
> Log: Add a pw_mkdb2(3) function which does the same thing
> as pw_mkdb(3) except it takes a new argument allowing to
> specify the endianness of the database to generate
> 
 
 Why not change pw_mkdb()? Is it used outside of the project?
 
>>> Because that would change the ABI of libutil and it is not a 
>>> private library aka we are supposed to maintain ABI
>>> compatibility as we do not know if it is used or not externally
>>> to the project. I care about the ABI because I have made this
>>> change in order to use it in pw(8) and MFC it to stable/10
>>> before 10.2.
>>> 
>>> libutil is not versionned so this is the only way to not break
>>> the ABI. Except if someone has a better idea than I do.
>> 
>> Looking at r113596, pwd_mkdb(8) was changed to generate both
>> legacy (version 3, endianness sensitive) and new (version 4,
>> machine independent) formats.
>> 
>> Now, after 12 years, is it still sensible to generate legacy
>> format db entries?  Maybe we should just disable the generation
>> by default and eventually remove the ability to generate them?
>> 
> 
> That could be an option, in this case we could add a -l (legacy)
> option to pwd_mkdb to allow the users to generate the db in legacy
> format and drop support support for legacy format in all other
> tools. Meaning I can revert pw_mkdb2(3)

Well, I think the pw_mkdb2(3) should be reverted, because the base
system libraries are not using the legacy format when new formatted
entries are present (which is true for databases generated on FreeBSD
5+); and if they do, that shall be seen as a bug and we should fix
these libraries.

I have committed r283981-r283983 to implement the default change and
the -l option.

Cheers,
-BEGIN PGP SIGNATURE-

iQIcBAEBCgAGBQJVcAPZAAoJEJW2GBstM+nsb1oQAKug0zb3dxTSZScZJ/R8YBof
+upLW/MALifOlhkYz0QBp+VQwrXvX+ZT1tseIwopg6pL0mrq9ZRrSb5DepFIc8fY
lJ0P1s15RF41hRFcRSh3bJh8rEGekgS5fv3EFWwvrwUSA1D22X+wOofCLfZs2uji
MpPmhc1g5jMN3tx4Evsx/7prSoXFGZYimnVIb8uNmjJyruHlrSrXsIau/b8ND4lm
7eQS4n5EoNmu8ui7rk4IsJPr1kP/gpjE+UPGi0tICjb8In8lE0Tj2fgMuDpRHQ7K
II90Qanv+RZrapRb8zIOJRH8GBA0IlE8LzcIcoI4Dd32eP+HfP6BPMOD+kB9VlsS
xapUo/PSF6ouScPNIoQD0Pq1VdvYHUTid/McoI6UTauHYSerl8mGOvpSRZF1GIFa
pFzpJcsl15tWXAhwrDxSSwO+2BvtXDO36K+VbmTlMlr8Z623S6F2K/MyEkIbpj55
Un85J2xNoYbeEjc8+66emjILUZajGXXiJLS4v1f5RYTyOTl4t7coV4aDPb2c0aZu
JsbagSfkPCuHttzwbry4EnfI+4eRo7+wtR3rf9tOXBt6DOY7qTba6GSBIpvVeqbe
tlM/rpXnREgIUFyshKGN50I2OcpJY9RWALNUMwlCXDUbW4sHwy7acma0+hhDoGAl
Q5Hc9f0/u76LNnvDQWNZ
=6rIW
-END PGP SIGNATURE-
___
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: r283974 - head/lib/libugidfw

2015-06-04 Thread Konstantin Belousov
On Thu, Jun 04, 2015 at 02:44:37AM +, Marcelo Araujo wrote:
> Author: araujo (ports committer)
> Date: Thu Jun  4 02:44:37 2015
> New Revision: 283974
> URL: https://svnweb.freebsd.org/changeset/base/283974
> 
> Log:
>   Remove unused variables and silence clang warnings.
>   
>   Differential Revision:  D2686
>   Reviewed by:rodrigc
> 
> Modified:
>   head/lib/libugidfw/ugidfw.c
> 
> @@ -1216,7 +1215,7 @@ bsde_delete_rule(int rulenum, size_t buf
>  {
>   struct mac_bsdextended_rule rule;
>   int name[10];
> - size_t len, size;
> + size_t len;
>   int error;
>  
>   if (bsde_check_version(buflen, errstr) != 0)
> @@ -1233,7 +1232,6 @@ bsde_delete_rule(int rulenum, size_t buf
>   name[len] = rulenum;
>   len++;
>  
> - size = sizeof(rule);
>   error = sysctl(name, len, NULL, NULL, &rule, 0);
This is very strange chunk.  I suspect that the intent was to have 'size'
as the sixth argument to the sysctl(3) call, or just have sizeof(rule)
instead of 0.

>   if (error) {
>   len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
___
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: r283983 - in head: . sys/sys

2015-06-04 Thread Xin LI
Author: delphij
Date: Thu Jun  4 07:37:09 2015
New Revision: 283983
URL: https://svnweb.freebsd.org/changeset/base/283983

Log:
  Document the disable of legacy entries in password database in UPDATING
  and bump __FreeBSD_version after r283981.

Modified:
  head/UPDATING
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Thu Jun  4 07:25:40 2015(r283982)
+++ head/UPDATING   Thu Jun  4 07:37:09 2015(r283983)
@@ -31,6 +31,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20150604:
+   Generation of legacy formatted entries have been disabled by default
+   in pwd_mkdb(8), as all base system consumers of the legacy formatted
+   entries were converted to use the new format by default when the new,
+   machine independent format have been added and supported since FreeBSD
+   5.x.
+
+   Please see the pwd_mkdb(8) manual page for further details.
+
 20150525:
Clang and llvm have been upgraded to 3.6.1 release.  Please see the
20141231 entry below for information about prerequisites and upgrading,

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hThu Jun  4 07:25:40 2015(r283982)
+++ head/sys/sys/param.hThu Jun  4 07:37:09 2015(r283983)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100075  /* Master, propagated to newvers */
+#define __FreeBSD_version 1100076  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r283982 - head/usr.sbin/pwd_mkdb

2015-06-04 Thread Xin LI
Author: delphij
Date: Thu Jun  4 07:25:40 2015
New Revision: 283982
URL: https://svnweb.freebsd.org/changeset/base/283982

Log:
  Whitespace changes for r283981.  No actual code changes.

Modified:
  head/usr.sbin/pwd_mkdb/pwd_mkdb.c

Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c
==
--- head/usr.sbin/pwd_mkdb/pwd_mkdb.c   Thu Jun  4 07:24:56 2015
(r283981)
+++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c   Thu Jun  4 07:25:40 2015
(r283982)
@@ -469,97 +469,97 @@ main(int argc, char *argv[])
}
 
if (lflag) {
-   /* Create insecure data. (legacy version) */
-   p = buf;
-   COMPACT(pwd.pw_name);
-   COMPACT("*");
-   LSCALAR(pwd.pw_uid);
-   LSCALAR(pwd.pw_gid);
-   LSCALAR(pwd.pw_change);
-   COMPACT(pwd.pw_class);
-   COMPACT(pwd.pw_gecos);
-   COMPACT(pwd.pw_dir);
-   COMPACT(pwd.pw_shell);
-   LSCALAR(pwd.pw_expire);
-   LSCALAR(pwd.pw_fields);
-   data.size = p - buf;
-
-   /* Create secure data. (legacy version) */
-   p = sbuf;
-   COMPACT(pwd.pw_name);
-   COMPACT(pwd.pw_passwd);
-   LSCALAR(pwd.pw_uid);
-   LSCALAR(pwd.pw_gid);
-   LSCALAR(pwd.pw_change);
-   COMPACT(pwd.pw_class);
-   COMPACT(pwd.pw_gecos);
-   COMPACT(pwd.pw_dir);
-   COMPACT(pwd.pw_shell);
-   LSCALAR(pwd.pw_expire);
-   LSCALAR(pwd.pw_fields);
-   sdata.size = p - sbuf;
-
-   /* Store insecure by name. */
-   tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME);
-   len = strlen(pwd.pw_name);
-   memmove(tbuf + 1, pwd.pw_name, len);
-   key.size = len + 1;
-   if ((dp->put)(dp, &key, &data, method) == -1)
-   error("put");
-
-   /* Store insecure by number. */
-   tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM);
-   store = HTOL(cnt);
-   memmove(tbuf + 1, &store, sizeof(store));
-   key.size = sizeof(store) + 1;
-   if ((dp->put)(dp, &key, &data, method) == -1)
-   error("put");
-
-   /* Store insecure by uid. */
-   tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID);
-   store = HTOL(pwd.pw_uid);
-   memmove(tbuf + 1, &store, sizeof(store));
-   key.size = sizeof(store) + 1;
-   if ((dp->put)(dp, &key, &data, methoduid) == -1)
-   error("put");
+   /* Create insecure data. (legacy version) */
+   p = buf;
+   COMPACT(pwd.pw_name);
+   COMPACT("*");
+   LSCALAR(pwd.pw_uid);
+   LSCALAR(pwd.pw_gid);
+   LSCALAR(pwd.pw_change);
+   COMPACT(pwd.pw_class);
+   COMPACT(pwd.pw_gecos);
+   COMPACT(pwd.pw_dir);
+   COMPACT(pwd.pw_shell);
+   LSCALAR(pwd.pw_expire);
+   LSCALAR(pwd.pw_fields);
+   data.size = p - buf;
+
+   /* Create secure data. (legacy version) */
+   p = sbuf;
+   COMPACT(pwd.pw_name);
+   COMPACT(pwd.pw_passwd);
+   LSCALAR(pwd.pw_uid);
+   LSCALAR(pwd.pw_gid);
+   LSCALAR(pwd.pw_change);
+   COMPACT(pwd.pw_class);
+   COMPACT(pwd.pw_gecos);
+   COMPACT(pwd.pw_dir);
+   COMPACT(pwd.pw_shell);
+   LSCALAR(pwd.pw_expire);
+   LSCALAR(pwd.pw_fields);
+   sdata.size = p - sbuf;
+
+   /* Store insecure by name. */
+   tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME);
+   len = strlen(pwd.pw_name);
+   memmove(tbuf + 1, pwd.pw_name, len);
+   key.si

svn commit: r283981 - head/usr.sbin/pwd_mkdb

2015-06-04 Thread Xin LI
Author: delphij
Date: Thu Jun  4 07:24:56 2015
New Revision: 283981
URL: https://svnweb.freebsd.org/changeset/base/283981

Log:
  In r113596, version 4 of entries have been added but pwd_mkdb have
  been generating both new (machine independent) and legacy version
  entries (endianness sensitive).
  
  The base system have been using the new format for quite some time,
  so disable the generation by default.
  
  An interim option, -l, have been added to re-enable old behavior.
  The -l, -B and -L options are considered deprecated and will be
  removed in FreeBSD 12.0 release.

Modified:
  head/usr.sbin/pwd_mkdb/pwd_mkdb.8
  head/usr.sbin/pwd_mkdb/pwd_mkdb.c

Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8
==
--- head/usr.sbin/pwd_mkdb/pwd_mkdb.8   Thu Jun  4 06:30:39 2015
(r283980)
+++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8   Thu Jun  4 07:24:56 2015
(r283981)
@@ -36,7 +36,7 @@
 .Nd "generate the password databases"
 .Sh SYNOPSIS
 .Nm
-.Op Fl BCiLNp
+.Op Fl BCilLNp
 .Op Fl d Ar directory
 .Op Fl s Ar cachesize
 .Op Fl u Ar username
@@ -61,14 +61,10 @@ different from the historic Version 7 st
 .Pp
 The options are as follows:
 .Bl -tag -width flag
-.It Fl B
-Store data in big-endian format.
 .It Fl C
 Check if the password file is in the correct format.
 Do not
 change, add, or remove any files.
-.It Fl L
-Store data in little-endian format.
 .It Fl N
 Tell
 .Nm
@@ -116,6 +112,34 @@ encrypted password and the insecure vers
 The databases are used by the C library password routines (see
 .Xr getpwent 3 ) .
 .Pp
+By default,
+the
+.Nm
+utility generates new,
+machine independent format
+.Pq v4
+entries only.
+For compatibility with
+.Fx 5.0
+and earlier releases,
+the
+.Fl l
+option may be specified,
+which enables generation of legacy format
+.Pq v3
+entries.
+The legacy format entries are endianness dependent.
+.Pp
+The following options may be specified and will affect the
+generation of legacy entries.
+.Pp
+.Bl -tag -width flag
+.It Fl B
+Store data in big-endian format.
+.It Fl L
+Store data in little-endian format.
+.El
+.Pp
 The
 .Nm
 utility exits zero on success, non-zero on failure.

Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c
==
--- head/usr.sbin/pwd_mkdb/pwd_mkdb.c   Thu Jun  4 06:30:39 2015
(r283980)
+++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c   Thu Jun  4 07:24:56 2015
(r283981)
@@ -112,15 +112,15 @@ main(int argc, char *argv[])
char sbuf2[MAXPATHLEN];
char *username;
u_int method, methoduid;
-   int Cflag, dflag, iflag;
+   int Cflag, dflag, iflag, lflag;
int nblock = 0;
 
-   iflag = dflag = Cflag = 0;
+   iflag = dflag = Cflag = lflag = 0;
strcpy(prefix, _PATH_PWD);
makeold = 0;
username = NULL;
oldfp = NULL;
-   while ((ch = getopt(argc, argv, "BCLNd:ips:u:v")) != -1)
+   while ((ch = getopt(argc, argv, "BCLlNd:ips:u:v")) != -1)
switch(ch) {
case 'B':   /* big-endian output */
openinfo.lorder = BIG_ENDIAN;
@@ -128,6 +128,9 @@ main(int argc, char *argv[])
case 'C':   /* verify only */
Cflag = 1;
break;
+   case 'l':   /* generate legacy entries */
+   lflag = 1;
+   break;
case 'L':   /* little-endian output */
openinfo.lorder = LITTLE_ENDIAN;
break;
@@ -465,6 +468,7 @@ main(int argc, char *argv[])
error("put");
}
 
+   if (lflag) {
/* Create insecure data. (legacy version) */
p = buf;
COMPACT(pwd.pw_name);
@@ -555,6 +559,7 @@ main(int argc, char *argv[])
error("put");
}
}
+   }
/* Create original format password file entry */
if (is_comment && makeold){ /* copy comments */
if (fprintf(oldfp, "%s\n", line) < 0)
@@ -583,6 +588,7 @@ main(int argc, char *argv[])
error("put");
if ((sdp->put)(sdp, &key, &data, method) == -1)
error("put");
+   if (lflag) {
tbuf[0] = LEGACY_VERSION(_PW_KEYYPENABLED);
key.size = 1;
if ((dp->put)(dp, &key, &data, method) == -1)
@@ -590,6 +596,7 @@ main(int argc, char *argv[])
if ((sdp->put)(sdp, &key, &data, method) == -1)
error("put");
}
+   }
 
if ((dp->close)(dp) == -1)
error("close");
_