CVS commit: src/external/bsd/tmux/dist
Module Name:src Committed By: joerg Date: Tue Jan 7 09:28:57 UTC 2014 Modified Files: src/external/bsd/tmux/dist: log.c Log Message: Fix build with GCC 4.5. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tmux/dist/log.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/tmux/dist/log.c diff -u src/external/bsd/tmux/dist/log.c:1.3 src/external/bsd/tmux/dist/log.c:1.4 --- src/external/bsd/tmux/dist/log.c:1.3 Tue Jan 7 02:11:29 2014 +++ src/external/bsd/tmux/dist/log.c Tue Jan 7 09:28:57 2014 @@ -1,4 +1,4 @@ -/* $Id: log.c,v 1.3 2014/01/07 02:11:29 joerg Exp $ */ +/* $Id: log.c,v 1.4 2014/01/07 09:28:57 joerg Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott n...@users.sourceforge.net @@ -105,7 +105,9 @@ log_vwrite(int pri, const char *msg, va_ } /* Log a warning with error string. */ +#if __GNUC_PREREQ__(4, 6) || defined(__clang__) #pragma GCC diagnostic push +#endif #pragma GCC diagnostic ignored -Wformat-nonliteral void printflike1 log_warn(const char *msg, ...) @@ -120,7 +122,9 @@ log_warn(const char *msg, ...) free(fmt); va_end(ap); } +#if __GNUC_PREREQ__(4, 6) || defined(__clang__) #pragma GCC diagnostic push +#endif /* Log a warning. */ void printflike1
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Tue Jan 7 13:14:39 UTC 2014 Modified Files: src/sys/dev/pci: if_wm.c Log Message: Insert completion barrier between register write and delay(). One exception is chip reset (to avoid hangup). To generate a diff of this commit: cvs rdiff -u -r1.265 -r1.266 src/sys/dev/pci/if_wm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.265 src/sys/dev/pci/if_wm.c:1.266 --- src/sys/dev/pci/if_wm.c:1.265 Sun Dec 29 21:28:41 2013 +++ src/sys/dev/pci/if_wm.c Tue Jan 7 13:14:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.265 2013/12/29 21:28:41 msaitoh Exp $ */ +/* $NetBSD: if_wm.c,v 1.266 2014/01/07 13:14:39 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -76,7 +76,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.265 2013/12/29 21:28:41 msaitoh Exp $); +__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.266 2014/01/07 13:14:39 msaitoh Exp $); #include sys/param.h #include sys/systm.h @@ -4126,8 +4126,9 @@ wm_reset(struct wm_softc *sc) /* Stop the transmit and receive processes. */ CSR_WRITE(sc, WMREG_RCTL, 0); - CSR_WRITE(sc, WMREG_TCTL, TCTL_PSP); sc-sc_rctl = ~RCTL_EN; + CSR_WRITE(sc, WMREG_TCTL, TCTL_PSP); + CSR_WRITE_FLUSH(sc); /* XXX set_tbi_sbp_82543() */ @@ -4152,6 +4153,7 @@ wm_reset(struct wm_softc *sc) if ((sc-sc_type == WM_T_82541) || (sc-sc_type == WM_T_82547)) { CSR_WRITE(sc, WMREG_CTRL, CSR_READ(sc, WMREG_CTRL) | CTRL_PHY_RESET); + CSR_WRITE_FLUSH(sc); delay(5000); } @@ -4212,6 +4214,7 @@ wm_reset(struct wm_softc *sc) } wm_get_swfwhw_semaphore(sc); CSR_WRITE(sc, WMREG_CTRL, reg); + /* Don't insert a completion barrier when reset */ delay(20*1000); wm_put_swfwhw_semaphore(sc); break; @@ -4262,6 +4265,7 @@ wm_reset(struct wm_softc *sc) delay(10); reg = CSR_READ(sc, WMREG_CTRL_EXT) | CTRL_EXT_EE_RST; CSR_WRITE(sc, WMREG_CTRL_EXT, reg); + CSR_WRITE_FLUSH(sc); delay(2000); break; case WM_T_82540: @@ -4288,6 +4292,7 @@ wm_reset(struct wm_softc *sc) delay(10); reg = CSR_READ(sc, WMREG_CTRL_EXT) | CTRL_EXT_EE_RST; CSR_WRITE(sc, WMREG_CTRL_EXT, reg); + CSR_WRITE_FLUSH(sc); } /* check EECD_EE_AUTORD */ wm_get_auto_rd_done(sc); @@ -5209,10 +5214,13 @@ wm_eeprom_sendbits(struct wm_softc *sc, else reg = ~EECD_DI; CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); CSR_WRITE(sc, WMREG_EECD, reg | EECD_SK); + CSR_WRITE_FLUSH(sc); delay(2); CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); } } @@ -5233,10 +5241,12 @@ wm_eeprom_recvbits(struct wm_softc *sc, val = 0; for (x = nbits; x 0; x--) { CSR_WRITE(sc, WMREG_EECD, reg | EECD_SK); + CSR_WRITE_FLUSH(sc); delay(2); if (CSR_READ(sc, WMREG_EECD) EECD_DO) val |= (1U (x - 1)); CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); } *valp = val; @@ -5270,6 +5280,7 @@ wm_read_eeprom_uwire(struct wm_softc *sc CSR_WRITE(sc, WMREG_EECD, reg); reg = ~EECD_SK; CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); } /* XXX: end of workaround */ @@ -5277,6 +5288,7 @@ wm_read_eeprom_uwire(struct wm_softc *sc /* Set CHIP SELECT. */ reg |= EECD_CS; CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); /* Shift in the READ command. */ @@ -5292,6 +5304,7 @@ wm_read_eeprom_uwire(struct wm_softc *sc /* Clear CHIP SELECT. */ reg = CSR_READ(sc, WMREG_EECD) ~EECD_CS; CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); } @@ -5337,6 +5350,7 @@ wm_read_eeprom_spi(struct wm_softc *sc, /* Clear SK and CS. */ reg = CSR_READ(sc, WMREG_EECD) ~(EECD_SK | EECD_CS); CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); if (wm_spi_eeprom_ready(sc)) @@ -5344,8 +5358,10 @@ wm_read_eeprom_spi(struct wm_softc *sc, /* Toggle CS to flush commands. */ CSR_WRITE(sc, WMREG_EECD, reg | EECD_CS); + CSR_WRITE_FLUSH(sc); delay(2); CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); opc = SPI_OPC_READ; @@ -5363,6 +5379,7 @@ wm_read_eeprom_spi(struct wm_softc *sc, /* Raise CS and clear SK. */ reg = (CSR_READ(sc, WMREG_EECD) ~EECD_SK) | EECD_CS; CSR_WRITE(sc, WMREG_EECD, reg); + CSR_WRITE_FLUSH(sc); delay(2); return 0; @@ -5984,12 +6001,14 @@ wm_tbi_mediachange(struct ifnet *ifp) sc-sc_ctrl |= CTRL_SLU | CTRL_FD; sc-sc_ctrl = ~(CTRL_TFCE | CTRL_RFCE); CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl); + CSR_WRITE_FLUSH(sc); delay(1000); } DPRINTF(WM_DEBUG_LINK,(%s: sc_txcw = 0x%x after autoneg check\n, device_xname(sc-sc_dev),sc-sc_txcw)); CSR_WRITE(sc, WMREG_TXCW, sc-sc_txcw); + CSR_WRITE_FLUSH(sc); delay(1); i = CSR_READ(sc, WMREG_CTRL) CTRL_SWDPIN(1); @@
CVS commit: src/distrib/sets
Module Name:src Committed By: christos Date: Tue Jan 7 13:32:38 UTC 2014 Modified Files: src/distrib/sets: makesrctars Log Message: PR/46182: Andreas Gustafsson: Make all files ending in [.-]sh executable. The perfect is the enemy of the good. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/distrib/sets/makesrctars Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/makesrctars diff -u src/distrib/sets/makesrctars:1.38 src/distrib/sets/makesrctars:1.39 --- src/distrib/sets/makesrctars:1.38 Mon Nov 30 11:13:23 2009 +++ src/distrib/sets/makesrctars Tue Jan 7 08:32:38 2014 @@ -1,6 +1,6 @@ #! /bin/sh # -# $NetBSD: makesrctars,v 1.38 2009/11/30 16:13:23 uebayasi Exp $ +# $NetBSD: makesrctars,v 1.39 2014/01/07 13:32:38 christos Exp $ # # makesrctars srcdir setdir # Create source tarballs in setdir from the source under srcdir. @@ -97,7 +97,7 @@ makeset() -e 's:type=dir: mode=0775:' \ -e 's:$: uname=root gname=wsrc:' \ -e '/\/move-if-change /s:\(mode\)=[0-9]*:\1=0775:' \ - -e '/^\.\/build.sh /s:\(mode\)=[0-9]*:\1=0775:' | \ + -e '/^\.\/.*[.-]sh /s:\(mode\)=[0-9]*:\1=0775:' | \ ${PAX} -M -N ${PASSWD} -w -d -s'|^\.|'${srcprefix}'|' | \ ${GZIP_CMD} ${setdir}/${set} rm -f ${intmp}
CVS commit: src/usr.bin/m4
Module Name:src Committed By: wiz Date: Tue Jan 7 13:32:21 UTC 2014 Modified Files: src/usr.bin/m4: m4.1 Log Message: Better document eval, mentioning optional second and third arguments. Requested by martin. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/usr.bin/m4/m4.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/m4/m4.1 diff -u src/usr.bin/m4/m4.1:1.24 src/usr.bin/m4/m4.1:1.25 --- src/usr.bin/m4/m4.1:1.24 Sat Jul 20 21:40:00 2013 +++ src/usr.bin/m4/m4.1 Tue Jan 7 13:32:21 2014 @@ -1,4 +1,4 @@ -.\ $NetBSD: m4.1,v 1.24 2013/07/20 21:40:00 wiz Exp $ +.\ $NetBSD: m4.1,v 1.25 2014/01/07 13:32:21 wiz Exp $ .\ @(#) $OpenBSD: m4.1,v 1.56 2009/10/14 17:19:47 sthen Exp $ .\ .\ Copyright (c) 1989, 1993 @@ -31,7 +31,7 @@ .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\ SUCH DAMAGE. .\ -.Dd October 14, 2009 +.Dd January 7, 2014 .Dt M4 1 .Os .Sh NAME @@ -256,15 +256,17 @@ Prints the first argument on the standar Passes its first argument to a shell and returns the shell's standard output. Note that the shell shares its standard input and standard error with .Nm m4 . -.It Fn eval expr +.It Fn eval expr[,radix[,minimum]] Computes the first argument as an arithmetic expression using 32-bit arithmetic. Operators are the standard C ternary, arithmetic, logical, shift, relational, bitwise, and parentheses operators. You can specify octal, decimal, and hexadecimal numbers as in C. -The second argument (if any) -specifies the radix for the result and the third argument (if any) +The optional second argument +.Fa radix +specifies the radix for the result and the optional third argument +.Fa minimum specifies the minimum number of digits in the result. .It Fn expr expr This is an alias for
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: njoly Date: Tue Jan 7 13:34:11 UTC 2014 Modified Files: src/lib/libc/stdio: fparseln.3 Log Message: Kill unneeded paragraph macro. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/stdio/fparseln.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdio/fparseln.3 diff -u src/lib/libc/stdio/fparseln.3:1.4 src/lib/libc/stdio/fparseln.3:1.5 --- src/lib/libc/stdio/fparseln.3:1.4 Wed Oct 21 01:07:45 2009 +++ src/lib/libc/stdio/fparseln.3 Tue Jan 7 13:34:11 2014 @@ -1,4 +1,4 @@ -.\ $NetBSD: fparseln.3,v 1.4 2009/10/21 01:07:45 snj Exp $ +.\ $NetBSD: fparseln.3,v 1.5 2014/01/07 13:34:11 njoly Exp $ .\ .\ Copyright (c) 1997 Christos Zoulas. All rights reserved. .\ @@ -114,7 +114,6 @@ Remove escape preceding any other charac .It Dv FPARSELN_UNESCALL All of the above. .El -.Pp .El .Sh RETURN VALUES Upon successful completion a pointer to the parsed line is returned;
CVS commit: src
Module Name:src Committed By: gson Date: Tue Jan 7 16:47:13 UTC 2014 Modified Files: src/distrib/sets/lists/tests: mi src/etc/mtree: NetBSD.dist.tests src/tests/usr.bin: Makefile Added Files: src/tests/usr.bin/vmstat: Makefile t_vmstat.sh Log Message: Add some minimal tests of vmstat(1), to serve as regression tests for PR bin/44518. To generate a diff of this commit: cvs rdiff -u -r1.554 -r1.555 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.98 -r1.99 src/etc/mtree/NetBSD.dist.tests cvs rdiff -u -r1.18 -r1.19 src/tests/usr.bin/Makefile cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/vmstat/Makefile \ src/tests/usr.bin/vmstat/t_vmstat.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.554 src/distrib/sets/lists/tests/mi:1.555 --- src/distrib/sets/lists/tests/mi:1.554 Mon Jan 6 14:50:32 2014 +++ src/distrib/sets/lists/tests/mi Tue Jan 7 16:47:13 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.554 2014/01/06 14:50:32 gson Exp $ +# $NetBSD: mi,v 1.555 2014/01/07 16:47:13 gson Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -3065,6 +3065,9 @@ ./usr/tests/usr.bin/unifdef/d_basic.in tests-usr.bin-tests atf ./usr/tests/usr.bin/unifdef/d_basic.out tests-usr.bin-tests atf ./usr/tests/usr.bin/unifdef/t_basic tests-usr.bin-tests atf +./usr/tests/usr.bin/vmstat tests-usr.bin-tests +./usr/tests/usr.bin/vmstat/Atffile tests-usr.bin-tests atf +./usr/tests/usr.bin/vmstat/t_vmstat tests-usr.bin-tests atf ./usr/tests/usr.bin/xlint tests-usr.bin-tests ./usr/tests/usr.bin/xlint/Atffile tests-usr.bin-tests atf ./usr/tests/usr.bin/xlint/Kyuafile tests-usr.bin-tests atf,kyua Index: src/etc/mtree/NetBSD.dist.tests diff -u src/etc/mtree/NetBSD.dist.tests:1.98 src/etc/mtree/NetBSD.dist.tests:1.99 --- src/etc/mtree/NetBSD.dist.tests:1.98 Sun Aug 11 03:53:12 2013 +++ src/etc/mtree/NetBSD.dist.tests Tue Jan 7 16:47:13 2014 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.tests,v 1.98 2013/08/11 03:53:12 dholland Exp $ +# $NetBSD: NetBSD.dist.tests,v 1.99 2014/01/07 16:47:13 gson Exp $ ./usr/libdata/debug/usr/tests ./usr/libdata/debug/usr/tests/atf @@ -363,6 +363,7 @@ ./usr/tests/usr.bin/tmux ./usr/tests/usr.bin/tr ./usr/tests/usr.bin/unifdef +./usr/tests/usr.bin/vmstat ./usr/tests/usr.bin/xlint ./usr/tests/usr.bin/xlint/lint1 ./usr/tests/usr.sbin Index: src/tests/usr.bin/Makefile diff -u src/tests/usr.bin/Makefile:1.18 src/tests/usr.bin/Makefile:1.19 --- src/tests/usr.bin/Makefile:1.18 Sat Aug 10 22:36:16 2013 +++ src/tests/usr.bin/Makefile Tue Jan 7 16:47:13 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.18 2013/08/10 22:36:16 dholland Exp $ +# $NetBSD: Makefile,v 1.19 2014/01/07 16:47:13 gson Exp $ # .include bsd.own.mk @@ -8,6 +8,6 @@ TESTSDIR= ${TESTSBASE}/usr.bin TESTS_SUBDIRS= awk basename bzip2 cc cmp config cut \ diff dirname find grep gzip id infocmp jot m4 make mkdep \ nbperf netpgpverify pr rump_server shmif_dumpbus sdiff \ - sed sort tmux tr unifdef xlint + sed sort tmux tr unifdef vmstat xlint .include bsd.test.mk Added files: Index: src/tests/usr.bin/vmstat/Makefile diff -u /dev/null src/tests/usr.bin/vmstat/Makefile:1.1 --- /dev/null Tue Jan 7 16:47:13 2014 +++ src/tests/usr.bin/vmstat/Makefile Tue Jan 7 16:47:13 2014 @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.1 2014/01/07 16:47:13 gson Exp $ + +.include bsd.own.mk + +TESTSDIR= ${TESTSBASE}/usr.bin/vmstat +TESTS_SH= t_vmstat + +.include bsd.test.mk Index: src/tests/usr.bin/vmstat/t_vmstat.sh diff -u /dev/null src/tests/usr.bin/vmstat/t_vmstat.sh:1.1 --- /dev/null Tue Jan 7 16:47:13 2014 +++ src/tests/usr.bin/vmstat/t_vmstat.sh Tue Jan 7 16:47:13 2014 @@ -0,0 +1,48 @@ +# $NetBSD: t_vmstat.sh,v 1.1 2014/01/07 16:47:13 gson Exp $ +# +# Copyright (c) 2013 The NetBSD Foundation, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR
CVS commit: [netbsd-6] xsrc
Module Name:xsrc Committed By: bouyer Date: Tue Jan 7 18:02:29 UTC 2014 Modified Files: xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-6]: bdfread.c xsrc/xfree/xc/lib/font/bitmap [netbsd-6]: bdfread.c Log Message: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.cpatch xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch Fix CVE-2013-6462: scanf without field width limits can crash with huge input data. [wiz, ticket #1011] To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.1.1.2.2.1 \ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c cvs rdiff -u -r1.2 -r1.2.8.1 xsrc/xfree/xc/lib/font/bitmap/bdfread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c diff -u xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2.2.1 --- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2 Wed Jun 10 07:33:40 2009 +++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c Tue Jan 7 18:02:29 2014 @@ -72,6 +72,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -341,7 +342,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -547,13 +548,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -636,7 +642,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, +BDFLINESTR BDFLINESTR BDFLINESTR, +namebuf, secondbuf, thirdbuf)) { default: bdfError(missing '%s' parameter value\n, namebuf); goto BAILOUT; Index: xsrc/xfree/xc/lib/font/bitmap/bdfread.c diff -u xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2.8.1 --- xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 Tue Apr 3 20:10:34 2007 +++ xsrc/xfree/xc/lib/font/bitmap/bdfread.c Tue Jan 7 18:02:29 2014 @@ -70,6 +70,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -340,7 +341,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -549,13 +550,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -639,7 +645,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) { default:
CVS commit: [netbsd-6-1] xsrc
Module Name:xsrc Committed By: bouyer Date: Tue Jan 7 18:02:33 UTC 2014 Modified Files: xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-6-1]: bdfread.c xsrc/xfree/xc/lib/font/bitmap [netbsd-6-1]: bdfread.c Log Message: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.cpatch xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch Fix CVE-2013-6462: scanf without field width limits can crash with huge input data. [wiz, ticket #1011] To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.1.1.2.6.1 \ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c cvs rdiff -u -r1.2 -r1.2.14.1 xsrc/xfree/xc/lib/font/bitmap/bdfread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c diff -u xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2.6.1 --- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2 Wed Jun 10 07:33:40 2009 +++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c Tue Jan 7 18:02:33 2014 @@ -72,6 +72,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -341,7 +342,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -547,13 +548,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -636,7 +642,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, +BDFLINESTR BDFLINESTR BDFLINESTR, +namebuf, secondbuf, thirdbuf)) { default: bdfError(missing '%s' parameter value\n, namebuf); goto BAILOUT; Index: xsrc/xfree/xc/lib/font/bitmap/bdfread.c diff -u xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2.14.1 --- xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 Tue Apr 3 20:10:34 2007 +++ xsrc/xfree/xc/lib/font/bitmap/bdfread.c Tue Jan 7 18:02:33 2014 @@ -70,6 +70,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -340,7 +341,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -549,13 +550,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -639,7 +645,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) { default:
CVS commit: [netbsd-6-0] xsrc
Module Name:xsrc Committed By: bouyer Date: Tue Jan 7 18:02:38 UTC 2014 Modified Files: xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-6-0]: bdfread.c xsrc/xfree/xc/lib/font/bitmap [netbsd-6-0]: bdfread.c Log Message: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.cpatch xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch Fix CVE-2013-6462: scanf without field width limits can crash with huge input data. [wiz, ticket #1011] To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.1.1.2.4.1 \ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c cvs rdiff -u -r1.2 -r1.2.10.1 xsrc/xfree/xc/lib/font/bitmap/bdfread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c diff -u xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2.4.1 --- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.2 Wed Jun 10 07:33:40 2009 +++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c Tue Jan 7 18:02:37 2014 @@ -72,6 +72,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -341,7 +342,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -547,13 +548,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -636,7 +642,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, +BDFLINESTR BDFLINESTR BDFLINESTR, +namebuf, secondbuf, thirdbuf)) { default: bdfError(missing '%s' parameter value\n, namebuf); goto BAILOUT; Index: xsrc/xfree/xc/lib/font/bitmap/bdfread.c diff -u xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2.10.1 --- xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 Tue Apr 3 20:10:34 2007 +++ xsrc/xfree/xc/lib/font/bitmap/bdfread.c Tue Jan 7 18:02:38 2014 @@ -70,6 +70,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -340,7 +341,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -549,13 +550,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -639,7 +645,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) { default:
CVS commit: [netbsd-6-1] src/doc
Module Name:src Committed By: bouyer Date: Tue Jan 7 18:03:24 UTC 2014 Modified Files: src/doc [netbsd-6-1]: CHANGES-6.1.3 Log Message: ticket 1011 To generate a diff of this commit: cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-6.1.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.1.3 diff -u src/doc/CHANGES-6.1.3:1.1.2.12 src/doc/CHANGES-6.1.3:1.1.2.13 --- src/doc/CHANGES-6.1.3:1.1.2.12 Mon Jan 6 19:13:04 2014 +++ src/doc/CHANGES-6.1.3 Tue Jan 7 18:03:24 2014 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.1.3,v 1.1.2.12 2014/01/06 19:13:04 bouyer Exp $ +# $NetBSD: CHANGES-6.1.3,v 1.1.2.13 2014/01/07 18:03:24 bouyer Exp $ A complete list of changes from the NetBSD 6.1.1 release to the NetBSD 6.1.2 release: @@ -153,3 +153,10 @@ external/bsd/ntp/dist/ntpd/ntp_request.c improve comments [spz, ticket #1010] +xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c patch +xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch + + Fix CVE-2013-6462: scanf without field width limits can crash + with huge input data. + [wiz, ticket #1011] +
CVS commit: [netbsd-5] xsrc
Module Name:xsrc Committed By: bouyer Date: Tue Jan 7 18:07:17 UTC 2014 Modified Files: xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-5]: bdfread.c xsrc/xfree/xc/lib/font/bitmap [netbsd-5]: bdfread.c Log Message: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.cpatch xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch Fix CVE-2013-6462: scanf without field width limits can crash with huge input data. [wiz, ticket #1896] To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 \ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c cvs rdiff -u -r1.2 -r1.2.2.1 xsrc/xfree/xc/lib/font/bitmap/bdfread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c diff -u xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.1 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.2 --- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.1 Thu Sep 17 03:33:14 2009 +++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c Tue Jan 7 18:07:17 2014 @@ -72,6 +72,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -341,7 +342,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -547,13 +548,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -636,7 +642,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) { default: bdfError(missing '%s' parameter value\n, namebuf); goto BAILOUT; Index: xsrc/xfree/xc/lib/font/bitmap/bdfread.c diff -u xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2.2.1 --- xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 Tue Apr 3 20:10:34 2007 +++ xsrc/xfree/xc/lib/font/bitmap/bdfread.c Tue Jan 7 18:07:17 2014 @@ -70,6 +70,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -340,7 +341,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -549,13 +550,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -639,7 +645,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) { default:
CVS commit: [netbsd-5-2] xsrc
Module Name:xsrc Committed By: bouyer Date: Tue Jan 7 18:07:21 UTC 2014 Modified Files: xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-5-2]: bdfread.c xsrc/xfree/xc/lib/font/bitmap [netbsd-5-2]: bdfread.c Log Message: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.cpatch xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch Fix CVE-2013-6462: scanf without field width limits can crash with huge input data. [wiz, ticket #1896] To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.1.4.1 \ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c cvs rdiff -u -r1.2 -r1.2.12.1 xsrc/xfree/xc/lib/font/bitmap/bdfread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c diff -u xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.1 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.1.4.1 --- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.1 Thu Sep 17 03:33:14 2009 +++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c Tue Jan 7 18:07:21 2014 @@ -72,6 +72,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -341,7 +342,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -547,13 +548,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -636,7 +642,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) { default: bdfError(missing '%s' parameter value\n, namebuf); goto BAILOUT; Index: xsrc/xfree/xc/lib/font/bitmap/bdfread.c diff -u xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2.12.1 --- xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 Tue Apr 3 20:10:34 2007 +++ xsrc/xfree/xc/lib/font/bitmap/bdfread.c Tue Jan 7 18:07:21 2014 @@ -70,6 +70,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -340,7 +341,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -549,13 +550,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -639,7 +645,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) {
CVS commit: [netbsd-6-0] src/doc
Module Name:src Committed By: bouyer Date: Tue Jan 7 18:03:21 UTC 2014 Modified Files: src/doc [netbsd-6-0]: CHANGES-6.0.4 Log Message: ticket 1011 To generate a diff of this commit: cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-6.0.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.0.4 diff -u src/doc/CHANGES-6.0.4:1.1.2.12 src/doc/CHANGES-6.0.4:1.1.2.13 --- src/doc/CHANGES-6.0.4:1.1.2.12 Mon Jan 6 19:13:07 2014 +++ src/doc/CHANGES-6.0.4 Tue Jan 7 18:03:20 2014 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.0.4,v 1.1.2.12 2014/01/06 19:13:07 bouyer Exp $ +# $NetBSD: CHANGES-6.0.4,v 1.1.2.13 2014/01/07 18:03:20 bouyer Exp $ A complete list of changes from the NetBSD 6.0.3 release to the NetBSD 6.0.4 release: @@ -145,3 +145,10 @@ external/bsd/ntp/dist/ntpd/ntp_request.c improve comments [spz, ticket #1010] +xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c patch +xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch + + Fix CVE-2013-6462: scanf without field width limits can crash + with huge input data. + [wiz, ticket #1011] +
CVS commit: [netbsd-5-2] src/doc
Module Name:src Committed By: bouyer Date: Tue Jan 7 18:08:18 UTC 2014 Modified Files: src/doc [netbsd-5-2]: CHANGES-5.2.2 Log Message: ticket #1896 To generate a diff of this commit: cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/doc/CHANGES-5.2.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.2.2 diff -u src/doc/CHANGES-5.2.2:1.1.2.7 src/doc/CHANGES-5.2.2:1.1.2.8 --- src/doc/CHANGES-5.2.2:1.1.2.7 Mon Jan 6 19:29:04 2014 +++ src/doc/CHANGES-5.2.2 Tue Jan 7 18:08:18 2014 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.2.2,v 1.1.2.7 2014/01/06 19:29:04 bouyer Exp $ +# $NetBSD: CHANGES-5.2.2,v 1.1.2.8 2014/01/07 18:08:18 bouyer Exp $ A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.2.1 release: @@ -54,3 +54,10 @@ distrib/ews4800mips/Makefile 1.3 Should prevent the iso image from being created in the source tree [apb, ticket #1894] +xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c patch +xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch + + Fix CVE-2013-6462: scanf without field width limits can crash + with huge input data. + [wiz, ticket #1896] +
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: bouyer Date: Tue Jan 7 18:08:20 UTC 2014 Modified Files: src/doc [netbsd-5]: CHANGES-5.3 Log Message: ticket #1896 To generate a diff of this commit: cvs rdiff -u -r1.1.2.45 -r1.1.2.46 src/doc/CHANGES-5.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.3 diff -u src/doc/CHANGES-5.3:1.1.2.45 src/doc/CHANGES-5.3:1.1.2.46 --- src/doc/CHANGES-5.3:1.1.2.45 Mon Jan 6 19:29:01 2014 +++ src/doc/CHANGES-5.3 Tue Jan 7 18:08:20 2014 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.3,v 1.1.2.45 2014/01/06 19:29:01 bouyer Exp $ +# $NetBSD: CHANGES-5.3,v 1.1.2.46 2014/01/07 18:08:20 bouyer Exp $ A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3 release: @@ -693,3 +693,10 @@ distrib/ews4800mips/Makefile 1.3 Should prevent the iso image from being created in the source tree [apb, ticket #1894] +xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c patch +xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch + + Fix CVE-2013-6462: scanf without field width limits can crash + with huge input data. + [wiz, ticket #1896] +
CVS commit: [netbsd-5-1] src/doc
Module Name:src Committed By: bouyer Date: Tue Jan 7 18:08:15 UTC 2014 Modified Files: src/doc [netbsd-5-1]: CHANGES-5.1.4 Log Message: ticket #1896 To generate a diff of this commit: cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/doc/CHANGES-5.1.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.1.4 diff -u src/doc/CHANGES-5.1.4:1.1.2.7 src/doc/CHANGES-5.1.4:1.1.2.8 --- src/doc/CHANGES-5.1.4:1.1.2.7 Mon Jan 6 19:29:05 2014 +++ src/doc/CHANGES-5.1.4 Tue Jan 7 18:08:15 2014 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1.4,v 1.1.2.7 2014/01/06 19:29:05 bouyer Exp $ +# $NetBSD: CHANGES-5.1.4,v 1.1.2.8 2014/01/07 18:08:15 bouyer Exp $ A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3 release: @@ -54,3 +54,10 @@ distrib/ews4800mips/Makefile 1.3 Should prevent the iso image from being created in the source tree [apb, ticket #1894] +xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c patch +xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch + + Fix CVE-2013-6462: scanf without field width limits can crash + with huge input data. + [wiz, ticket #1896] +
CVS commit: [netbsd-5-1] xsrc
Module Name:xsrc Committed By: bouyer Date: Tue Jan 7 18:07:27 UTC 2014 Modified Files: xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-5-1]: bdfread.c xsrc/xfree/xc/lib/font/bitmap [netbsd-5-1]: bdfread.c Log Message: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.cpatch xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch Fix CVE-2013-6462: scanf without field width limits can crash with huge input data. [wiz, ticket #1896] To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.1.2.1 \ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c cvs rdiff -u -r1.2 -r1.2.6.1 xsrc/xfree/xc/lib/font/bitmap/bdfread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c diff -u xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.1 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.1.2.1 --- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c:1.1.1.1.2.1 Thu Sep 17 03:33:14 2009 +++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c Tue Jan 7 18:07:27 2014 @@ -72,6 +72,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -341,7 +342,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -547,13 +548,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -636,7 +642,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) { default: bdfError(missing '%s' parameter value\n, namebuf); goto BAILOUT; Index: xsrc/xfree/xc/lib/font/bitmap/bdfread.c diff -u xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2.6.1 --- xsrc/xfree/xc/lib/font/bitmap/bdfread.c:1.2 Tue Apr 3 20:10:34 2007 +++ xsrc/xfree/xc/lib/font/bitmap/bdfread.c Tue Jan 7 18:07:27 2014 @@ -70,6 +70,7 @@ from The Open Group. #define INDICES 256 #define MAXENCODING 0x #define BDFLINELEN 1024 +#define BDFLINESTR %1023s /* scanf specifier to read a BDFLINELEN string */ static Bool bdfPadToTerminal(FontPtr pFont); extern int bdfFileLineNum; @@ -340,7 +341,7 @@ bdfReadCharacters(FontFilePtr file, Font charcharName[100]; int ignore; - if (sscanf((char *) line, STARTCHAR %s, charName) != 1) { + if (sscanf((char *) line, STARTCHAR %99s, charName) != 1) { bdfError(bad character name in BDF file\n); goto BAILOUT; /* bottom of function, free and return error */ } @@ -549,13 +550,18 @@ bdfReadHeader(FontFilePtr file, bdfFileS unsigned charlineBuf[BDFLINELEN]; line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, STARTFONT %s, namebuf) != 1 || +if (!line || + sscanf((char *) line, STARTFONT BDFLINESTR, namebuf) != 1 || !bdfStrEqual(namebuf, 2.1)) { bdfError(bad 'STARTFONT'\n); return (FALSE); } line = bdfGetLine(file, lineBuf, BDFLINELEN); -if (!line || sscanf((char *) line, FONT %[^\n], pState-fontName) != 1) { +#if MAXFONTNAMELEN != 1024 +# error need to adjust sscanf length limit to be MAXFONTNAMELEN - 1 +#endif +if (!line || + sscanf((char *) line, FONT %1023[^\n], pState-fontName) != 1) { bdfError(bad 'FONT'\n); return (FALSE); } @@ -639,7 +645,9 @@ bdfReadProperties(FontFilePtr file, Font while (*line isspace(*line)) line++; - switch (sscanf((char *) line, %s%s%s, namebuf, secondbuf, thirdbuf)) { + switch (sscanf((char *) line, + BDFLINESTR BDFLINESTR BDFLINESTR, + namebuf, secondbuf, thirdbuf)) {
CVS commit: [netbsd-6] src/doc
Module Name:src Committed By: bouyer Date: Tue Jan 7 18:03:26 UTC 2014 Modified Files: src/doc [netbsd-6]: CHANGES-6.2 Log Message: ticket 1011 To generate a diff of this commit: cvs rdiff -u -r1.1.2.74 -r1.1.2.75 src/doc/CHANGES-6.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-6.2 diff -u src/doc/CHANGES-6.2:1.1.2.74 src/doc/CHANGES-6.2:1.1.2.75 --- src/doc/CHANGES-6.2:1.1.2.74 Mon Jan 6 19:13:15 2014 +++ src/doc/CHANGES-6.2 Tue Jan 7 18:03:26 2014 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-6.2,v 1.1.2.74 2014/01/06 19:13:15 bouyer Exp $ +# $NetBSD: CHANGES-6.2,v 1.1.2.75 2014/01/07 18:03:26 bouyer Exp $ A complete list of changes from the 6.1 release until the 6.2 release: @@ -1167,3 +1167,10 @@ external/bsd/ntp/dist/ntpd/ntp_request.c improve comments [spz, ticket #1010] +xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c patch +xsrc/xfree/xc/lib/font/bitmap/bdfread.c patch + + Fix CVE-2013-6462: scanf without field width limits can crash + with huge input data. + [wiz, ticket #1011] +
CVS commit: src/sys/arch/sparc64
Module Name:src Committed By: palle Date: Tue Jan 7 20:11:35 UTC 2014 Modified Files: src/sys/arch/sparc64/include: cpu.h sparc64.h src/sys/arch/sparc64/sparc64: cpu.c genassym.cf locore.s ofw_machdep.c pmap.c Log Message: sun4v: trap table setup - currently populated with dummy entries which will be properly implemented later - parts from OpenBSD - OK martin@ To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.107 src/sys/arch/sparc64/include/cpu.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc64/include/sparc64.h cvs rdiff -u -r1.106 -r1.107 src/sys/arch/sparc64/sparc64/cpu.c cvs rdiff -u -r1.68 -r1.69 src/sys/arch/sparc64/sparc64/genassym.cf cvs rdiff -u -r1.352 -r1.353 src/sys/arch/sparc64/sparc64/locore.s cvs rdiff -u -r1.40 -r1.41 src/sys/arch/sparc64/sparc64/ofw_machdep.c cvs rdiff -u -r1.284 -r1.285 src/sys/arch/sparc64/sparc64/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/include/cpu.h diff -u src/sys/arch/sparc64/include/cpu.h:1.106 src/sys/arch/sparc64/include/cpu.h:1.107 --- src/sys/arch/sparc64/include/cpu.h:1.106 Mon Dec 16 20:17:35 2013 +++ src/sys/arch/sparc64/include/cpu.h Tue Jan 7 20:11:35 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.106 2013/12/16 20:17:35 palle Exp $ */ +/* $NetBSD: cpu.h,v 1.107 2014/01/07 20:11:35 palle Exp $ */ /* * Copyright (c) 1992, 1993 @@ -174,6 +174,12 @@ struct cpu_info { pte_t *ci_tsb_dmmu; pte_t *ci_tsb_immu; +#ifdef SUN4V + /* MMU Fault Status Area. Will be initialized to the physical + address of the bottom of the interrupt stack */ + paddr_t ci_mmfsa; +#endif + /* probe fault in PCI config space reads */ bool ci_pci_probe; bool ci_pci_fault; Index: src/sys/arch/sparc64/include/sparc64.h diff -u src/sys/arch/sparc64/include/sparc64.h:1.11 src/sys/arch/sparc64/include/sparc64.h:1.12 --- src/sys/arch/sparc64/include/sparc64.h:1.11 Sat Feb 20 16:46:38 2010 +++ src/sys/arch/sparc64/include/sparc64.h Tue Jan 7 20:11:35 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sparc64.h,v 1.11 2010/02/20 16:46:38 martin Exp $ */ +/* $NetBSD: sparc64.h,v 1.12 2014/01/07 20:11:35 palle Exp $ */ /* * Copyright (C) 1996 Wolfgang Solfrank. @@ -38,7 +38,10 @@ struct mem_region { uint64_t size; }; -int prom_set_trap_table(vaddr_t); +int prom_set_trap_table_sun4u(vaddr_t); +#ifdef SUN4V +int prom_set_trap_table_sun4v(vaddr_t, paddr_t); +#endif paddr_t prom_vtop(vaddr_t); vaddr_t prom_claim_virt(vaddr_t, int); vaddr_t prom_alloc_virt(int, int); Index: src/sys/arch/sparc64/sparc64/cpu.c diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.106 src/sys/arch/sparc64/sparc64/cpu.c:1.107 --- src/sys/arch/sparc64/sparc64/cpu.c:1.106 Mon Dec 16 20:17:35 2013 +++ src/sys/arch/sparc64/sparc64/cpu.c Tue Jan 7 20:11:35 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.106 2013/12/16 20:17:35 palle Exp $ */ +/* $NetBSD: cpu.c,v 1.107 2014/01/07 20:11:35 palle Exp $ */ /* * Copyright (c) 1996 @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.106 2013/12/16 20:17:35 palle Exp $); +__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.107 2014/01/07 20:11:35 palle Exp $); #include opt_multiprocessor.h @@ -179,6 +179,10 @@ alloc_cpuinfo(u_int cpu_node) cpi-ci_spinup = NULL; cpi-ci_paddr = pa0; cpi-ci_self = cpi; +#ifdef SUN4V + if ( CPU_ISSUN4V ) + cpi-ci_mmfsa = pa0; +#endif cpi-ci_node = cpu_node; cpi-ci_idepth = -1; memset(cpi-ci_intrpending, -1, sizeof(cpi-ci_intrpending)); Index: src/sys/arch/sparc64/sparc64/genassym.cf diff -u src/sys/arch/sparc64/sparc64/genassym.cf:1.68 src/sys/arch/sparc64/sparc64/genassym.cf:1.69 --- src/sys/arch/sparc64/sparc64/genassym.cf:1.68 Sat Dec 28 11:12:09 2013 +++ src/sys/arch/sparc64/sparc64/genassym.cf Tue Jan 7 20:11:35 2014 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.68 2013/12/28 11:12:09 nakayama Exp $ +# $NetBSD: genassym.cf,v 1.69 2014/01/07 20:11:35 palle Exp $ # # Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -163,6 +163,9 @@ define CI_TICK_IH offsetof(struct cpu_in define CI_CTXBUSY offsetof(struct cpu_info, ci_ctxbusy) define CI_TSB_DMMU offsetof(struct cpu_info, ci_tsb_dmmu) define CI_TSB_IMMU offsetof(struct cpu_info, ci_tsb_immu) +#ifdef SUN4V +define CI_MMFSAoffsetof(struct cpu_info, ci_mmfsa) +#endif ifdef MULTIPROCESSOR define CI_IPIEVC offsetof(struct cpu_info, ci_ipi_evcnt[0].ev_count) endif Index: src/sys/arch/sparc64/sparc64/locore.s diff -u src/sys/arch/sparc64/sparc64/locore.s:1.352 src/sys/arch/sparc64/sparc64/locore.s:1.353 --- src/sys/arch/sparc64/sparc64/locore.s:1.352 Sun Dec 29 12:36:30 2013 +++ src/sys/arch/sparc64/sparc64/locore.s Tue Jan 7 20:11:35 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.352 2013/12/29 12:36:30 nakayama Exp $ */ +/* $NetBSD: locore.s,v 1.353 2014/01/07 20:11:35 palle Exp $ */ /* * Copyright (c) 2006-2010 Matthew R. Green @@ -864,6 +864,27
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: degroote Date: Tue Jan 7 20:25:24 UTC 2014 Modified Files: src/sbin/ifconfig: ieee80211.c ifconfig.8 Log Message: Before scanning, check if the card is up. If it is not the case, exit with some useful error message. Add some note about this fact in the man page too. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sbin/ifconfig/ieee80211.c cvs rdiff -u -r1.105 -r1.106 src/sbin/ifconfig/ifconfig.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ieee80211.c diff -u src/sbin/ifconfig/ieee80211.c:1.25 src/sbin/ifconfig/ieee80211.c:1.26 --- src/sbin/ifconfig/ieee80211.c:1.25 Mon Dec 13 17:35:08 2010 +++ src/sbin/ifconfig/ieee80211.c Tue Jan 7 20:25:24 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211.c,v 1.25 2010/12/13 17:35:08 pooka Exp $ */ +/* $NetBSD: ieee80211.c,v 1.26 2014/01/07 20:25:24 degroote Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: ieee80211.c,v 1.25 2010/12/13 17:35:08 pooka Exp $); +__RCSID($NetBSD: ieee80211.c,v 1.26 2014/01/07 20:25:24 degroote Exp $); #endif /* not lint */ #include sys/param.h @@ -463,8 +463,19 @@ setifpowersavesleep(prop_dictionary_t en static int scan_exec(prop_dictionary_t env, prop_dictionary_t oenv) { + struct ifreq ifr; + + if (direct_ioctl(env, SIOCGIFFLAGS, ifr) == -1) { + perror(ioctl(SIOCGIFFLAGS); + return -1; + } + + if ((ifr.ifr_flags IFF_UP) == 0) + errx(EXIT_FAILURE, The interface must be up before scanning.); + scan_and_wait(env); list_scan(env); + return 0; } Index: src/sbin/ifconfig/ifconfig.8 diff -u src/sbin/ifconfig/ifconfig.8:1.105 src/sbin/ifconfig/ifconfig.8:1.106 --- src/sbin/ifconfig/ifconfig.8:1.105 Sat Nov 9 13:10:35 2013 +++ src/sbin/ifconfig/ifconfig.8 Tue Jan 7 20:25:24 2014 @@ -1,4 +1,4 @@ -.\ $NetBSD: ifconfig.8,v 1.105 2013/11/09 13:10:35 kefren Exp $ +.\ $NetBSD: ifconfig.8,v 1.106 2014/01/07 20:25:24 degroote Exp $ .\ .\ Copyright (c) 1983, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -503,6 +503,7 @@ The flag may be used to display long SSIDs. .Fl v also causes received information elements to be displayed symbolically. +The interface must be up before any scanning operation. Only the super-user can use this command. .It Cm tunnel Ar src_addr Ns Oo Ar ,src_port Oc Ar dest_addr Ns Oo Ar ,dest_port .Oc
CVS commit: src/external/bsd/nvi/dist/common
Module Name:src Committed By: christos Date: Tue Jan 7 21:46:47 UTC 2014 Modified Files: src/external/bsd/nvi/dist/common: conv.c Log Message: handle unaligned accesses To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/nvi/dist/common/conv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/nvi/dist/common/conv.c diff -u src/external/bsd/nvi/dist/common/conv.c:1.2 src/external/bsd/nvi/dist/common/conv.c:1.3 --- src/external/bsd/nvi/dist/common/conv.c:1.2 Fri Nov 22 10:52:05 2013 +++ src/external/bsd/nvi/dist/common/conv.c Tue Jan 7 16:46:47 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: conv.c,v 1.2 2013/11/22 15:52:05 christos Exp $ */ +/* $NetBSD: conv.c,v 1.3 2014/01/07 21:46:47 christos Exp $ */ /*- * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -53,8 +53,10 @@ raw2int(SCR *sp, const char * str, ssize BINC_RETW(NULL, *tostr, *blen, len); *tolen = len; -for (i = 0; i len; ++i) - (*tostr)[i] = (u_char) str[i]; +for (i = 0; i len; ++i) { + CHAR_T w = (u_char)str[i]; + memcpy((*tostr) + i, w, sizeof(**tostr)); +} *dst = cw-bp1; @@ -131,11 +133,15 @@ default_char2int(SCR *sp, const char * s #endif for (i = 0, j = 0; j len; ) { - n = mbrtowc((*tostr)+i, src+j, len-j, mbs); + CHAR_T w; + n = mbrtowc(w, src + j, len - j, mbs); + memcpy((*tostr) + i, w, sizeof(**tostr)); /* NULL character converted */ - if (n == (size_t)-2) error = -(len-j); - if (n == (size_t)-1 || n == (size_t)-2) - HANDLE_MBR_ERROR(n, mbs, (*tostr)[i], src[j]); + if (n == (size_t)-2) error = -(len - j); + if (n == (size_t)-1 || n == (size_t)-2) { + HANDLE_MBR_ERROR(n, mbs, w, src[j]); + memcpy((*tostr) + i, w, sizeof(**tostr)); + } if (n == 0) n = 1; j += n; if (++i = *blen) { @@ -216,8 +222,11 @@ int2raw(SCR *sp, const CHAR_T * str, ssi BINC_RETC(NULL, *tostr, *blen, len); *tolen = len; -for (i = 0; i len; ++i) - (*tostr)[i] = str[i]; +for (i = 0; i len; ++i) { + CHAR_T w; + memcpy(w, str + i, sizeof(w)); + (*tostr)[i] = w; +} *dst = cw-bp1; @@ -282,9 +291,11 @@ default_int2char(SCR *sp, const CHAR_T * #endif for (i = 0, j = 0; i (size_t)len; ++i) { - n = wcrtomb(dst+j, str[i], mbs); + CHAR_T w; + memcpy(w, str + i, sizeof(w)); + n = wcrtomb(dst + j, w, mbs); if (n == (size_t)-1) - HANDLE_MBR_ERROR(n, mbs, dst[j], str[i]); + HANDLE_MBR_ERROR(n, mbs, dst[j], w); j += n; if (buflen j + MB_CUR_MAX) { if (id != (iconv_t)-1) { @@ -297,7 +308,7 @@ default_int2char(SCR *sp, const CHAR_T * } } -n = wcrtomb(dst+j, L'\0', mbs); +n = wcrtomb(dst + j, L'\0', mbs); j += n - 1;/* don't count NUL at the end */ *tolen = j;
CVS commit: src/external/bsd/nvi/dist/regex
Module Name:src Committed By: christos Date: Tue Jan 7 21:48:12 UTC 2014 Modified Files: src/external/bsd/nvi/dist/regex: engine.c regcomp.c regerror.c regexec.c regfree.c Log Message: remove register To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/nvi/dist/regex/engine.c \ src/external/bsd/nvi/dist/regex/regcomp.c \ src/external/bsd/nvi/dist/regex/regerror.c \ src/external/bsd/nvi/dist/regex/regexec.c \ src/external/bsd/nvi/dist/regex/regfree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/nvi/dist/regex/engine.c diff -u src/external/bsd/nvi/dist/regex/engine.c:1.2 src/external/bsd/nvi/dist/regex/engine.c:1.3 --- src/external/bsd/nvi/dist/regex/engine.c:1.2 Fri Nov 22 10:52:06 2013 +++ src/external/bsd/nvi/dist/regex/engine.c Tue Jan 7 16:48:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: engine.c,v 1.2 2013/11/22 15:52:06 christos Exp $ */ +/* $NetBSD: engine.c,v 1.3 2014/01/07 21:48:12 christos Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 @@ -130,24 +130,24 @@ static char *pchar __P((int ch)); /* - matcher - the actual matching engine - == static int matcher(register struct re_guts *g, RCHAR_T *string, \ + == static int matcher(struct re_guts *g, RCHAR_T *string, \ == size_t nmatch, regmatch_t pmatch[], int eflags); */ static int /* 0 success, REG_NOMATCH failure */ matcher(g, string, nmatch, pmatch, eflags) -register struct re_guts *g; +struct re_guts *g; RCHAR_T *string; size_t nmatch; regmatch_t pmatch[]; int eflags; { - register RCHAR_T *endp; - register size_t i; + RCHAR_T *endp; + size_t i; struct match mv; - register struct match *m = mv; - register RCHAR_T *dp; - register const sopno gf = g-firststate+1; /* +1 for OEND */ - register const sopno gl = g-laststate; + struct match *m = mv; + RCHAR_T *dp; + const sopno gf = g-firststate+1; /* +1 for OEND */ + const sopno gl = g-laststate; RCHAR_T *start; RCHAR_T *stop; @@ -296,30 +296,30 @@ int eflags; /* - dissect - figure out what matched what, no back references - == static RCHAR_T *dissect(register struct match *m, RCHAR_T *start, \ + == static RCHAR_T *dissect(struct match *m, RCHAR_T *start, \ == RCHAR_T *stop, sopno startst, sopno stopst); */ static RCHAR_T * /* == stop (success) always */ dissect(m, start, stop, startst, stopst) -register struct match *m; +struct match *m; RCHAR_T *start; RCHAR_T *stop; sopno startst; sopno stopst; { - register int i; - register sopno ss; /* start sop of current subRE */ - register sopno es; /* end sop of current subRE */ - register RCHAR_T *sp; /* start of string matched by it */ - register RCHAR_T *stp; /* string matched by it cannot pass here */ - register RCHAR_T *rest; /* start of rest of string */ - register RCHAR_T *tail; /* string unmatched by rest of RE */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register RCHAR_T *ssp; /* start of string matched by subsubRE */ - register RCHAR_T *sep; /* end of string matched by subsubRE */ - register RCHAR_T *oldssp; /* previous ssp */ - register RCHAR_T *dp; + int i; + sopno ss; /* start sop of current subRE */ + sopno es; /* end sop of current subRE */ + RCHAR_T *sp; /* start of string matched by it */ + RCHAR_T *stp; /* string matched by it cannot pass here */ + RCHAR_T *rest; /* start of rest of string */ + RCHAR_T *tail; /* string unmatched by rest of RE */ + sopno ssub; /* start sop of subsubRE */ + sopno esub; /* end sop of subsubRE */ + RCHAR_T *ssp; /* start of string matched by subsubRE */ + RCHAR_T *sep; /* end of string matched by subsubRE */ + RCHAR_T *oldssp; /* previous ssp */ + RCHAR_T *dp; AT(diss, start, stop, startst, stopst); sp = start; @@ -485,31 +485,31 @@ sopno stopst; /* - backref - figure out what matched what, figuring in back references - == static RCHAR_T *backref(register struct match *m, RCHAR_T *start, \ + == static RCHAR_T *backref(struct match *m, RCHAR_T *start, \ == RCHAR_T *stop, sopno startst, sopno stopst, sopno lev); */ static RCHAR_T * /* == stop (success) or NULL (failure) */ backref(m, start, stop, startst, stopst, lev) -register struct match *m; +struct match *m; RCHAR_T *start; RCHAR_T *stop; sopno startst; sopno stopst; sopno lev; /* PLUS nesting level */ { - register int i; - register sopno ss; /* start sop of current subRE */ - register RCHAR_T *sp; /* start of string matched by it */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register RCHAR_T *ssp; /* start of string matched by subsubRE */ - register RCHAR_T *dp; - register size_t len; - register int hard; - register sop s; - register RCHAR_T d; - register regoff_t offsave; - register cset *cs; + int i; + sopno ss; /* start sop of current subRE
CVS commit: src/share/man/man3lua
Module Name:src Committed By: mbalmer Date: Tue Jan 7 21:54:17 UTC 2014 Modified Files: src/share/man/man3lua: gpio.3lua syslog.3lua Log Message: Use 5.2 usage pattern in the synopsis. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man3lua/gpio.3lua cvs rdiff -u -r1.2 -r1.3 src/share/man/man3lua/syslog.3lua Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3lua/gpio.3lua diff -u src/share/man/man3lua/gpio.3lua:1.3 src/share/man/man3lua/gpio.3lua:1.4 --- src/share/man/man3lua/gpio.3lua:1.3 Mon Jan 6 09:25:08 2014 +++ src/share/man/man3lua/gpio.3lua Tue Jan 7 21:54:17 2014 @@ -1,6 +1,7 @@ -.\ $NetBSD: gpio.3lua,v 1.3 2014/01/06 09:25:08 wiz Exp $ +.\ $NetBSD: gpio.3lua,v 1.4 2014/01/07 21:54:17 mbalmer Exp $ .\ -.\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved. +.\ Copyright (c) 2013, 2014 Marc Balmer mbal...@netbsd.org. +.\ All rights reserved. .\ .\ Redistribution and use in source and binary forms, with or without .\ modification, are permitted provided that the following conditions @@ -27,7 +28,7 @@ .\ SUCH DAMAGE. .\ .\ -.Dd October 27, 2013 +.Dd Januar 7, 2014 .Dt GPIO 3lua .Os .Sh NAME @@ -36,7 +37,7 @@ .Xr gpio 4 pins from Lua .Sh SYNOPSIS -.Cd require 'gpio' +.Cd local gpio = require 'gpio' .Pp .Bl -tag -width -compact .It Dv gpiodev = gpio.open(path) Index: src/share/man/man3lua/syslog.3lua diff -u src/share/man/man3lua/syslog.3lua:1.2 src/share/man/man3lua/syslog.3lua:1.3 --- src/share/man/man3lua/syslog.3lua:1.2 Mon Jan 6 09:23:18 2014 +++ src/share/man/man3lua/syslog.3lua Tue Jan 7 21:54:17 2014 @@ -1,6 +1,7 @@ -.\ $NetBSD: syslog.3lua,v 1.2 2014/01/06 09:23:18 wiz Exp $ +.\ $NetBSD: syslog.3lua,v 1.3 2014/01/07 21:54:17 mbalmer Exp $ .\ -.\ Copyright (c) 2013 Marc Balmer mbal...@netbsd.org. All rights reserved. +.\ Copyright (c) 2013, 2014 Marc Balmer mbal...@netbsd.org. +.\ All rights reserved. .\ .\ Redistribution and use in source and binary forms, with or without .\ modification, are permitted provided that the following conditions @@ -27,7 +28,7 @@ .\ SUCH DAMAGE. .\ .\ -.Dd November 13, 2013 +.Dd January 7, 2014 .Dt SYSLOG 3lua .Os .Sh NAME @@ -36,7 +37,7 @@ .Xr syslog 3 functionality from Lua .Sh SYNOPSIS -.Cd require 'syslog' +.Cd local syslog = require 'syslog' .Pp .Bl -tag -width -compact .It Dv syslog.openlog(ident, logopt, facility)
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Wed Jan 8 01:45:29 UTC 2014 Modified Files: src/lib/librumpuser: rumpuser_port.h rumpuser_sp.c sp_common.c Log Message: OpenBSD support from Justin Cormack via github To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/lib/librumpuser/rumpuser_port.h cvs rdiff -u -r1.61 -r1.62 src/lib/librumpuser/rumpuser_sp.c cvs rdiff -u -r1.37 -r1.38 src/lib/librumpuser/sp_common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.23 src/lib/librumpuser/rumpuser_port.h:1.24 --- src/lib/librumpuser/rumpuser_port.h:1.23 Wed Dec 18 20:24:04 2013 +++ src/lib/librumpuser/rumpuser_port.h Wed Jan 8 01:45:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_port.h,v 1.23 2013/12/18 20:24:04 pooka Exp $ */ +/* $NetBSD: rumpuser_port.h,v 1.24 2014/01/08 01:45:29 pooka Exp $ */ /* * Portability header for non-NetBSD platforms. @@ -94,7 +94,7 @@ clock_gettime(clockid_t clk, struct time /* maybe this should be !__NetBSD__ ? */ #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ -|| defined(__DragonFly__) || defined(__APPLE__) || defined(__CYGWIN__) +|| defined(__DragonFly__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__CYGWIN__) #include errno.h #include stdlib.h #include string.h Index: src/lib/librumpuser/rumpuser_sp.c diff -u src/lib/librumpuser/rumpuser_sp.c:1.61 src/lib/librumpuser/rumpuser_sp.c:1.62 --- src/lib/librumpuser/rumpuser_sp.c:1.61 Fri Nov 1 23:22:13 2013 +++ src/lib/librumpuser/rumpuser_sp.c Wed Jan 8 01:45:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_sp.c,v 1.61 2013/11/01 23:22:13 pooka Exp $ */ +/* $NetBSD: rumpuser_sp.c,v 1.62 2014/01/08 01:45:29 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -37,7 +37,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_sp.c,v 1.61 2013/11/01 23:22:13 pooka Exp $); +__RCSID($NetBSD: rumpuser_sp.c,v 1.62 2014/01/08 01:45:29 pooka Exp $); #endif /* !lint */ #include sys/types.h @@ -90,7 +90,7 @@ static char banner[MAXBANNER]; /* how to use atomic ops on Linux? */ -#if defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__) +#if defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__OpenBSD__) static pthread_mutex_t discomtx = PTHREAD_MUTEX_INITIALIZER; static void Index: src/lib/librumpuser/sp_common.c diff -u src/lib/librumpuser/sp_common.c:1.37 src/lib/librumpuser/sp_common.c:1.38 --- src/lib/librumpuser/sp_common.c:1.37 Tue Dec 31 00:25:17 2013 +++ src/lib/librumpuser/sp_common.c Wed Jan 8 01:45:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sp_common.c,v 1.37 2013/12/31 00:25:17 pooka Exp $ */ +/* $NetBSD: sp_common.c,v 1.38 2014/01/08 01:45:29 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -36,6 +36,7 @@ #include sys/queue.h #include sys/socket.h #include sys/un.h +#include sys/uio.h #include arpa/inet.h #include netinet/in.h
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Wed Jan 8 01:47:31 UTC 2014 Modified Files: src/lib/librumpuser: rumpuser_port.h Log Message: do as the comment says and #if defined(every_other) || defined(platform) || ... === #if !defined(__NetBSD__) To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/lib/librumpuser/rumpuser_port.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.24 src/lib/librumpuser/rumpuser_port.h:1.25 --- src/lib/librumpuser/rumpuser_port.h:1.24 Wed Jan 8 01:45:29 2014 +++ src/lib/librumpuser/rumpuser_port.h Wed Jan 8 01:47:31 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_port.h,v 1.24 2014/01/08 01:45:29 pooka Exp $ */ +/* $NetBSD: rumpuser_port.h,v 1.25 2014/01/08 01:47:31 pooka Exp $ */ /* * Portability header for non-NetBSD platforms. @@ -92,9 +92,8 @@ clock_gettime(clockid_t clk, struct time #include sys/types.h #include sys/param.h -/* maybe this should be !__NetBSD__ ? */ -#if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ -|| defined(__DragonFly__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__CYGWIN__) +/* NetBSD is the only(?) platform with getenv_r() */ +#if !defined(__NetBSD__) #include errno.h #include stdlib.h #include string.h
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: christos Date: Wed Jan 8 01:56:20 UTC 2014 Modified Files: src/sbin/ifconfig: ieee80211.c Log Message: perror is obsolete, use warn and add missing paren. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sbin/ifconfig/ieee80211.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ieee80211.c diff -u src/sbin/ifconfig/ieee80211.c:1.26 src/sbin/ifconfig/ieee80211.c:1.27 --- src/sbin/ifconfig/ieee80211.c:1.26 Tue Jan 7 15:25:24 2014 +++ src/sbin/ifconfig/ieee80211.c Tue Jan 7 20:56:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211.c,v 1.26 2014/01/07 20:25:24 degroote Exp $ */ +/* $NetBSD: ieee80211.c,v 1.27 2014/01/08 01:56:20 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: ieee80211.c,v 1.26 2014/01/07 20:25:24 degroote Exp $); +__RCSID($NetBSD: ieee80211.c,v 1.27 2014/01/08 01:56:20 christos Exp $); #endif /* not lint */ #include sys/param.h @@ -466,7 +466,7 @@ scan_exec(prop_dictionary_t env, prop_di struct ifreq ifr; if (direct_ioctl(env, SIOCGIFFLAGS, ifr) == -1) { - perror(ioctl(SIOCGIFFLAGS); + warn(ioctl(SIOCGIFFLAGS)); return -1; } @@ -739,7 +739,7 @@ scan_and_wait(prop_dictionary_t env) sroute = prog_socket(PF_ROUTE, SOCK_RAW, 0); if (sroute 0) { - perror(socket(PF_ROUTE,SOCK_RAW)); + warn(socket(PF_ROUTE,SOCK_RAW)); return; } /* NB: only root can trigger a scan so ignore errors */ @@ -750,7 +750,7 @@ scan_and_wait(prop_dictionary_t env) do { if (prog_read(sroute, buf, sizeof(buf)) 0) { -perror(read(PF_ROUTE)); +warn(read(PF_ROUTE)); break; } rtm = (struct rt_msghdr *) buf;
CVS commit: src/include
Module Name:src Committed By: christos Date: Wed Jan 8 02:16:03 UTC 2014 Modified Files: src/include: stdlib.h Log Message: add ptsname_r To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.107 src/include/stdlib.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/stdlib.h diff -u src/include/stdlib.h:1.106 src/include/stdlib.h:1.107 --- src/include/stdlib.h:1.106 Fri Apr 26 14:07:43 2013 +++ src/include/stdlib.h Tue Jan 7 21:16:03 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: stdlib.h,v 1.106 2013/04/26 18:07:43 christos Exp $ */ +/* $NetBSD: stdlib.h,v 1.107 2014/01/08 02:16:03 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -302,6 +302,7 @@ void cfree(void *); int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); +int ptsname_r(int, char *, size_t); int radixsort(const unsigned char **, int, const unsigned char *, unsigned); int sradixsort(const unsigned char **, int, const unsigned char *,
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: christos Date: Wed Jan 8 02:15:42 UTC 2014 Modified Files: src/lib/libc/stdlib: Makefile.inc ptsname.3 pty.c Log Message: add ptsname_r To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/lib/libc/stdlib/Makefile.inc cvs rdiff -u -r1.6 -r1.7 src/lib/libc/stdlib/ptsname.3 cvs rdiff -u -r1.2 -r1.3 src/lib/libc/stdlib/pty.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/Makefile.inc diff -u src/lib/libc/stdlib/Makefile.inc:1.80 src/lib/libc/stdlib/Makefile.inc:1.81 --- src/lib/libc/stdlib/Makefile.inc:1.80 Sun Dec 1 23:39:10 2013 +++ src/lib/libc/stdlib/Makefile.inc Tue Jan 7 21:15:42 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.80 2013/12/02 04:39:10 lneto Exp $ +# $NetBSD: Makefile.inc,v 1.81 2014/01/08 02:15:42 christos Exp $ # from: @(#)Makefile.inc 8.3 (Berkeley) 2/4/95 # stdlib sources @@ -70,6 +70,7 @@ MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 MLINKS+=malloc.3 calloc.3 malloc.3 realloc.3 malloc.3 free.3 MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 +MLINKS+=ptsname.3 ptsname_r.3 MLINKS+=rand.3 rand_r.3 MLINKS+=rand.3 srand.3 MLINKS+=rand48.3 drand48.3 rand48.3 erand48.3 rand48.3 lrand48.3 Index: src/lib/libc/stdlib/ptsname.3 diff -u src/lib/libc/stdlib/ptsname.3:1.6 src/lib/libc/stdlib/ptsname.3:1.7 --- src/lib/libc/stdlib/ptsname.3:1.6 Fri Oct 19 06:44:34 2012 +++ src/lib/libc/stdlib/ptsname.3 Tue Jan 7 21:15:42 2014 @@ -1,4 +1,4 @@ -.\ $NetBSD: ptsname.3,v 1.6 2012/10/19 10:44:34 apb Exp $ +.\ $NetBSD: ptsname.3,v 1.7 2014/01/08 02:15:42 christos Exp $ .\ .\ Copyright (c) 2004 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -27,11 +27,12 @@ .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\ POSSIBILITY OF SUCH DAMAGE. .\ -.Dd May 25, 2004 +.Dd January 7, 2014 .Dt PTSNAME 3 .Os .Sh NAME -.Nm ptsname +.Nm ptsname , +.Nm ptsname_r .Nd get the pathname of the slave pseudo-terminal device .Sh LIBRARY .Lb libc @@ -39,6 +40,8 @@ .In stdlib.h .Ft char * .Fn ptsname int masterfd +.Ft char * +.Fn ptsname_r int masterfd char *buf size_t buflen .Sh DESCRIPTION The .Fn ptsname @@ -48,6 +51,23 @@ that corresponds to the master pseudo-te The .Fn ptsname function is not reentrant or thread-safe. +.Pp +The +.Fn ptsname_r +function +places the pathname of the slave pseudo-terminal device that corresponds +to the master pseudo-terminal device associated with +.Fa masterfd +int the +.Fa buf +argument copying up to +.Fa buflen +characters. +The +.Fa buf +is always +.Dv NUL +terminated. .Sh RETURN VALUES If successful, .Fn ptsname @@ -60,10 +80,25 @@ will return and .Va errno is set to indicate the error. +.Pp +If successful, +.Fn ptsname_r +places a nul-terminated string containing the pathname +of the slave pseudo-terminal device +in +.Fa buf +and returns +.Dv 0 . +If an error occurs +.Fn ptsname_r +will return +an error number number indicating what went wrong. .Sh ERRORS The .Fn ptsname -function will fail if: +and +.Fn ptsname_r +functions will fail if: .Bl -tag -width Er .It Bq Er EACCESS the corresponding pseudo-terminal device could not be accessed. @@ -74,6 +109,18 @@ is not a valid descriptor. .Fa masterfd is not associated with a master pseudo-terminal device. .El +.Pp +In addition the +.Fn ptsname_r +function +will return: +.Bl -tag -width Er +.It Bq Er ENOSPC +the name of the pseudo-terminal is longer than +.Fa bufsiz +characters plus the terminating +.Dv NUL . +.El .Sh NOTES The error returns of .Fn ptsname @@ -87,8 +134,23 @@ function is equivalent to: struct ptmget pm; return ioctl(masterfd, TIOCPTSNAME, \*[Am]pm) == -1 ? NULL : pm.sn; .Ed +.Pp +Both the +.Fn ptsname +and +.Fn ptsname_r +functions will also return the name of the slave pseudo-terminal if a file +descriptor to the slave pseudo-terminal is passed to +.Fa masterfd . +.Pp +This is a convenient extension because it allows one to use the file descriptor +obtained by +.Xr open 2 +.Pa /dev/tty +to obtain the name of the pseudo-terminal for the current process. .Sh SEE ALSO .Xr ioctl 2 , +.Xr open 2 , .Xr grantpt 3 , .Xr posix_openpt 3 , .Xr unlockpt 3 Index: src/lib/libc/stdlib/pty.c diff -u src/lib/libc/stdlib/pty.c:1.2 src/lib/libc/stdlib/pty.c:1.3 --- src/lib/libc/stdlib/pty.c:1.2 Mon Apr 28 16:23:00 2008 +++ src/lib/libc/stdlib/pty.c Tue Jan 7 21:15:42 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: pty.c,v 1.2 2008/04/28 20:23:00 martin Exp $ */ +/* $NetBSD: pty.c,v 1.3 2014/01/08 02:15:42 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -31,11 +31,13 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: pty.c,v 1.2 2008/04/28 20:23:00 martin Exp $); +__RCSID($NetBSD: pty.c,v 1.3 2014/01/08 02:15:42 christos Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h #include fcntl.h
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: christos Date: Wed Jan 8 02:17:30 UTC 2014 Modified Files: src/lib/libc/stdlib: ptsname.3 pty.c Log Message: return the same errors as linux for ptsname_r To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdlib/ptsname.3 cvs rdiff -u -r1.3 -r1.4 src/lib/libc/stdlib/pty.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/ptsname.3 diff -u src/lib/libc/stdlib/ptsname.3:1.7 src/lib/libc/stdlib/ptsname.3:1.8 --- src/lib/libc/stdlib/ptsname.3:1.7 Tue Jan 7 21:15:42 2014 +++ src/lib/libc/stdlib/ptsname.3 Tue Jan 7 21:17:30 2014 @@ -1,4 +1,4 @@ -.\ $NetBSD: ptsname.3,v 1.7 2014/01/08 02:15:42 christos Exp $ +.\ $NetBSD: ptsname.3,v 1.8 2014/01/08 02:17:30 christos Exp $ .\ .\ Copyright (c) 2004 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -115,7 +115,12 @@ In addition the function will return: .Bl -tag -width Er -.It Bq Er ENOSPC +.It Bq Er EINVAL +the +.Fa buf +argument is +.Dv NULL . +.It Bq Er ERANGE the name of the pseudo-terminal is longer than .Fa bufsiz characters plus the terminating Index: src/lib/libc/stdlib/pty.c diff -u src/lib/libc/stdlib/pty.c:1.3 src/lib/libc/stdlib/pty.c:1.4 --- src/lib/libc/stdlib/pty.c:1.3 Tue Jan 7 21:15:42 2014 +++ src/lib/libc/stdlib/pty.c Tue Jan 7 21:17:30 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: pty.c,v 1.3 2014/01/08 02:15:42 christos Exp $ */ +/* $NetBSD: pty.c,v 1.4 2014/01/08 02:17:30 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: pty.c,v 1.3 2014/01/08 02:15:42 christos Exp $); +__RCSID($NetBSD: pty.c,v 1.4 2014/01/08 02:17:30 christos Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -71,9 +71,11 @@ int ptsname_r(int fildes, char *buf, size_t buflen) { struct ptmget pm; + if (buf == NULL) + return EINVAL; if (ioctl(fildes, TIOCPTSNAME, pm) == -1) return errno; if (strlcpy(buf, pm.sn, buflen) buflen) - return ENOSPC; + return ERANGE; return 0; }
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: christos Date: Wed Jan 8 02:19:12 UTC 2014 Modified Files: src/distrib/sets/lists/comp: mi Log Message: add ptsname_r To generate a diff of this commit: cvs rdiff -u -r1.1872 -r1.1873 src/distrib/sets/lists/comp/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1872 src/distrib/sets/lists/comp/mi:1.1873 --- src/distrib/sets/lists/comp/mi:1.1872 Thu Dec 19 14:40:08 2013 +++ src/distrib/sets/lists/comp/mi Tue Jan 7 21:19:12 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1872 2013/12/19 19:40:08 rmind Exp $ +# $NetBSD: mi,v 1.1873 2014/01/08 02:19:12 christos Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -8360,6 +8360,7 @@ ./usr/share/man/cat3/pthread_suspend_np.0 comp-c-catman .cat ./usr/share/man/cat3/pthread_testcancel.0 comp-c-catman .cat ./usr/share/man/cat3/ptsname.0 comp-c-catman .cat +./usr/share/man/cat3/ptsname_r.0 comp-c-catman .cat ./usr/share/man/cat3/puffs.0 comp-puffs-catman .cat ./usr/share/man/cat3/puffs_cc.0 comp-puffs-catman .cat ./usr/share/man/cat3/puffs_cred.0 comp-puffs-catman .cat @@ -14901,6 +14902,7 @@ ./usr/share/man/html3/pthread_suspend_np.html comp-c-htmlman html ./usr/share/man/html3/pthread_testcancel.html comp-c-htmlman html ./usr/share/man/html3/ptsname.html comp-c-htmlman html +./usr/share/man/html3/ptsname_r.html comp-c-htmlman html ./usr/share/man/html3/puffs.html comp-puffs-htmlman html ./usr/share/man/html3/puffs_cc.html comp-puffs-htmlman html ./usr/share/man/html3/puffs_cred.html comp-puffs-htmlman html @@ -21438,6 +21440,7 @@ ./usr/share/man/man3/pthread_suspend_np.3 comp-c-man .man ./usr/share/man/man3/pthread_testcancel.3 comp-c-man .man ./usr/share/man/man3/ptsname.3 comp-c-man .man +./usr/share/man/man3/ptsname_r.3 comp-c-man .man ./usr/share/man/man3/puffs.3 comp-puffs-man .man ./usr/share/man/man3/puffs_cc.3 comp-puffs-man .man ./usr/share/man/man3/puffs_cred.3 comp-puffs-man .man