svn commit: r248998 - head/sys/dev/ath
Author: adrian Date: Tue Apr 2 06:21:37 2013 New Revision: 248998 URL: http://svnweb.freebsd.org/changeset/base/248998 Log: Add a missing unmap; if we're freeing this mbuf then we must really both sync/unmap the dmamap before freeing it. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c == --- head/sys/dev/ath/if_ath_rx.cTue Apr 2 05:57:36 2013 (r248997) +++ head/sys/dev/ath/if_ath_rx.cTue Apr 2 06:21:37 2013 (r248998) @@ -621,6 +621,7 @@ rx_error: (rs-rs_status sc-sc_monpass)) { bus_dmamap_sync(sc-sc_dmat, bf-bf_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc-sc_dmat, bf-bf_dmamap); /* NB: bpf needs the mbuf length setup */ len = rs-rs_datalen; m-m_pkthdr.len = m-m_len = len; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r248999 - head/sys/dev/ath
Author: adrian Date: Tue Apr 2 06:24:22 2013 New Revision: 248999 URL: http://svnweb.freebsd.org/changeset/base/248999 Log: Some TX dmamap cleanups. * Don't use BUS_DMA_ALLOCNOW for descriptor DMA maps; we never use bounce buffers for the descriptors themselves. * Add some XXX's to mark where the ath_buf has its mbuf ripped from underneath it without actually cleaning up the dmamap. I haven't audited those particular code paths to see if the DMA map is guaranteed to be setup there; I'll do that later. * Print out a warning if the descdma tidyup code is given some descriptors w/ maps to free. Ideally the owner will free the mbufs and unmap the descriptors before freeing the descriptor/ath_buf pairs, but right now that's not guaranteed to be done. Reviewed by: scottl (BUS_DMA_ALLOCNOW tag) Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Tue Apr 2 06:21:37 2013(r248998) +++ head/sys/dev/ath/if_ath.c Tue Apr 2 06:24:22 2013(r248999) @@ -2742,6 +2742,7 @@ ath_start(struct ifnet *ifp) %s: flush fragmented packet, state %s\n, __func__, ieee80211_state_name[ni-ni_vap-iv_state]); + /* XXX dmamap */ ath_freetx(next); goto reclaim; } @@ -3031,6 +3032,9 @@ ath_descdma_alloc_desc(struct ath_softc /* * Setup DMA descriptor area. +* +* BUS_DMA_ALLOCNOW is not used; we never use bounce +* buffers for the descriptors themselves. */ error = bus_dma_tag_create(bus_get_dma_tag(sc-sc_dev), /* parent */ PAGE_SIZE, 0,/* alignment, bounds */ @@ -3040,7 +3044,7 @@ ath_descdma_alloc_desc(struct ath_softc dd-dd_desc_len, /* maxsize */ 1, /* nsegments */ dd-dd_desc_len, /* maxsegsize */ - BUS_DMA_ALLOCNOW,/* flags */ + 0, /* flags */ NULL,/* lockfunc */ NULL,/* lockarg */ dd-dd_dmat); @@ -3237,6 +3241,7 @@ ath_descdma_cleanup(struct ath_softc *sc { struct ath_buf *bf; struct ieee80211_node *ni; + int do_warning = 0; if (dd-dd_dmamap != 0) { bus_dmamap_unload(dd-dd_dmat, dd-dd_dmamap); @@ -3247,6 +3252,23 @@ ath_descdma_cleanup(struct ath_softc *sc if (head != NULL) { TAILQ_FOREACH(bf, head, bf_list) { if (bf-bf_m) { + /* +* XXX warn if there's buffers here. +* XXX it should have been freed by the +* owner! +*/ + + if (do_warning == 0) { + do_warning = 1; + device_printf(sc-sc_dev, + %s: %s: mbuf should've been +unmapped/freed!\n, + __func__, + dd-dd_name); + } + bus_dmamap_sync(sc-sc_dmat, bf-bf_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc-sc_dmat, bf-bf_dmamap); m_freem(bf-bf_m); bf-bf_m = NULL; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249000 - head/sys/dev/ath
Author: adrian Date: Tue Apr 2 06:25:10 2013 New Revision: 249000 URL: http://svnweb.freebsd.org/changeset/base/249000 Log: Mark a couple of places where I think the dmamap isn't being unmapped before the TX path is being aborted. Right now it's in the TDMA code and I can live with that; but it really should get fixed. I'll do a more thorough audit of this code soon. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c == --- head/sys/dev/ath/if_ath_tx.cTue Apr 2 06:24:22 2013 (r248999) +++ head/sys/dev/ath/if_ath_tx.cTue Apr 2 06:25:10 2013 (r249000) @@ -1615,6 +1615,7 @@ ath_tx_normal_setup(struct ath_softc *sc if_printf(ifp, bogus frame type 0x%x (%s)\n, wh-i_fc[0] IEEE80211_FC0_TYPE_MASK, __func__); /* XXX statistic */ + /* XXX free tx dmamap */ ath_freetx(m0); return EIO; } @@ -1670,6 +1671,7 @@ ath_tx_normal_setup(struct ath_softc *sc DPRINTF(sc, ATH_DEBUG_TDMA, %s: discard frame, ACK required w/ TDMA\n, __func__); sc-sc_stats.ast_tdma_ack++; + /* XXX free tx dmamap */ ath_freetx(m0); return EIO; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249004 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mm Date: Tue Apr 2 08:15:39 2013 New Revision: 249004 URL: http://svnweb.freebsd.org/changeset/base/249004 Log: Do not check against uninitialized rc and comment out vendor code MFC after:16 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Apr 2 07:28:14 2013(r249003) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Apr 2 08:15:39 2013(r249004) @@ -5713,11 +5713,11 @@ zfsdev_ioctl(struct cdev *dev, u_long zc { zfs_cmd_t *zc; uint_t vecnum; - int error, rc, len; #ifdef illumos + int error, rc, len; minor_t minor = getminor(dev); #else - int cflag, cmd, oldvecnum; + int error, len, cflag, cmd, oldvecnum; cred_t *cr = td-td_ucred; #endif const zfs_ioc_vec_t *vec; @@ -5904,8 +5904,11 @@ zfsdev_ioctl(struct cdev *dev, u_long zc out: nvlist_free(innvl); +#ifdef illumos + rc = ddi_copyout(zc, (void *)arg, sizeof (zfs_cmd_t), flag); if (error == 0 rc != 0) error = EFAULT; +#endif if (error == 0 vec-zvec_allow_log) { char *s = tsd_get(zfs_allow_log_key); if (s != NULL) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249008 - head/sys/cam
Author: trasz Date: Tue Apr 2 09:38:04 2013 New Revision: 249008 URL: http://svnweb.freebsd.org/changeset/base/249008 Log: Fix panic in the error path caused by recursive acquisition of XPT topology lock. Reviewed by: ken Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c == --- head/sys/cam/cam_periph.c Tue Apr 2 09:33:22 2013(r249007) +++ head/sys/cam/cam_periph.c Tue Apr 2 09:38:04 2013(r249008) @@ -218,9 +218,9 @@ cam_periph_alloc(periph_ctor_t *periph_c } if (*p_drv == NULL) { printf(cam_periph_alloc: invalid periph name '%s'\n, name); + xpt_unlock_buses(); xpt_free_path(periph-path); free(periph, M_CAMPERIPH); - xpt_unlock_buses(); return (CAM_REQ_INVALID); } periph-unit_number = camperiphunit(*p_drv, path_id, target_id, lun_id); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249009 - in head: share/man/man4 sys/cam/ctl sys/modules sys/modules/ctl usr.bin/ctlstat usr.sbin/ctladm
Author: trasz Date: Tue Apr 2 09:42:42 2013 New Revision: 249009 URL: http://svnweb.freebsd.org/changeset/base/249009 Log: Make it possible to build CTL as a module. Reviewed by: ken Sponsored by: FreeBSD Foundation Added: head/share/man/man4/ctl.4 (contents, props changed) head/sys/modules/ctl/ head/sys/modules/ctl/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/cam/ctl/README.ctl.txt head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_internal.c head/sys/cam/ctl/scsi_ctl.c head/sys/modules/Makefile head/usr.bin/ctlstat/ctlstat.8 head/usr.sbin/ctladm/ctladm.8 Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileTue Apr 2 09:38:04 2013 (r249008) +++ head/share/man/man4/MakefileTue Apr 2 09:42:42 2013 (r249009) @@ -99,6 +99,7 @@ MAN= aac.4 \ ${_cpuctl.4} \ cpufreq.4 \ crypto.4 \ + ctl.4 \ cue.4 \ cxgb.4 \ cxgbe.4 \ Added: head/share/man/man4/ctl.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ctl.4 Tue Apr 2 09:42:42 2013(r249009) @@ -0,0 +1,90 @@ +.\ Copyright (c) 2013 Edward Tomasz Napierala +.\ 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$ +.Dd March 8, 2013 +.Dt CTL 4 +.Os +.Sh NAME +.Nm ctl +.Nd CAM Target Layer +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd device ctl +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ctl_load=YES +.Ed +.Sh DESCRIPTION +The +.Nm +subsystem provides SCSI disk and processor emulation. +It supports features such as: +.Pp +.Bl -bullet -compact +.It +Disk and processor device emulation +.It +Tagged queueing +.It +SCSI task attribute support (ordered, head of queue, simple tags) +.It +SCSI implicit command ordering support. +.It +Full task management support (abort, LUN reset, target reset, etc.) +.It +Support for multiple ports +.It +Support for multiple simultaneous initiators +.It +Support for multiple simultaneous backing stores +.It +Persistent reservation support +.It +Mode sense/select support +.It +Error injection support +.It +All I/O handled in-kernel, no userland context switch overhead +.El +.Sh SEE ALSO +.Xr ctladm 8 , +.Xr ctlstat 8 +.Sh HISTORY +The +.Nm +subsystem first appeared in +.Fx 9.1 . +.Sh AUTHORS +The +.Nm +subsystem was written by +.An Kenneth Merry Aq k...@freebsd.org . Modified: head/sys/cam/ctl/README.ctl.txt == --- head/sys/cam/ctl/README.ctl.txt Tue Apr 2 09:38:04 2013 (r249008) +++ head/sys/cam/ctl/README.ctl.txt Tue Apr 2 09:42:42 2013 (r249009) @@ -227,9 +227,6 @@ Revision 1.2 Changes To Do List: == - - Make CTL buildable as a module. Work needs to be done on initialization, - and on freeing resources and LUNs when it is built as a module. - - Use devstat(9) for CTL's statistics collection. CTL uses a home-grown statistics collection system that is similar to devstat(9). ctlstat should be retired in favor of iostat, etc., once aggregation modes are Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Tue Apr 2
svn commit: r249011 - in head: share/man/man4 usr.sbin/ctladm
Author: trasz Date: Tue Apr 2 09:44:59 2013 New Revision: 249011 URL: http://svnweb.freebsd.org/changeset/base/249011 Log: Fix dates in manual pages modified in 249009. Modified: head/share/man/man4/ctl.4 head/usr.sbin/ctladm/ctladm.8 Modified: head/share/man/man4/ctl.4 == --- head/share/man/man4/ctl.4 Tue Apr 2 09:44:12 2013(r249010) +++ head/share/man/man4/ctl.4 Tue Apr 2 09:44:59 2013(r249011) @@ -23,7 +23,7 @@ .\ SUCH DAMAGE. .\ .\ $FreeBSD$ -.Dd March 8, 2013 +.Dd April 2, 2013 .Dt CTL 4 .Os .Sh NAME Modified: head/usr.sbin/ctladm/ctladm.8 == --- head/usr.sbin/ctladm/ctladm.8 Tue Apr 2 09:44:12 2013 (r249010) +++ head/usr.sbin/ctladm/ctladm.8 Tue Apr 2 09:44:59 2013 (r249011) @@ -34,7 +34,7 @@ .\ $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\ $FreeBSD$ .\ -.Dd March 6, 2013 +.Dd April 2, 2013 .Dt CTLADM 8 .Os .Sh NAME ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249012 - head/sys/cam/ctl
Author: trasz Date: Tue Apr 2 09:45:34 2013 New Revision: 249012 URL: http://svnweb.freebsd.org/changeset/base/249012 Log: Remove unused code. Reviewed by: ken Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c == --- head/sys/cam/ctl/scsi_ctl.c Tue Apr 2 09:44:59 2013(r249011) +++ head/sys/cam/ctl/scsi_ctl.c Tue Apr 2 09:45:34 2013(r249012) @@ -246,36 +246,6 @@ MODULE_DEPEND(ctlfe, cam, 1, 1, 1); extern struct ctl_softc *control_softc; extern int ctl_disable; -#ifdef seems_unused -int -ctlfeinitialize(void) -{ - cam_status status; - - /* Don't initialize if we're disabled */ - if (ctl_disable != 0) - return (0); - - STAILQ_INIT(ctlfe_softc_list); - - mtx_init(ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); - - xpt_lock_buses(); - periphdriver_register(ctlfe_driver); - xpt_unlock_buses(); - - status = xpt_register_async(AC_PATH_REGISTERED | AC_PATH_DEREGISTERED | - AC_CONTRACT, ctlfeasync, NULL, NULL); - - if (status != CAM_REQ_CMP) { - printf(ctl: Failed to attach async callback due to CAM - status 0x%x!\n, status); - } - - return (0); -} -#endif - void ctlfeshutdown(void) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249015 - head/crypto/openssh
Author: des Date: Tue Apr 2 11:42:39 2013 New Revision: 249015 URL: http://svnweb.freebsd.org/changeset/base/249015 Log: Silence printf format warnings. Modified: head/crypto/openssh/krl.c Modified: head/crypto/openssh/krl.c == --- head/crypto/openssh/krl.c Tue Apr 2 10:05:30 2013(r249014) +++ head/crypto/openssh/krl.c Tue Apr 2 11:42:39 2013(r249015) @@ -502,8 +502,11 @@ choose_next_state(int current_state, u_i } debug3(%s: contig %llu last_gap %llu next_gap %llu final %d, costs: list %llu range %llu bitmap %llu new bitmap %llu, - selected 0x%02x%s, __func__, contig, last_gap, next_gap, final, - cost_list, cost_range, cost_bitmap, cost_bitmap_restart, new_state, + selected 0x%02x%s, __func__, (unsigned long long)contig, + (unsigned long long)last_gap, (unsigned long long)next_gap, final, + (unsigned long long)cost_list, (unsigned long long)cost_range, + (unsigned long long)cost_bitmap, + (unsigned long long)cost_bitmap_restart, new_state, *force_new_section ? restart : ); return new_state; } @@ -539,7 +542,8 @@ revoked_certs_generate(struct revoked_ce rs != NULL; rs = RB_NEXT(revoked_serial_tree, rc-revoked_serials, rs)) { debug3(%s: serial %llu:%llu state 0x%02x, __func__, - rs-lo, rs-hi, state); + (unsigned long long)rs-lo, (unsigned long long)rs-hi, + state); /* Check contiguous length and gap to next section (if any) */ nrs = RB_NEXT(revoked_serial_tree, rc-revoked_serials, rs); @@ -928,8 +932,9 @@ ssh_krl_from_blob(Buffer *buf, struct ss } format_timestamp(krl-generated_date, timestamp, sizeof(timestamp)); - debug(KRL version %llu generated at %s%s%s, krl-krl_version, - timestamp, *krl-comment ? : : , krl-comment); + debug(KRL version %llu generated at %s%s%s, + (unsigned long long)krl-krl_version, timestamp, + *krl-comment ? : : , krl-comment); /* * 1st pass: verify signatures, if any. This is done to avoid ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249016 - head/crypto/openssh
Author: des Date: Tue Apr 2 11:44:55 2013 New Revision: 249016 URL: http://svnweb.freebsd.org/changeset/base/249016 Log: Merge upstream patch to silence spurious no such identity file warnings. Modified: head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/ssh.c head/crypto/openssh/sshconnect2.c Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/readconf.c == --- head/crypto/openssh/readconf.c Tue Apr 2 11:42:39 2013 (r249015) +++ head/crypto/openssh/readconf.c Tue Apr 2 11:44:55 2013 (r249016) @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.194 2011/09/23 07:45:05 markus Exp $ */ +/* $OpenBSD: readconf.c,v 1.195 2013/02/17 23:16:57 dtucker Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen y...@cs.hut.fi @@ -356,6 +356,26 @@ clear_forwardings(Options *options) options-tun_open = SSH_TUNMODE_NO; } +void +add_identity_file(Options *options, const char *dir, const char *filename, +int userprovided) +{ + char *path; + + if (options-num_identity_files = SSH_MAX_IDENTITY_FILES) + fatal(Too many identity files specified (max %d), + SSH_MAX_IDENTITY_FILES); + + if (dir == NULL) /* no dir, filename is absolute */ + path = xstrdup(filename); + else + (void)xasprintf(path, %.100s%.100s, dir, filename); + + options-identity_file_userprovided[options-num_identity_files] = + userprovided; + options-identity_files[options-num_identity_files++] = path; +} + /* * Returns the number of the token pointed to by cp or oBadOption. */ @@ -616,9 +636,7 @@ parse_yesnoask: if (*intptr = SSH_MAX_IDENTITY_FILES) fatal(%.200s line %d: Too many identity files specified (max %d)., filename, linenum, SSH_MAX_IDENTITY_FILES); - charptr = options-identity_files[*intptr]; - *charptr = xstrdup(arg); - *intptr = *intptr + 1; + add_identity_file(options, NULL, arg, 1); } break; Modified: head/crypto/openssh/readconf.h == --- head/crypto/openssh/readconf.h Tue Apr 2 11:42:39 2013 (r249015) +++ head/crypto/openssh/readconf.h Tue Apr 2 11:44:55 2013 (r249016) @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.h,v 1.91 2011/09/23 07:45:05 markus Exp $ */ +/* $OpenBSD: readconf.h,v 1.92 2013/02/17 23:16:57 dtucker Exp $ */ /* $FreeBSD$ */ /* @@ -97,6 +97,7 @@ typedef struct { int num_identity_files; /* Number of files for RSA/DSA identities. */ char *identity_files[SSH_MAX_IDENTITY_FILES]; + intidentity_file_userprovided[SSH_MAX_IDENTITY_FILES]; Key*identity_keys[SSH_MAX_IDENTITY_FILES]; /* Local TCP/IP forward requests. */ @@ -172,5 +173,6 @@ process_config_line(Options *, const cha voidadd_local_forward(Options *, const Forward *); voidadd_remote_forward(Options *, const Forward *); +voidadd_identity_file(Options *, const char *, const char *, int); #endif /* READCONF_H */ Modified: head/crypto/openssh/ssh.c == --- head/crypto/openssh/ssh.c Tue Apr 2 11:42:39 2013(r249015) +++ head/crypto/openssh/ssh.c Tue Apr 2 11:44:55 2013(r249016) @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.370 2012/07/06 01:47:38 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.371 2013/02/17 23:16:57 dtucker Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen y...@cs.hut.fi @@ -407,12 +407,7 @@ main(int ac, char **av) strerror(errno)); break; } - if (options.num_identity_files = - SSH_MAX_IDENTITY_FILES) - fatal(Too many identity files specified - (max %d), SSH_MAX_IDENTITY_FILES); - options.identity_files[options.num_identity_files++] = - xstrdup(optarg); + add_identity_file(options, NULL, optarg, 1); break; case 'I': #ifdef ENABLE_PKCS11 Modified: head/crypto/openssh/sshconnect2.c == --- head/crypto/openssh/sshconnect2.c Tue Apr 2 11:42:39 2013 (r249015) +++ head/crypto/openssh/sshconnect2.c Tue Apr 2 11:44:55 2013 (r249016) @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect2.c,v 1.191 2013/02/15 00:21:01 dtucker Exp $ */ +/* $OpenBSD: sshconnect2.c,v 1.192 2013/02/17
svn commit: r249019 - head/sys/cam/ctl
Author: trasz Date: Tue Apr 2 12:22:44 2013 New Revision: 249019 URL: http://svnweb.freebsd.org/changeset/base/249019 Log: Fix comment formatting. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Tue Apr 2 11:48:06 2013(r249018) +++ head/sys/cam/ctl/ctl.c Tue Apr 2 12:22:44 2013(r249019) @@ -92,9 +92,9 @@ struct ctl_softc *control_softc = NULL; #define CTL_DONE_THREAD /* - * * Use the serial number and device ID provided by the backend, rather than - * * making up our own. - **/ + * Use the serial number and device ID provided by the backend, rather than + * making up our own. + */ #define CTL_USE_BACKEND_SN /* @@ -7893,7 +7893,7 @@ ctl_persistent_reserve_out(struct ctl_sc return (CTL_RETVAL_COMPLETE); } } else if ((cdb-action SPRO_ACTION_MASK) != SPRO_REGISTER) { - /* + /* * We are not registered */ mtx_unlock(softc-ctl_lock); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249020 - in head/share/man: man5 man7
Author: eadler Date: Tue Apr 2 12:40:01 2013 New Revision: 249020 URL: http://svnweb.freebsd.org/changeset/base/249020 Log: Remove obsolete references to sysinstall. This change is not intended for MFC. PR: docs/177570 Submitted by: Garrett Cooper yaneurab...@gmail.com (partial) Approved by: bcr (mentor) Modified: head/share/man/man5/rc.conf.5 head/share/man/man7/hier.7 Modified: head/share/man/man5/rc.conf.5 == --- head/share/man/man5/rc.conf.5 Tue Apr 2 12:22:44 2013 (r249019) +++ head/share/man/man5/rc.conf.5 Tue Apr 2 12:40:01 2013 (r249020) @@ -38,8 +38,7 @@ details for any potential network interf started up at system initial boot time. In new installations, the .Nm -file is generally initialized by the system installation utility, -.Xr sysinstall 8 . +file is generally initialized by the system installation utility. .Pp The purpose of .Nm @@ -2452,10 +2451,6 @@ This command is intended to synchronize the system clock only .Em once from some standard reference. -An option to set this up initially -(from a list of known servers) is also provided by the -.Xr sysinstall 8 -program when the system is first installed. .It Va ntpdate_config .Pq Vt str Configuration file for Modified: head/share/man/man7/hier.7 == --- head/share/man/man7/hier.7 Tue Apr 2 12:22:44 2013(r249019) +++ head/share/man/man7/hier.7 Tue Apr 2 12:40:01 2013(r249020) @@ -62,16 +62,12 @@ see .El .It Pa /cdrom/ default mount point for CD-ROM drives -(created by -.Xr sysinstall 8 ) .It Pa /compat/ normally a link to .Pa /usr/compat . If not, then the .Pa /usr/compat comments apply -(created by -.Xr sysinstall 8 ) .It Pa /dev/ device special files managed by .Xr devfs 5 @@ -84,9 +80,6 @@ see .It Pa net/ network devices .El -.It Pa /dist/ -mount point used by -.Xr sysinstall 8 .It Pa /etc/ system configuration files and scripts .Pp @@ -190,8 +183,6 @@ common utilities, programming tools, and .It Pa compat/ files needed to support binary compatibility with other operating systems, such as Linux -(created by -.Xr sysinstall 8 ) .It Pa games/ useful and semi-frivolous programs .It Pa include/ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r249020 - in head/share/man: man5 man7
/cdrom isn't created by bsdinstall nowadays.. Otherwise, looks good :)! Thanks! -Garrett Sent from my iPhone On Apr 2, 2013, at 5:40 AM, Eitan Adler ead...@freebsd.org wrote: Author: eadler Date: Tue Apr 2 12:40:01 2013 New Revision: 249020 URL: http://svnweb.freebsd.org/changeset/base/249020 Log: Remove obsolete references to sysinstall. This change is not intended for MFC. PR:docs/177570 Submitted by:Garrett Cooper yaneurab...@gmail.com (partial) Approved by:bcr (mentor) Modified: head/share/man/man5/rc.conf.5 head/share/man/man7/hier.7 Modified: head/share/man/man5/rc.conf.5 == --- head/share/man/man5/rc.conf.5Tue Apr 2 12:22:44 2013(r249019) +++ head/share/man/man5/rc.conf.5Tue Apr 2 12:40:01 2013(r249020) @@ -38,8 +38,7 @@ details for any potential network interf started up at system initial boot time. In new installations, the .Nm -file is generally initialized by the system installation utility, -.Xr sysinstall 8 . +file is generally initialized by the system installation utility. .Pp The purpose of .Nm @@ -2452,10 +2451,6 @@ This command is intended to synchronize the system clock only .Em once from some standard reference. -An option to set this up initially -(from a list of known servers) is also provided by the -.Xr sysinstall 8 -program when the system is first installed. .It Va ntpdate_config .Pq Vt str Configuration file for Modified: head/share/man/man7/hier.7 == --- head/share/man/man7/hier.7Tue Apr 2 12:22:44 2013(r249019) +++ head/share/man/man7/hier.7Tue Apr 2 12:40:01 2013(r249020) @@ -62,16 +62,12 @@ see .El .It Pa /cdrom/ default mount point for CD-ROM drives -(created by -.Xr sysinstall 8 ) .It Pa /compat/ normally a link to .Pa /usr/compat . If not, then the .Pa /usr/compat comments apply -(created by -.Xr sysinstall 8 ) .It Pa /dev/ device special files managed by .Xr devfs 5 @@ -84,9 +80,6 @@ see .It Pa net/ network devices .El -.It Pa /dist/ -mount point used by -.Xr sysinstall 8 .It Pa /etc/ system configuration files and scripts .Pp @@ -190,8 +183,6 @@ common utilities, programming tools, and .It Pa compat/ files needed to support binary compatibility with other operating systems, such as Linux -(created by -.Xr sysinstall 8 ) .It Pa games/ useful and semi-frivolous programs .It Pa include/ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249022 - head/sys/modules/ctl
Author: glebius Date: Tue Apr 2 13:52:09 2013 New Revision: 249022 URL: http://svnweb.freebsd.org/changeset/base/249022 Log: - Remove extra $FreeBSD$ - Touch options headers to make module buildable. Reviewed by: trasz Modified: head/sys/modules/ctl/Makefile Modified: head/sys/modules/ctl/Makefile == --- head/sys/modules/ctl/Makefile Tue Apr 2 13:42:20 2013 (r249021) +++ head/sys/modules/ctl/Makefile Tue Apr 2 13:52:09 2013 (r249022) @@ -1,7 +1,5 @@ # $FreeBSD$ -# $FreeBSD$ - .PATH: ${.CURDIR}/../../cam/ctl KMOD= ctl @@ -22,5 +20,8 @@ SRCS+=scsi_ctl.c SRCS+= bus_if.h SRCS+= device_if.h SRCS+= vnode_if.h +SRCS+= opt_cam.h +SRCS+= opt_ctl.h +SRCS+= opt_kdtrace.h .include bsd.kmod.mk ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r248997 - head/sys/conf
On Tuesday, April 02, 2013 1:57:37 am Kevin Lo wrote: Author: kevlo Date: Tue Apr 2 05:57:36 2013 New Revision: 248997 URL: http://svnweb.freebsd.org/changeset/base/248997 Log: Add VIMAGE to NOTES. Reviewed by:zec Modified: head/sys/conf/NOTES Hmm, we've intentionally not done that to date (see how x86 conf Makefiles create separate LINT-VIMAGE configs). It might be good to keep these but comment them out? We need to build both LINTS to get good coverage. Also, I thought VIMAGE wasn't known to be buildable on non-x86? -- John Baldwin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249025 - head/sys/kern
Author: ken Date: Tue Apr 2 16:49:49 2013 New Revision: 249025 URL: http://svnweb.freebsd.org/changeset/base/249025 Log: Add support for XPT_CONT_TARGET_IO CCBs in _bus_dmamap_load_ccb(). Declare CCB types in their respective switch blocks. Sponsored by: Spectra Logic Modified: head/sys/kern/subr_bus_dma.c Modified: head/sys/kern/subr_bus_dma.c == --- head/sys/kern/subr_bus_dma.cTue Apr 2 14:27:44 2013 (r249024) +++ head/sys/kern/subr_bus_dma.cTue Apr 2 16:49:49 2013 (r249025) @@ -158,8 +158,6 @@ static int _bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, int *nsegs, int flags) { - struct ccb_ataio *ataio; - struct ccb_scsiio *csio; struct ccb_hdr *ccb_h; void *data_ptr; int error; @@ -169,18 +167,33 @@ _bus_dmamap_load_ccb(bus_dma_tag_t dmat, error = 0; ccb_h = ccb-ccb_h; switch (ccb_h-func_code) { - case XPT_SCSI_IO: + case XPT_SCSI_IO: { + struct ccb_scsiio *csio; + csio = ccb-csio; data_ptr = csio-data_ptr; dxfer_len = csio-dxfer_len; sglist_cnt = csio-sglist_cnt; break; - case XPT_ATA_IO: + } + case XPT_CONT_TARGET_IO: { + struct ccb_scsiio *ctio; + + ctio = ccb-ctio; + data_ptr = ctio-data_ptr; + dxfer_len = ctio-dxfer_len; + sglist_cnt = ctio-sglist_cnt; + break; + } + case XPT_ATA_IO: { + struct ccb_ataio *ataio; + ataio = ccb-ataio; data_ptr = ataio-data_ptr; dxfer_len = ataio-dxfer_len; sglist_cnt = 0; break; + } default: panic(_bus_dmamap_load_ccb: Unsupported func code %d, ccb_h-func_code); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249026 - head/sys/cam/ctl
Author: trasz Date: Tue Apr 2 16:50:50 2013 New Revision: 249026 URL: http://svnweb.freebsd.org/changeset/base/249026 Log: Don't directly dereference userland pointer; instead use kernel pointer copied in from userspace. This fixes instant panic when creating CTL LUN on sparc64. Not a security problem, since the API is root-only. Reviewed by: ken Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c == --- head/sys/cam/ctl/ctl_backend_block.cTue Apr 2 16:49:49 2013 (r249025) +++ head/sys/cam/ctl/ctl_backend_block.cTue Apr 2 16:50:50 2013 (r249026) @@ -1658,7 +1658,7 @@ ctl_be_block_create(struct ctl_be_block_ if (be_lun-ctl_be_lun.lun_type == T_DIRECT) { for (i = 0; i req-num_be_args; i++) { - if (strcmp(req-kern_be_args[i].name, file) == 0) { + if (strcmp(req-kern_be_args[i].kname, file) == 0) { file_arg = req-kern_be_args[i]; break; } @@ -1673,7 +1673,7 @@ ctl_be_block_create(struct ctl_be_block_ be_lun-dev_path = malloc(file_arg-vallen, M_CTLBLK, M_WAITOK | M_ZERO); - strlcpy(be_lun-dev_path, (char *)file_arg-value, + strlcpy(be_lun-dev_path, (char *)file_arg-kvalue, file_arg-vallen); retval = ctl_be_block_open(softc, be_lun, req); @@ -1712,7 +1712,7 @@ ctl_be_block_create(struct ctl_be_block_ * the loop above, */ for (i = 0; i req-num_be_args; i++) { - if (strcmp(req-kern_be_args[i].name, num_threads) == 0) { + if (strcmp(req-kern_be_args[i].kname, num_threads) == 0) { struct ctl_be_arg *thread_arg; char num_thread_str[16]; int tmp_num_threads; @@ -1720,7 +1720,7 @@ ctl_be_block_create(struct ctl_be_block_ thread_arg = req-kern_be_args[i]; - strlcpy(num_thread_str, (char *)thread_arg-value, + strlcpy(num_thread_str, (char *)thread_arg-kvalue, min(thread_arg-vallen, sizeof(num_thread_str))); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249028 - head/sys/cam/ctl
Author: ken Date: Tue Apr 2 17:29:17 2013 New Revision: 249028 URL: http://svnweb.freebsd.org/changeset/base/249028 Log: Fix sending virtual scatter/gather lists from the CTL CAM frontend peripheral. Sponsored by: Spectra Logic Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c == --- head/sys/cam/ctl/scsi_ctl.c Tue Apr 2 17:11:07 2013(r249027) +++ head/sys/cam/ctl/scsi_ctl.c Tue Apr 2 17:29:17 2013(r249028) @@ -916,7 +916,7 @@ ctlfestart(struct cam_periph *periph, un if (io-io_hdr.flags CTL_FLAG_BUS_ADDR) flags |= CAM_DATA_SG_PADDR; else - flags = ~CAM_DATA_SG; + flags |= CAM_DATA_SG; data_ptr = (uint8_t *)cam_sglist; dxfer_len = io-scsiio.kern_data_len; } else { @@ -938,6 +938,10 @@ ctlfestart(struct cam_periph *periph, un data_ptr = sglist[*ti].addr; dxfer_len = sglist[*ti].len; csio-sglist_cnt = 0; + if (io-io_hdr.flags CTL_FLAG_BUS_ADDR) + flags |= CAM_DATA_PADDR; + else + flags |= CAM_DATA_VADDR; cmd_info-flags |= CTLFE_CMD_PIECEWISE; (*ti)++; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249032 - head/sys/dev/md
Author: kib Date: Tue Apr 2 19:39:31 2013 New Revision: 249032 URL: http://svnweb.freebsd.org/changeset/base/249032 Log: Do not declare that preloaded md(4) supports unmapped bio requests, it does not. Reported by: m...@kernel32.de Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c == --- head/sys/dev/md/md.cTue Apr 2 19:33:35 2013(r249031) +++ head/sys/dev/md/md.cTue Apr 2 19:39:31 2013(r249032) @@ -1008,7 +1008,15 @@ mdinit(struct md_s *sc) pp = g_new_providerf(gp, md%d, sc-unit); pp-mediasize = sc-mediasize; pp-sectorsize = sc-sectorsize; - pp-flags |= G_PF_ACCEPT_UNMAPPED; + switch (sc-type) { + case MD_MALLOC: + case MD_VNODE: + case MD_SWAP: + pp-flags |= G_PF_ACCEPT_UNMAPPED; + break; + case MD_PRELOAD: + break; + } sc-gp = gp; sc-pp = pp; g_error_provider(pp, 0); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249033 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests
Author: sjg Date: Tue Apr 2 21:31:11 2013 New Revision: 249033 URL: http://svnweb.freebsd.org/changeset/base/249033 Log: Update to bmake-20130330 Added: head/contrib/bmake/unit-tests/export-env - copied unchanged from r248991, vendor/NetBSD/bmake/dist/unit-tests/export-env Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/FILES head/contrib/bmake/Makefile head/contrib/bmake/bmake.1 head/contrib/bmake/bmake.cat1 head/contrib/bmake/boot-strap head/contrib/bmake/configure head/contrib/bmake/configure.in head/contrib/bmake/dir.c head/contrib/bmake/job.c head/contrib/bmake/job.h head/contrib/bmake/main.c head/contrib/bmake/make.1 head/contrib/bmake/make.h head/contrib/bmake/meta.c head/contrib/bmake/meta.h head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/gendirdeps.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/mk/meta2deps.py head/contrib/bmake/mk/meta2deps.sh head/contrib/bmake/mk/sys.dependfile.mk head/contrib/bmake/parse.c head/contrib/bmake/unit-tests/Makefile.in head/contrib/bmake/unit-tests/test.exp head/contrib/bmake/var.c head/usr.bin/bmake/Makefile head/usr.bin/bmake/config.h head/usr.bin/bmake/unit-tests/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog == --- head/contrib/bmake/ChangeLogTue Apr 2 19:39:31 2013 (r249032) +++ head/contrib/bmake/ChangeLogTue Apr 2 21:31:11 2013 (r249033) @@ -1,3 +1,47 @@ +2013-03-30 Simon J. Gerraty s...@bad.crufty.net + + * Makefile (MAKE_VERSION): 20130330 + Merge with NetBSD make, pick up + o meta.c: refine the handling of .OODATE in commands. + Rather than suppress command comparison for the entire script + as though .NOMETA_CMP had been used, only suppress it for the + one command line. + This allows something like ${.OODATE:M.NOMETA_CMP} to be used to + suppress comparison of a command without otherwise affecting it. + o make.1: document that + +2013-03-22 Simon J. Gerraty s...@bad.crufty.net + + * Makefile (MAKE_VERSION): 20130321 + yes, not quite right but its a cooler number. + Merge with NetBSD make, pick up + o parse.c: fix ParseGmakeExport to be portable + and add a unit-test. + * meta.c: call meta_init() before makefiles are read and if built + with filemon support set .MAKE.PATH_FILEMON to _PATH_FILEMON + this let's makefiles test for support. + Call meta_mode_init() to process .MAKE.MODE. + +2013-03-13 Simon J. Gerraty s...@bad.crufty.net + + * Makefile (MAKE_VERSION): 20130305 + Merge with NetBSD make, pick up + o run .STALE: target when a dependency from .depend is missing. + o job.c: add Job_RunTarget() for the above and .BEGIN + +2013-03-03 Simon J. Gerraty s...@bad.crufty.net + + * Makefile (MAKE_VERSION): 20130303 + Merge with NetBSD make, pick up + o main.c: set .MAKE.OS to utsname.sysname + o job.c: more checks for read and poll errors + o var.c: lose VarChangeCase() saves 4% time + +2013-03-02 Simon J. Gerraty s...@bad.crufty.net + + * boot-strap: remove MAKEOBJDIRPREFIX from environment since we + want to use MAKEOBJDIR + 2013-01-27 Simon J. Gerraty s...@bad.crufty.net * Merge with NetBSD make, pick up Modified: head/contrib/bmake/FILES == --- head/contrib/bmake/FILESTue Apr 2 19:39:31 2013(r249032) +++ head/contrib/bmake/FILESTue Apr 2 21:31:11 2013(r249033) @@ -102,6 +102,7 @@ unit-tests/dotwait unit-tests/error unit-tests/export unit-tests/export-all +unit-tests/export-env unit-tests/forloop unit-tests/forsubst unit-tests/hash Modified: head/contrib/bmake/Makefile == --- head/contrib/bmake/Makefile Tue Apr 2 19:39:31 2013(r249032) +++ head/contrib/bmake/Makefile Tue Apr 2 21:31:11 2013(r249033) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.5 2013/01/28 19:31:58 sjg Exp $ +# $Id: Makefile,v 1.10 2013/03/31 05:57:19 sjg Exp $ # Base version on src date -MAKE_VERSION= 20130123 +MAKE_VERSION= 20130330 PROG= bmake @@ -187,14 +187,14 @@ MANDIR= ${SHAREDIR}/man .if !exists(.depend) ${OBJS}: config.h .endif -.if ${MK_AUTOCONF_MK} == yes -.include autoconf.mk -.endif # make sure that MAKE_VERSION gets updated. main.o: ${SRCS} ${MAKEFILE} # start-delete2 for bsd.after-import.mk +.if ${MK_AUTOCONF_MK} == yes +.include autoconf.mk +.endif SHARE_MK?=${SHAREDIR}/mk MKSRC=${srcdir}/mk INSTALL?=${srcdir}/install-sh Modified: head/contrib/bmake/bmake.1
svn commit: r249034 - head/bin/sh
Author: jilles Date: Tue Apr 2 21:34:38 2013 New Revision: 249034 URL: http://svnweb.freebsd.org/changeset/base/249034 Log: sh: Write as much into the heredoc pipe as possible, to avoid forking. Use non-blocking I/O to write as much as the pipe will accept (often 64K, but it can be as little as 4K), avoiding the need for the ugly PIPESIZE constant. If PIPESIZE was set too high, a deadlock would occur. Modified: head/bin/sh/redir.c Modified: head/bin/sh/redir.c == --- head/bin/sh/redir.c Tue Apr 2 21:31:11 2013(r249033) +++ head/bin/sh/redir.c Tue Apr 2 21:34:38 2013(r249034) @@ -64,7 +64,6 @@ __FBSDID($FreeBSD$); #define EMPTY -2 /* marks an unused slot in redirtab */ #define CLOSED -1 /* fd was not open before redir */ -#define PIPESIZE 4096 /* amount of buffering in a pipe */ MKINIT @@ -253,7 +252,9 @@ openhere(union node *redir) { char *p; int pip[2]; - int len = 0; + size_t len = 0; + int flags; + ssize_t written = 0; if (pipe(pip) 0) error(Pipe call failed: %s, strerror(errno)); @@ -263,9 +264,16 @@ openhere(union node *redir) else p = redir-nhere.doc-narg.text; len = strlen(p); - if (len = PIPESIZE) { - xwrite(pip[1], p, len); + if (len == 0) goto out; + flags = fcntl(pip[1], F_GETFL, 0); + if (flags != -1 fcntl(pip[1], F_SETFL, flags | O_NONBLOCK) != -1) { + written = write(pip[1], p, len); + if (written 0) + written = 0; + if ((size_t)written == len) + goto out; + fcntl(pip[1], F_SETFL, flags); } if (forkshell((struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) { @@ -275,7 +283,7 @@ openhere(union node *redir) signal(SIGHUP, SIG_IGN); signal(SIGTSTP, SIG_IGN); signal(SIGPIPE, SIG_DFL); - xwrite(pip[1], p, len); + xwrite(pip[1], p + written, len - written); _exit(0); } out: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r249035 - head/lib/libc/stdlib
Author: delphij Date: Tue Apr 2 23:41:20 2013 New Revision: 249035 URL: http://svnweb.freebsd.org/changeset/base/249035 Log: Replace access to /dev/random with the kernel pseudo-random number source sysctl(KERN_ARND) and remove the fallback code. Obtained from:OpenBSD Reviewed by: secteam MFC after:1 month Modified: head/lib/libc/stdlib/rand.3 head/lib/libc/stdlib/rand.c head/lib/libc/stdlib/random.3 head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/rand.3 == --- head/lib/libc/stdlib/rand.3 Tue Apr 2 21:34:38 2013(r249034) +++ head/lib/libc/stdlib/rand.3 Tue Apr 2 23:41:20 2013(r249035) @@ -32,7 +32,7 @@ .\ @(#)rand.3 8.1 (Berkeley) 6/4/93 .\ $FreeBSD$ .\ -.Dd September 4, 2012 +.Dd April 2, 2013 .Dt RAND 3 .Os .Sh NAME @@ -91,9 +91,7 @@ seeded with a value of 1. .Pp The .Fn sranddev -function initializes a seed using the -.Xr random 4 -random number device which returns good random numbers. +function initializes a seed using pseudo-random numbers obtained from the kernel. .Pp The .Fn rand_r Modified: head/lib/libc/stdlib/rand.c == --- head/lib/libc/stdlib/rand.c Tue Apr 2 21:34:38 2013(r249034) +++ head/lib/libc/stdlib/rand.c Tue Apr 2 23:41:20 2013(r249035) @@ -36,11 +36,10 @@ static char sccsid[] = @(#)rand.c 8.1 ( __FBSDID($FreeBSD$); #include namespace.h -#include sys/time.h /* for sranddev() */ +#include sys/param.h +#include sys/sysctl.h #include sys/types.h -#include fcntl.h /* for sranddev() */ #include stdlib.h -#include unistd.h/* for sranddev() */ #include un-namespace.h #ifdef TEST @@ -112,28 +111,20 @@ u_int seed; * sranddev: * * Many programs choose the seed value in a totally predictable manner. - * This often causes problems. We seed the generator using the much more - * secure random(4) interface. + * This often causes problems. We seed the generator using pseudo-random + * data from the kernel. */ void sranddev() { - int fd, done; + int mib[2]; + size_t len; - done = 0; - fd = _open(/dev/random, O_RDONLY | O_CLOEXEC, 0); - if (fd = 0) { - if (_read(fd, (void *) next, sizeof(next)) == sizeof(next)) - done = 1; - _close(fd); - } - - if (!done) { - struct timeval tv; - - gettimeofday(tv, NULL); - srand((getpid() 16) ^ tv.tv_sec ^ tv.tv_usec); - } + len = sizeof(next); + + mib[0] = CTL_KERN; + mib[1] = KERN_ARND; + sysctl(mib, 2, (void *)next, len, NULL, 0); } Modified: head/lib/libc/stdlib/random.3 == --- head/lib/libc/stdlib/random.3 Tue Apr 2 21:34:38 2013 (r249034) +++ head/lib/libc/stdlib/random.3 Tue Apr 2 23:41:20 2013 (r249035) @@ -28,7 +28,7 @@ .\ @(#)random.3 8.1 (Berkeley) 6/4/93 .\ $FreeBSD$ .\ -.Dd September 4, 2012 +.Dd April 2, 2013 .Dt RANDOM 3 .Os .Sh NAME @@ -106,8 +106,8 @@ as the seed. .Pp The .Fn srandomdev -routine initializes a state array using data from -.Xr random 4 . +routine initializes a state array using +pseudo-random numbers obtained from the kernel. Note that this particular seeding procedure can generate states which are impossible to reproduce by calling Modified: head/lib/libc/stdlib/random.c == --- head/lib/libc/stdlib/random.c Tue Apr 2 21:34:38 2013 (r249034) +++ head/lib/libc/stdlib/random.c Tue Apr 2 23:41:20 2013 (r249035) @@ -34,12 +34,11 @@ static char sccsid[] = @(#)random.c8.2 __FBSDID($FreeBSD$); #include namespace.h -#include sys/time.h /* for srandomdev() */ -#include fcntl.h /* for srandomdev() */ +#include sys/param.h +#include sys/sysctl.h #include stdint.h #include stdio.h #include stdlib.h -#include unistd.h/* for srandomdev() */ #include un-namespace.h /* @@ -284,39 +283,28 @@ srandom(unsigned long x) * srandomdev: * * Many programs choose the seed value in a totally predictable manner. - * This often causes problems. We seed the generator using the much more - * secure random(4) interface. Note that this particular seeding - * procedure can generate states which are impossible to reproduce by - * calling srandom() with any value, since the succeeding terms in the - * state buffer are no longer derived from the LC algorithm applied to - * a fixed seed. + * This often causes problems. We seed the generator using pseudo-random + * data from the kernel. + * + * Note that this particular seeding procedure can generate states + * which are impossible to reproduce by
Re: Re: svn commit: r248997 - head/sys/conf
On 2013/04/03 00:34, John Baldwin wrote: On Tuesday, April 02, 2013 1:57:37 am Kevin Lo wrote: Author: kevlo Date: Tue Apr 2 05:57:36 2013 New Revision: 248997 URL: http://svnweb.freebsd.org/changeset/base/248997 Log: Add VIMAGE to NOTES. Reviewed by: zec Modified: head/sys/conf/NOTES Hmm, we've intentionally not done that to date (see how x86 conf Makefiles create separate LINT-VIMAGE configs). It might be good to keep these but comment them out? We need to build both LINTS to get good coverage. Ok, fixed. Thanks for pointing that out. Also, I thought VIMAGE wasn't known to be buildable on non-x86? I'm not sure if VIMAGE doesn't support on non-x86 arches. I'll try it out on my ARM platform. Kevin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org