Date: Sun, 14 Nov 2010 01:06:10 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r215273 - in projects/binutils-2.17: . bin/echo bin/sh bin/sh/funcs contrib/binutils/bfd contrib/top etc etc/defaults etc/periodic/security include lib/libc/gen lib/libc_r lib/libusb li... Message-ID: <201011140106.oAE16Ant065516@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sun Nov 14 01:06:10 2010 New Revision: 215273 URL: http://svn.freebsd.org/changeset/base/215273 Log: Sync: merge r215189 through r215272 from ^/head. Added: projects/binutils-2.17/etc/periodic/security/110.neggrpperm - copied unchanged from r215272, head/etc/periodic/security/110.neggrpperm projects/binutils-2.17/share/mk/bsd.crunchgen.mk - copied unchanged from r215272, head/share/mk/bsd.crunchgen.mk projects/binutils-2.17/sys/mips/atheros/std.ar71xx - copied unchanged from r215272, head/sys/mips/atheros/std.ar71xx projects/binutils-2.17/sys/mips/sentry5/std.sentry5 - copied unchanged from r215272, head/sys/mips/sentry5/std.sentry5 projects/binutils-2.17/sys/mips/sibyte/std.sibyte - copied unchanged from r215272, head/sys/mips/sibyte/std.sibyte projects/binutils-2.17/tools/regression/netinet/arphold/ - copied from r215272, head/tools/regression/netinet/arphold/ projects/binutils-2.17/usr.sbin/bluetooth/ath3kfw/ - copied from r215272, head/usr.sbin/bluetooth/ath3kfw/ Deleted: projects/binutils-2.17/lib/libc_r/ projects/binutils-2.17/sys/boot/pc98/libpc98/i386_module.c projects/binutils-2.17/sys/i386/acpica/Makefile projects/binutils-2.17/sys/i386/acpica/genwakecode.sh Modified: projects/binutils-2.17/Makefile projects/binutils-2.17/Makefile.inc1 projects/binutils-2.17/bin/echo/echo.1 projects/binutils-2.17/bin/sh/funcs/suspend projects/binutils-2.17/bin/sh/sh.1 projects/binutils-2.17/bin/sh/var.c projects/binutils-2.17/contrib/binutils/bfd/config.bfd projects/binutils-2.17/etc/defaults/periodic.conf projects/binutils-2.17/etc/devd.conf projects/binutils-2.17/etc/periodic/security/Makefile projects/binutils-2.17/etc/services projects/binutils-2.17/include/readpassphrase.h projects/binutils-2.17/lib/libc/gen/readpassphrase.3 projects/binutils-2.17/lib/libc/gen/readpassphrase.c projects/binutils-2.17/lib/libusb/libusb10.c projects/binutils-2.17/lib/libusb/libusb10_io.c projects/binutils-2.17/lib/msun/src/e_jn.c projects/binutils-2.17/lib/msun/src/e_jnf.c projects/binutils-2.17/rescue/rescue/Makefile projects/binutils-2.17/sbin/ifconfig/ifmedia.c projects/binutils-2.17/sbin/kldstat/kldstat.c projects/binutils-2.17/sbin/mdconfig/mdconfig.8 projects/binutils-2.17/sbin/mdconfig/mdconfig.c projects/binutils-2.17/share/man/man5/periodic.conf.5 projects/binutils-2.17/share/man/man5/rc.conf.5 projects/binutils-2.17/sys/boot/i386/libi386/i386_module.c projects/binutils-2.17/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/binutils-2.17/sys/conf/files.i386 projects/binutils-2.17/sys/conf/ldscript.mips projects/binutils-2.17/sys/dev/arcmsr/arcmsr.c projects/binutils-2.17/sys/dev/arcmsr/arcmsr.h projects/binutils-2.17/sys/dev/nfe/if_nfe.c projects/binutils-2.17/sys/dev/usb/input/uhid.c projects/binutils-2.17/sys/dev/usb/serial/u3g.c projects/binutils-2.17/sys/dev/usb/usbdevs projects/binutils-2.17/sys/i386/acpica/acpi_wakecode.S projects/binutils-2.17/sys/i386/acpica/acpi_wakeup.c projects/binutils-2.17/sys/kern/sched_ule.c projects/binutils-2.17/sys/mips/adm5120/std.adm5120 projects/binutils-2.17/sys/mips/alchemy/std.alchemy projects/binutils-2.17/sys/mips/cavium/std.octeon1 projects/binutils-2.17/sys/mips/conf/ADM5120 projects/binutils-2.17/sys/mips/conf/ALCHEMY projects/binutils-2.17/sys/mips/conf/AR71XX projects/binutils-2.17/sys/mips/conf/DEFAULTS projects/binutils-2.17/sys/mips/conf/MALTA projects/binutils-2.17/sys/mips/conf/MALTA64 projects/binutils-2.17/sys/mips/conf/OCTEON1 projects/binutils-2.17/sys/mips/conf/OCTEON1-32 projects/binutils-2.17/sys/mips/conf/QEMU projects/binutils-2.17/sys/mips/conf/SENTRY5 projects/binutils-2.17/sys/mips/conf/SWARM projects/binutils-2.17/sys/mips/conf/SWARM64 projects/binutils-2.17/sys/mips/conf/SWARM64_SMP projects/binutils-2.17/sys/mips/conf/SWARM_SMP projects/binutils-2.17/sys/mips/conf/XLR projects/binutils-2.17/sys/mips/conf/XLR64 projects/binutils-2.17/sys/mips/conf/XLRN32 projects/binutils-2.17/sys/mips/conf/std.SWARM projects/binutils-2.17/sys/mips/idt/std.idt projects/binutils-2.17/sys/modules/Makefile projects/binutils-2.17/sys/modules/acpi/acpi/Makefile projects/binutils-2.17/sys/net/if_llatbl.c projects/binutils-2.17/sys/net/if_llatbl.h projects/binutils-2.17/sys/net/vnet.h projects/binutils-2.17/sys/net80211/ieee80211_ratectl_none.c projects/binutils-2.17/sys/netinet/if_ether.c projects/binutils-2.17/sys/netinet/in.c projects/binutils-2.17/sys/netinet/sctp_output.c projects/binutils-2.17/sys/netinet/sctp_pcb.c projects/binutils-2.17/sys/netinet/sctputil.c projects/binutils-2.17/sys/powerpc/aim/mp_cpudep.c projects/binutils-2.17/usr.bin/top/top.local.1 projects/binutils-2.17/usr.bin/truss/main.c projects/binutils-2.17/usr.sbin/bluetooth/Makefile projects/binutils-2.17/usr.sbin/sysinstall/install.c projects/binutils-2.17/usr.sbin/sysinstall/menus.c Directory Properties: projects/binutils-2.17/ (props changed) projects/binutils-2.17/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/contrib/bind9/ (props changed) projects/binutils-2.17/contrib/binutils/ (props changed) projects/binutils-2.17/contrib/bzip2/ (props changed) projects/binutils-2.17/contrib/ee/ (props changed) projects/binutils-2.17/contrib/expat/ (props changed) projects/binutils-2.17/contrib/file/ (props changed) projects/binutils-2.17/contrib/gdb/ (props changed) projects/binutils-2.17/contrib/gdtoa/ (props changed) projects/binutils-2.17/contrib/gnu-sort/ (props changed) projects/binutils-2.17/contrib/groff/ (props changed) projects/binutils-2.17/contrib/less/ (props changed) projects/binutils-2.17/contrib/libpcap/ (props changed) projects/binutils-2.17/contrib/llvm/ (props changed) projects/binutils-2.17/contrib/llvm/tools/clang/ (props changed) projects/binutils-2.17/contrib/ncurses/ (props changed) projects/binutils-2.17/contrib/netcat/ (props changed) projects/binutils-2.17/contrib/ntp/ (props changed) projects/binutils-2.17/contrib/one-true-awk/ (props changed) projects/binutils-2.17/contrib/openbsm/ (props changed) projects/binutils-2.17/contrib/openpam/ (props changed) projects/binutils-2.17/contrib/pf/ (props changed) projects/binutils-2.17/contrib/sendmail/ (props changed) projects/binutils-2.17/contrib/tcpdump/ (props changed) projects/binutils-2.17/contrib/tcsh/ (props changed) projects/binutils-2.17/contrib/top/ (props changed) projects/binutils-2.17/contrib/top/install-sh (props changed) projects/binutils-2.17/contrib/tzcode/stdtime/ (props changed) projects/binutils-2.17/contrib/tzcode/zic/ (props changed) projects/binutils-2.17/contrib/tzdata/ (props changed) projects/binutils-2.17/contrib/wpa/ (props changed) projects/binutils-2.17/contrib/xz/ (props changed) projects/binutils-2.17/crypto/openssh/ (props changed) projects/binutils-2.17/crypto/openssl/ (props changed) projects/binutils-2.17/lib/libc/ (props changed) projects/binutils-2.17/lib/libc/stdtime/ (props changed) projects/binutils-2.17/lib/libutil/ (props changed) projects/binutils-2.17/lib/libz/ (props changed) projects/binutils-2.17/sbin/ (props changed) projects/binutils-2.17/sbin/ipfw/ (props changed) projects/binutils-2.17/share/mk/bsd.arch.inc.mk (props changed) projects/binutils-2.17/share/zoneinfo/ (props changed) projects/binutils-2.17/sys/ (props changed) projects/binutils-2.17/sys/amd64/include/xen/ (props changed) projects/binutils-2.17/sys/cddl/contrib/opensolaris/ (props changed) projects/binutils-2.17/sys/contrib/dev/acpica/ (props changed) projects/binutils-2.17/sys/contrib/pf/ (props changed) projects/binutils-2.17/sys/contrib/x86emu/ (props changed) projects/binutils-2.17/sys/dev/xen/xenpci/ (props changed) projects/binutils-2.17/usr.bin/calendar/ (props changed) projects/binutils-2.17/usr.bin/csup/ (props changed) projects/binutils-2.17/usr.bin/procstat/ (props changed) projects/binutils-2.17/usr.sbin/zic/ (props changed) Modified: projects/binutils-2.17/Makefile ============================================================================== --- projects/binutils-2.17/Makefile Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/Makefile Sun Nov 14 01:06:10 2010 (r215273) @@ -281,7 +281,7 @@ tinderbox: # existing system is. # .if make(universe) || make(universe_kernels) || make(tinderbox) -TARGETS?=amd64 i386 ia64 pc98 powerpc sparc64 sun4v +TARGETS?=amd64 i386 ia64 pc98 powerpc sparc64 sun4v mips .if defined(DOING_TINDERBOX) FAILFILE=tinderbox.failed Modified: projects/binutils-2.17/Makefile.inc1 ============================================================================== --- projects/binutils-2.17/Makefile.inc1 Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/Makefile.inc1 Sun Nov 14 01:06:10 2010 (r215273) @@ -123,6 +123,21 @@ TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun ${TARGET_ARCH} != ${MACHINE_ARCH} TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm} .endif +# Legacy names, for a transition period mips:mips -> mipsel:mips +.if defined(TARGET) && defined(TARGET_ARCH) && \ + ${TARGET_ARCH} == "mips" && ${TARGET} == "mips" +.warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb" +.if defined(TARGET_BIG_ENDIAN) +TARGET_ARCH=mipseb +.else +TARGET_ARCH=mipsel +.endif +.endif +# arm with TARGET_BIG_ENDIAN -> armeb +.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) +.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated. use armeb" +TARGET_ARCH=armeb +.endif # Otherwise, default to current machine type and architecture. TARGET?= ${MACHINE} TARGET_ARCH?= ${MACHINE_ARCH} Modified: projects/binutils-2.17/bin/echo/echo.1 ============================================================================== --- projects/binutils-2.17/bin/echo/echo.1 Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/bin/echo/echo.1 Sun Nov 14 01:06:10 2010 (r215273) @@ -32,7 +32,7 @@ .\" @(#)echo.1 8.1 (Berkeley) 7/22/93 .\" $FreeBSD$ .\" -.Dd April 12, 2003 +.Dd November 12, 2010 .Dt ECHO 1 .Os .Sh NAME @@ -56,24 +56,37 @@ The following option is available: .Bl -tag -width flag .It Fl n Do not print the trailing newline character. -This may also be achieved by appending +.El +.Pp +The end-of-options marker +.Fl Fl +is not recognized and written literally. +.Pp +The newline may also be suppressed by appending .Ql \ec to the end of the string, as is done by iBCS2 compatible systems. -Note that this option as well as the effect of +Note that the +.Fl n +option as well as the effect of .Ql \ec are implementation-defined in .St -p1003.1-2001 as amended by Cor.\& 1-2002. -Applications aiming for maximum -portability are strongly encouraged to use +For portability, +.Nm +should only be used if the first argument does not start with a hyphen +.Pq Ql "-" +and does not contain any backslashes +.Pq Ql "\e" . +If this is not sufficient, .Xr printf 1 -to suppress the newline character. -.El +should be used. .Pp -Some shells may provide a builtin +Most shells provide a builtin .Nm -command which is similar or identical to this utility. +command which tends to differ from this utility +in the treatment of options and backslashes. Consult the .Xr builtin 1 manual page. Modified: projects/binutils-2.17/bin/sh/funcs/suspend ============================================================================== --- projects/binutils-2.17/bin/sh/funcs/suspend Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/bin/sh/funcs/suspend Sun Nov 14 01:06:10 2010 (r215273) @@ -34,6 +34,6 @@ suspend() { local - - set +j + set +m kill -TSTP 0 } Modified: projects/binutils-2.17/bin/sh/sh.1 ============================================================================== --- projects/binutils-2.17/bin/sh/sh.1 Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/bin/sh/sh.1 Sun Nov 14 01:06:10 2010 (r215273) @@ -626,6 +626,7 @@ There are two kinds of built-in commands Assignments before special builtins persist after they finish executing and assignment errors, redirection errors and certain operand errors cause a script to be aborted. +Special builtins cannot be overridden with a function. Both regular and special builtins can affect the shell in ways normal programs cannot. .Pp @@ -1268,19 +1269,22 @@ consists of all characters until the mat .Ql } . Any .Ql } -escaped by a backslash or within a single-quoted string, and characters in +escaped by a backslash or within a single-quoted or double-quoted +string, and characters in embedded arithmetic expansions, command substitutions, and variable expansions, are not examined in determining the matching .Ql } . -Except for the variants with +If the variants with .Ql + , .Ql - , .Ql = or -.Ql ?\& , -any +.Ql ?\& +occur within a double-quoted string, +as an extension there may be unquoted parts +(via double-quotes inside the expansion); .Ql } -within a double-quoted string is also not examined in determining the matching +within such parts are also not examined in determining the matching .Ql } . .Pp The simplest form for parameter expansion is: Modified: projects/binutils-2.17/bin/sh/var.c ============================================================================== --- projects/binutils-2.17/bin/sh/var.c Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/bin/sh/var.c Sun Nov 14 01:06:10 2010 (r215273) @@ -805,6 +805,7 @@ poplocalvars(void) if (vp == NULL) { /* $- saved */ memcpy(optlist, lvp->text, sizeof optlist); ckfree(lvp->text); + optschanged(); } else if ((lvp->flags & (VUNSET|VSTRFIXED)) == VUNSET) { (void)unsetvar(vp->text); } else { Modified: projects/binutils-2.17/contrib/binutils/bfd/config.bfd ============================================================================== --- projects/binutils-2.17/contrib/binutils/bfd/config.bfd Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/contrib/binutils/bfd/config.bfd Sun Nov 14 01:06:10 2010 (r215273) @@ -863,14 +863,18 @@ case "${targ}" in targ_defvec=bfd_elf32_tradlittlemips_vec targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_little_vec ecoff_big_vec" ;; - mips*-*-freebsd*) - targ_defvec=bfd_elf32_tradbigmips_vec - targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" - ;; mips*-*-netbsd*) targ_defvec=bfd_elf32_tradbigmips_vec targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" ;; + mips*el-*-freebsd*) + targ_defvec=bfd_elf32_tradlittlemips_vec + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + ;; + mips*-*-freebsd*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + ;; mips*-dec-* | mips*el-*-ecoff*) targ_defvec=ecoff_little_vec targ_selvecs=ecoff_big_vec Modified: projects/binutils-2.17/etc/defaults/periodic.conf ============================================================================== --- projects/binutils-2.17/etc/defaults/periodic.conf Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/etc/defaults/periodic.conf Sun Nov 14 01:06:10 2010 (r215273) @@ -160,6 +160,9 @@ daily_status_security_diff_flags="-b -u" # 100.chksetuid daily_status_security_chksetuid_enable="YES" +# 110.neggrpperm +daily_status_security_neggrpperm_enable="NO" + # 200.chkmounts daily_status_security_chkmounts_enable="YES" #daily_status_security_chkmounts_ignore="^amd:" # Don't check matching Modified: projects/binutils-2.17/etc/devd.conf ============================================================================== --- projects/binutils-2.17/etc/devd.conf Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/etc/devd.conf Sun Nov 14 01:06:10 2010 (r215273) @@ -97,6 +97,13 @@ detach 100 { action "/etc/rc.d/bluetooth quietstop $device-name"; }; +# Firmware downloader for Atheros AR3011 based USB Bluetooth devices +#attach 100 { +# match "vendor" "0x0cf3"; +# match "product" "0x3000"; +# action "sleep 2 && /usr/sbin/ath3kfw -d $device-name -f /usr/local/etc/ath3k-1.fw"; +#}; + # When a USB keyboard arrives, attach it as the console keyboard. attach 100 { device-name "ukbd0"; Copied: projects/binutils-2.17/etc/periodic/security/110.neggrpperm (from r215272, head/etc/periodic/security/110.neggrpperm) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/binutils-2.17/etc/periodic/security/110.neggrpperm Sun Nov 14 01:06:10 2010 (r215273, copy of r215272, head/etc/periodic/security/110.neggrpperm) @@ -0,0 +1,54 @@ +#!/bin/sh - +# +# Copyright (c) 2001 The FreeBSD Project +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +rc=0 + +case "$daily_status_security_neggrpperm_enable" in + [Yy][Ee][Ss]) + echo "" + echo 'Checking negative group permissions:' + MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'` + n=$(find -sx $MP /dev/null -type f \ + \( \( ! -perm +010 -and -perm +001 \) -or \ + \( ! -perm +020 -and -perm +002 \) -or \ + \( ! -perm +040 -and -perm +004 \) \) \ + -exec ls -liTd \{\} \+ | tee /dev/stderr | wc -l) + [ $n -gt 0 ] && rc=1 || rc=0 + ;; +esac + +exit $rc Modified: projects/binutils-2.17/etc/periodic/security/Makefile ============================================================================== --- projects/binutils-2.17/etc/periodic/security/Makefile Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/etc/periodic/security/Makefile Sun Nov 14 01:06:10 2010 (r215273) @@ -3,6 +3,7 @@ .include <bsd.own.mk> FILES= 100.chksetuid \ + 110.neggrpperm \ 200.chkmounts \ 300.chkuid0 \ 400.passwdless \ Modified: projects/binutils-2.17/etc/services ============================================================================== --- projects/binutils-2.17/etc/services Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/etc/services Sun Nov 14 01:06:10 2010 (r215273) @@ -33,24 +33,31 @@ echo 4/ddp #AppleTalk Echo Protoco rje 5/tcp #Remote Job Entry rje 5/udp #Remote Job Entry zip 6/ddp #Zone Information Protocol +echo 7/sctp echo 7/tcp echo 7/udp +discard 9/sctp sink null discard 9/tcp sink null discard 9/udp sink null systat 11/tcp users #Active Users systat 11/udp users #Active Users +daytime 13/sctp daytime 13/tcp daytime 13/udp qotd 17/tcp quote #Quote of the Day qotd 17/udp quote #Quote of the Day msp 18/tcp #Message Send Protocol msp 18/udp #Message Send Protocol +chargen 19/sctp ttytst source #Character Generator chargen 19/tcp ttytst source #Character Generator chargen 19/udp ttytst source #Character Generator +ftp-data 20/sctp #File Transfer [Default Data] ftp-data 20/tcp #File Transfer [Default Data] ftp-data 20/udp #File Transfer [Default Data] +ftp 21/sctp #File Transfer [Control] ftp 21/tcp #File Transfer [Control] ftp 21/udp #File Transfer [Control] +ssh 22/sctp #Secure Shell Login ssh 22/tcp #Secure Shell Login ssh 22/udp #Secure Shell Login telnet 23/tcp @@ -151,6 +158,7 @@ vettcp 78/tcp vettcp 78/udp finger 79/tcp finger 79/udp +http 80/sctp www www-http #World Wide Web HTTP http 80/tcp www www-http #World Wide Web HTTP http 80/udp www www-http #World Wide Web HTTP hosts2-ns 81/tcp #HOSTS2 Name Server @@ -350,6 +358,7 @@ xdmcp 177/tcp #X Display Manager Con xdmcp 177/udp #X Display Manager Control Protocol NextStep 178/tcp nextstep NeXTStep #NextStep Window Server NextStep 178/udp nextstep NeXTStep #NextStep Window Server +bgp 179/sctp #Border Gateway Protocol bgp 179/tcp #Border Gateway Protocol bgp 179/udp #Border Gateway Protocol ris 180/tcp #Intergraph @@ -738,6 +747,7 @@ decvms-sysmgt 441/tcp decvms-sysmgt 441/udp cvc_hostd 442/tcp cvc_hostd 442/udp +https 443/sctp https 443/tcp https 443/udp snpp 444/tcp #Simple Network Paging Protocol @@ -1519,7 +1529,9 @@ nfsd-keepalive 1110/udp #Client status supfiledbg 1127/tcp # for SUP nfa 1155/tcp #Network File Access nfa 1155/udp #Network File Access -phone 1167/udp #conference calling +cisco-ipsla 1167/sctp #Cisco IP SLAs Control Protocol +cisco-ipsla 1167/tcp #Cisco IP SLAs Control Protocol +cisco-ipsla 1167/udp #Cisco IP SLAs Control Protocol skkserv 1178/tcp #SKK (kanji input) openvpn 1194/tcp #OpenVPN openvpn 1194/udp #OpenVPN @@ -2119,6 +2131,7 @@ sdfunc 2046/udp #dls 2047/udp dls-monitor 2048/tcp dls-monitor 2048/udp +nfsd 2049/sctp nfs # NFS server daemon nfsd 2049/tcp nfs # NFS server daemon nfsd 2049/udp nfs # NFS server daemon #PROBLEMS!============================================================= @@ -2146,6 +2159,8 @@ hpssd 2207/tcp #HP Status and Service hpssd 2207/udp #HP Status and Services hpiod 2208/tcp #HP I/O Backend hpiod 2208/udp #HP I/O Backend +rcip-itu 2225/sctp #Resource Connection Initiation Protocol +rcip-itu 2225/tcp #Resource Connection Initiation Protocol ivs-video 2232/tcp #IVS Video default ivs-video 2232/udp #IVS Video default ivsd 2241/tcp #IVS Daemon @@ -2179,6 +2194,17 @@ dict 2628/udp #RFC 2229 listen 2766/tcp #System V listener port www-dev 2784/tcp #world wide web - development www-dev 2784/udp #world wide web - development +m2ua 2904/sctp #M2UA +m2ua 2904/tcp #M2UA +m2ua 2904/udp #M2UA +m3ua 2905/sctp #M3UA +m3ua 2905/tcp #M3UA +megaco-h248 2944/sctp #Megaco-H.248 text +megaco-h248 2944/tcp #Megaco H-248 +megaco-h248 2944/udp #Megaco H-248 +h248-binary 2945/sctp #Megaco/H.248 binary +h248-binary 2945/tcp #H248 Binary +h248-binary 2945/udp #H248 Binary eppc 3031/tcp #Remote AppleEvents/PPC Toolbox eppc 3031/udp #Remote AppleEvents/PPC Toolbox NSWS 3049/tcp @@ -2186,6 +2212,7 @@ NSWS 3049/udp gds_db 3050/tcp #InterBase Database Remote Protocol gds_db 3050/udp #InterBase Database Remote Protocol sj3 3086/tcp #SJ3 (kanji input) +itu-bicc-stc 3097/sctp #ITU-T Q.1902.1/Q.2150.3 vmodem 3141/tcp vmodem 3141/udp iscsi-target 3260/tcp # iSCSI port @@ -2205,10 +2232,19 @@ vat-control 3457/tcp #VAT default cont vat-control 3457/udp #VAT default control nut 3493/tcp #Network UPS Tools nut 3493/udp #Network UPS Tools +m2pa 3565/sctp #M2PA +m2pa 3565/tcp #M2PA tsp 3653/tcp #Tunnel Setup Protocol tsp 3653/udp #Tunnel Setup Protocol svn 3690/tcp #Subversion svn 3690/udp #Subversion +asap 3863/sctp #asap sctp +asap 3863/tcp #asap tcp port +asap 3863/udp #asap udp port +asap-tls 3864/sctp #asap-sctp/tls +asap-tls 3864/tcp #asap/tls tcp port +diameter 3868/tcp #DIAMETER +diameter 3868/sctp #DIAMETER udt_os 3900/tcp #Unidata UDT OS udt_os 3900/udp #Unidata UDT OS mapper-nodemgr 3984/tcp #MAPPER network node manager @@ -2245,6 +2281,12 @@ fax 4557/tcp #FAX transmission servic hylafax 4559/tcp #HylaFAX client-server protocol rfa 4672/tcp #remote file access server rfa 4672/udp #remote file access server +ipfix 4739/sctp #IP Flow Info Export +ipfix 4739/tcp #IP Flow Info Export +ipfix 4739/udp #IP Flow Info Export +ipfixs 4740/sctp #ipfix protocol over DTLS +ipfixs 4740/tcp #ipfix protocol over TLS +ipfixs 4740/udp #ipfix protocol over DTLS commplex-main 5000/tcp commplex-main 5000/udp commplex-link 5001/tcp @@ -2263,6 +2305,8 @@ sip 5060/tcp #Session Initialization sip 5060/udp #Session Initialization Protocol (VoIP) sip-tls 5061/tcp #SIP over TLS sip-tls 5061/udp #SIP over TLS +car 5090/sctp #Candidate AR +cxtp 5091/sctp #Context Transfer Protocol rmonitor_secure 5145/tcp rmonitor_secure 5145/udp aol 5190/tcp #America-Online @@ -2298,6 +2342,12 @@ mdns 5353/udp #Multicast DNS postgresql 5432/tcp #PostgreSQL Database postgresql 5432/udp #PostgreSQL Database rplay 5555/udp +amqp 5672/sctp #AMQP +amqp 5672/tcp #AMQP +amqp 5672/udp #AMQP +v5ua 5675/sctp #V5UA application port +v5ua 5675/tcp #V5UA application port +v5ua 5675/udp #V5UA application port canna 5680/tcp #Canna (Japanese Input) proshareaudio 5713/tcp #proshare conf audio proshareaudio 5713/udp #proshare conf audio @@ -2343,6 +2393,9 @@ xdsxdm 6558/udp sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unoffical) +frc-hp 6704/sctp #ForCES HP (High Priority) channel +frc-mp 6705/sctp #ForCES MP (Medium Priority) channel +frc-lp 6706/sctp #ForCES LP (Low priority) channel acmsoda 6969/tcp acmsoda 6969/udp afs3-fileserver 7000/tcp #file server itself @@ -2377,8 +2430,16 @@ fodms 7200/tcp #FODMS FLIP fodms 7200/udp #FODMS FLIP dlip 7201/tcp dlip 7201/udp +simco 7626/sctp #SImple Middlebox COnfiguration (SIMCO) +simco 7626/tcp #SImple Middlebox COnfiguration (SIMCO) Server ftp-proxy 8021/tcp # FTP proxy +pim 8471/sctp #PIM over Reliable Transport +pim 8471/tcp #PIM over Reliable Transport natd 8668/divert # Network Address Translation +lcs-ap 9082/sctp #LCS Application Protocol +aurora 9084/sctp #IBM AURORA Performance Visualizer +aurora 9084/tcp #IBM AURORA Performance Visualizer +aurora 9084/udp #IBM AURORA Performance Visualizer jetdirect 9100/tcp #HP JetDirect card git 9418/tcp #git pack transfer service git 9418/udp #git pack transfer service @@ -2386,18 +2447,37 @@ man 9535/tcp man 9535/udp sd 9876/tcp #Session Director sd 9876/udp #Session Director +iua 9900/sctp #IUA +iua 9900/tcp #IUA +iua 9900/udp #IUA +enrp 9901/sctp #enrp server channel +enrp 9901/udp #enrp server channel +enrp-tls 9902/sctp #enrp/tls server channel amanda 10080/tcp #Dump server control amanda 10080/udp #Dump server control amandaidx 10082/tcp #Amanda indexing amidxtape 10083/tcp #Amanda tape indexing +wmereceiving 11997/sctp #WorldMailExpress +wmedistribution 11998/sctp #WorldMailExpress +wmereporting 11999/sctp #WorldMailExpress +sua 14001/sctp #SUA +sua 14001/tcp #SUA isode-dua 17007/tcp isode-dua 17007/udp biimenu 18000/tcp #Beckman Instruments, Inc. biimenu 18000/udp #Beckman Instruments, Inc. +nfsrdma 20049/sctp #Network File System (NFS) over RDMA +nfsrdma 20049/tcp #Network File System (NFS) over RDMA +nfsrdma 20049/udp #Network File System (NFS) over RDMA wnn4 22273/tcp wnn6 #Wnn4 (Japanese input) wnn4_Cn 22289/tcp wnn6_Cn #Wnn4 (Chinese input) wnn4_Kr 22305/tcp wnn6_Kr #Wnn4 (Korean input) wnn4_Tw 22321/tcp wnn6_Tw #Wnn4 (Taiwanse input) wnn6_DS 26208/tcp #Wnn6 (Dserver) +sgsap 29118/sctp #SGsAP in 3GPP +sbcap 29168/sctp #SBcAP in 3GPP +iuhsctpassoc 29169/sctp #HNBAP and RUA Common Association +s1-control 36412/sctp #S1-Control Plane (3GPP) +x2-control 36422/sctp #X2-Control Plane (3GPP) dbbrowse 47557/tcp #Databeam Corporation dbbrowse 47557/udp #Databeam Corporation Modified: projects/binutils-2.17/include/readpassphrase.h ============================================================================== --- projects/binutils-2.17/include/readpassphrase.h Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/include/readpassphrase.h Sun Nov 14 01:06:10 2010 (r215273) @@ -1,31 +1,24 @@ -/* $OpenBSD: /usr/local/www/cvsroot/OpenBSD/src/include/readpassphrase.h,v 1.2 2002/02/16 21:27:17 millert Exp $ */ +/* $OpenBSD: readpassphrase.h,v 1.5 2003/06/17 21:56:23 millert Exp $ */ /* $FreeBSD$ */ /* - * Copyright (c) 2000 Todd C. Miller <Todd.Miller@courtesan.com> - * All rights reserved. + * Copyright (c) 2000, 2002 Todd C. Miller <Todd.Miller@courtesan.com> * - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ #ifndef _READPASSPHRASE_H_ @@ -37,6 +30,7 @@ #define RPP_FORCELOWER 0x04 /* Force input to lower case. */ #define RPP_FORCEUPPER 0x08 /* Force input to upper case. */ #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */ +#define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */ #include <sys/cdefs.h> #include <sys/_types.h> Modified: projects/binutils-2.17/lib/libc/gen/readpassphrase.3 ============================================================================== --- projects/binutils-2.17/lib/libc/gen/readpassphrase.3 Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/lib/libc/gen/readpassphrase.3 Sun Nov 14 01:06:10 2010 (r215273) @@ -1,33 +1,26 @@ -.\" $OpenBSD: readpassphrase.3,v 1.7 2001/12/15 15:37:51 millert Exp $ +.\" $OpenBSD: readpassphrase.3,v 1.17 2007/05/31 19:19:28 jmc Exp $ .\" -.\" Copyright (c) 2000 Todd C. Miller <Todd.Miller@courtesan.com> -.\" All rights reserved. +.\" Copyright (c) 2000, 2002 Todd C. Miller <Todd.Miller@courtesan.com> .\" -.\" 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. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" Sponsored in part by the Defense Advanced Research Projects +.\" Agency (DARPA) and Air Force Research Laboratory, Air Force +.\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ .\" -.Dd December 7, 2001 +.Dd May 31, 2007 .Dt READPASSPHRASE 3 .Os .Sh NAME @@ -79,6 +72,8 @@ force input to lower case force input to upper case .It Dv RPP_SEVENBIT strip the high bit from input +.It Dv RPP_STDIN +force read of passphrase from stdin .El .Pp The calling process should zero the passphrase as soon as possible to @@ -87,7 +82,7 @@ space. .Sh RETURN VALUES Upon successful completion, .Fn readpassphrase -returns a pointer to the null-terminated passphrase. +returns a pointer to the NUL-terminated passphrase. If an error is encountered, the terminal state is restored and a .Dv NULL @@ -117,40 +112,6 @@ if (compare(transform(passbuf), epass) ! memset(passbuf, 0, sizeof(passbuf)); .Ed -.Sh SIGNALS -The -.Fn readpassphrase -function -will catch the following signals: -.Pp -.Bl -tag -compact -.It Dv SIGINT -.It Dv SIGHUP -.It Dv SIGQUIT -.It Dv SIGTERM -.It Dv SIGTSTP -.It Dv SIGTTIN -.It Dv SIGTTOU -.El -.Pp -When one of the above signals is intercepted, terminal echo will -be restored if it had previously been turned off. -If a signal handler was installed for the signal when -.Fn readpassphrase -was called that handler is then executed. -If no handler was previously installed for the signal then the -default action is taken as per -.Xr sigaction 2 . -.Pp -The -.Dv SIGTSTP , SIGTTIN , -and -.Dv SIGTTOU -signals (stop signal generated from keyboard or due to terminal I/O -from a background process) are treated specially. -When the process is resumed after it has been stopped, -.Fn readpassphrase -will reprint the prompt and the user may then enter a passphrase. .Sh ERRORS .Bl -tag -width Er .It Bq Er EINTR @@ -159,14 +120,14 @@ The function was interrupted by a signal. .It Bq Er EINVAL The -.Fa bufsiz +.Ar bufsiz argument was zero. .It Bq Er EIO The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the .Dv SIGTTIN -signal or the process group is orphaned. +signal, or the process group is orphaned. .It Bq Er EMFILE The process has already reached its limit for open file descriptors. .It Bq Er ENFILE @@ -176,6 +137,35 @@ There is no controlling terminal and the .Dv RPP_REQUIRE_TTY flag was specified. .El +.Sh SIGNALS +The +.Fn readpassphrase +function +will catch the following signals: +.Bd -literal -offset indent +SIGALRM SIGHUP SIGINT +SIGPIPE SIGQUIT SIGTERM +SIGTSTP SIGTTIN SIGTTOU +.Ed +.Pp +When one of the above signals is intercepted, terminal echo will +be restored if it had previously been turned off. +If a signal handler was installed for the signal when +.Fn readpassphrase +was called, that handler is then executed. +If no handler was previously installed for the signal then the +default action is taken as per +.Xr sigaction 2 . +.Pp +The +.Dv SIGTSTP , SIGTTIN +and +.Dv SIGTTOU +signals (stop signals generated from keyboard or due to terminal I/O +from a background process) are treated specially. +When the process is resumed after it has been stopped, +.Fn readpassphrase +will reprint the prompt and the user may then enter a passphrase. .Sh SEE ALSO .Xr sigaction 2 , .Xr getpass 3 Modified: projects/binutils-2.17/lib/libc/gen/readpassphrase.c ============================================================================== --- projects/binutils-2.17/lib/libc/gen/readpassphrase.c Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/lib/libc/gen/readpassphrase.c Sun Nov 14 01:06:10 2010 (r215273) @@ -1,35 +1,26 @@ -/* $OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.23 2010/05/14 13:30:34 millert Exp $ */ /* - * Copyright (c) 2000 Todd C. Miller <Todd.Miller@courtesan.com> - * All rights reserved. + * Copyright (c) 2000-2002, 2007, 2010 + * Todd C. Miller <Todd.Miller@courtesan.com> * - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -46,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include <readpassphrase.h> #include "un-namespace.h" -static volatile sig_atomic_t signo; +static volatile sig_atomic_t signo[NSIG]; static void handler(int); @@ -54,11 +45,11 @@ char * readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) { ssize_t nr; - int input, output, save_errno; + int input, output, save_errno, i, need_restart; char ch, *p, *end; struct termios term, oterm; - struct sigaction sa, saveint, savehup, savequit, saveterm; - struct sigaction savetstp, savettin, savettou; + struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; + struct sigaction savetstp, savettin, savettou, savepipe; /* I suppose we could alloc on demand in this case (XXX). */ if (bufsiz == 0) { @@ -67,11 +58,17 @@ readpassphrase(const char *prompt, char } restart: + for (i = 0; i < NSIG; i++) + signo[i] = 0; + nr = -1; + save_errno = 0; + need_restart = 0; /* * Read and write to /dev/tty if available. If not, read from * stdin and write to stderr unless a tty is required. */ - if ((input = output = _open(_PATH_TTY, O_RDWR)) == -1) { + if ((flags & RPP_STDIN) || + (input = output = _open(_PATH_TTY, O_RDWR)) == -1) { if (flags & RPP_REQUIRE_TTY) { errno = ENOTTY; return(NULL); @@ -81,45 +78,55 @@ restart: } /* + * Turn off echo if possible. + * If we are using a tty but are not the foreground pgrp this will + * generate SIGTTOU, so do it *before* installing the signal handlers. + */ + if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { + memcpy(&term, &oterm, sizeof(term)); + if (!(flags & RPP_ECHO_ON)) + term.c_lflag &= ~(ECHO | ECHONL); + if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) + term.c_cc[VSTATUS] = _POSIX_VDISABLE; + (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); + } else { + memset(&term, 0, sizeof(term)); + term.c_lflag |= ECHO; + memset(&oterm, 0, sizeof(oterm)); + oterm.c_lflag |= ECHO; + } + + /* * Catch signals that would otherwise cause the user to end * up with echo turned off in the shell. Don't worry about - * things like SIGALRM and SIGPIPE for now. + * things like SIGXCPU and SIGVTALRM for now. */ sigemptyset(&sa.sa_mask); sa.sa_flags = 0; /* don't restart system calls */ sa.sa_handler = handler; - (void)_sigaction(SIGINT, &sa, &saveint); + (void)_sigaction(SIGALRM, &sa, &savealrm); (void)_sigaction(SIGHUP, &sa, &savehup); + (void)_sigaction(SIGINT, &sa, &saveint); + (void)_sigaction(SIGPIPE, &sa, &savepipe); (void)_sigaction(SIGQUIT, &sa, &savequit); (void)_sigaction(SIGTERM, &sa, &saveterm); (void)_sigaction(SIGTSTP, &sa, &savetstp); (void)_sigaction(SIGTTIN, &sa, &savettin); (void)_sigaction(SIGTTOU, &sa, &savettou); - /* Turn off echo if possible. */ - if (tcgetattr(input, &oterm) == 0) { - memcpy(&term, &oterm, sizeof(term)); - if (!(flags & RPP_ECHO_ON)) - term.c_lflag &= ~(ECHO | ECHONL); - if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) - term.c_cc[VSTATUS] = _POSIX_VDISABLE; - (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); - } else { - memset(&term, 0, sizeof(term)); - memset(&oterm, 0, sizeof(oterm)); - } - - (void)_write(output, prompt, strlen(prompt)); + if (!(flags & RPP_STDIN)) + (void)_write(output, prompt, strlen(prompt)); end = buf + bufsiz - 1; - for (p = buf; (nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r';) { + p = buf; + while ((nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') { if (p < end) { if ((flags & RPP_SEVENBIT)) ch &= 0x7f; if (isalpha(ch)) { if ((flags & RPP_FORCELOWER)) - ch = tolower(ch); + ch = (char)tolower(ch); if ((flags & RPP_FORCEUPPER)) - ch = toupper(ch); + ch = (char)toupper(ch); } *p++ = ch; } @@ -130,11 +137,16 @@ restart: (void)_write(output, "\n", 1); /* Restore old terminal settings and signals. */ - if (memcmp(&term, &oterm, sizeof(term)) != 0) - (void)tcsetattr(input, TCSANOW|TCSASOFT, &oterm); - (void)_sigaction(SIGINT, &saveint, NULL); + if (memcmp(&term, &oterm, sizeof(term)) != 0) { + while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 && + errno == EINTR && !signo[SIGTTOU]) + continue; + } + (void)_sigaction(SIGALRM, &savealrm, NULL); (void)_sigaction(SIGHUP, &savehup, NULL); + (void)_sigaction(SIGINT, &saveint, NULL); (void)_sigaction(SIGQUIT, &savequit, NULL); + (void)_sigaction(SIGPIPE, &savepipe, NULL); (void)_sigaction(SIGTERM, &saveterm, NULL); (void)_sigaction(SIGTSTP, &savetstp, NULL); (void)_sigaction(SIGTTIN, &savettin, NULL); @@ -146,18 +158,22 @@ restart: * If we were interrupted by a signal, resend it to ourselves * now that we have restored the signal handlers. */ - if (signo) { - kill(getpid(), signo); - switch (signo) { - case SIGTSTP: - case SIGTTIN: - case SIGTTOU: - signo = 0; - goto restart; + for (i = 0; i < NSIG; i++) { + if (signo[i]) { + kill(getpid(), i); + switch (i) { + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + need_restart = 1; + } } } + if (need_restart) + goto restart; - errno = save_errno; + if (save_errno) + errno = save_errno; return(nr == -1 ? NULL : buf); } @@ -174,5 +190,5 @@ getpass(const char *prompt) static void handler(int s) { - signo = s; + signo[s] = 1; } Modified: projects/binutils-2.17/lib/libusb/libusb10.c ============================================================================== --- projects/binutils-2.17/lib/libusb/libusb10.c Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/lib/libusb/libusb10.c Sun Nov 14 01:06:10 2010 (r215273) @@ -800,6 +800,10 @@ libusb_free_transfer(struct libusb_trans if (uxfer == NULL) return; /* be NULL safe */ + /* check if we should free the transfer buffer */ + if (uxfer->flags & LIBUSB_TRANSFER_FREE_BUFFER) + free(uxfer->buffer); + sxfer = (struct libusb_super_transfer *)( (uint8_t *)uxfer - sizeof(*sxfer)); Modified: projects/binutils-2.17/lib/libusb/libusb10_io.c ============================================================================== --- projects/binutils-2.17/lib/libusb/libusb10_io.c Sat Nov 13 22:40:37 2010 (r215272) +++ projects/binutils-2.17/lib/libusb/libusb10_io.c Sun Nov 14 01:06:10 2010 (r215273) @@ -187,6 +187,8 @@ do_done: /* Do all done callbacks */ while ((sxfer = TAILQ_FIRST(&ctx->tr_done))) { + uint8_t flags; + TAILQ_REMOVE(&ctx->tr_done, sxfer, entry); sxfer->entry.tqe_prev = NULL; @@ -197,13 +199,14 @@ do_done: uxfer = (struct libusb_transfer *)( ((uint8_t *)sxfer) + sizeof(*sxfer)); + /* Allow the callback to free the transfer itself. */ + flags = uxfer->flags; + if (uxfer->callback != NULL) (uxfer->callback) (uxfer); - if (uxfer->flags & LIBUSB_TRANSFER_FREE_BUFFER) - free(uxfer->buffer); - - if (uxfer->flags & LIBUSB_TRANSFER_FREE_TRANSFER) + /* Check if the USB transfer should be automatically freed. */ + if (flags & LIBUSB_TRANSFER_FREE_TRANSFER) libusb_free_transfer(uxfer); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011140106.oAE16Ant065516>