From owner-svn-src-stable-10@freebsd.org Mon Jun 25 08:47:55 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADDE110013AF; Mon, 25 Jun 2018 08:47:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 589D071DF7; Mon, 25 Jun 2018 08:47:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39C962AE96; Mon, 25 Jun 2018 08:47:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5P8ltUs041001; Mon, 25 Jun 2018 08:47:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5P8lt85041000; Mon, 25 Jun 2018 08:47:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806250847.w5P8lt85041000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 Jun 2018 08:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335617 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/usb/serial X-SVN-Commit-Revision: 335617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 08:47:55 -0000 Author: avg Date: Mon Jun 25 08:47:54 2018 New Revision: 335617 URL: https://svnweb.freebsd.org/changeset/base/335617 Log: MFC r333997: uchcom: report detected product based on USB product ID Modified: stable/10/sys/dev/usb/serial/uchcom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:47:07 2018 (r335616) +++ stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:47:54 2018 (r335617) @@ -320,12 +320,16 @@ uchcom_attach(device_t dev) sc->sc_udev = uaa->device; - switch (uaa->info.bcdDevice) { - case UCHCOM_REV_CH340: + switch (uaa->info.idProduct) { + case USB_PRODUCT_WCH2_CH341SER: device_printf(dev, "CH340 detected\n"); break; - default: + case USB_PRODUCT_WCH2_CH341SER_2: device_printf(dev, "CH341 detected\n"); + break; + default: + device_printf(dev, "New CH340/CH341 product 0x%04x detected\n", + uaa->info.idProduct); break; } From owner-svn-src-stable-10@freebsd.org Mon Jun 25 08:49:14 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5619710014FA; Mon, 25 Jun 2018 08:49:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0809C72079; Mon, 25 Jun 2018 08:49:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD4E52AE98; Mon, 25 Jun 2018 08:49:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5P8nDvF041184; Mon, 25 Jun 2018 08:49:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5P8nDMA041183; Mon, 25 Jun 2018 08:49:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806250849.w5P8nDMA041183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 Jun 2018 08:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335619 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/usb/serial X-SVN-Commit-Revision: 335619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 08:49:14 -0000 Author: avg Date: Mon Jun 25 08:49:13 2018 New Revision: 335619 URL: https://svnweb.freebsd.org/changeset/base/335619 Log: MFC r333998: uchcom: add DPRINTF-s to aid debugging of the driver Modified: stable/10/sys/dev/usb/serial/uchcom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:48:39 2018 (r335618) +++ stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:49:13 2018 (r335619) @@ -414,6 +414,8 @@ uchcom_ctrl_write(struct uchcom_softc *sc, uint8_t req USETW(req.wIndex, index); USETW(req.wLength, 0); + DPRINTF("WR REQ 0x%02X VAL 0x%04X IDX 0x%04X\n", + reqno, value, index); ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000); } @@ -430,6 +432,8 @@ uchcom_ctrl_read(struct uchcom_softc *sc, uint8_t reqn USETW(req.wIndex, index); USETW(req.wLength, buflen); + DPRINTF("RD REQ 0x%02X VAL 0x%04X IDX 0x%04X LEN %d\n", + reqno, value, index, buflen); ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, buf, USB_SHORT_XFER_OK, 1000); } @@ -504,6 +508,7 @@ static void uchcom_update_version(struct uchcom_softc *sc) { uchcom_get_version(sc, &sc->sc_version); + DPRINTF("Chip version: 0x%02x\n", sc->sc_version); } static void From owner-svn-src-stable-10@freebsd.org Mon Jun 25 08:50:47 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EA7410016A3; Mon, 25 Jun 2018 08:50:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D460E72361; Mon, 25 Jun 2018 08:50:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B15532AEB2; Mon, 25 Jun 2018 08:50:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5P8okdt043610; Mon, 25 Jun 2018 08:50:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5P8okBX043609; Mon, 25 Jun 2018 08:50:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806250850.w5P8okBX043609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 Jun 2018 08:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335621 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/usb/serial X-SVN-Commit-Revision: 335621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 08:50:47 -0000 Author: avg Date: Mon Jun 25 08:50:46 2018 New Revision: 335621 URL: https://svnweb.freebsd.org/changeset/base/335621 Log: MFC r333999: uchcom: add a hardware configuration tweak seen in Linux code Modified: stable/10/sys/dev/usb/serial/uchcom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:50:06 2018 (r335620) +++ stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:50:46 2018 (r335621) @@ -616,8 +616,12 @@ uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t if (uchcom_calc_divider_settings(&dv, rate)) return; + /* + * According to linux code we need to set bit 7 of UCHCOM_REG_BPS_PRE, + * otherwise the chip will buffer data. + */ uchcom_write_reg(sc, - UCHCOM_REG_BPS_PRE, dv.dv_prescaler, + UCHCOM_REG_BPS_PRE, dv.dv_prescaler | 0x80, UCHCOM_REG_BPS_DIV, dv.dv_div); uchcom_write_reg(sc, UCHCOM_REG_BPS_MOD, dv.dv_mod, From owner-svn-src-stable-10@freebsd.org Mon Jun 25 08:53:31 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CFEE1001DC4; Mon, 25 Jun 2018 08:53:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F101E72A31; Mon, 25 Jun 2018 08:53:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1FA02B02A; Mon, 25 Jun 2018 08:53:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5P8rUE3046022; Mon, 25 Jun 2018 08:53:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5P8rU2c046021; Mon, 25 Jun 2018 08:53:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806250853.w5P8rU2c046021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 Jun 2018 08:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335623 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/usb/serial X-SVN-Commit-Revision: 335623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 08:53:31 -0000 Author: avg Date: Mon Jun 25 08:53:30 2018 New Revision: 335623 URL: https://svnweb.freebsd.org/changeset/base/335623 Log: MFC r334000: uchcom: reject parity and double stop bits as unsupported Modified: stable/10/sys/dev/usb/serial/uchcom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:52:48 2018 (r335622) +++ stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:53:30 2018 (r335623) @@ -686,6 +686,10 @@ uchcom_pre_param(struct ucom_softc *ucom, struct termi default: return (EIO); } + if ((t->c_cflag & CSTOPB) != 0) + return (EIO); + if ((t->c_cflag & PARENB) != 0) + return (EIO); if (uchcom_calc_divider_settings(&dv, t->c_ospeed)) { return (EIO); From owner-svn-src-stable-10@freebsd.org Mon Jun 25 08:55:20 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 584B11002106; Mon, 25 Jun 2018 08:55:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 005D572CF1; Mon, 25 Jun 2018 08:55:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D59B52B02C; Mon, 25 Jun 2018 08:55:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5P8tJUY046255; Mon, 25 Jun 2018 08:55:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5P8tJrX046254; Mon, 25 Jun 2018 08:55:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806250855.w5P8tJrX046254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 Jun 2018 08:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335625 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/usb/serial X-SVN-Commit-Revision: 335625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 08:55:20 -0000 Author: avg Date: Mon Jun 25 08:55:19 2018 New Revision: 335625 URL: https://svnweb.freebsd.org/changeset/base/335625 Log: MFC r334001: uchcom: remove UCHCOM_REG_BREAK2 alias of UCHCOM_REG_LCR1 Modified: stable/10/sys/dev/usb/serial/uchcom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:54:46 2018 (r335624) +++ stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:55:19 2018 (r335625) @@ -120,7 +120,6 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RW #define UCHCOM_REG_BPS_MOD 0x14 #define UCHCOM_REG_BPS_PAD 0x0F #define UCHCOM_REG_BREAK1 0x05 -#define UCHCOM_REG_BREAK2 0x18 #define UCHCOM_REG_LCR1 0x18 #define UCHCOM_REG_LCR2 0x25 @@ -133,12 +132,14 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RW #define UCHCOM_DTR_MASK 0x20 #define UCHCOM_RTS_MASK 0x40 -#define UCHCOM_BRK1_MASK 0x01 -#define UCHCOM_BRK2_MASK 0x40 +#define UCHCOM_BRK_MASK 0x01 #define UCHCOM_LCR1_MASK 0xAF #define UCHCOM_LCR2_MASK 0x07 -#define UCHCOM_LCR1_PARENB 0x80 +#define UCHCOM_LCR1_RX 0x80 +#define UCHCOM_LCR1_TX 0x40 +#define UCHCOM_LCR1_PARENB 0x08 +#define UCHCOM_LCR1_CS8 0x03 #define UCHCOM_LCR2_PAREVEN 0x07 #define UCHCOM_LCR2_PARODD 0x06 #define UCHCOM_LCR2_PARMARK 0x05 @@ -554,17 +555,17 @@ uchcom_cfg_set_break(struct ucom_softc *ucom, uint8_t uint8_t brk1; uint8_t brk2; - uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_BREAK2, &brk2); + uchcom_read_reg(sc, UCHCOM_REG_BREAK1, &brk1, UCHCOM_REG_LCR1, &brk2); if (onoff) { /* on - clear bits */ - brk1 &= ~UCHCOM_BRK1_MASK; - brk2 &= ~UCHCOM_BRK2_MASK; + brk1 &= ~UCHCOM_BRK_MASK; + brk2 &= ~UCHCOM_LCR1_TX; } else { /* off - set bits */ - brk1 |= UCHCOM_BRK1_MASK; - brk2 |= UCHCOM_BRK2_MASK; + brk1 |= UCHCOM_BRK_MASK; + brk2 |= UCHCOM_LCR1_TX; } - uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_BREAK2, brk2); + uchcom_write_reg(sc, UCHCOM_REG_BREAK1, brk1, UCHCOM_REG_LCR1, brk2); } static int From owner-svn-src-stable-10@freebsd.org Mon Jun 25 08:57:05 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B2DF10022C8; Mon, 25 Jun 2018 08:57:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C5AC72FC9; Mon, 25 Jun 2018 08:57:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EC5A2B02E; Mon, 25 Jun 2018 08:57:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5P8v4gM046461; Mon, 25 Jun 2018 08:57:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5P8v4fl046460; Mon, 25 Jun 2018 08:57:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806250857.w5P8v4fl046460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 25 Jun 2018 08:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335627 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/usb/serial X-SVN-Commit-Revision: 335627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 08:57:05 -0000 Author: avg Date: Mon Jun 25 08:57:03 2018 New Revision: 335627 URL: https://svnweb.freebsd.org/changeset/base/335627 Log: MFC r334002: uchcom: extend hardware support to version 0x30 Modified: stable/10/sys/dev/usb/serial/uchcom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:56:30 2018 (r335626) +++ stable/10/sys/dev/usb/serial/uchcom.c Mon Jun 25 08:57:03 2018 (r335627) @@ -124,6 +124,7 @@ SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RW #define UCHCOM_REG_LCR2 0x25 #define UCHCOM_VER_20 0x20 +#define UCHCOM_VER_30 0x30 #define UCHCOM_BASE_UNKNOWN 0 #define UCHCOM_BPS_MOD_BASE 20000000 @@ -703,11 +704,26 @@ uchcom_cfg_param(struct ucom_softc *ucom, struct termi { struct uchcom_softc *sc = ucom->sc_parent; - uchcom_get_version(sc, 0); + uchcom_get_version(sc, NULL); uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); uchcom_set_baudrate(sc, t->c_ospeed); - uchcom_read_reg(sc, 0x18, 0, 0x25, 0); - uchcom_write_reg(sc, 0x18, 0x50, 0x25, 0x00); + if (sc->sc_version < UCHCOM_VER_30) { + uchcom_read_reg(sc, UCHCOM_REG_LCR1, NULL, + UCHCOM_REG_LCR2, NULL); + uchcom_write_reg(sc, UCHCOM_REG_LCR1, 0x50, + UCHCOM_REG_LCR2, 0x00); + } else { + /* + * Set up line control: + * - enable transmit and receive + * - set 8n1 mode + * To do: support other sizes, parity, stop bits. + */ + uchcom_write_reg(sc, + UCHCOM_REG_LCR1, + UCHCOM_LCR1_RX | UCHCOM_LCR1_TX | UCHCOM_LCR1_CS8, + UCHCOM_REG_LCR2, 0x00); + } uchcom_update_status(sc); uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0x501f, 0xd90a); uchcom_set_baudrate(sc, t->c_ospeed); From owner-svn-src-stable-10@freebsd.org Tue Jun 26 16:16:09 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D45481000F06; Tue, 26 Jun 2018 16:16:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88FFF771C3; Tue, 26 Jun 2018 16:16:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 677A916913; Tue, 26 Jun 2018 16:16:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5QGG91V012056; Tue, 26 Jun 2018 16:16:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5QGG99r012055; Tue, 26 Jun 2018 16:16:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806261616.w5QGG99r012055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 26 Jun 2018 16:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335670 - in stable: 10 11 X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10 11 X-SVN-Commit-Revision: 335670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2018 16:16:10 -0000 Author: gjb Date: Tue Jun 26 16:16:08 2018 New Revision: 335670 URL: https://svnweb.freebsd.org/changeset/base/335670 Log: MFC r325107, r335665: r325107 (eadler, partial): Update the updating URL in UPDATING. r335665: Use the 'Updating from Source' Handbook section in UPDATING. PR: 229345 Submitted by: Niels Bakker Approved by: re (marius, insta-MFC) Sponsored by: The FreeBSD Foundation Modified: stable/10/UPDATING Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/UPDATING Directory Properties: stable/11/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Tue Jun 26 16:00:16 2018 (r335669) +++ stable/10/UPDATING Tue Jun 26 16:16:08 2018 (r335670) @@ -6,7 +6,7 @@ COMMON ITEMS: section later in the file. These instru basically know what you are doing. If not, then please consult the FreeBSD handbook: - https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-src.html + https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. From owner-svn-src-stable-10@freebsd.org Wed Jun 27 04:56:04 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBAE0102EEBC; Wed, 27 Jun 2018 04:56:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D81F93FB7; Wed, 27 Jun 2018 04:56:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E8941E663; Wed, 27 Jun 2018 04:56:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5R4u3oA003716; Wed, 27 Jun 2018 04:56:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5R4u29X003709; Wed, 27 Jun 2018 04:56:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806270456.w5R4u29X003709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 27 Jun 2018 04:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335694 - stable/10/usr.bin/mail X-SVN-Group: stable-10 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/10/usr.bin/mail X-SVN-Commit-Revision: 335694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 04:56:04 -0000 Author: eadler Date: Wed Jun 27 04:56:01 2018 New Revision: 335694 URL: https://svnweb.freebsd.org/changeset/base/335694 Log: MFC r302776, r302799: mail(1): Bring some fixes from other BSDs. - Use varargs properly - Use pid_t - Better handling of error conditions on forked jobs. - Some prototype and warning cleanups. Fix missing forked job changes from r302776 in wait_child(). Modified: stable/10/usr.bin/mail/cmd1.c stable/10/usr.bin/mail/cmd2.c stable/10/usr.bin/mail/cmd3.c stable/10/usr.bin/mail/edit.c stable/10/usr.bin/mail/extern.h stable/10/usr.bin/mail/fio.c stable/10/usr.bin/mail/getname.c stable/10/usr.bin/mail/popen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mail/cmd1.c ============================================================================== --- stable/10/usr.bin/mail/cmd1.c Wed Jun 27 04:37:22 2018 (r335693) +++ stable/10/usr.bin/mail/cmd1.c Wed Jun 27 04:56:01 2018 (r335694) @@ -439,7 +439,7 @@ folders(void) } if ((cmd = value("LISTER")) == NULL) cmd = "ls"; - (void)run_command(cmd, 0, -1, -1, dirname, NULL, NULL); + (void)run_command(cmd, 0, -1, -1, dirname, NULL); return (0); } Modified: stable/10/usr.bin/mail/cmd2.c ============================================================================== --- stable/10/usr.bin/mail/cmd2.c Wed Jun 27 04:37:22 2018 (r335693) +++ stable/10/usr.bin/mail/cmd2.c Wed Jun 27 04:56:01 2018 (r335694) @@ -130,8 +130,9 @@ hitit: * so we can discard when the user quits. */ int -save(char str[]) +save(void *v) { + char *str = v; return (save1(str, 1, "save", saveignore)); } @@ -140,8 +141,9 @@ save(char str[]) * Copy a message to a file without affected its saved-ness */ int -copycmd(char str[]) +copycmd(void *v) { + char *str = v; return (save1(str, 0, "copy", saveignore)); } Modified: stable/10/usr.bin/mail/cmd3.c ============================================================================== --- stable/10/usr.bin/mail/cmd3.c Wed Jun 27 04:37:22 2018 (r335693) +++ stable/10/usr.bin/mail/cmd3.c Wed Jun 27 04:56:01 2018 (r335694) @@ -79,7 +79,7 @@ dosh(char *str __unused) if ((sh = value("SHELL")) == NULL) sh = _PATH_CSHELL; - (void)run_command(sh, 0, -1, -1, NULL, NULL, NULL); + (void)run_command(sh, 0, -1, -1, NULL); (void)signal(SIGINT, sigint); printf("\n"); return (0); @@ -102,7 +102,7 @@ bangexp(char *str, size_t strsize) n = sizeof(bangbuf); while (*cp != '\0') { if (*cp == '!') { - if (n < strlen(lastbang)) { + if (n < (int)strlen(lastbang)) { overf: printf("Command buffer overflow\n"); return (-1); Modified: stable/10/usr.bin/mail/edit.c ============================================================================== --- stable/10/usr.bin/mail/edit.c Wed Jun 27 04:37:22 2018 (r335693) +++ stable/10/usr.bin/mail/edit.c Wed Jun 27 04:56:01 2018 (r335694) @@ -180,7 +180,7 @@ run_editor(FILE *fp, off_t size, int type, int readonl nf = NULL; if ((edit = value(type == 'e' ? "EDITOR" : "VISUAL")) == NULL) edit = type == 'e' ? _PATH_EX : _PATH_VI; - if (run_command(edit, 0, -1, -1, tempname, NULL, NULL) < 0) { + if (run_command(edit, 0, -1, -1, tempname, NULL) < 0) { (void)rm(tempname); goto out; } Modified: stable/10/usr.bin/mail/extern.h ============================================================================== --- stable/10/usr.bin/mail/extern.h Wed Jun 27 04:37:22 2018 (r335693) +++ stable/10/usr.bin/mail/extern.h Wed Jun 27 04:56:01 2018 (r335694) @@ -49,7 +49,7 @@ char *copyin(char *, char **); char *detract(struct name *, int); char *expand(char *); char *getdeadletter(void); -char *getname(int); +char *getname(uid_t); char *hfield(const char *, struct message *); FILE *infix(struct header *, FILE *); char *ishfield(char [], char *, const char *); @@ -95,7 +95,7 @@ void collhup(int); void collint(int); void collstop(int); void commands(void); -int copycmd(char []); +int copycmd(void *v); int core(void); int count(struct name *); int delete(int []); @@ -130,7 +130,7 @@ int getfold(char *, int); int gethfield(FILE *, char [], int, char **); int getmsglist(char *, int *, int); int getrawlist(char [], char **, int); -int getuserid(char []); +uid_t getuserid(char []); int grabh(struct header *, int); int group(char **); void hangup(int); @@ -198,8 +198,8 @@ int respond(int *); int retfield(char *[]); int rexit(int); int rm(char *); -int run_command(char *, sigset_t *, int, int, char *, char *, char *); -int save(char []); +int run_command(char *, sigset_t *, int, int, ...); +int save(void *v); int save1(char [], int, const char *, struct ignoretab *); void savedeadletter(FILE *); int saveigfield(char *[]); @@ -223,7 +223,7 @@ void sort(char **); int source(char **); void spreserve(void); void sreset(void); -int start_command(char *, sigset_t *, int, int, char *, char *, char *); +int start_command(char *, sigset_t *, int, int, ...); void statusput(struct message *, FILE *, char *); void stop(int); int stouch(int []); Modified: stable/10/usr.bin/mail/fio.c ============================================================================== --- stable/10/usr.bin/mail/fio.c Wed Jun 27 04:37:22 2018 (r335693) +++ stable/10/usr.bin/mail/fio.c Wed Jun 27 04:56:01 2018 (r335694) @@ -235,7 +235,7 @@ makemessage(FILE *f, int omsgCount) size -= (omsgCount + 1) * sizeof(struct message); (void)fflush(f); (void)lseek(fileno(f), (off_t)sizeof(*message), 0); - if (read(fileno(f), (char *)&message[omsgCount], size) != size) + if (read(fileno(f), (void *)&message[omsgCount], size) != size) errx(1, "Message temporary file corrupted"); message[msgCount].m_size = 0; message[msgCount].m_lines = 0; Modified: stable/10/usr.bin/mail/getname.c ============================================================================== --- stable/10/usr.bin/mail/getname.c Wed Jun 27 04:37:22 2018 (r335693) +++ stable/10/usr.bin/mail/getname.c Wed Jun 27 04:56:01 2018 (r335694) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); * Search the passwd file for a uid. Return name on success, NULL on failure. */ char * -getname(int uid) +getname(uid_t uid) { struct passwd *pw; @@ -58,7 +58,7 @@ getname(int uid) * Convert the passed name to a user id and return it. Return -1 * on error. */ -int +uid_t getuserid(char name[]) { struct passwd *pw; Modified: stable/10/usr.bin/mail/popen.c ============================================================================== --- stable/10/usr.bin/mail/popen.c Wed Jun 27 04:37:22 2018 (r335693) +++ stable/10/usr.bin/mail/popen.c Wed Jun 27 04:56:01 2018 (r335694) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include "rcv.h" #include #include +#include +#include #include "extern.h" #define READ 0 @@ -46,22 +48,23 @@ __FBSDID("$FreeBSD$"); struct fp { FILE *fp; int pipe; - int pid; + pid_t pid; struct fp *link; }; static struct fp *fp_head; struct child { - int pid; + pid_t pid; char done; char free; int status; struct child *link; }; -static struct child *child; -static struct child *findchild(int); +static struct child *child, *child_freelist = NULL; + static void delchild(struct child *); -static int file_pid(FILE *); +static pid_t file_pid(FILE *); +static pid_t start_commandv(char *, sigset_t *, int, int, va_list); FILE * Fopen(const char *path, const char *mode) @@ -90,6 +93,7 @@ Fdopen(int fd, const char *mode) int Fclose(FILE *fp) { + unregister_file(fp); return (fclose(fp)); } @@ -99,7 +103,7 @@ Popen(char *cmd, const char *mode) { int p[2]; int myside, hisside, fd0, fd1; - int pid; + pid_t pid; sigset_t nset; FILE *fp; @@ -109,15 +113,15 @@ Popen(char *cmd, const char *mode) (void)fcntl(p[WRITE], F_SETFD, 1); if (*mode == 'r') { myside = p[READ]; - fd0 = -1; - hisside = fd1 = p[WRITE]; + hisside = fd0 = fd1 = p[WRITE]; } else { myside = p[WRITE]; hisside = fd0 = p[READ]; fd1 = -1; } (void)sigemptyset(&nset); - if ((pid = start_command(cmd, &nset, fd0, fd1, NULL, NULL, NULL)) < 0) { + pid = start_command(value("SHELL"), &nset, fd0, fd1, "-c", cmd, NULL); + if (pid < 0) { (void)close(p[READ]); (void)close(p[WRITE]); return (NULL); @@ -158,7 +162,7 @@ close_all_files(void) } void -register_file(FILE *fp, int pipe, int pid) +register_file(FILE *fp, int pipe, pid_t pid) { struct fp *fpp; @@ -186,7 +190,7 @@ unregister_file(FILE *fp) /*NOTREACHED*/ } -int +pid_t file_pid(FILE *fp) { struct fp *p; @@ -200,30 +204,17 @@ file_pid(FILE *fp) /* * Run a command without a shell, with optional arguments and splicing - * of stdin and stdout. The command name can be a sequence of words. + * of stdin (-1 means none) and stdout. The command name can be a sequence + * of words. * Signals must be handled by the caller. - * "Mask" contains the signals to ignore in the new process. - * SIGINT is enabled unless it's in the mask. + * "nset" contains the signals to ignore in the new process. + * SIGINT is enabled unless it's in "nset". */ -/*VARARGS4*/ -int -run_command(char *cmd, sigset_t *mask, int infd, int outfd, char *a0, - char *a1, char *a2) +static pid_t +start_commandv(char *cmd, sigset_t *nset, int infd, int outfd, va_list args) { - int pid; + pid_t pid; - if ((pid = start_command(cmd, mask, infd, outfd, a0, a1, a2)) < 0) - return (-1); - return (wait_command(pid)); -} - -/*VARARGS4*/ -int -start_command(char *cmd, sigset_t *mask, int infd, int outfd, char *a0, - char *a1, char *a2) -{ - int pid; - if ((pid = fork()) < 0) { warn("fork"); return (-1); @@ -232,11 +223,10 @@ start_command(char *cmd, sigset_t *mask, int infd, int char *argv[100]; int i = getrawlist(cmd, argv, sizeof(argv) / sizeof(*argv)); - if ((argv[i++] = a0) != NULL && - (argv[i++] = a1) != NULL && - (argv[i++] = a2) != NULL) - argv[i] = NULL; - prepare_child(mask, infd, outfd); + while ((argv[i++] = va_arg(args, char *))) + ; + argv[i] = NULL; + prepare_child(nset, infd, outfd); execvp(argv[0], argv); warn("%s", argv[0]); _exit(1); @@ -244,6 +234,32 @@ start_command(char *cmd, sigset_t *mask, int infd, int return (pid); } +int +run_command(char *cmd, sigset_t *nset, int infd, int outfd, ...) +{ + pid_t pid; + va_list args; + + va_start(args, outfd); + pid = start_commandv(cmd, nset, infd, outfd, args); + va_end(args); + if (pid < 0) + return -1; + return wait_command(pid); +} + +int +start_command(char *cmd, sigset_t *nset, int infd, int outfd, ...) +{ + va_list args; + int r; + + va_start(args, outfd); + r = start_commandv(cmd, nset, infd, outfd, args); + va_end(args); + return r; +} + void prepare_child(sigset_t *nset, int infd, int outfd) { @@ -268,7 +284,7 @@ prepare_child(sigset_t *nset, int infd, int outfd) } int -wait_command(int pid) +wait_command(pid_t pid) { if (wait_child(pid) < 0) { @@ -279,7 +295,7 @@ wait_command(int pid) } static struct child * -findchild(int pid) +findchild(pid_t pid, int dont_alloc) { struct child **cpp; @@ -287,9 +303,16 @@ findchild(int pid) cpp = &(*cpp)->link) ; if (*cpp == NULL) { - *cpp = malloc(sizeof(struct child)); - if (*cpp == NULL) - err(1, "Out of memory"); + if (dont_alloc) + return(NULL); + if (child_freelist) { + *cpp = child_freelist; + child_freelist = (*cpp)->link; + } else { + *cpp = malloc(sizeof(struct child)); + if (*cpp == NULL) + err(1, "malloc"); + } (*cpp)->pid = pid; (*cpp)->done = (*cpp)->free = 0; (*cpp)->link = NULL; @@ -305,19 +328,22 @@ delchild(struct child *cp) for (cpp = &child; *cpp != cp; cpp = &(*cpp)->link) ; *cpp = cp->link; - (void)free(cp); + cp->link = child_freelist; + child_freelist = cp; } /*ARGSUSED*/ void sigchild(int signo __unused) { - int pid; + pid_t pid; int status; struct child *cp; + int save_errno; + save_errno = errno; while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { - cp = findchild(pid); + cp = findchild(pid, 1); if (cp->free) delchild(cp); else { @@ -325,6 +351,7 @@ sigchild(int signo __unused) cp->status = status; } } + errno = save_errno; } int wait_status; @@ -333,41 +360,51 @@ int wait_status; * Wait for a specific child to die. */ int -wait_child(int pid) +wait_child(pid_t pid) { - sigset_t nset, oset; struct child *cp; + sigset_t nset, oset; + pid_t rv = 0; (void)sigemptyset(&nset); (void)sigaddset(&nset, SIGCHLD); - (void)sigprocmask(SIG_BLOCK, &nset, &oset); - - cp = findchild(pid); - - while (!cp->done) - (void)sigsuspend(&oset); - wait_status = cp->status; - delchild(cp); + (void)sigprocmask(SIG_BLOCK, &nset, &oset); + /* + * If we have not already waited on the pid (via sigchild) + * wait on it now. Otherwise, use the wait status stashed + * by sigchild. + */ + cp = findchild(pid, 1); + if (cp == NULL || !cp->done) + rv = waitpid(pid, &wait_status, 0); + else + wait_status = cp->status; + if (cp != NULL) + delchild(cp); (void)sigprocmask(SIG_SETMASK, &oset, NULL); - return ((WIFEXITED(wait_status) && WEXITSTATUS(wait_status)) ? -1 : 0); + if (rv == -1 || (WIFEXITED(wait_status) && WEXITSTATUS(wait_status))) + return -1; + else + return 0; } /* * Mark a child as don't care. */ void -free_child(int pid) +free_child(pid_t pid) { + struct child *cp; sigset_t nset, oset; - struct child *cp = findchild(pid); (void)sigemptyset(&nset); (void)sigaddset(&nset, SIGCHLD); - (void)sigprocmask(SIG_BLOCK, &nset, &oset); - - if (cp->done) - delchild(cp); - else - cp->free = 1; + (void)sigprocmask(SIG_BLOCK, &nset, &oset); + if ((cp = findchild(pid, 0)) != NULL) { + if (cp->done) + delchild(cp); + else + cp->free = 1; + } (void)sigprocmask(SIG_SETMASK, &oset, NULL); } From owner-svn-src-stable-10@freebsd.org Wed Jun 27 19:42:56 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAD321004A1B; Wed, 27 Jun 2018 19:42:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EBE08FA41; Wed, 27 Jun 2018 19:42:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51491277E3; Wed, 27 Jun 2018 19:42:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5RJgul2058791; Wed, 27 Jun 2018 19:42:56 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5RJguX0058790; Wed, 27 Jun 2018 19:42:56 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201806271942.w5RJguX0058790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Jun 2018 19:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335734 - in stable: 10/contrib/amd/amq 11/contrib/amd/amq X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/amd/amq 11/contrib/amd/amq X-SVN-Commit-Revision: 335734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 19:42:57 -0000 Author: cy Date: Wed Jun 27 19:42:55 2018 New Revision: 335734 URL: https://svnweb.freebsd.org/changeset/base/335734 Log: MFC r335355: Fix amq -i timestamp segmentation violation. Modified: stable/10/contrib/amd/amq/amq.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/amd/amq/amq.c Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/amd/amq/amq.c ============================================================================== --- stable/10/contrib/amd/amq/amq.c Wed Jun 27 19:29:15 2018 (r335733) +++ stable/10/contrib/amd/amq/amq.c Wed Jun 27 19:42:55 2018 (r335734) @@ -79,7 +79,7 @@ enum show_opt { static void time_print(time_type tt) { - time_t t = (time_t)*tt; + time_t t = (time_t)(intptr_t)tt; struct tm *tp = localtime(&t); printf("%02d/%02d/%04d %02d:%02d:%02d", tp->tm_mon + 1, tp->tm_mday, From owner-svn-src-stable-10@freebsd.org Wed Jun 27 21:22:01 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A1751012618; Wed, 27 Jun 2018 21:22:01 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09428741EC; Wed, 27 Jun 2018 21:22:01 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF090859; Wed, 27 Jun 2018 21:22:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5RLM0Zr011172; Wed, 27 Jun 2018 21:22:00 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5RLM0n4011171; Wed, 27 Jun 2018 21:22:00 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806272122.w5RLM0n4011171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jun 2018 21:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335744 - stable/10/sys/boot/forth X-SVN-Group: stable-10 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/10/sys/boot/forth X-SVN-Commit-Revision: 335744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 21:22:01 -0000 Author: dteske Date: Wed Jun 27 21:22:00 2018 New Revision: 335744 URL: https://svnweb.freebsd.org/changeset/base/335744 Log: MFC r335607: check-password.4th(8): Fix manual [in]accuracy SVN r280384 updated the maximum password length from 16 bytes to 255. The manual was not updated to reflect this. Sponsored by: Smule, Inc. Modified: stable/10/sys/boot/forth/check-password.4th.8 Modified: stable/10/sys/boot/forth/check-password.4th.8 ============================================================================== --- stable/10/sys/boot/forth/check-password.4th.8 Wed Jun 27 21:13:20 2018 (r335743) +++ stable/10/sys/boot/forth/check-password.4th.8 Wed Jun 27 21:22:00 2018 (r335744) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2015 Devin Teske +.\" Copyright (c) 2011-2018 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2015 +.Dd June 24, 2018 .Dt CHECK-PASSWORD.4TH 8 .Os .Sh NAME @@ -91,7 +91,7 @@ for additional information. The environment variables that effect its behavior are: .Bl -tag -width bootlock_password -offset indent .It Va bootlock_password -Sets the bootlock password (up to 16 characters long) that is required by +Sets the bootlock password (up to 255 characters long) that is required by .Ic check-password to be entered before the system is allowed to boot. .It Va geom_eli_passphrase_prompt @@ -100,7 +100,7 @@ kernel for later mounting of .Xr geli 8 encrypted root device(s). .It Va password -Sets the password (up to 16 characters long) that is required by +Sets the password (up to 255 characters long) that is required by .Ic check-password before the user is allowed to visit the boot menu. .El From owner-svn-src-stable-10@freebsd.org Wed Jun 27 21:25:17 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BEA310127FB; Wed, 27 Jun 2018 21:25:17 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27FF074519; Wed, 27 Jun 2018 21:25:17 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B8B5F2089C; Wed, 27 Jun 2018 21:25:16 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f176.google.com with SMTP id u6-v6so2738187lju.13; Wed, 27 Jun 2018 14:25:16 -0700 (PDT) X-Gm-Message-State: APt69E2b0YFPcdx3Da6Zl9D1rU0PyhB0mM77q8QNNE19a5PPJN+aa9LL PkJgumzVFvjGPX93HIbIfUReJSeo2CKYgRXUo+E= X-Google-Smtp-Source: AAOMgpdqTqpOVpug90zto9d9ydg4q3JdfL/T2vRrW/FbXieX1P4p8rJ1y1Vv9n2bTK4cOmGGbWHSJZUQtfozvgAEIXc= X-Received: by 2002:a2e:8051:: with SMTP id p17-v6mr5140539ljg.22.1530134715153; Wed, 27 Jun 2018 14:25:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:3c0f:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 14:24:54 -0700 (PDT) In-Reply-To: <201806272122.w5RLM0n4011171@repo.freebsd.org> References: <201806272122.w5RLM0n4011171@repo.freebsd.org> From: Kyle Evans Date: Wed, 27 Jun 2018 16:24:54 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335744 - stable/10/sys/boot/forth To: Devin Teske Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 21:25:17 -0000 On Wed, Jun 27, 2018 at 4:22 PM, Devin Teske wrote: > Author: dteske > Date: Wed Jun 27 21:22:00 2018 > New Revision: 335744 > URL: https://svnweb.freebsd.org/changeset/base/335744 > > Log: > MFC r335607: check-password.4th(8): Fix manual [in]accuracy > > SVN r280384 updated the maximum password length from 16 bytes to 255. The > manual was not updated to reflect this. > > Sponsored by: Smule, Inc. > > Modified: > stable/10/sys/boot/forth/check-password.4th.8 > Hi, I think this should probably have been supplemented with a record-only merge of r335607 since it has actually been MFC'd, just in the old location. I'm not sure how much it matters, though, other than reflecting that this (general this; stable/10 commits) really wasn't a direct commit. Thanks, Kyle Evans From owner-svn-src-stable-10@freebsd.org Wed Jun 27 21:57:24 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 646DF1013F56; Wed, 27 Jun 2018 21:57:24 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C25647566F; Wed, 27 Jun 2018 21:57:23 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=63464 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fY970-00061E-1L; Wed, 27 Jun 2018 11:59:50 +0000 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r335744 - stable/10/sys/boot/forth Date: Wed, 27 Jun 2018 14:57:19 -0700 In-Reply-To: Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org To: Kyle Evans References: <201806272122.w5RLM0n4011171@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 21:57:24 -0000 > On Jun 27, 2018, at 2:24 PM, Kyle Evans wrote: >=20 > On Wed, Jun 27, 2018 at 4:22 PM, Devin Teske > wrote: >> Author: dteske >> Date: Wed Jun 27 21:22:00 2018 >> New Revision: 335744 >> URL: https://svnweb.freebsd.org/changeset/base/335744 >>=20 >> Log: >> MFC r335607: check-password.4th(8): Fix manual [in]accuracy >>=20 >> SVN r280384 updated the maximum password length from 16 bytes to = 255. The >> manual was not updated to reflect this. >>=20 >> Sponsored by: Smule, Inc. >>=20 >> Modified: >> stable/10/sys/boot/forth/check-password.4th.8 >>=20 >=20 > Hi, >=20 > I think this should probably have been supplemented with a record-only > merge of r335607 since it has actually been MFC'd, just in the old > location. I'm not sure how much it matters, though, other than > reflecting that this (general this; stable/10 commits) really wasn't a > direct commit. >=20 I kept trying that and kept getting "tree conflict" because it wants to = record info in stand which doesn't exist. Do you have a recommended way to achieve this that has a half-way chance = of working? --=20 Cheers, Devin= From owner-svn-src-stable-10@freebsd.org Wed Jun 27 21:59:22 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE5C1101519D; Wed, 27 Jun 2018 21:59:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C2D07582C; Wed, 27 Jun 2018 21:59:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id ECD8D20BA8; Wed, 27 Jun 2018 21:59:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f45.google.com with SMTP id m12-v6so2093924lfc.10; Wed, 27 Jun 2018 14:59:21 -0700 (PDT) X-Gm-Message-State: APt69E2svHH4Eb2KAEwXUTI8vOEwfLeGrrNbTxv1NhL7TUPhaAwUE8Sl U5uR41xcabmKNp9Cdlw/XASUeTnAUr3NTdU6COg= X-Google-Smtp-Source: AAOMgpfq/CsIhERajPJXzkmJEaRG69UG7GWZtqmIRCCxlhSVcknpzn8TGOqXMi7KW7P11CEHP06D4k25Glag932oQt4= X-Received: by 2002:a19:b598:: with SMTP id g24-v6mr5475331lfk.129.1530136760458; Wed, 27 Jun 2018 14:59:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:3c0f:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 14:58:59 -0700 (PDT) In-Reply-To: References: <201806272122.w5RLM0n4011171@repo.freebsd.org> From: Kyle Evans Date: Wed, 27 Jun 2018 16:58:59 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335744 - stable/10/sys/boot/forth To: Devin Teske Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 21:59:22 -0000 On Wed, Jun 27, 2018 at 4:57 PM, Devin Teske wrote: > > On Jun 27, 2018, at 2:24 PM, Kyle Evans wrote: > > On Wed, Jun 27, 2018 at 4:22 PM, Devin Teske wrote: > > Author: dteske > Date: Wed Jun 27 21:22:00 2018 > New Revision: 335744 > URL: https://svnweb.freebsd.org/changeset/base/335744 > > Log: > MFC r335607: check-password.4th(8): Fix manual [in]accuracy > > SVN r280384 updated the maximum password length from 16 bytes to 255. The > manual was not updated to reflect this. > > Sponsored by: Smule, Inc. > > Modified: > stable/10/sys/boot/forth/check-password.4th.8 > > > Hi, > > I think this should probably have been supplemented with a record-only > merge of r335607 since it has actually been MFC'd, just in the old > location. I'm not sure how much it matters, though, other than > reflecting that this (general this; stable/10 commits) really wasn't a > direct commit. > > > I kept trying that and kept getting "tree conflict" because it wants to > record info in stand which doesn't exist. > > Do you have a recommended way to achieve this that has a half-way chance of > working? > -- Target the base directory should be fine; assuming you're at base/: svn merge -c r335607 --record-only ^/head stable/11 From owner-svn-src-stable-10@freebsd.org Wed Jun 27 23:01:04 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCFA1019D66; Wed, 27 Jun 2018 23:01:04 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCBB8776E7; Wed, 27 Jun 2018 23:01:03 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=1314 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fYA6X-0006er-6t; Wed, 27 Jun 2018 13:03:25 +0000 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r335744 - stable/10/sys/boot/forth Date: Wed, 27 Jun 2018 16:00:55 -0700 In-Reply-To: Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org To: Kyle Evans References: <201806272122.w5RLM0n4011171@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 23:01:04 -0000 > On Jun 27, 2018, at 2:58 PM, Kyle Evans wrote: >=20 > On Wed, Jun 27, 2018 at 4:57 PM, Devin Teske > wrote: >>=20 >> On Jun 27, 2018, at 2:24 PM, Kyle Evans wrote: >>=20 >> On Wed, Jun 27, 2018 at 4:22 PM, Devin Teske = wrote: >>=20 >> Author: dteske >> Date: Wed Jun 27 21:22:00 2018 >> New Revision: 335744 >> URL: https://svnweb.freebsd.org/changeset/base/335744 >>=20 >> Log: >> MFC r335607: check-password.4th(8): Fix manual [in]accuracy >>=20 >> SVN r280384 updated the maximum password length from 16 bytes to 255. = The >> manual was not updated to reflect this. >>=20 >> Sponsored by: Smule, Inc. >>=20 >> Modified: >> stable/10/sys/boot/forth/check-password.4th.8 >>=20 >>=20 >> Hi, >>=20 >> I think this should probably have been supplemented with a = record-only >> merge of r335607 since it has actually been MFC'd, just in the old >> location. I'm not sure how much it matters, though, other than >> reflecting that this (general this; stable/10 commits) really wasn't = a >> direct commit. >>=20 >>=20 >> I kept trying that and kept getting "tree conflict" because it wants = to >> record info in stand which doesn't exist. >>=20 >> Do you have a recommended way to achieve this that has a half-way = chance of >> working? >> -- >=20 > Target the base directory should be fine; assuming you're at base/: >=20 > svn merge -c r335607 --record-only ^/head stable/11 stable/11 ??? --=20 Devin From owner-svn-src-stable-10@freebsd.org Wed Jun 27 23:04:02 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 936B3101A24A; Wed, 27 Jun 2018 23:04:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38ACC77BE9; Wed, 27 Jun 2018 23:04:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C89A8212BA; Wed, 27 Jun 2018 23:04:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f42.google.com with SMTP id n24-v6so2753805lfh.3; Wed, 27 Jun 2018 16:04:01 -0700 (PDT) X-Gm-Message-State: APt69E0fY1DNpGdcCERgqe/Rb2+6+RR0WkbT+AD4bx9bgt0T3qe9qMgU pwjIdDcj5duSTzsBsB4BHmoNFUcSZ/O9xmfX8YE= X-Google-Smtp-Source: AAOMgpefPplGAZAOQmsXspaqkXNxdPo3nfIrkfLLnd0Mf4O1/Cca/LpWx4Uk9gjyBIboIO6urYDDNwGC4qL0wC4KKhI= X-Received: by 2002:a19:ce51:: with SMTP id e78-v6mr4829629lfg.99.1530140640336; Wed, 27 Jun 2018 16:04:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:3c0f:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 16:03:39 -0700 (PDT) In-Reply-To: References: <201806272122.w5RLM0n4011171@repo.freebsd.org> From: Kyle Evans Date: Wed, 27 Jun 2018 18:03:39 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335744 - stable/10/sys/boot/forth To: Devin Teske Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 23:04:02 -0000 On Wed, Jun 27, 2018 at 6:00 PM, Devin Teske wrote: > > On Jun 27, 2018, at 2:58 PM, Kyle Evans wrote: > > On Wed, Jun 27, 2018 at 4:57 PM, Devin Teske wrote: > > > On Jun 27, 2018, at 2:24 PM, Kyle Evans wrote: > > On Wed, Jun 27, 2018 at 4:22 PM, Devin Teske wrote: > > Author: dteske > Date: Wed Jun 27 21:22:00 2018 > New Revision: 335744 > URL: https://svnweb.freebsd.org/changeset/base/335744 > > Log: > MFC r335607: check-password.4th(8): Fix manual [in]accuracy > > SVN r280384 updated the maximum password length from 16 bytes to 255. The > manual was not updated to reflect this. > > Sponsored by: Smule, Inc. > > Modified: > stable/10/sys/boot/forth/check-password.4th.8 > > > Hi, > > I think this should probably have been supplemented with a record-only > merge of r335607 since it has actually been MFC'd, just in the old > location. I'm not sure how much it matters, though, other than > reflecting that this (general this; stable/10 commits) really wasn't a > direct commit. > > > I kept trying that and kept getting "tree conflict" because it wants to > record info in stand which doesn't exist. > > Do you have a recommended way to achieve this that has a half-way chance of > working? > -- > > > Target the base directory should be fine; assuming you're at base/: > > svn merge -c r335607 --record-only ^/head stable/11 > > > stable/11 ??? > -- > Devin > s/11/10/ Works just the same. =) From owner-svn-src-stable-10@freebsd.org Thu Jun 28 07:01:57 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9287C1020E07; Thu, 28 Jun 2018 07:01:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E1F18DC2C; Thu, 28 Jun 2018 07:01:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F6476DDB; Thu, 28 Jun 2018 07:01:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5S71vJD009233; Thu, 28 Jun 2018 07:01:57 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5S71v5o009232; Thu, 28 Jun 2018 07:01:57 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806280701.w5S71v5o009232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 28 Jun 2018 07:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335758 - stable/10 X-SVN-Group: stable-10 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/10 X-SVN-Commit-Revision: 335758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2018 07:01:57 -0000 Author: dteske Date: Thu Jun 28 07:01:56 2018 New Revision: 335758 URL: https://svnweb.freebsd.org/changeset/base/335758 Log: Add mergeinfo for MFC r335607 This is a direct commit on stable/10 accounting for missing mergeinfo from SVN r335744. Difficulties with dealing with 'stand' vs 'sys/boot' in MFCs. Reported by: kevans Sponsored by: Smule, Inc. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Thu Jun 28 21:23:06 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 293EA1027AC6; Thu, 28 Jun 2018 21:23:06 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA3F48F143; Thu, 28 Jun 2018 21:23:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB84E17B87; Thu, 28 Jun 2018 21:23:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5SLN57h067489; Thu, 28 Jun 2018 21:23:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5SLN5dw067487; Thu, 28 Jun 2018 21:23:05 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201806282123.w5SLN5dw067487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 28 Jun 2018 21:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335781 - stable/10/contrib/smbfs/lib/smb X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/contrib/smbfs/lib/smb X-SVN-Commit-Revision: 335781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2018 21:23:06 -0000 Author: brooks Date: Thu Jun 28 21:23:05 2018 New Revision: 335781 URL: https://svnweb.freebsd.org/changeset/base/335781 Log: MFC r335641: Fix a stack overflow in mount_smbfs when hostname is too long. The local hostname was blindly copied into the to the nn_name array. When the hostname exceeded 16 bytes, it would overflow. Truncate the hostname to 15 bytes plus a 0 terminator which is the "workstation name" suffix. Use defensive strlcpy() when filling nn_name in all cases. PR: 228354 Reported by: donald.buchholz@intel.com Reviewed by: jpaetzel, ian (prior version) Discussed with: Security Officer (gtetlow) Security: Stack overflow with the hostname. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15936 Modified: stable/10/contrib/smbfs/lib/smb/ctx.c stable/10/contrib/smbfs/lib/smb/nbns_rq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/smbfs/lib/smb/ctx.c ============================================================================== --- stable/10/contrib/smbfs/lib/smb/ctx.c Thu Jun 28 21:16:50 2018 (r335780) +++ stable/10/contrib/smbfs/lib/smb/ctx.c Thu Jun 28 21:23:05 2018 (r335781) @@ -549,7 +549,9 @@ smb_ctx_resolve(struct smb_ctx *ctx) } nn.nn_scope = ctx->ct_nb->nb_scope; nn.nn_type = NBT_SERVER; - strcpy(nn.nn_name, ssn->ioc_srvname); + if (strlen(ssn->ioc_srvname) > NB_NAMELEN) + return NBERROR(NBERR_NAMETOOLONG); + strlcpy(nn.nn_name, ssn->ioc_srvname, sizeof(nn.nn_name)); error = nb_sockaddr(sap, &nn, &saserver); nb_snbfree(sap); if (error) { @@ -565,7 +567,11 @@ smb_ctx_resolve(struct smb_ctx *ctx) } nls_str_upper(ctx->ct_locname, ctx->ct_locname); } - strcpy(nn.nn_name, ctx->ct_locname); + /* + * Truncate the local host name to NB_NAMELEN-1 which gives a + * suffix of 0 which is "workstation name". + */ + strlcpy(nn.nn_name, ctx->ct_locname, NB_NAMELEN); nn.nn_type = NBT_WKSTA; nn.nn_scope = ctx->ct_nb->nb_scope; error = nb_sockaddr(NULL, &nn, &salocal); Modified: stable/10/contrib/smbfs/lib/smb/nbns_rq.c ============================================================================== --- stable/10/contrib/smbfs/lib/smb/nbns_rq.c Thu Jun 28 21:16:50 2018 (r335780) +++ stable/10/contrib/smbfs/lib/smb/nbns_rq.c Thu Jun 28 21:23:05 2018 (r335781) @@ -74,7 +74,7 @@ nbns_resolvename(const char *name, struct nb_ctx *ctx, if (error) return error; bzero(&nn, sizeof(nn)); - strcpy(nn.nn_name, name); + strlcpy(nn.nn_name, name, sizeof(nn.nn_name)); nn.nn_scope = ctx->nb_scope; nn.nn_type = NBT_SERVER; rqp->nr_nmflags = NBNS_NMFLAG_RD;