svn commit: r263107 - head/lib/libc/gen

2014-03-13 Thread David Xu
Author: davidxu
Date: Thu Mar 13 06:54:10 2014
New Revision: 263107
URL: http://svnweb.freebsd.org/changeset/base/263107

Log:
  To avoid missing a chance to cancel thread, call _pthread_testcancel at the
  beginning of _sem_timedwait.
  
  Submitted by: Eric van Gyzen lt; eric at vangyzen dot net gt;
  MFC after:3 days

Modified:
  head/lib/libc/gen/sem_new.c

Modified: head/lib/libc/gen/sem_new.c
==
--- head/lib/libc/gen/sem_new.c Thu Mar 13 05:17:53 2014(r263106)
+++ head/lib/libc/gen/sem_new.c Thu Mar 13 06:54:10 2014(r263107)
@@ -381,6 +381,7 @@ _sem_timedwait(sem_t * __restrict sem,
return (-1);
 
retval = 0;
+   _pthread_testcancel();
for (;;) {
while ((val = sem-_kern._count)  0) {
if (atomic_cmpset_acq_int(sem-_kern._count, val, val 
- 1))
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263109 - head/sys/dev/puc

2014-03-13 Thread Ryan Stone
Author: rstone
Date: Thu Mar 13 15:57:25 2014
New Revision: 263109
URL: http://svnweb.freebsd.org/changeset/base/263109

Log:
  Add MSI support to puc(9)
  
  Add support for MSI interrupts in the puc(9) driver.  By default the driver
  will prefer MSI interrupts to legacy interrupts.  A tunable,
  hw.puc.msi_disable, has been added to force the allocation of legacy
  interrupts.
  
  Reviewed by:  jhb@
  MFC after:2 weeks
  Sponsored by: Sandvine Inc.

Modified:
  head/sys/dev/puc/puc.c
  head/sys/dev/puc/puc_bfe.h
  head/sys/dev/puc/puc_cfg.c
  head/sys/dev/puc/puc_pccard.c
  head/sys/dev/puc/puc_pci.c
  head/sys/dev/puc/pucdata.c

Modified: head/sys/dev/puc/puc.c
==
--- head/sys/dev/puc/puc.c  Thu Mar 13 14:34:25 2014(r263108)
+++ head/sys/dev/puc/puc.c  Thu Mar 13 15:57:25 2014(r263109)
@@ -34,6 +34,7 @@ __FBSDID($FreeBSD$);
 #include sys/conf.h
 #include sys/malloc.h
 #include sys/mutex.h
+#include sys/sysctl.h
 
 #include machine/bus.h
 #include machine/resource.h
@@ -70,6 +71,8 @@ const char puc_driver_name[] = puc;
 
 static MALLOC_DEFINE(M_PUC, PUC, PUC driver);
 
+SYSCTL_NODE(_hw, OID_AUTO, puc, CTLFLAG_RD, 0, puc(9) driver configuration);
+
 struct puc_bar *
 puc_get_bar(struct puc_softc *sc, int rid)
 {
@@ -324,7 +327,6 @@ puc_bfe_attach(device_t dev)
if (bootverbose  sc-sc_ilr != 0)
device_printf(dev, using interrupt latch register\n);
 
-   sc-sc_irid = 0;
sc-sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, sc-sc_irid,
RF_ACTIVE|RF_SHAREABLE);
if (sc-sc_ires != NULL) {

Modified: head/sys/dev/puc/puc_bfe.h
==
--- head/sys/dev/puc/puc_bfe.h  Thu Mar 13 14:34:25 2014(r263108)
+++ head/sys/dev/puc/puc_bfe.h  Thu Mar 13 15:57:25 2014(r263109)
@@ -66,6 +66,7 @@ struct puc_softc {
int sc_fastintr:1;
int sc_leaving:1;
int sc_polled:1;
+   int sc_msi:1;
 
int sc_ilr;
 
@@ -94,4 +95,6 @@ int puc_bus_setup_intr(device_t, device_
 driver_filter_t *, driver_intr_t *, void *, void **);
 int puc_bus_teardown_intr(device_t, device_t, struct resource *, void *);
 
+SYSCTL_DECL(_hw_puc);
+
 #endif /* _DEV_PUC_BFE_H_ */

Modified: head/sys/dev/puc/puc_cfg.c
==
--- head/sys/dev/puc/puc_cfg.c  Thu Mar 13 14:34:25 2014(r263108)
+++ head/sys/dev/puc/puc_cfg.c  Thu Mar 13 15:57:25 2014(r263109)
@@ -31,6 +31,7 @@ __FBSDID($FreeBSD$);
 #include sys/systm.h
 #include sys/bus.h
 #include sys/rman.h
+#include sys/sysctl.h
 
 #include dev/puc/puc_bus.h
 #include dev/puc/puc_cfg.h

Modified: head/sys/dev/puc/puc_pccard.c
==
--- head/sys/dev/puc/puc_pccard.c   Thu Mar 13 14:34:25 2014
(r263108)
+++ head/sys/dev/puc/puc_pccard.c   Thu Mar 13 15:57:25 2014
(r263109)
@@ -34,6 +34,7 @@ __FBSDID($FreeBSD$);
 #include sys/bus.h
 #include sys/conf.h
 #include sys/malloc.h
+#include sys/sysctl.h
 
 #include machine/bus.h
 #include machine/resource.h

Modified: head/sys/dev/puc/puc_pci.c
==
--- head/sys/dev/puc/puc_pci.c  Thu Mar 13 14:34:25 2014(r263108)
+++ head/sys/dev/puc/puc_pci.c  Thu Mar 13 15:57:25 2014(r263109)
@@ -67,6 +67,7 @@ __FBSDID($FreeBSD$);
 #include sys/bus.h
 #include sys/conf.h
 #include sys/malloc.h
+#include sys/sysctl.h
 
 #include machine/bus.h
 #include machine/resource.h
@@ -78,6 +79,11 @@ __FBSDID($FreeBSD$);
 #include dev/puc/puc_cfg.h
 #include dev/puc/puc_bfe.h
 
+static int puc_msi_disable;
+TUNABLE_INT(hw.puc.msi_disable, puc_msi_disable);
+SYSCTL_INT(_hw_puc, OID_AUTO, msi_disable, CTLFLAG_RD | CTLFLAG_TUN,
+puc_msi_disable, 0, Disable use of MSI interrupts by puc(9));
+
 static const struct puc_cfg *
 puc_pci_match(device_t dev, const struct puc_cfg *desc)
 {
@@ -120,11 +126,56 @@ puc_pci_probe(device_t dev)
return (puc_bfe_probe(dev, desc));
 }
 
+static int
+puc_pci_attach(device_t dev)
+{
+   struct puc_softc *sc;
+   int error, count;
+
+   sc = device_get_softc(dev);
+
+   if (!puc_msi_disable) {
+   count = 1;
+
+   if (pci_alloc_msi(dev, count) == 0) {
+   sc-sc_msi = 1;
+   sc-sc_irid = 1;
+   }
+   }
+
+   error = puc_bfe_attach(dev);
+
+   if (error != 0  sc-sc_msi)
+   pci_release_msi(dev);
+
+   return (error);
+}
+
+static int
+puc_pci_detach(device_t dev)
+{
+   struct puc_softc *sc;
+   int error;
+
+   sc = device_get_softc(dev);
+   
+   error = puc_bfe_detach(dev);
+
+   if (error != 0)
+ 

svn commit: r263110 - head/share/man/man4

2014-03-13 Thread John-Mark Gurney
Author: jmg
Date: Thu Mar 13 16:19:36 2014
New Revision: 263110
URL: http://svnweb.freebsd.org/changeset/base/263110

Log:
  remove link to the missing AMD Geode LX SB man page... we can add it
  back once someone cares enough to write one..

Modified:
  head/share/man/man4/crypto.4

Modified: head/share/man/man4/crypto.4
==
--- head/share/man/man4/crypto.4Thu Mar 13 15:57:25 2014
(r263109)
+++ head/share/man/man4/crypto.4Thu Mar 13 16:19:36 2014
(r263110)
@@ -107,7 +107,6 @@ crypto access device
 .El
 .Sh SEE ALSO
 .Xr aesni 4 ,
-.Xr glxsb 4 ,
 .Xr hifn 4 ,
 .Xr ipsec 4 ,
 .Xr padlock 4 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263111 - head/sys/dev/hwpmc

2014-03-13 Thread Eitan Adler
Author: eadler
Date: Thu Mar 13 16:51:01 2014
New Revision: 263111
URL: http://svnweb.freebsd.org/changeset/base/263111

Log:
  Fix pointer type in call to malloc
  
  Submitted by: Meyer, Conrad conrad.me...@isilon.com

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==
--- head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 13 16:19:36 2014
(r263110)
+++ head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 13 16:51:01 2014
(r263111)
@@ -2679,7 +2679,7 @@ pmc_core_initialize(struct pmc_mdep *md,
PMCDBG(MDP,INI,1,core-init pmcmask=0x%jx iafri=%d, core_pmcmask,
core_iaf_ri);
 
-   core_pcpu = malloc(sizeof(struct core_cpu **) * maxcpu, M_PMC,
+   core_pcpu = malloc(sizeof(*core_pcpu) * maxcpu, M_PMC,
M_ZERO | M_WAITOK);
 
/*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263112 - head/sys/dev/hwpmc

2014-03-13 Thread Eitan Adler
Author: eadler
Date: Thu Mar 13 16:51:40 2014
New Revision: 263112
URL: http://svnweb.freebsd.org/changeset/base/263112

Log:
  Fix pointer type in call to malloc
  
  Submitted by: Meyer, Conrad conrad.me...@isilon.com

Modified:
  head/sys/dev/hwpmc/hwpmc_uncore.c

Modified: head/sys/dev/hwpmc/hwpmc_uncore.c
==
--- head/sys/dev/hwpmc/hwpmc_uncore.c   Thu Mar 13 16:51:01 2014
(r263111)
+++ head/sys/dev/hwpmc/hwpmc_uncore.c   Thu Mar 13 16:51:40 2014
(r263112)
@@ -1212,7 +1212,7 @@ pmc_uncore_initialize(struct pmc_mdep *m
PMCDBG(MDP,INI,1,uncore-init pmcmask=0x%jx ucfri=%d, uncore_pmcmask,
uncore_ucf_ri);
 
-   uncore_pcpu = malloc(sizeof(struct uncore_cpu **) * maxcpu, M_PMC,
+   uncore_pcpu = malloc(sizeof(*uncore_pcpu) * maxcpu, M_PMC,
M_ZERO | M_WAITOK);
 
return (0);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263113 - head/sys/x86/x86

2014-03-13 Thread John Baldwin
Author: jhb
Date: Thu Mar 13 18:11:42 2014
New Revision: 263113
URL: http://svnweb.freebsd.org/changeset/base/263113

Log:
  Correct type for malloc().
  
  Submitted by: Conrad Meyer conrad.me...@isilon.com

Modified:
  head/sys/x86/x86/mca.c

Modified: head/sys/x86/x86/mca.c
==
--- head/sys/x86/x86/mca.c  Thu Mar 13 16:51:40 2014(r263112)
+++ head/sys/x86/x86/mca.c  Thu Mar 13 18:11:42 2014(r263113)
@@ -700,8 +700,8 @@ cmci_setup(void)
 {
int i;
 
-   cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state **),
-   M_MCA, M_WAITOK);
+   cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state *), M_MCA,
+   M_WAITOK);
for (i = 0; i = mp_maxid; i++)
cmc_state[i] = malloc(sizeof(struct cmc_state) * mca_banks,
M_MCA, M_WAITOK | M_ZERO);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263115 - in head/sys/boot/efi: include/amd64 libefi

2014-03-13 Thread Ed Maste
Author: emaste
Date: Thu Mar 13 18:17:18 2014
New Revision: 263115
URL: http://svnweb.freebsd.org/changeset/base/263115

Log:
  Add amd64 EFI headers
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/boot/efi/include/amd64/
  head/sys/boot/efi/include/amd64/efibind.h   (contents, props changed)
  head/sys/boot/efi/include/amd64/pe.h   (contents, props changed)
Modified:
  head/sys/boot/efi/libefi/Makefile

Added: head/sys/boot/efi/include/amd64/efibind.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/efi/include/amd64/efibind.h   Thu Mar 13 18:17:18 2014
(r263115)
@@ -0,0 +1,267 @@
+/* $FreeBSD$ */
+/*++
+
+Copyright (c)  1999 - 2003 Intel Corporation. All rights reserved
+This software and associated documentation (if any) is furnished
+under a license and may only be used or copied in accordance
+with the terms of the license. Except as permitted by such
+license, no part of this software or documentation may be
+reproduced, stored in a retrieval system, or transmitted in any
+form or by any means without the express written consent of
+Intel Corporation.
+
+Module Name:
+
+efefind.h
+
+Abstract:
+
+EFI to compile bindings
+
+
+
+
+Revision History
+
+--*/
+
+#pragma pack()
+
+
+#ifdef __FreeBSD__
+#include sys/stdint.h
+#else
+//
+// Basic int types of various widths
+//
+
+#if (__STDC_VERSION__  199901L )
+
+// No ANSI C 1999/2000 stdint.h integer width declarations 
+
+#if _MSC_EXTENSIONS
+
+// Use Microsoft C compiler integer width declarations 
+
+typedef unsigned __int64uint64_t;
+typedef __int64 int64_t;
+typedef unsigned __int32uint32_t;
+typedef __int32 int32_t;
+typedef unsigned short  uint16_t;
+typedef short   int16_t;
+typedef unsigned char   uint8_t;
+typedef charint8_t;
+#else 
+#ifdef UNIX_LP64
+
+// Use LP64 programming model from C_FLAGS for integer width 
declarations 
+
+typedef unsigned long   uint64_t;
+typedef longint64_t;
+typedef unsigned intuint32_t;
+typedef int int32_t;
+typedef unsigned short  uint16_t;
+typedef short   int16_t;
+typedef unsigned char   uint8_t;
+typedef charint8_t;
+#else
+
+// Assume P64 programming model from C_FLAGS for integer width 
declarations 
+
+typedef unsigned long long  uint64_t;
+typedef long long   int64_t;
+typedef unsigned intuint32_t;
+typedef int int32_t;
+typedef unsigned short  uint16_t;
+typedef short   int16_t;
+typedef unsigned char   uint8_t;
+typedef charint8_t;
+#endif
+#endif
+#endif
+#endif /* __FreeBSD__ */
+
+//
+// Basic EFI types of various widths
+//
+
+typedef uint64_t   UINT64;
+typedef int64_tINT64;
+
+#ifndef _BASETSD_H_
+typedef uint32_t   UINT32;
+typedef int32_tINT32;
+#endif
+
+typedef uint16_t   UINT16;
+typedef int16_tINT16;
+typedef uint8_tUINT8;
+typedef int8_t INT8;
+
+
+#undef VOID
+#define VOIDvoid
+
+
+typedef int64_tINTN;
+typedef uint64_t   UINTN;
+
+#ifdef EFI_NT_EMULATOR
+#define POST_CODE(_Data)
+#else
+#ifdef EFI_DEBUG
+#define POST_CODE(_Data)__asm mov eax,(_Data) __asm out 0x80,al
+#else
+#define POST_CODE(_Data)
+#endif  
+#endif
+
+#define EFIERR(a)   (0x8000 | a)
+#define EFI_ERROR_MASK  0x8000
+#define EFIERR_OEM(a)   (0xc000 | a)  
+
+
+#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
+#define MAX_ADDRESS 0x
+
+#define BREAKPOINT()__asm { int 3 }
+
+//
+// Pointers must be aligned to these address to function
+//
+
+#define MIN_ALIGNMENT_SIZE  4
+
+#define ALIGN_VARIABLE(Value ,Adjustment) \
+(UINTN)Adjustment = 0; \
+if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
+(UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % 
MIN_ALIGNMENT_SIZE); \
+Value = (UINTN)Value + (UINTN)Adjustment
+
+
+//
+// Define macros to build data structure signatures from characters.
+//
+
+#define EFI_SIGNATURE_16(A,B) ((A) | (B8))
+#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | 
(EFI_SIGNATURE_16(C,D)  16))
+#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | 
((UINT64)(EFI_SIGNATURE_32(E,F,G,H))  32))
+
+//
+// EFIAPI - prototype calling convention for EFI function pointers
+// BOOTSERVICE - prototype for implementation of a boot service interface
+// RUNTIMESERVICE - 

svn commit: r263116 - in head: sys/kern sys/sys tests/sys/kern

2014-03-13 Thread Alan Somers
Author: asomers
Date: Thu Mar 13 18:42:12 2014
New Revision: 263116
URL: http://svnweb.freebsd.org/changeset/base/263116

Log:
  Replace 4.4BSD Lite's unix domain socket backpressure hack with a cleaner
  mechanism, based on the new SB_STOP sockbuf flag.  The old hack dynamically
  changed the sending sockbuf's high water mark whenever adding or removing
  data from the receiving sockbuf.  It worked for stream sockets, but it never
  worked for SOCK_SEQPACKET sockets because of their atomic nature.  If the
  sockbuf was partially full, it might return EMSGSIZE instead of blocking.
  
  The new solution is based on DragonFlyBSD's fix from commit
  3a6117bbe0ed6a87605c1e43e12a1438d8844380 on 2008-05-27.  It adds an SB_STOP
  flag to sockbufs.  Whenever uipc_send surpasses the socket's size limit, it
  sets SB_STOP on the sending sockbuf.  sbspace() will then return 0 for that
  sockbuf, causing sosend_generic and friends to block.  uipc_rcvd will
  likewise clear SB_STOP.  There are two fringe benefits: uipc_{send,rcvd} no
  longer need to call chgsbsize() on every send and receive because they don't
  change the sockbuf's high water mark.  Also, uipc_sense no longer needs to
  acquire the UIPC linkage lock, because it's simpler to compute the
  st_blksizes.
  
  There is one drawback: since sbspace() will only ever return 0 or the
  maximum, sosend_generic will allow the sockbuf to exceed its nominal maximum
  size by at most one packet of size less than the max.  I don't think that's
  a serious problem.  In fact, I'm not even positive that FreeBSD guarantees a
  socket will always stay within its nominal size limit.
  
  sys/sys/sockbuf.h
Add the SB_STOP flag and adjust sbspace()
  
  sys/sys/unpcb.h
Delete the obsolete unp_cc and unp_mbcnt fields from struct unpcb.
  
  sys/kern/uipc_usrreq.c
Adjust uipc_rcvd, uipc_send, and uipc_sense to use the SB_STOP
backpressure mechanism.  Removing obsolete unpcb fields from
db_show_unpcb.
  
  tests/sys/kern/unix_seqpacket_test.c
Clear expected failures from ATF.
  
  Obtained from:DragonFly BSD
  PR:   kern/185812
  Reviewed by:  silence from freebsd-net@ and rwatson@
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation

Modified:
  head/sys/kern/uipc_usrreq.c
  head/sys/sys/sockbuf.h
  head/sys/sys/unpcb.h
  head/tests/sys/kern/unix_seqpacket_test.c

Modified: head/sys/kern/uipc_usrreq.c
==
--- head/sys/kern/uipc_usrreq.c Thu Mar 13 18:17:18 2014(r263115)
+++ head/sys/kern/uipc_usrreq.c Thu Mar 13 18:42:12 2014(r263116)
@@ -51,7 +51,6 @@
  *
  * TODO:
  * RDM
- * distinguish datagram size limits from flow control limits in SEQPACKET
  * rethink name space problems
  * need a proper out-of-band
  */
@@ -789,7 +788,6 @@ uipc_rcvd(struct socket *so, int flags)
struct unpcb *unp, *unp2;
struct socket *so2;
u_int mbcnt, sbcc;
-   u_long newhiwat;
 
unp = sotounpcb(so);
KASSERT(unp != NULL, (uipc_rcvd: unp == NULL));
@@ -811,6 +809,15 @@ uipc_rcvd(struct socket *so, int flags)
mbcnt = so-so_rcv.sb_mbcnt;
sbcc = so-so_rcv.sb_cc;
SOCKBUF_UNLOCK(so-so_rcv);
+   /*
+* There is a benign race condition at this point.  If we're planning to
+* clear SB_STOP, but uipc_send is called on the connected socket at
+* this instant, it might add data to the sockbuf and set SB_STOP.  Then
+* we would erroneously clear SB_STOP below, even though the sockbuf is
+* full.  The race is benign because the only ill effect is to allow the
+* sockbuf to exceed its size limit, and the size limits are not
+* strictly guaranteed anyway.
+*/
UNP_PCB_LOCK(unp);
unp2 = unp-unp_conn;
if (unp2 == NULL) {
@@ -819,13 +826,9 @@ uipc_rcvd(struct socket *so, int flags)
}
so2 = unp2-unp_socket;
SOCKBUF_LOCK(so2-so_snd);
-   so2-so_snd.sb_mbmax += unp-unp_mbcnt - mbcnt;
-   newhiwat = so2-so_snd.sb_hiwat + unp-unp_cc - sbcc;
-   (void)chgsbsize(so2-so_cred-cr_uidinfo, so2-so_snd.sb_hiwat,
-   newhiwat, RLIM_INFINITY);
+   if (sbcc  so2-so_snd.sb_hiwat  mbcnt  so2-so_snd.sb_mbmax)
+   so2-so_snd.sb_flags = ~SB_STOP;
sowwakeup_locked(so2);
-   unp-unp_mbcnt = mbcnt;
-   unp-unp_cc = sbcc;
UNP_PCB_UNLOCK(unp);
return (0);
 }
@@ -836,8 +839,7 @@ uipc_send(struct socket *so, int flags, 
 {
struct unpcb *unp, *unp2;
struct socket *so2;
-   u_int mbcnt_delta, sbcc;
-   u_int newhiwat;
+   u_int mbcnt, sbcc;
int error = 0;
 
unp = sotounpcb(so);
@@ -991,27 +993,21 @@ uipc_send(struct socket *so, int flags, 
}
}
 
-   /*
-* XXXRW: While fine for SOCK_STREAM, this conflates 

svn commit: r263118 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-03-13 Thread Alexander Motin
Author: mav
Date: Thu Mar 13 19:26:26 2014
New Revision: 263118
URL: http://svnweb.freebsd.org/changeset/base/263118

Log:
  Report ZVOL block size as GEOM stripesize.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Thu Mar 13 
19:26:23 2014(r263117)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Thu Mar 13 
19:26:26 2014(r263118)
@@ -925,12 +925,16 @@ zvol_open(struct g_provider *pp, int fla
return (SET_ERROR(ENXIO));
}
 
-   if (zv-zv_total_opens == 0)
+   if (zv-zv_total_opens == 0) {
err = zvol_first_open(zv);
-   if (err) {
-   if (locked)
-   mutex_exit(spa_namespace_lock);
-   return (err);
+   if (err) {
+   if (locked)
+   mutex_exit(spa_namespace_lock);
+   return (err);
+   }
+   pp-mediasize = zv-zv_volsize;
+   pp-stripeoffset = 0;
+   pp-stripesize = zv-zv_volblocksize;
}
if ((flag  FWRITE)  (zv-zv_flags  ZVOL_RDONLY)) {
err = SET_ERROR(EROFS);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263117 - head/sys/boot

2014-03-13 Thread Ed Maste
Author: emaste
Date: Thu Mar 13 19:26:23 2014
New Revision: 263117
URL: http://svnweb.freebsd.org/changeset/base/263117

Log:
  Connect 64-bit boot ficl to the build
  
  It is not yet used, but this will ensure it doesn't get broken.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/boot/Makefile.amd64

Modified: head/sys/boot/Makefile.amd64
==
--- head/sys/boot/Makefile.amd64Thu Mar 13 18:42:12 2014
(r263116)
+++ head/sys/boot/Makefile.amd64Thu Mar 13 19:26:23 2014
(r263117)
@@ -1,6 +1,7 @@
 # $FreeBSD$
 
 SUBDIR+=   efi
+SUBDIR+=   ficl64
 SUBDIR+=   libstand32
 SUBDIR+=   zfs
 SUBDIR+=   userboot
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263113 - head/sys/x86/x86

2014-03-13 Thread Bruce Evans

On Thu, 13 Mar 2014, John Baldwin wrote:


Log:
 Correct type for malloc().

 Submitted by:  Conrad Meyer conrad.me...@isilon.com


Not so nice a cleanup as a previous one by the same author.


Modified: head/sys/x86/x86/mca.c
==
--- head/sys/x86/x86/mca.c  Thu Mar 13 16:51:40 2014(r263112)
+++ head/sys/x86/x86/mca.c  Thu Mar 13 18:11:42 2014(r263113)
@@ -700,8 +700,8 @@ cmci_setup(void)
{
int i;

-   cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state **),
-   M_MCA, M_WAITOK);
+   cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state *), M_MCA,
+   M_WAITOK);


This still spells the element type verbosely and non-robustly as
element type instead of as element object.  Better spelling:

cmc_state = malloc((mp_maxid + 1) * sizeof(*cmc_state), M_MCA,
M_WAITOK);

The variable names are confusing.  cmc_state is a doubly-indirect pointer,
but is spelled without a single p.  This was confusing enough to give the
original bug (but since all struct pointers have the same size even in
strictly portable C, this was only a style bug).  It is unclear what sort
of a pointer cmc_state is in the changed version, but using the correct
spelling automatically gets the number of stars right (since the size being
malloc()ed has a product term with a variable, the allocation must be for a
dynamic array and the element type must need a single star to modify the
result type; this star actually removes 1 of the 2 indirections, giving
a pointer to the basic struct type).

Local pointers to struct cmc_state are mostly spelled cc.

Struct member names in struct cmc_state are missing prefixes.


for (i = 0; i = mp_maxid; i++)
cmc_state[i] = malloc(sizeof(struct cmc_state) * mca_banks,
M_MCA, M_WAITOK | M_ZERO);


SImilarly, plus the order of terms in the multiplication is gratuitously
different.  I prefer the first order:

cmc_state[i] = malloc(mca_banks * sizeof(*cmc_state[i]),
M_MCA, M_WAITOK | M_ZERO);

There are 2 other malloc()s in the file.  These use the best spelling
for the sizeof() but not for variable names.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263110 - head/share/man/man4

2014-03-13 Thread John Nielsen

On Mar 13, 2014, at 10:19 AM, John-Mark Gurney j...@freebsd.org wrote:

 Author: jmg
 Date: Thu Mar 13 16:19:36 2014
 New Revision: 263110
 URL: http://svnweb.freebsd.org/changeset/base/263110
 
 Log:
  remove link to the missing AMD Geode LX SB man page... we can add it
  back once someone cares enough to write one..

You mean like this one?
http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4


 Modified:
  head/share/man/man4/crypto.4
 
 Modified: head/share/man/man4/crypto.4
 ==
 --- head/share/man/man4/crypto.4  Thu Mar 13 15:57:25 2014
 (r263109)
 +++ head/share/man/man4/crypto.4  Thu Mar 13 16:19:36 2014
 (r263110)
 @@ -107,7 +107,6 @@ crypto access device
 .El
 .Sh SEE ALSO
 .Xr aesni 4 ,
 -.Xr glxsb 4 ,
 .Xr hifn 4 ,
 .Xr ipsec 4 ,
 .Xr padlock 4 ,
 ___
 svn-src-head@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-head
 To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
 

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263120 - head/contrib/libc++/include

2014-03-13 Thread Dimitry Andric
Author: dim
Date: Thu Mar 13 23:09:48 2014
New Revision: 263120
URL: http://svnweb.freebsd.org/changeset/base/263120

Log:
  Pull in r201021 from upstream libc++ trunk:
  
Fix for PR18735 - self-assignment for map/multimap gives incorrect
results in C++03
  
  (Please note: that is an LLVM PR identifier, not a FreeBSD one.)
  
  Reported by:  rakuco
  MFC after:3 days

Modified:
  head/contrib/libc++/include/map
  head/contrib/libc++/include/unordered_map

Modified: head/contrib/libc++/include/map
==
--- head/contrib/libc++/include/map Thu Mar 13 21:06:13 2014
(r263119)
+++ head/contrib/libc++/include/map Thu Mar 13 23:09:48 2014
(r263120)
@@ -884,10 +884,12 @@ public:
 #if __cplusplus = 201103L
 __tree_ = __m.__tree_;
 #else
-__tree_.clear();
-__tree_.value_comp() = __m.__tree_.value_comp();
-__tree_.__copy_assign_alloc(__m.__tree_);
-insert(__m.begin(), __m.end());
+if (this != __m) {
+__tree_.clear();
+__tree_.value_comp() = __m.__tree_.value_comp();
+__tree_.__copy_assign_alloc(__m.__tree_);
+insert(__m.begin(), __m.end());
+}
 #endif
 return *this;
 }
@@ -1616,10 +1618,12 @@ public:
 #if __cplusplus = 201103L
 __tree_ = __m.__tree_;
 #else
-__tree_.clear();
-__tree_.value_comp() = __m.__tree_.value_comp();
-__tree_.__copy_assign_alloc(__m.__tree_);
-insert(__m.begin(), __m.end());
+if (this != __m) {
+__tree_.clear();
+__tree_.value_comp() = __m.__tree_.value_comp();
+__tree_.__copy_assign_alloc(__m.__tree_);
+insert(__m.begin(), __m.end());
+}
 #endif
 return *this;
 }

Modified: head/contrib/libc++/include/unordered_map
==
--- head/contrib/libc++/include/unordered_map   Thu Mar 13 21:06:13 2014
(r263119)
+++ head/contrib/libc++/include/unordered_map   Thu Mar 13 23:09:48 2014
(r263120)
@@ -831,12 +831,14 @@ public:
 #if __cplusplus = 201103L
 __table_ = __u.__table_;
 #else
-__table_.clear();
-__table_.hash_function() = __u.__table_.hash_function();
-__table_.key_eq() = __u.__table_.key_eq();
-__table_.max_load_factor() = __u.__table_.max_load_factor();
-__table_.__copy_assign_alloc(__u.__table_);
-insert(__u.begin(), __u.end());
+if (this != __u) {
+__table_.clear();
+__table_.hash_function() = __u.__table_.hash_function();
+__table_.key_eq() = __u.__table_.key_eq();
+__table_.max_load_factor() = __u.__table_.max_load_factor();
+__table_.__copy_assign_alloc(__u.__table_);
+insert(__u.begin(), __u.end());
+}
 #endif
 return *this;
 }
@@ -1567,12 +1569,14 @@ public:
 #if __cplusplus = 201103L
 __table_ = __u.__table_;
 #else
-__table_.clear();
-__table_.hash_function() = __u.__table_.hash_function();
-__table_.key_eq() = __u.__table_.key_eq();
-__table_.max_load_factor() = __u.__table_.max_load_factor();
-__table_.__copy_assign_alloc(__u.__table_);
-insert(__u.begin(), __u.end());
+if (this != __u) {
+__table_.clear();
+__table_.hash_function() = __u.__table_.hash_function();
+__table_.key_eq() = __u.__table_.key_eq();
+__table_.max_load_factor() = __u.__table_.max_load_factor();
+__table_.__copy_assign_alloc(__u.__table_);
+insert(__u.begin(), __u.end());
+}
 #endif
 return *this;
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263121 - head/libexec/bootpd/tools/bootptest

2014-03-13 Thread Christian Brueffer
Author: brueffer
Date: Thu Mar 13 23:31:05 2014
New Revision: 263121
URL: http://svnweb.freebsd.org/changeset/base/263121

Log:
  Re-format the license to conform to our BSD license template as much
  as possible.  This does not change the wording in any way.
  
  Remove the 3rd clause (advertising clause) of the BSD license as
  permitted by the University of Berkeley on July 22, 1999.  While the
  clause itself mentions Lawrence Berkeley Laboratory, UCB is the sole
  copyright holder of this file.
  
  Reviewed by:  imp, emaste, eadler
  MFC after:2 weeks

Modified:
  head/libexec/bootpd/tools/bootptest/print-bootp.c

Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c
==
--- head/libexec/bootpd/tools/bootptest/print-bootp.c   Thu Mar 13 23:09:48 
2014(r263120)
+++ head/libexec/bootpd/tools/bootptest/print-bootp.c   Thu Mar 13 23:31:05 
2014(r263121)
@@ -1,19 +1,18 @@
 /*
- * Copyright (c) 1988-1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988-1990
+ *  The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that: (1) source code distributions
- * retain the above copyright notice and this paragraph in its entirety, (2)
- * distributions including binary code include the above copyright notice and
- * this paragraph in its entirety in the documentation or other materials
- * provided with the distribution, and (3) all advertising materials mentioning
- * features or use of this software display the following acknowledgement:
- * ``This product includes software developed by the University of California,
- * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
- * the University nor the names of its contributors may be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
+ * modification, are permitted provided that:
+ * 1. Source code distributions retain the above copyright
+ *notice and this paragraph in its entirety
+ * 2. Distributions including binary code include the above copyright
+ *notice and this paragraph in its entirety in the documentation
+ *or other materials provided with the distribution, and 
+ * 3. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263123 - head/sys/dev/hyperv/netvsc

2014-03-13 Thread Xin LI
Author: delphij
Date: Fri Mar 14 00:47:46 2014
New Revision: 263123
URL: http://svnweb.freebsd.org/changeset/base/263123

Log:
  Hide a few messages under bootverbose.
  
  Reviewed by:  Abhishek Gupta
  MFC after:2 weeks

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Mar 14 00:12:53 
2014(r263122)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Mar 14 00:47:46 
2014(r263123)
@@ -182,7 +182,8 @@ netvsc_drv_init(void)
 static void
 netvsc_init(void)
 {
-   printf(Netvsc initializing... );
+   if (bootverbose)
+   printf(Netvsc initializing... );
 
/*
 * XXXKYS: cleanup initialization
@@ -190,10 +191,10 @@ netvsc_init(void)
if (!cold  !g_netvsc_drv.drv_inited) {
g_netvsc_drv.drv_inited = 1;
netvsc_drv_init();
-   printf(done!\n);
-   } else {
+   if (bootverbose)
+   printf(done!\n);
+   } else if (bootverbose)
printf(Already initialized!\n);
-   }
 }
 
 /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
@@ -214,7 +215,8 @@ netvsc_probe(device_t dev)
p = vmbus_get_type(dev);
if (!memcmp(p, g_net_vsc_device_type.data, sizeof(hv_guid))) {
device_set_desc(dev, Synthetic Network Interface);
-   printf(Netvsc probe... DONE \n);
+   if (bootverbose)
+   printf(Netvsc probe... DONE \n);
 
return (0);
}
@@ -300,7 +302,8 @@ netvsc_detach(device_t dev)
 {
struct hv_device *hv_device = vmbus_get_devctx(dev); 
 
-   printf(netvsc_detach\n);
+   if (bootverbose)
+   printf(netvsc_detach\n);
 
/*
 * XXXKYS:  Need to clean up all our
@@ -895,7 +898,8 @@ hn_stop(hn_softc_t *sc)
 
ifp = sc-hn_ifp;
 
-   printf( Closing Device ...\n);
+   if (bootverbose)
+   printf( Closing Device ...\n);
 
ifp-if_drv_flags = ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
sc-hn_initdone = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263124 - head/sys/boot/uboot/common

2014-03-13 Thread Ian Lepore
Author: ian
Date: Fri Mar 14 00:49:02 2014
New Revision: 263124
URL: http://svnweb.freebsd.org/changeset/base/263124

Log:
  Fix an uninitialized variable error I perpetrated when splitting some
  code into a separate function.  Pass the missing value from main() to
  the probe_disks() function.

Modified:
  head/sys/boot/uboot/common/main.c

Modified: head/sys/boot/uboot/common/main.c
==
--- head/sys/boot/uboot/common/main.c   Fri Mar 14 00:47:46 2014
(r263123)
+++ head/sys/boot/uboot/common/main.c   Fri Mar 14 00:49:02 2014
(r263124)
@@ -298,9 +298,10 @@ get_load_device(int *type, int *unit, in
 } 
 
 static int
-probe_disks(int load_type, int load_unit, int load_slice, int load_partition)
+probe_disks(int devidx, int load_type, int load_unit, int load_slice, 
+int load_partition)
 {
-   int i, open_result, unit;
+   int open_result, unit;
struct open_file f;
 
currdev.d_disk.slice = load_slice;
@@ -317,7 +318,7 @@ probe_disks(int load_type, int load_unit
printf(Checking unit=%d slice=%d partition=%d...,
currdev.d_unit, currdev.d_disk.slice, 
currdev.d_disk.partition);
-   open_result = devsw[i]-dv_open(f, currdev);
+   open_result = devsw[devidx]-dv_open(f, currdev);
if (open_result == 0) {
printf( good.\n);
return (0);
@@ -337,7 +338,7 @@ probe_disks(int load_type, int load_unit
printf(Checking unit=%d slice=%d partition=%d...,
currdev.d_unit, currdev.d_disk.slice, 
currdev.d_disk.partition);
-   open_result = devsw[i]-dv_open(f, currdev);
+   open_result = devsw[devidx]-dv_open(f, currdev);
if (open_result == 0) {
printf( good.\n);
return (0);
@@ -351,7 +352,7 @@ probe_disks(int load_type, int load_unit
printf(Checking unit=%d slice=%d partition=%d...,
currdev.d_unit, currdev.d_disk.slice,
currdev.d_disk.partition);
-   open_result = devsw[i]-dv_open(f,currdev);
+   open_result = devsw[devidx]-dv_open(f,currdev);
if (open_result == 0) {
printf(good.\n);
return (0);
@@ -440,7 +441,7 @@ main(void)
 
if ((load_type == -1 || (load_type  DEV_TYP_STOR)) 
strcmp(devsw[i]-dv_name, disk) == 0) {
-   if (probe_disks(load_type, load_unit, load_slice, 
+   if (probe_disks(i, load_type, load_unit, load_slice, 
load_partition) == 0)
break;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263129 - head/sys/kern

2014-03-13 Thread Bryan Drewery
Author: bdrewery
Date: Fri Mar 14 01:17:11 2014
New Revision: 263129
URL: http://svnweb.freebsd.org/changeset/base/263129

Log:
  Combine similar code from vprintf(9) and log(9).
  
  MFC after:2 weeks

Modified:
  head/sys/kern/subr_prf.c

Modified: head/sys/kern/subr_prf.c
==
--- head/sys/kern/subr_prf.cFri Mar 14 01:10:54 2014(r263128)
+++ head/sys/kern/subr_prf.cFri Mar 14 01:17:11 2014(r263129)
@@ -248,23 +248,18 @@ ttyprintf(struct tty *tp, const char *fm
return (retval);
 }
 
-/*
- * Log writes to the log buffer, and guarantees not to sleep (so can be
- * called by interrupt routines).  If there is no process reading the
- * log yet, it writes to the console also.
- */
-void
-log(int level, const char *fmt, ...)
+static int
+_vprintf(int level, int flags, const char *fmt, va_list ap)
 {
-   va_list ap;
struct putchar_arg pca;
+   int retval;
 #ifdef PRINTF_BUFR_SIZE
char bufr[PRINTF_BUFR_SIZE];
 #endif
 
pca.tty = NULL;
pca.pri = level;
-   pca.flags = log_open ? TOLOG : TOCONS;
+   pca.flags = flags;
 #ifdef PRINTF_BUFR_SIZE
pca.p_bufr = bufr;
pca.p_next = pca.p_bufr;
@@ -272,12 +267,11 @@ log(int level, const char *fmt, ...)
pca.remain = sizeof(bufr);
*pca.p_next = '\0';
 #else
+   /* Don't buffer console output. */
pca.p_bufr = NULL;
 #endif
 
-   va_start(ap, fmt);
-   kvprintf(fmt, putchar, pca, 10, ap);
-   va_end(ap);
+   retval = kvprintf(fmt, putchar, pca, 10, ap);
 
 #ifdef PRINTF_BUFR_SIZE
/* Write any buffered console/log output: */
@@ -289,6 +283,24 @@ log(int level, const char *fmt, ...)
cnputs(pca.p_bufr);
}
 #endif
+
+   return (retval);
+}
+
+/*
+ * Log writes to the log buffer, and guarantees not to sleep (so can be
+ * called by interrupt routines).  If there is no process reading the
+ * log yet, it writes to the console also.
+ */
+void
+log(int level, const char *fmt, ...)
+{
+   va_list ap;
+
+   va_start(ap, fmt);
+   (void)_vprintf(level, log_open ? TOLOG : TOCONS, fmt, ap);
+   va_end(ap);
+
msgbuftrigger = 1;
 }
 
@@ -374,35 +386,9 @@ printf(const char *fmt, ...)
 int
 vprintf(const char *fmt, va_list ap)
 {
-   struct putchar_arg pca;
int retval;
-#ifdef PRINTF_BUFR_SIZE
-   char bufr[PRINTF_BUFR_SIZE];
-#endif
 
-   pca.tty = NULL;
-   pca.flags = TOCONS | TOLOG;
-   pca.pri = -1;
-#ifdef PRINTF_BUFR_SIZE
-   pca.p_bufr = bufr;
-   pca.p_next = pca.p_bufr;
-   pca.n_bufr = sizeof(bufr);
-   pca.remain = sizeof(bufr);
-   *pca.p_next = '\0';
-#else
-   /* Don't buffer console output. */
-   pca.p_bufr = NULL;
-#endif
-
-   retval = kvprintf(fmt, putchar, pca, 10, ap);
-
-#ifdef PRINTF_BUFR_SIZE
-   /* Write any buffered console/log output: */
-   if (*pca.p_bufr != '\0') {
-   cnputs(pca.p_bufr);
-   msglogstr(pca.p_bufr, pca.pri, /*filter_cr*/ 1);
-   }
-#endif
+   retval = _vprintf(-1, TOCONS | TOLOG, fmt, ap);
 
if (!panicstr)
msgbuftrigger = 1;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263130 - head/sys/fs/tmpfs

2014-03-13 Thread Bryan Drewery
Author: bdrewery
Date: Fri Mar 14 01:43:55 2014
New Revision: 263130
URL: http://svnweb.freebsd.org/changeset/base/263130

Log:
  Fix -o size less than PAGE_SIZE resulting in SIZE_MAX being used.
  
  Discussed with:   kib
  MFC after:2 weeks

Modified:
  head/sys/fs/tmpfs/tmpfs_vfsops.c

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cFri Mar 14 01:17:11 2014
(r263129)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cFri Mar 14 01:43:55 2014
(r263130)
@@ -200,11 +200,13 @@ tmpfs_mount(struct mount *mp)
 * allowed to use, based on the maximum size the user passed in
 * the mount structure.  A value of zero is treated as if the
 * maximum available space was requested. */
-   if (size_max  PAGE_SIZE || size_max  OFF_MAX - PAGE_SIZE ||
+   if (size_max == 0 || size_max  OFF_MAX - PAGE_SIZE ||
(SIZE_MAX  OFF_MAX  size_max / PAGE_SIZE = SIZE_MAX))
pages = SIZE_MAX;
-   else
+   else {
+   size_max = roundup(size_max, PAGE_SIZE);
pages = howmany(size_max, PAGE_SIZE);
+   }
MPASS(pages  0);
 
if (nodes_max = 3) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263110 - head/share/man/man4

2014-03-13 Thread John-Mark Gurney
John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 -0600:
 On Mar 13, 2014, at 10:19 AM, John-Mark Gurney j...@freebsd.org wrote:
 
  Author: jmg
  Date: Thu Mar 13 16:19:36 2014
  New Revision: 263110
  URL: http://svnweb.freebsd.org/changeset/base/263110
  
  Log:
   remove link to the missing AMD Geode LX SB man page... we can add it
   back once someone cares enough to write one..
 
 You mean like this one?
 http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4

The problems of checking on an amd64 box... :(

Actually, how are we suppose to handle links to arch dependant man
pages in arch independant man pages?  I did this check on an amd64 box,
so the page glxsb didn't get installed...  Should we just always
install these man pages on all arches then?  Or are we fine w/
references to non-existant pages (on some arches)?

Or should glxsb.4 be moved to an arch independant dir?

I'll fix properly once the above questions get answered...

  Modified:
   head/share/man/man4/crypto.4
  
  Modified: head/share/man/man4/crypto.4
  ==
  --- head/share/man/man4/crypto.4Thu Mar 13 15:57:25 2014
  (r263109)
  +++ head/share/man/man4/crypto.4Thu Mar 13 16:19:36 2014
  (r263110)
  @@ -107,7 +107,6 @@ crypto access device
  .El
  .Sh SEE ALSO
  .Xr aesni 4 ,
  -.Xr glxsb 4 ,
  .Xr hifn 4 ,
  .Xr ipsec 4 ,
  .Xr padlock 4 ,
  ___
  svn-src-head@freebsd.org mailing list
  http://lists.freebsd.org/mailman/listinfo/svn-src-head
  To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
  

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 All that I will do, has been done, All that I have, has not.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263131 - head/sys/fs/tmpfs

2014-03-13 Thread Bryan Drewery
Author: bdrewery
Date: Fri Mar 14 02:10:30 2014
New Revision: 263131
URL: http://svnweb.freebsd.org/changeset/base/263131

Log:
  Cleanup redundant logic and add some comments to help explain how
  it works in lieu of potentially less clear code.
  
  Sponsored by: EMC / Isilon Storage Division
  Discussed with:   Russell Cattelan

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==
--- head/sys/fs/tmpfs/tmpfs_subr.c  Fri Mar 14 01:43:55 2014
(r263130)
+++ head/sys/fs/tmpfs/tmpfs_subr.c  Fri Mar 14 02:10:30 2014
(r263131)
@@ -348,6 +348,9 @@ tmpfs_dirent_hash(const char *name, u_in
 static __inline off_t
 tmpfs_dirent_cookie(struct tmpfs_dirent *de)
 {
+   if (de == NULL)
+   return (TMPFS_DIRCOOKIE_EOF);
+
MPASS(de-td_cookie = TMPFS_DIRCOOKIE_MIN);
 
return (de-td_cookie);
@@ -1155,6 +1158,15 @@ tmpfs_dir_getdents(struct tmpfs_node *no
TMPFS_VALIDATE_DIR(node);
 
off = 0;
+
+   /*
+* Lookup the node from the current offset.  The starting offset of
+* 0 will lookup both '.' and '..', and then the first real entry,
+* or EOF if there are none.  Then find all entries for the dir that
+* fit into the buffer.  Once no more entries are found (de == NULL),
+* the offset is set to TMPFS_DIRCOOKIE_EOF, which will cause the next
+* call to return 0.
+*/
switch (uio-uio_offset) {
case TMPFS_DIRCOOKIE_DOT:
error = tmpfs_dir_getdotdent(node, uio);
@@ -1168,12 +1180,10 @@ tmpfs_dir_getdents(struct tmpfs_node *no
if (error != 0)
return (error);
de = tmpfs_dir_first(node, dc);
-   if (de == NULL)
-   uio-uio_offset = TMPFS_DIRCOOKIE_EOF;
-   else
-   uio-uio_offset = tmpfs_dirent_cookie(de);
+   uio-uio_offset = tmpfs_dirent_cookie(de);
if (cnt != 0)
cookies[(*ncookies)++] = off = uio-uio_offset;
+   /* EOF. */
if (de == NULL)
return (0);
break;
@@ -1252,10 +1262,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no
if (error == 0) {
de = tmpfs_dir_next(node, dc);
if (cnt != 0) {
-   if (de == NULL)
-   off = TMPFS_DIRCOOKIE_EOF;
-   else
-   off = tmpfs_dirent_cookie(de);
+   off = tmpfs_dirent_cookie(de);
MPASS(*ncookies  cnt);
cookies[(*ncookies)++] = off;
}
@@ -1263,12 +1270,8 @@ tmpfs_dir_getdents(struct tmpfs_node *no
} while (error == 0  uio-uio_resid  0  de != NULL);
 
/* Update the offset and cache. */
-   if (cnt == 0) {
-   if (de == NULL)
-   off = TMPFS_DIRCOOKIE_EOF;
-   else
-   off = tmpfs_dirent_cookie(de);
-   }
+   if (cnt == 0)
+   off = tmpfs_dirent_cookie(de);
 
uio-uio_offset = off;
node-tn_dir.tn_readdir_lastn = off;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r262972 - head/sys/dev/usb/input

2014-03-13 Thread Rui Paulo
On 10 Mar 2014, at 01:52, Hans Petter Selasky hsela...@freebsd.org wrote:

 Author: hselasky
 Date: Mon Mar 10 08:52:30 2014
 New Revision: 262972
 URL: http://svnweb.freebsd.org/changeset/base/262972
 
 Log:
  Ignore USB keyboard driver calls from critical sections.
 
  Reported by: Oliver Pinter oliver.p...@gmail.com
  MFC after:   1 week
 
 Modified:
  head/sys/dev/usb/input/ukbd.c
 
 Modified: head/sys/dev/usb/input/ukbd.c
 ==
 --- head/sys/dev/usb/input/ukbd.c Mon Mar 10 06:41:48 2014
 (r262971)
 +++ head/sys/dev/usb/input/ukbd.c Mon Mar 10 08:52:30 2014
 (r262972)
 @@ -1909,6 +1909,12 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, 
   int result;
 
   /*
 +  * XXX Check of someone is calling us from a critical section:
 +  */
 + if (curthread-td_critnest != 0)
 + return (EDEADLK);

Shouldn't this panic?

--
Rui Paulo



___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263133 - head/usr.sbin/bsdconfig

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 02:37:39 2014
New Revision: 263133
URL: http://svnweb.freebsd.org/changeset/base/263133

Log:
  Remove indexfile from debug statement as it is already logged by
  f_index_menusel_command() used just-prior to this debug statement.
  Also, log the arguments being passed to the resword.

Modified:
  head/usr.sbin/bsdconfig/bsdconfig

Modified: head/usr.sbin/bsdconfig/bsdconfig
==
--- head/usr.sbin/bsdconfig/bsdconfig   Fri Mar 14 02:37:07 2014
(r263132)
+++ head/usr.sbin/bsdconfig/bsdconfig   Fri Mar 14 02:37:39 2014
(r263133)
@@ -315,8 +315,7 @@ if [ $pgm != bsdconfig ]; then
if indexfile=$( f_index_file $pgm ) 
   cmd=$( f_index_menusel_command $indexfile $pgm )
then
-   f_dprintf pgm=[%s] indexfile=[%s] cmd=[%s] \
- $pgm $indexfile $cmd
+   f_dprintf pgm=[%s] cmd=[%s] *=[%s] $pgm $cmd $*
exec $cmd $@ || exit 1
else
f_include $BSDCFG_SHARE/script.subr
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263134 - head/usr.sbin/bsdconfig

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 02:38:56 2014
New Revision: 263134
URL: http://svnweb.freebsd.org/changeset/base/263134

Log:
  Add debug statement just before attempting to exec a module.

Modified:
  head/usr.sbin/bsdconfig/bsdconfig

Modified: head/usr.sbin/bsdconfig/bsdconfig
==
--- head/usr.sbin/bsdconfig/bsdconfig   Fri Mar 14 02:37:39 2014
(r263133)
+++ head/usr.sbin/bsdconfig/bsdconfig   Fri Mar 14 02:38:56 2014
(r263134)
@@ -381,6 +381,7 @@ if [ $1 ]; then
# Not reached
fi
 
+   f_dprintf cmd=[%s] *=[%s] $cmd $*
shift
exec $cmd ${USE_XDIALOG:+-X} $@ || exit 1
# Not reached
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263136 - in head/usr.sbin/bsdconfig: . share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 02:40:52 2014
New Revision: 263136
URL: http://svnweb.freebsd.org/changeset/base/263136

Log:
  Update copyright.

Modified:
  head/usr.sbin/bsdconfig/bsdconfig
  head/usr.sbin/bsdconfig/share/device.subr

Modified: head/usr.sbin/bsdconfig/bsdconfig
==
--- head/usr.sbin/bsdconfig/bsdconfig   Fri Mar 14 02:39:42 2014
(r263135)
+++ head/usr.sbin/bsdconfig/bsdconfig   Fri Mar 14 02:40:52 2014
(r263136)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #-
 # Copyright (c) 2012 Ron McDowell
-# Copyright (c) 2012-2013 Devin Teske
+# Copyright (c) 2012-2014 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Modified: head/usr.sbin/bsdconfig/share/device.subr
==
--- head/usr.sbin/bsdconfig/share/device.subr   Fri Mar 14 02:39:42 2014
(r263135)
+++ head/usr.sbin/bsdconfig/share/device.subr   Fri Mar 14 02:40:52 2014
(r263136)
@@ -1,6 +1,6 @@
 if [ ! $_DEVICE_SUBR ]; then _DEVICE_SUBR=1
 #
-# Copyright (c) 2012-2013 Devin Teske
+# Copyright (c) 2012-2014 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263137 - head/usr.sbin/bsdconfig/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 02:50:32 2014
New Revision: 263137
URL: http://svnweb.freebsd.org/changeset/base/263137

Log:
  Fix future namespace issues for functions taking $var_to_set -- functions
  taking a variable to set need to make sure they protect their locals; if
  $var_to_set positional argument coincides with a local the expected call
  to `setvar' will fail to reach outside of the function's namespace. When
  such collisions are experienced (as I did in the rewrite of usermgmt) the
  solution is to append a full or abbreviated version of the function name
  to the local (ultimately eliminating collisions). This is rarely needed
  and only occurs when you have a lot of like-named functions that pass
  very similar $var_to_set positional arguments to each other (such as-is
  the case with an expansive library such as `dialog.subr').

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==
--- head/usr.sbin/bsdconfig/share/dialog.subr   Fri Mar 14 02:40:52 2014
(r263136)
+++ head/usr.sbin/bsdconfig/share/dialog.subr   Fri Mar 14 02:50:32 2014
(r263137)
@@ -1,6 +1,6 @@
 if [ ! $_DIALOG_SUBR ]; then _DIALOG_SUBR=1
 #
-# Copyright (c) 2006-2013 Devin Teske
+# Copyright (c) 2006-2014 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -469,16 +469,17 @@ f_dialog_menu_constrain()
# Print debug warnings if any given (non-NULL) argument are invalid
# NOTE: Don't change the name of $__{var,min,}{height,width,rows}
#
-   local __height __width __rows
+   local __height_menu_constrain __width_menu_constrain
+   local __rows_menu_constrain
local __arg __cp __fname=f_dialog_menu_constrain 
for __arg in height width rows; do
debug= f_getvar __var_$__arg __cp
[ $__cp ] || continue
-   if ! debug= f_getvar $__cp __$__arg; then
+   if ! debug= f_getvar $__cp __${__arg}_menu_constrain; then
f_dprintf %s: var_%s variable \`%s' not set \
  $__fname $__arg $__cp
__retval=$FAILURE
-   elif ! eval f_isinteger \$__$__arg; then
+   elif ! eval f_isinteger \$__${__arg}_menu_constrain; then
f_dprintf %s: var_%s variable value not a number \
  $__fname $__arg
__retval=$FAILURE
@@ -502,9 +503,11 @@ f_dialog_menu_constrain()
 
# Adjust height if desired
if [ $__var_height ]; then
-   if [ $__height -lt ${__min_height:-0} ]; then
+   if [ $__height_menu_constrain -lt ${__min_height:-0} ]; then
setvar $__var_height $__min_height
-   elif [ $__height -gt $__max_height_menu_constrain ]; then
+   elif [ $__height_menu_constrain -gt \
+  $__max_height_menu_constrain ]
+   then
setvar $__var_height $__max_height_menu_constrain
fi
fi
@@ -516,9 +519,11 @@ f_dialog_menu_constrain()
else
: ${__min_width:=${DIALOG_MIN_WIDTH:-24}}
fi
-   if [ $__width -lt $__min_width ]; then
+   if [ $__width_menu_constrain -lt $__min_width ]; then
setvar $__var_width $__min_width
-   elif [ $__width -gt $__max_width_menu_constrain ]; then
+   elif [ $__width_menu_constrain -gt \
+  $__max_width_menu_constrain ]
+   then
setvar $__var_width $__max_width_menu_constrain
fi
fi
@@ -531,16 +536,20 @@ f_dialog_menu_constrain()
: ${__min_rows:=0}
fi
 
-   local __max_rows=$(( $__max_height_menu_constrain - 7 ))
+   local __max_rows_menu_constrain=$((
+   $__max_height_menu_constrain - 7
+   ))
# If prompt_len is zero (no prompt), bump the max-rows by 1
# Default assumption is (if no argument) that there's no prompt
-   [ ${__prompt_len:-0} -gt 0 ] ||
-   __max_rows=$(( $__max_rows + 1 ))
+   [ ${__prompt_len:-0} -gt 0 ] || __max_rows_menu_constrain=$((
+   $__max_rows_menu_constrain + 1
+   ))
 
-   if [ $__rows -lt $__min_rows ]; then
+   if [ $__rows_menu_constrain -lt $__min_rows ]; then
setvar $__var_rows $__min_rows
-   elif [ $__rows -gt $__max_rows ]; then
-   setvar $__var_rows $__max_rows
+   elif [ $__rows_menu_constrain -gt $__max_rows_menu_constrain ]
+   then
+   

svn commit: r263138 - in head/share: doc/papers/diskperf doc/papers/fsinterface doc/papers/kernmalloc doc/papers/kerntune doc/papers/newvm doc/papers/relengr doc/papers/sysperf doc/psd/05.sysman do...

2014-03-13 Thread Eitan Adler
Author: eadler
Date: Fri Mar 14 02:53:36 2014
New Revision: 263138
URL: http://svnweb.freebsd.org/changeset/base/263138

Log:
  Set nokeyword property on some files which don't already have it.  This will 
allow my next commit.

Modified:
Directory Properties:
  head/share/doc/papers/diskperf/appendix.ms   (props changed)
  head/share/doc/papers/diskperf/equip.ms   (props changed)
  head/share/doc/papers/diskperf/methodology.ms   (props changed)
  head/share/doc/papers/diskperf/results.ms   (props changed)
  head/share/doc/papers/fsinterface/abstract.ms   (props changed)
  head/share/doc/papers/fsinterface/slides.t   (props changed)
  head/share/doc/papers/kernmalloc/alloc.fig   (props changed)
  head/share/doc/papers/kernmalloc/appendix.t   (props changed)
  head/share/doc/papers/kernmalloc/usage.tbl   (props changed)
  head/share/doc/papers/kerntune/0.t   (props changed)
  head/share/doc/papers/kerntune/2.t   (props changed)
  head/share/doc/papers/kerntune/3.t   (props changed)
  head/share/doc/papers/kerntune/4.t   (props changed)
  head/share/doc/papers/kerntune/fig2.pic   (props changed)
  head/share/doc/papers/newvm/0.t   (props changed)
  head/share/doc/papers/relengr/1.t   (props changed)
  head/share/doc/papers/relengr/2.t   (props changed)
  head/share/doc/papers/relengr/3.t   (props changed)
  head/share/doc/papers/sysperf/0.t   (props changed)
  head/share/doc/papers/sysperf/1.t   (props changed)
  head/share/doc/papers/sysperf/2.t   (props changed)
  head/share/doc/papers/sysperf/3.t   (props changed)
  head/share/doc/papers/sysperf/6.t   (props changed)
  head/share/doc/papers/sysperf/7.t   (props changed)
  head/share/doc/papers/sysperf/a1.t   (props changed)
  head/share/doc/papers/sysperf/a2.t   (props changed)
  head/share/doc/psd/05.sysman/0.t   (props changed)
  head/share/doc/psd/05.sysman/1.0.t   (props changed)
  head/share/doc/psd/05.sysman/1.3.t   (props changed)
  head/share/doc/psd/05.sysman/1.4.t   (props changed)
  head/share/doc/psd/05.sysman/1.5.t   (props changed)
  head/share/doc/psd/05.sysman/1.6.t   (props changed)
  head/share/doc/psd/05.sysman/1.7.t   (props changed)
  head/share/doc/psd/05.sysman/2.0.t   (props changed)
  head/share/doc/psd/05.sysman/2.1.t   (props changed)
  head/share/doc/psd/05.sysman/2.2.t   (props changed)
  head/share/doc/psd/05.sysman/2.4.t   (props changed)
  head/share/doc/psd/05.sysman/2.5.t   (props changed)
  head/share/doc/psd/05.sysman/a.t   (props changed)
  head/share/doc/psd/18.gprof/abstract.me   (props changed)
  head/share/doc/psd/18.gprof/gathering.me   (props changed)
  head/share/doc/psd/18.gprof/header.me   (props changed)
  head/share/doc/psd/18.gprof/intro.me   (props changed)
  head/share/doc/psd/18.gprof/postp.me   (props changed)
  head/share/doc/psd/18.gprof/postp1.pic   (props changed)
  head/share/doc/psd/18.gprof/postp2.pic   (props changed)
  head/share/doc/psd/18.gprof/postp3.pic   (props changed)
  head/share/doc/psd/18.gprof/pres1.pic   (props changed)
  head/share/doc/psd/18.gprof/pres2.pic   (props changed)
  head/share/doc/psd/18.gprof/present.me   (props changed)
  head/share/doc/psd/18.gprof/profiling.me   (props changed)
  head/share/doc/psd/18.gprof/refs.me   (props changed)
  head/share/doc/psd/20.ipctut/dgramread.c   (props changed)
  head/share/doc/psd/20.ipctut/dgramsend.c   (props changed)
  head/share/doc/psd/20.ipctut/pipe.c   (props changed)
  head/share/doc/psd/20.ipctut/socketpair.c   (props changed)
  head/share/doc/psd/20.ipctut/strchkread.c   (props changed)
  head/share/doc/psd/20.ipctut/streamread.c   (props changed)
  head/share/doc/psd/20.ipctut/streamwrite.c   (props changed)
  head/share/doc/psd/20.ipctut/tutor.me   (props changed)
  head/share/doc/psd/20.ipctut/udgramread.c   (props changed)
  head/share/doc/psd/20.ipctut/udgramsend.c   (props changed)
  head/share/doc/psd/20.ipctut/ustreamread.c   (props changed)
  head/share/doc/psd/20.ipctut/ustreamwrite.c   (props changed)
  head/share/doc/psd/21.ipc/0.t   (props changed)
  head/share/doc/psd/21.ipc/1.t   (props changed)
  head/share/doc/psd/21.ipc/2.t   (props changed)
  head/share/doc/smm/01.setup/1.t   (props changed)
  head/share/doc/smm/01.setup/6.t   (props changed)
  head/share/doc/smm/02.config/0.t   (props changed)
  head/share/doc/smm/02.config/1.t   (props changed)
  head/share/doc/smm/02.config/2.t   (props changed)
  head/share/doc/smm/02.config/3.t   (props changed)
  head/share/doc/smm/02.config/4.t   (props changed)
  head/share/doc/smm/02.config/5.t   (props changed)
  head/share/doc/smm/02.config/a.t   (props changed)
  head/share/doc/smm/02.config/b.t   (props changed)
  head/share/doc/smm/02.config/c.t   (props changed)
  head/share/doc/smm/02.config/d.t   (props changed)
  head/share/doc/smm/02.config/e.t   (props changed)
  head/share/doc/smm/04.quotas/quotas.ms   (props changed)
  head/share/doc/smm/05.fastfs/0.t   (props changed)
  head/share/doc/smm/05.fastfs/1.t   (props changed)
  

svn commit: r263139 - in head/usr.sbin/bsdconfig: share timezone/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 02:56:49 2014
New Revision: 263139
URL: http://svnweb.freebsd.org/changeset/base/263139

Log:
  Remove useless NULL string '' in compound strings. Look very closely.

Modified:
  head/usr.sbin/bsdconfig/share/keymap.subr
  head/usr.sbin/bsdconfig/timezone/share/menus.subr

Modified: head/usr.sbin/bsdconfig/share/keymap.subr
==
--- head/usr.sbin/bsdconfig/share/keymap.subr   Fri Mar 14 02:53:36 2014
(r263138)
+++ head/usr.sbin/bsdconfig/share/keymap.subr   Fri Mar 14 02:56:49 2014
(r263139)
@@ -165,7 +165,7 @@ f_keymap_get_all()
marks[keym] = mark
name = keym
gsub(/[^[:alnum:]_]/, _, name)
-   gsub(/'\''/, '\''\\'\'''\'', desc);
+   gsub(/'\''/, '\''\\'\'\'', desc);
printf f_keymap_checkfile %s   \
   f_keymap_register %s '\'%s\'' %s %u\n,
   keym, name, desc, keym, mark

Modified: head/usr.sbin/bsdconfig/timezone/share/menus.subr
==
--- head/usr.sbin/bsdconfig/timezone/share/menus.subr   Fri Mar 14 02:53:36 
2014(r263138)
+++ head/usr.sbin/bsdconfig/timezone/share/menus.subr   Fri Mar 14 02:56:49 
2014(r263139)
@@ -104,7 +104,7 @@ f_make_menus_awk='
 function add_zone_n_to_country_menu(tlc, n)
 {
zone_title = ENVIRON[country_ tlc _descr_ n]
-   gsub(/'\''/, '\''\\'\'''\'', zone_title)
+   gsub(/'\''/, '\''\\'\'\'', zone_title)
country_menu_list[tlc] = country_menu_list[tlc] \
( length(country_menu_list[tlc])  0 ? \n :  ) \
n  '\'' zone_title '\''
@@ -121,7 +121,7 @@ BEGIN {
{
tlc = countries[cp]
title = ENVIRON[country_ tlc _name]
-   gsub(/'\''/, '\''\\'\'''\'', title)
+   gsub(/'\''/, '\''\\'\'\'', title)
nzones = ENVIRON[country_ tlc _nzones]
if (!nzones)
{
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263140 - in head: . contrib/mdocml etc etc/defaults etc/mtree etc/rc.d gnu/usr.bin/groff/tmac include lib lib/libipx release/picobsd/bridge release/picobsd/qemu rescue/rescue sbin/ifco...

2014-03-13 Thread Gleb Smirnoff
Author: glebius
Date: Fri Mar 14 02:58:48 2014
New Revision: 263140
URL: http://svnweb.freebsd.org/changeset/base/263140

Log:
  Remove IPX support.
  
  IPX was a network transport protocol in Novell's NetWare network operating
  system from late 80s and then 90s. The NetWare itself switched to TCP/IP
  as default transport in 1998. Later, in this century the Novell Open
  Enterprise Server became successor of Novell NetWare. The last release
  that claimed to still support IPX was OES 2 in 2007. Routing equipment
  vendors (e.g. Cisco) discontinued support for IPX in 2011.
  
  Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.

Deleted:
  head/etc/rc.d/ipxrouted
  head/lib/libipx/
  head/sbin/ifconfig/af_ipx.c
  head/share/man/man4/ef.4
  head/sys/modules/if_ef/
  head/sys/net/if_ef.c
  head/sys/netipx/
  head/tools/build/options/WITHOUT_IPX
  head/tools/build/options/WITHOUT_IPX_SUPPORT
  head/tools/regression/netipx/
  head/usr.bin/netstat/ipx.c
  head/usr.sbin/IPXrouted/
Modified:
  head/Makefile.inc1
  head/ObsoleteFiles.inc
  head/contrib/mdocml/lib.in
  head/etc/defaults/rc.conf
  head/etc/mtree/BSD.include.dist
  head/etc/network.subr
  head/etc/nsmb.conf
  head/etc/rc.d/Makefile
  head/etc/rc.d/routing
  head/gnu/usr.bin/groff/tmac/fr.ISO8859-1
  head/gnu/usr.bin/groff/tmac/ru.KOI8-R
  head/include/Makefile
  head/lib/Makefile
  head/release/picobsd/bridge/crunch.conf
  head/release/picobsd/qemu/crunch.conf
  head/rescue/rescue/Makefile
  head/sbin/ifconfig/Makefile
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/ifconfig.c
  head/sbin/route/route.8
  head/share/man/man4/Makefile
  head/share/man/man4/netgraph.4
  head/share/man/man4/ng_iface.4
  head/share/man/man5/nsmb.conf.5
  head/share/man/man5/rc.conf.5
  head/share/man/man5/src.conf.5
  head/share/man/man7/hier.7
  head/share/man/man9/netisr.9
  head/share/mk/bsd.libnames.mk
  head/share/mk/bsd.own.mk
  head/sys/Makefile
  head/sys/amd64/amd64/machdep.c
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/i386/i386/machdep.c
  head/sys/kern/Make.tags.inc
  head/sys/kern/kern_jail.c
  head/sys/mips/rmi/rootfs_list.txt
  head/sys/modules/Makefile
  head/sys/modules/arcnet/Makefile
  head/sys/modules/if_tun/Makefile
  head/sys/modules/netgraph/iface/Makefile
  head/sys/modules/smbfs/Makefile
  head/sys/modules/sppp/Makefile
  head/sys/modules/wlan/Makefile
  head/sys/net/if_arcsubr.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_fddisubr.c
  head/sys/net/if_iso88025subr.c
  head/sys/net/if_loop.c
  head/sys/net/if_spppfr.c
  head/sys/net/if_spppsubr.c
  head/sys/net/if_tun.c
  head/sys/net/if_types.h
  head/sys/net/netisr.h
  head/sys/net/rtsock.c
  head/sys/net80211/ieee80211_ioctl.c
  head/sys/netgraph/ng_cisco.c
  head/sys/netgraph/ng_iface.c
  head/sys/netgraph/ng_iface.h
  head/sys/netgraph/ng_ksocket.c
  head/sys/netinet/in_proto.c
  head/sys/netsmb/netbios.h
  head/sys/pc98/pc98/machdep.c
  head/sys/security/mac_biba/mac_biba.c
  head/sys/security/mac_lomac/mac_lomac.c
  head/sys/sys/param.h
  head/sys/sys/priv.h
  head/tools/bsdbox/Makefile
  head/tools/bsdbox/Makefile.net
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/tools/tools/nanobsd/gateworks/common
  head/usr.bin/kdump/kdump.c
  head/usr.bin/netstat/Makefile
  head/usr.bin/netstat/if.c
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.1
  head/usr.bin/netstat/netstat.h
  head/usr.bin/netstat/route.c
  head/usr.sbin/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Mar 14 02:56:49 2014(r263139)
+++ head/Makefile.inc1  Fri Mar 14 02:58:48 2014(r263140)
@@ -1486,7 +1486,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1
${_lib_atf} \
lib/libbz2 ${_libcom_err} lib/libcrypt \
lib/libelf lib/libexpat \
-   ${_lib_libgssapi} ${_lib_libipx} \
+   ${_lib_libgssapi} \
lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \
${_lib_libcapsicum} \
lib/ncurses/ncurses lib/ncurses/ncursesw \
@@ -1588,10 +1588,6 @@ kerberos5/lib/libheimsqlite__L: lib/libt
 _lib_libgssapi=lib/libgssapi
 .endif
 
-.if ${MK_IPX} != no
-_lib_libipx=   lib/libipx
-.endif
-
 .if ${MK_KERBEROS} != no
 _kerberos5_lib=kerberos5/lib
 _kerberos5_lib_libasn1= kerberos5/lib/libasn1

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Mar 14 02:56:49 2014(r263139)
+++ head/ObsoleteFiles.inc  Fri Mar 14 02:58:48 2014(r263140)
@@ -38,6 +38,30 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20140314: Remove IPX/SPX
+OLD_LIBS+=lib/libipx.so.5
+OLD_FILES+=usr/include/netipx/ipx.h
+OLD_FILES+=usr/include/netipx/ipx_if.h
+OLD_FILES+=usr/include/netipx/ipx_pcb.h
+OLD_FILES+=usr/include/netipx/ipx_var.h

svn commit: r263141 - head/usr.sbin/bsdconfig/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 03:00:02 2014
New Revision: 263141
URL: http://svnweb.freebsd.org/changeset/base/263141

Log:
  Point hat! Fix a broken f_isinteger().

Modified:
  head/usr.sbin/bsdconfig/share/strings.subr

Modified: head/usr.sbin/bsdconfig/share/strings.subr
==
--- head/usr.sbin/bsdconfig/share/strings.subr  Fri Mar 14 02:58:48 2014
(r263140)
+++ head/usr.sbin/bsdconfig/share/strings.subr  Fri Mar 14 03:00:02 2014
(r263141)
@@ -195,7 +195,7 @@ f_number_of_lines()
 f_isinteger()
 {
local arg=${1#-}
-   [ ${arg:-x} = ${arg#[!0-9]*} ]
+   [ ${arg:-x} = ${arg%[!0-9]*} ]
 }
 
 # f_uriencode [$text]
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263142 - in head: lib/libpam/modules/pam_radius lib/libpam/modules/pam_tacplus sbin/mdconfig secure/usr.bin/bdes share/doc/papers/beyond4.3 share/doc/papers/diskperf share/doc/papers/

2014-03-13 Thread Gleb Smirnoff
On Fri, Mar 14, 2014 at 03:07:52AM +, Eitan Adler wrote:
E Author: eadler
E Date: Fri Mar 14 03:07:51 2014
E New Revision: 263142
E URL: http://svnweb.freebsd.org/changeset/base/263142
E 
E Log:
E   multiple: Remove 3rd clause from BSD license where approved by the
E   regents and renumber.
E   
E   This patch skips files in contrib/ and crypto/
E   
E   Acked by:  imp
E   Discussed with:emaste
E 
E Added:
E   head/usr.sbin/IPXrouted/
E  - copied from r262539, head/usr.sbin/IPXrouted/

Seems like you blindly did mine full, when subversion reported
you a merge conflict.

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r263142 - in head: lib/libpam/modules/pam_radius lib/libpam/modules/pam_tacplus sbin/mdconfig secure/usr.bin/bdes share/doc/papers/beyond4.3 share/doc/papers/diskperf share/doc/papers/

2014-03-13 Thread Eitan Adler
On 13 March 2014 23:09, Gleb Smirnoff gleb...@freebsd.org wrote:
 On Fri, Mar 14, 2014 at 03:07:52AM +, Eitan Adler wrote:
 E Author: eadler
 E Date: Fri Mar 14 03:07:51 2014
 E New Revision: 263142
 E URL: http://svnweb.freebsd.org/changeset/base/263142
 E
 E Log:
 E   multiple: Remove 3rd clause from BSD license where approved by the
 E   regents and renumber.
 E
 E   This patch skips files in contrib/ and crypto/
 E
 E   Acked by:  imp
 E   Discussed with:emaste
 E
 E Added:
 E   head/usr.sbin/IPXrouted/
 E  - copied from r262539, head/usr.sbin/IPXrouted/

 Seems like you blindly did mine full, when subversion reported
 you a merge conflict.

I thought I hit theirs full.  I noticed this and am working on fixing it.


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263143 - head/usr.sbin/IPXrouted

2014-03-13 Thread Eitan Adler
Author: eadler
Date: Fri Mar 14 03:12:41 2014
New Revision: 263143
URL: http://svnweb.freebsd.org/changeset/base/263143

Log:
  Remove directory which should not have been re-added.

Deleted:
  head/usr.sbin/IPXrouted/
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263144 - head/usr.sbin/bsdconfig/usermgmt/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 03:15:02 2014
New Revision: 263144
URL: http://svnweb.freebsd.org/changeset/base/263144

Log:
  Fix a code-typo that prevented auto-sizing of the dialog.

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Mar 14 
03:12:41 2014(r263143)
+++ head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Mar 14 
03:15:02 2014(r263144)
@@ -301,7 +301,7 @@ f_dialog_input_group_members()
\\$DIALOG_BACKTITLE\ \
\\$__prompt\ \
\\$__hline\  \
-   $menu_list
+   $__menu_list
 
local __menu_choice __retval
while :; do
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263145 - head/usr.sbin/bsdconfig/usermgmt/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 03:25:33 2014
New Revision: 263145
URL: http://svnweb.freebsd.org/changeset/base/263145

Log:
  Fix comments and whitespace.

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/group.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:15:02 
2014(r263144)
+++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:25:33 
2014(r263145)
@@ -163,7 +163,7 @@ f_group_add()
   elif [ $group_password ]; then
echo $group_password |
f_eval_catch $funcname \
-   pw '%s -h 0' $cmd
+   pw '%s -h 0' $cmd
   else
f_eval_catch $funcname pw '%s' $cmd
   fi  break
@@ -324,7 +324,9 @@ f_group_delete()
 #  unchanged.
 #  VAR_GROUP_MEMBERS [Optional]
 #  Comma separated list of users that are a member of this group.
-#  If NULL or unset, group membership is unmodified.
+#  If set but NULL, group memberships are reset (no users will be
+#  a member of this group). If unset, group membership is
+#  unmodified.
 #  VAR_GROUP_PASSWORD [Optional]
 #  newgrp(1) password to set for the group. If unset, the password
 #  is unmodified. If NULL, the newgrp(1) password is disabled.
@@ -409,9 +411,8 @@ f_group_edit()
   if [ $group_password_disable ]; then
f_eval_catch $funcname pw '%s -h -' $cmd
   elif [ $group_password ]; then
-   echo $group_password |
-   f_eval_catch $funcname \
-   pw '%s -h 0' $cmd
+   echo $group_password | f_eval_catch \
+   $funcname pw '%s -h 0' $cmd
   else
f_eval_catch $funcname pw '%s' $cmd
   fi  break
@@ -424,7 +425,7 @@ f_group_edit()
 
   if ! f_input_group $mtag; then
f_show_err $msg_group_not_found $mtag
-   # Attempt to fall back to prevoius selection
+   # Attempt to fall back to previous selection
f_input_group $input || return $FAILURE
   else
input=$mtag
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263146 - head/usr.sbin/bsdconfig/usermgmt/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 03:28:21 2014
New Revision: 263146
URL: http://svnweb.freebsd.org/changeset/base/263146

Log:
  Reduce the sleep cycle when using dialog(1) to 1-second.

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/group.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:25:33 
2014(r263145)
+++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:28:21 
2014(r263146)
@@ -217,7 +217,7 @@ f_group_add()
f_dialog_title $title
$alert $msg_group_added
f_dialog_title_restore
-   [ $no_confirm -a $USE_DIALOG ]  sleep 2
+   [ $no_confirm -a $USE_DIALOG ]  sleep 1
 
return $SUCCESS
 }
@@ -305,7 +305,7 @@ f_group_delete()
 f_dialog_title $title
$alert $msg_group_deleted
f_dialog_title_restore
-   [ $no_confirm -a $USE_DIALOG ]  sleep 2
+   [ $no_confirm -a $USE_DIALOG ]  sleep 1
 
return $SUCCESS
 }
@@ -473,7 +473,7 @@ f_group_edit()
f_dialog_title $title
$alert $msg_group_updated
f_dialog_title_restore
-   [ $no_confirm -a $USE_DIALOG ]  sleep 2
+   [ $no_confirm -a $USE_DIALOG ]  sleep 1
 
return $SUCCESS
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263147 - head/usr.sbin/bsdconfig/usermgmt/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 03:33:03 2014
New Revision: 263147
URL: http://svnweb.freebsd.org/changeset/base/263147

Log:
  Fix a bug preventing errors from pw(8) from filtering up to a dialog.
  Programs running as rvalue to pipe cannot access current namespace.

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/group.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:28:21 
2014(r263146)
+++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:33:03 
2014(r263147)
@@ -202,8 +202,8 @@ f_group_add()
if [ $group_password_disable ]; then
f_eval_catch -k err $funcname pw '%s -h -' $cmd
elif [ $group_password ]; then
-   echo $group_password | f_eval_catch -k err \
-   $funcname pw '%s -h 0' $cmd
+   err=$( echo $group_password | f_eval_catch -de \
+   $funcname pw '%s -h 0' $cmd 21 )
else
f_eval_catch -k err $funcname pw '%s' $cmd
fi
@@ -458,8 +458,8 @@ f_group_edit()
if [ $group_password_disable ]; then
f_eval_catch -k err $funcname pw '%s -h -' $cmd
elif [ $group_password -o $null_password ]; then
-   echo $group_password | f_eval_catch -k err \
-   $funcname pw '%s -h 0' $cmd
+   err=$( echo $group_password | f_eval_catch -de \
+   $funcname pw '%s -h 0' $cmd 21 )
else
f_eval_catch -k err $funcname pw '%s' $cmd
fi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263148 - head/usr.sbin/bsdconfig/usermgmt/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 03:34:43 2014
New Revision: 263148
URL: http://svnweb.freebsd.org/changeset/base/263148

Log:
  For non-interactive scripts, forgot to check we were given an argument
  before proceeding.

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/group.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:33:03 
2014(r263147)
+++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:34:43 
2014(r263148)
@@ -96,6 +96,10 @@ f_group_add()
[ $group_name ] ||
f_show_err $msg_please_enter_a_group_name
done
+   if [ ! $group_name ]; then
+   f_show_err $msg_no_group_specified
+   return $FAILURE
+   fi
 
local group_password group_gid group_members
f_getvar $VAR_GROUP_PASSWORDgroup_password
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r263149 - head/usr.sbin/bsdconfig/usermgmt/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 03:37:08 2014
New Revision: 263149
URL: http://svnweb.freebsd.org/changeset/base/263149

Log:
  Add protection against input containing single-quotes (e.g., i18n-users).

Modified:
  head/usr.sbin/bsdconfig/usermgmt/share/group.subr
  head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr

Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:34:43 
2014(r263148)
+++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr   Fri Mar 14 03:37:08 
2014(r263149)
@@ -156,10 +156,17 @@ f_group_add()
 
case $mtag in
X) # Add/Exit
-  local cmd=pw groupadd -n '$group_name'
-  [ $group_gid ]  cmd=$cmd -g '$group_gid'
+  local var
+  for var in gid members name; do
+   local _group_$var
+   eval f_shell_escape \
+   \\$group_$var\ _group_$var
+  done
+
+  local cmd=pw groupadd -n '$_group_name'
+  [ $group_gid ]  cmd=$cmd -g '$_group_gid'
   [ $group_members ] 
-   cmd=$cmd -M '$group_members'
+   cmd=$cmd -M '$_group_members'
 
   # Execute the command (break on success)
   if [ $group_password_disable ]; then
@@ -196,10 +203,16 @@ f_group_add()
esac
done
else
+   local var
+   for var in gid members name; do
+   local _group_$var
+   eval f_shell_escape \\$group_$var\ _group_$var
+   done
+
# Form the command
-   local cmd=pw groupadd -n '$group_name'
-   [ $group_gid ]  cmd=$cmd -g '$group_gid'
-   [ $group_members ]  cmd=$cmd -M '$group_members'
+   local cmd=pw groupadd -n '$_group_name'
+   [ $group_gid ]  cmd=$cmd -g '$_group_gid'
+   [ $group_members ]  cmd=$cmd -M '$_group_members'
 
# Execute the command
local retval err
@@ -276,8 +289,10 @@ f_group_delete()
 
case $mtag in
X) # Delete/Exit
+  local _group_name
+  f_shell_escape $group_name _group_name
   f_eval_catch $funcname pw 'pw groupdel %s' \
-   $group_name  break
+   $_group_name  break
   ;;
1) # Group Name (select different group from list)
   f_dialog_menu_group_list $group_name || continue
@@ -296,9 +311,10 @@ f_group_delete()
esac
done
else
-   local retval err
+   local retval err _group_name
+   f_shell_escape $group_name _group_name
f_eval_catch -k err $funcname pw \
-   'pw groupdel %s' $group_name
+   pw groupdel '%s' $_group_name
retval=$?
if [ $retval -ne $SUCCESS ]; then
f_show_err %s $err
@@ -406,10 +422,17 @@ f_group_edit()
 
case $mtag in
X) # Save/Exit
-  local cmd=pw groupmod -n '$group_name'
-  [ $group_gid ]  cmd=$cmd -g '$group_gid'
+  local var
+  for var in gid members name; do
+   local _group_$var
+   eval f_shell_escape \
+   \\$group_$var\ _group_$var
+  done
+
+  local cmd=pw groupmod -n '$_group_name'
+  [ $group_gid ]  cmd=$cmd -g '$_group_gid'
   [ $group_members -o $null_members ] 
-   cmd=$cmd -M '$group_members'
+   cmd=$cmd -M '$_group_members'
 
   # Execute the command (break on success)
   if [ $group_password_disable ]; then
@@ -451,11 +474,17 @@ f_group_edit()
esac
done
else
+   local var
+   for var in gid members name; do
+   local _group_$var
+   eval f_shell_escape \\$group_$var\ _group_$var
+   done
+
# Form the command
-   local cmd=pw groupmod -n '$group_name'
-   [ $group_gid ]  cmd=$cmd -g 

svn commit: r263150 - in head/usr.sbin/bsdconfig: share usermgmt usermgmt/include usermgmt/share

2014-03-13 Thread Devin Teske
Author: dteske
Date: Fri Mar 14 03:42:05 2014
New Revision: 263150
URL: http://svnweb.freebsd.org/changeset/base/263150

Log:
  Rewrite usermgmt -- hooking it into the scripting system with dispatch
  commands addUser, deleteUser, and editUser. Getting rid of the awkward-
  to-use `userinput' bolt-on which Ron and I talked about rewriting.

Added:
  head/usr.sbin/bsdconfig/usermgmt/share/user.subr   (contents, props changed)
Deleted:
  head/usr.sbin/bsdconfig/usermgmt/userinput
Modified:
  head/usr.sbin/bsdconfig/share/script.subr
  head/usr.sbin/bsdconfig/share/variable.subr
  head/usr.sbin/bsdconfig/usermgmt/Makefile
  head/usr.sbin/bsdconfig/usermgmt/include/messages.subr
  head/usr.sbin/bsdconfig/usermgmt/share/Makefile
  head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
  head/usr.sbin/bsdconfig/usermgmt/useradd
  head/usr.sbin/bsdconfig/usermgmt/userdel
  head/usr.sbin/bsdconfig/usermgmt/useredit

Modified: head/usr.sbin/bsdconfig/share/script.subr
==
--- head/usr.sbin/bsdconfig/share/script.subr   Fri Mar 14 03:37:08 2014
(r263149)
+++ head/usr.sbin/bsdconfig/share/script.subr   Fri Mar 14 03:42:05 2014
(r263150)
@@ -38,6 +38,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr
 f_include $BSDCFG_SHARE/networking/services.subr
 f_include $BSDCFG_SHARE/packages/packages.subr
 f_include $BSDCFG_SHARE/usermgmt/group.subr
+f_include $BSDCFG_SHARE/usermgmt/user.subr
 f_include $BSDCFG_SHARE/variable.subr
 
  GLOBALS
@@ -204,6 +205,11 @@ f_resword_new addGroup f_group_add
 f_resword_new deleteGroup  f_group_delete
 f_resword_new editGroupf_group_edit
 
+# usermgmt/user.subr
+f_resword_new addUser  f_user_add
+f_resword_new deleteUser   f_user_delete
+f_resword_new editUser f_user_edit
+
 # variable.subr
 f_resword_new installVarDefaults   f_variable_set_defaults
 f_resword_new dumpVariablesf_dump_variables

Modified: head/usr.sbin/bsdconfig/share/variable.subr
==
--- head/usr.sbin/bsdconfig/share/variable.subr Fri Mar 14 03:37:08 2014
(r263149)
+++ head/usr.sbin/bsdconfig/share/variable.subr Fri Mar 14 03:42:05 2014
(r263150)
@@ -283,6 +283,21 @@ f_variable_new VAR_SLOW_ETHER  slowEther
 f_variable_new VAR_TRY_DHCPtryDHCP
 f_variable_new VAR_TRY_RTSOL   tryRTSOL
 f_variable_new VAR_UFS_PATHufs
+f_variable_new VAR_USERuser
+f_variable_new VAR_USER_ACCOUNT_EXPIRE userAccountExpire
+f_variable_new VAR_USER_DOTFILES_CREATEuserDotfilesCreate
+f_variable_new VAR_USER_GECOS  userGecos
+f_variable_new VAR_USER_GIDuserGid
+f_variable_new VAR_USER_GROUPS userGroups
+f_variable_new VAR_USER_GROUP_DELETE   userGroupDelete
+f_variable_new VAR_USER_HOME   userHome
+f_variable_new VAR_USER_HOME_CREATEuserHomeCreate
+f_variable_new VAR_USER_HOME_DELETEuserHomeDelete
+f_variable_new VAR_USER_LOGIN_CLASSuserLoginClass
+f_variable_new VAR_USER_PASSWORD   userPassword
+f_variable_new VAR_USER_PASSWORD_EXPIREuserPasswordExpire
+f_variable_new VAR_USER_SHELL  userShell
+f_variable_new VAR_USER_UIDuserUid
 f_variable_new VAR_ZFSINTERACTIVE  zfsInteractive
 
 #

Modified: head/usr.sbin/bsdconfig/usermgmt/Makefile
==
--- head/usr.sbin/bsdconfig/usermgmt/Makefile   Fri Mar 14 03:37:08 2014
(r263149)
+++ head/usr.sbin/bsdconfig/usermgmt/Makefile   Fri Mar 14 03:42:05 2014
(r263150)
@@ -8,8 +8,7 @@ FILESDIR=   ${LIBEXECDIR}/bsdconfig/070.us
 FILES= INDEX USAGE
 
 SCRIPTSDIR=${FILESDIR}
-SCRIPTS=   groupadd groupdel groupedit useradd userdel useredit \
-   userinput usermgmt
+SCRIPTS=   groupadd groupdel groupedit useradd userdel useredit usermgmt
 
 beforeinstall:
mkdir -p ${DESTDIR}${FILESDIR}

Modified: head/usr.sbin/bsdconfig/usermgmt/include/messages.subr
==
--- head/usr.sbin/bsdconfig/usermgmt/include/messages.subr  Fri Mar 14 
03:37:08 2014(r263149)
+++ head/usr.sbin/bsdconfig/usermgmt/include/messages.subr  Fri Mar 14 
03:42:05 2014(r263150)
@@ -33,7 +33,7 @@ hline_arrows_tab_enter=Press arrows, TA
 hline_num_arrows_tab_enter=Use numbers, arrows, TAB or ENTER
 hline_num_tab_enter=Use numbers, TAB or ENTER
 msg_account_does_not_expire=Account does not expire
-msg_account_expires_in_how_many_days=Account expires in how many days?
+msg_account_expire_manual_edit=Enter account expiration time. Format is one 
of:\n\n a) decimal for UNIX time since %s\n b) dd-mmm-yy[yy] for day, month, 
and 2- or 4-digit year\n c) +n[mhdwoy] for relative