From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 13 04:13:15 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 729EB585; Sun, 13 Jan 2013 04:13:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A11B6D8; Sun, 13 Jan 2013 04:13:15 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0D4DFtg095519; Sun, 13 Jan 2013 04:13:15 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0D4DEgT095516; Sun, 13 Jan 2013 04:13:14 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301130413.r0D4DEgT095516@svn.freebsd.org> From: Mark Johnston Date: Sun, 13 Jan 2013 04:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245357 - in stable/8/sys/dev/usb: . quirk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2013 04:13:15 -0000 Author: markj Date: Sun Jan 13 04:13:14 2013 New Revision: 245357 URL: http://svnweb.freebsd.org/changeset/base/245357 Log: MFC r244719: Add the NO_SYNC_CACHE quirk for all Apple USB MSC devices, as they typically do not handle the SYNCHRONIZE_CACHE command - they either return an error or the firmware enters a reset loop. Approved by: rstone (co-mentor) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Sun Jan 13 01:26:50 2013 (r245356) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Sun Jan 13 04:13:14 2013 (r245357) @@ -467,6 +467,7 @@ static struct usb_quirk_entry usb_quirks * after issuing non-supported commands: */ USB_QUIRK(ALCOR, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_TEST_UNIT_READY, UQ_MATCH_VENDOR_ONLY), + USB_QUIRK(APPLE, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(INITIO, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Jan 13 01:26:50 2013 (r245356) +++ stable/8/sys/dev/usb/usbdevs Sun Jan 13 04:13:14 2013 (r245357) @@ -1050,6 +1050,7 @@ product AOX USB101 0x0008 Ethernet product APC UPS 0x0002 Uninterruptible Power Supply /* Apple Computer products */ +product APPLE DUMMY 0x0000 Dummy product product APPLE IMAC_KBD 0x0201 USB iMac Keyboard product APPLE KBD 0x0202 USB Keyboard M2452 product APPLE EXT_KBD 0x020c Apple Extended USB Keyboard From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 13 04:14:31 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AEDF9862; Sun, 13 Jan 2013 04:14:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 888246E9; Sun, 13 Jan 2013 04:14:31 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0D4EVmb095790; Sun, 13 Jan 2013 04:14:31 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0D4EV4E095788; Sun, 13 Jan 2013 04:14:31 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301130414.r0D4EV4E095788@svn.freebsd.org> From: Mark Johnston Date: Sun, 13 Jan 2013 04:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245359 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2013 04:14:31 -0000 Author: markj Date: Sun Jan 13 04:14:30 2013 New Revision: 245359 URL: http://svnweb.freebsd.org/changeset/base/245359 Log: MFC r244995 r244996 r244997. MFC r244995: Fix a typo in an error message. MFC r244996: Have -n imply -r, since dry-run mode obviously doesn't require root privileges. MFC r244997: Make sure to update the mtime of a logfile after archiving it. This ensures that the next rotation happens at the correct time when using interval-based rotations. Approved by: rstone (co-mentor) Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.8 Sun Jan 13 04:13:45 2013 (r245358) +++ stable/8/usr.sbin/newsyslog/newsyslog.8 Sun Jan 13 04:14:30 2013 (r245359) @@ -126,7 +126,9 @@ reasons for either trimming that log or Cause .Nm not to trim the logs, but to print out what it would do if this option -were not specified. +were not specified. This option implies the +.Fl r +option. .It Fl r Remove the restriction that .Nm Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Sun Jan 13 04:13:45 2013 (r245358) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Sun Jan 13 04:14:30 2013 (r245359) @@ -639,7 +639,7 @@ parse_args(int argc, char **argv) break; case 'n': noaction++; - break; + /* FALLTHROUGH */ case 'r': needroot = 0; break; @@ -1576,7 +1576,7 @@ delete_oldest_timelog(const struct conf_ oldlogs[i].fname); else if (unlinkat(dirfd, oldlogs[i].fname, 0) != 0) { snprintf(errbuf, sizeof(errbuf), - "Could not delet old logfile '%s'", + "Could not delete old logfile '%s'", oldlogs[i].fname); perror(errbuf); } @@ -1778,12 +1778,21 @@ do_rotate(const struct conf_entry *ent) printf("\tcp %s %s\n", ent->log, file1); else printf("\tln %s %s\n", ent->log, file1); + printf("\ttouch %s\t\t" + "# Update mtime for 'when'-interval processing\n", + file1); } else { if (!(flags & CE_BINARY)) { /* Report the trimming to the old log */ log_trim(ent->log, ent); } savelog(ent->log, file1); + /* + * Interval-based rotations are done using the mtime of + * the most recently archived log, so make sure it gets + * updated during a rotation. + */ + utimes(file1, NULL); } change_attrs(file1, ent); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 13 22:36:13 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0A0FCB9; Sun, 13 Jan 2013 22:36:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91DFB26E; Sun, 13 Jan 2013 22:36:13 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DMaD15019875; Sun, 13 Jan 2013 22:36:13 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DMaCZn019871; Sun, 13 Jan 2013 22:36:12 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201301132236.r0DMaCZn019871@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 13 Jan 2013 22:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245393 - stable/8/usr.sbin/pkg X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2013 22:36:13 -0000 Author: bapt Date: Sun Jan 13 22:36:12 2013 New Revision: 245393 URL: http://svnweb.freebsd.org/changeset/base/245393 Log: MFC: r243883 if PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and use them if any. It allows the bootstrap to use directly pkg.FreeBSD.org instead of pkgbeta.FreeBSD.org Added: stable/8/usr.sbin/pkg/dns_utils.c - copied unchanged from r243883, head/usr.sbin/pkg/dns_utils.c stable/8/usr.sbin/pkg/dns_utils.h - copied unchanged from r243883, head/usr.sbin/pkg/dns_utils.h Modified: stable/8/usr.sbin/pkg/Makefile stable/8/usr.sbin/pkg/pkg.c Directory Properties: stable/8/usr.sbin/pkg/ (props changed) Modified: stable/8/usr.sbin/pkg/Makefile ============================================================================== --- stable/8/usr.sbin/pkg/Makefile Sun Jan 13 22:35:51 2013 (r245392) +++ stable/8/usr.sbin/pkg/Makefile Sun Jan 13 22:36:12 2013 (r245393) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= pkg -SRC= pkg.c +SRCS= pkg.c dns_utils.c NO_MAN= yes DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} Copied: stable/8/usr.sbin/pkg/dns_utils.c (from r243883, head/usr.sbin/pkg/dns_utils.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/pkg/dns_utils.c Sun Jan 13 22:36:12 2013 (r245393, copy of r243883, head/usr.sbin/pkg/dns_utils.c) @@ -0,0 +1,136 @@ +/*- + * Copyright (c) 2012 Baptiste Daroussin + * 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, + * without modification, immediately at the beginning of the file. + * 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 ``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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "dns_utils.h" + +typedef union { + HEADER hdr; + unsigned char buf[1024]; +} dns_query; + +struct dns_srvinfo * +dns_getsrvinfo(const char *zone) +{ + struct dns_srvinfo **res, *first; + unsigned char *end, *p; + char host[MAXHOSTNAMELEN]; + dns_query q; + int len, qdcount, ancount, n, i; + unsigned int type, class, ttl, priority, weight, port; + + if ((len = res_query(zone, C_IN, T_SRV, q.buf, sizeof(q.buf))) == -1 || + len < (int)sizeof(HEADER)) + return (NULL); + + qdcount = ntohs(q.hdr.qdcount); + ancount = ntohs(q.hdr.ancount); + + end = q.buf + len; + p = q.buf + sizeof(HEADER); + + while(qdcount > 0 && p < end) { + qdcount--; + if((len = dn_expand(q.buf, end, p, host, MAXHOSTNAMELEN)) < 0) + return (NULL); + p += len + NS_QFIXEDSZ; + } + + res = malloc(sizeof(struct dns_srvinfo) * ancount); + if (res == NULL) + return (NULL); + memset(res, 0, sizeof(struct dns_srvinfo) * ancount); + + n = 0; + while (ancount > 0 && p < end) { + ancount--; + len = dn_expand(q.buf, end, p, host, MAXHOSTNAMELEN); + if (len < 0) { + for (i = 0; i < n; i++) + free(res[i]); + free(res); + return NULL; + } + + p += len; + + NS_GET16(type, p); + NS_GET16(class, p); + NS_GET32(ttl, p); + NS_GET16(len, p); + + if (type != T_SRV) { + p += len; + continue; + } + + NS_GET16(priority, p); + NS_GET16(weight, p); + NS_GET16(port, p); + + len = dn_expand(q.buf, end, p, host, MAXHOSTNAMELEN); + if (len < 0) { + for (i = 0; i < n; i++) + free(res[i]); + free(res); + return (NULL); + } + + res[n] = malloc(sizeof(struct dns_srvinfo)); + if (res[n] == NULL) { + for (i = 0; i < n; i++) + free(res[i]); + free(res); + return (NULL); + } + res[n]->type = type; + res[n]->class = class; + res[n]->ttl = ttl; + res[n]->priority = priority; + res[n]->weight = weight; + res[n]->port = port; + res[n]->next = NULL; + strlcpy(res[n]->host, host, MAXHOSTNAMELEN); + + p += len; + n++; + } + + for (i = 0; i < n - 1; i++) + res[i]->next = res[i + 1]; + + first = res[0]; + free(res); + + return (first); +} Copied: stable/8/usr.sbin/pkg/dns_utils.h (from r243883, head/usr.sbin/pkg/dns_utils.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/pkg/dns_utils.h Sun Jan 13 22:36:12 2013 (r245393, copy of r243883, head/usr.sbin/pkg/dns_utils.h) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2012 Baptiste Daroussin + * 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$ + */ + +#ifndef DNS_UTILS_H +#define DNS_UTILS_H +struct dns_srvinfo { + unsigned int type; + unsigned int class; + unsigned int ttl; + unsigned int priority; + unsigned int weight; + unsigned int port; + char host[MAXHOSTNAMELEN]; + struct dns_srvinfo *next; +}; + +struct dns_srvinfo * + dns_getsrvinfo(const char *zone); + +#endif Modified: stable/8/usr.sbin/pkg/pkg.c ============================================================================== --- stable/8/usr.sbin/pkg/pkg.c Sun Jan 13 22:35:51 2013 (r245392) +++ stable/8/usr.sbin/pkg/pkg.c Sun Jan 13 22:36:12 2013 (r245393) @@ -48,9 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include "elf_tables.h" +#include "dns_utils.h" #define _LOCALBASE "/usr/local" -#define _PKGS_URL "http://pkgbeta.FreeBSD.org" +#define _PKGS_URL "http://pkg.FreeBSD.org" static const char * elf_corres_to_string(struct _elf_corres *m, int e) @@ -281,16 +282,20 @@ install_pkg_static(char *path, char *pkg static int bootstrap_pkg(void) { + struct url *u; FILE *remote; FILE *config; char *site; + struct dns_srvinfo *mirrors, *current; + /* To store _https._tcp. + hostname + \0 */ + char zone[MAXHOSTNAMELEN + 13]; char url[MAXPATHLEN]; char conf[MAXPATHLEN]; char abi[BUFSIZ]; char tmppkg[MAXPATHLEN]; char buf[10240]; char pkgstatic[MAXPATHLEN]; - int fd, retry, ret; + int fd, retry, ret, max_retry; struct url_stat st; off_t done, r; time_t now; @@ -298,9 +303,11 @@ bootstrap_pkg(void) done = 0; last = 0; + max_retry = 3; ret = -1; remote = NULL; config = NULL; + current = mirrors = NULL; printf("Bootstrapping pkg please wait\n"); @@ -324,12 +331,37 @@ bootstrap_pkg(void) return (-1); } - retry = 3; - do { - remote = fetchXGetURL(url, &st, ""); - if (remote == NULL) - sleep(1); - } while (remote == NULL && retry-- > 0); + retry = max_retry; + + u = fetchParseURL(url); + while (remote == NULL) { + if (retry == max_retry) { + if (strcmp(u->scheme, "file") != 0) { + snprintf(zone, sizeof(zone), + "_%s._tcp.%s", u->scheme, u->host); + printf("%s\n", zone); + mirrors = dns_getsrvinfo(zone); + current = mirrors; + } + } + + if (mirrors != NULL) + strlcpy(u->host, current->host, sizeof(u->host)); + + remote = fetchXGet(u, &st, ""); + if (remote == NULL) { + --retry; + if (retry <= 0) + goto fetchfail; + if (mirrors == NULL) { + sleep(1); + } else { + current = current->next; + if (current == NULL) + current = mirrors; + } + } + } if (remote == NULL) goto fetchfail; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 15 09:17:08 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F091900; Tue, 15 Jan 2013 09:17:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4051775E; Tue, 15 Jan 2013 09:17:08 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0F9H8FD060019; Tue, 15 Jan 2013 09:17:08 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0F9H8Og060018; Tue, 15 Jan 2013 09:17:08 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201301150917.r0F9H8Og060018@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 15 Jan 2013 09:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245452 - stable/8/usr.sbin/pkg X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2013 09:17:08 -0000 Author: bapt Date: Tue Jan 15 09:17:07 2013 New Revision: 245452 URL: http://svnweb.freebsd.org/changeset/base/245452 Log: MFC r244553,244594,244608,244639 In preparation for making 'pkg -N' the one true method of determining whether a system has been configured to use pkgng, cause /usr/sbin/pkg recognise a -N option and exit with a failure code when the pkg port is not installed Submitted by: matthew Modified: stable/8/usr.sbin/pkg/pkg.c Directory Properties: stable/8/usr.sbin/pkg/ (props changed) Modified: stable/8/usr.sbin/pkg/pkg.c ============================================================================== --- stable/8/usr.sbin/pkg/pkg.c Tue Jan 15 09:14:18 2013 (r245451) +++ stable/8/usr.sbin/pkg/pkg.c Tue Jan 15 09:17:07 2013 (r245452) @@ -452,6 +452,14 @@ main(__unused int argc, char *argv[]) getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); if (access(pkgpath, X_OK) == -1) { + /* + * To allow 'pkg -N' to be used as a reliable test for whether + * a system is configured to use pkg, don't bootstrap pkg + * when that argument is given as argv[1]. + */ + if (argv[1] != NULL && strcmp(argv[1], "-N") == 0) + errx(EXIT_FAILURE, "pkg is not installed"); + /* * Do not ask for confirmation if either of stdin or stdout is * not tty. Check the environment to see if user has answer From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 15 15:29:29 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B6A5D26C; Tue, 15 Jan 2013 15:29:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E582F87; Tue, 15 Jan 2013 15:29:29 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0FFTTTi074433; Tue, 15 Jan 2013 15:29:29 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0FFTT8P074432; Tue, 15 Jan 2013 15:29:29 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201301151529.r0FFTT8P074432@svn.freebsd.org> From: Kevin Lo Date: Tue, 15 Jan 2013 15:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245460 - stable/8/sys/libkern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2013 15:29:29 -0000 Author: kevlo Date: Tue Jan 15 15:29:28 2013 New Revision: 245460 URL: http://svnweb.freebsd.org/changeset/base/245460 Log: MFC r236899: Fix unloading of libiconv module. Previously it would either loop infinitely or exit with error leaking a lock. Modified: stable/8/sys/libkern/iconv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/libkern/ (props changed) Modified: stable/8/sys/libkern/iconv.c ============================================================================== --- stable/8/sys/libkern/iconv.c Tue Jan 15 14:35:35 2013 (r245459) +++ stable/8/sys/libkern/iconv.c Tue Jan 15 15:29:28 2013 (r245460) @@ -90,9 +90,11 @@ iconv_mod_unload(void) struct iconv_cspair *csp; sx_xlock(&iconv_lock); - while ((csp = TAILQ_FIRST(&iconv_cslist)) != NULL) { - if (csp->cp_refcount) + TAILQ_FOREACH(csp, &iconv_cslist, cp_link) { + if (csp->cp_refcount) { + sx_xunlock(&iconv_lock); return EBUSY; + } } while ((csp = TAILQ_FIRST(&iconv_cslist)) != NULL) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 16 00:52:37 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8895649B; Wed, 16 Jan 2013 00:52:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FE8C9CE; Wed, 16 Jan 2013 00:52:37 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G0qbxc010490; Wed, 16 Jan 2013 00:52:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G0qbSv010489; Wed, 16 Jan 2013 00:52:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301160052.r0G0qbSv010489@svn.freebsd.org> From: Xin LI Date: Wed, 16 Jan 2013 00:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245483 - stable/8/crypto/openssl/crypto/bn X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 00:52:37 -0000 Author: delphij Date: Wed Jan 16 00:52:36 2013 New Revision: 245483 URL: http://svnweb.freebsd.org/changeset/base/245483 Log: MFC r244974: MFV r244973: Integrate OpenSSL changeset 22950 (appro): bn_word.c: fix overflow bug in BN_add_word. Modified: stable/8/crypto/openssl/crypto/bn/bn_word.c Directory Properties: stable/8/crypto/openssl/ (props changed) Modified: stable/8/crypto/openssl/crypto/bn/bn_word.c ============================================================================== --- stable/8/crypto/openssl/crypto/bn/bn_word.c Wed Jan 16 00:45:05 2013 (r245482) +++ stable/8/crypto/openssl/crypto/bn/bn_word.c Wed Jan 16 00:52:36 2013 (r245483) @@ -144,26 +144,17 @@ int BN_add_word(BIGNUM *a, BN_ULONG w) a->neg=!(a->neg); return(i); } - /* Only expand (and risk failing) if it's possibly necessary */ - if (((BN_ULONG)(a->d[a->top - 1] + 1) == 0) && - (bn_wexpand(a,a->top+1) == NULL)) - return(0); - i=0; - for (;;) + for (i=0;w!=0 && itop;i++) { - if (i >= a->top) - l=w; - else - l=(a->d[i]+w)&BN_MASK2; - a->d[i]=l; - if (w > l) - w=1; - else - break; - i++; + a->d[i] = l = (a->d[i]+w)&BN_MASK2; + w = (w>l)?1:0; } - if (i >= a->top) + if (w && i==a->top) + { + if (bn_wexpand(a,a->top+1) == NULL) return 0; a->top++; + a->d[i]=w; + } bn_check_top(a); return(1); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 16 00:54:52 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 24C1E62A; Wed, 16 Jan 2013 00:54:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16F8B9EC; Wed, 16 Jan 2013 00:54:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0G0speT010816; Wed, 16 Jan 2013 00:54:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0G0spNc010815; Wed, 16 Jan 2013 00:54:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301160054.r0G0spNc010815@svn.freebsd.org> From: Xin LI Date: Wed, 16 Jan 2013 00:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245484 - stable/8/crypto/openssl/crypto X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 00:54:52 -0000 Author: delphij Date: Wed Jan 16 00:54:51 2013 New Revision: 245484 URL: http://svnweb.freebsd.org/changeset/base/245484 Log: MFC r244975: Indicate that we are using OpenSSL with some local modifications. Modified: stable/8/crypto/openssl/crypto/opensslv.h Directory Properties: stable/8/crypto/openssl/ (props changed) Modified: stable/8/crypto/openssl/crypto/opensslv.h ============================================================================== --- stable/8/crypto/openssl/crypto/opensslv.h Wed Jan 16 00:52:36 2013 (r245483) +++ stable/8/crypto/openssl/crypto/opensslv.h Wed Jan 16 00:54:51 2013 (r245484) @@ -29,7 +29,7 @@ #ifdef OPENSSL_FIPS #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8x-fips 10 May 2012" #else -#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8x 10 May 2012" +#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8x-freebsd 10 May 2012" #endif #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 17 17:05:55 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 63E8A83D; Thu, 17 Jan 2013 17:05:55 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55DF0F5C; Thu, 17 Jan 2013 17:05:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0HH5tDx020864; Thu, 17 Jan 2013 17:05:55 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0HH5tfe020863; Thu, 17 Jan 2013 17:05:55 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201301171705.r0HH5tfe020863@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 17 Jan 2013 17:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245557 - stable/8/lib/libc/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2013 17:05:55 -0000 Author: ume Date: Thu Jan 17 17:05:54 2013 New Revision: 245557 URL: http://svnweb.freebsd.org/changeset/base/245557 Log: MFC r245225, r245256: Restrict use of source address selection of getipnodebyname(1) only to IPv6 address. Modified: stable/8/lib/libc/net/name6.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/net/name6.c ============================================================================== --- stable/8/lib/libc/net/name6.c Thu Jan 17 16:43:59 2013 (r245556) +++ stable/8/lib/libc/net/name6.c Thu Jan 17 17:05:54 2013 (r245557) @@ -200,6 +200,7 @@ static struct hostent *_hpmapv6(struct #endif static struct hostent *_hpsort(struct hostent *, res_state); +#ifdef INET6 static struct hostent *_hpreorder(struct hostent *); static int get_addrselectpolicy(struct policyhead *); static void free_addrselectpolicy(struct policyhead *); @@ -209,6 +210,7 @@ static void set_source(struct hp_order static int matchlen(struct sockaddr *, struct sockaddr *); static int comp_dst(const void *, const void *); static int gai_addr2scopetype(struct sockaddr *); +#endif /* * Functions defined in RFC2553 @@ -285,8 +287,10 @@ getipnodebyname(const char *name, int af hp = gethostbyname2(name, af); hp = _hpcopy(hp, errp); - #ifdef INET6 + if (af == AF_INET6) + hp = _hpreorder(hp); + if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) && MAPADDRENABLED(flags)) { struct hostent *hp2 = gethostbyname2(name, AF_INET); @@ -309,7 +313,7 @@ getipnodebyname(const char *name, int af *errp = statp->res_h_errno; statp->options = options; - return _hpreorder(_hpsort(hp, statp)); + return _hpsort(hp, statp); } struct hostent * @@ -632,6 +636,7 @@ _hpsort(struct hostent *hp, res_state st return hp; } +#ifdef INET6 /* * _hpreorder: sort address by default address selection */ @@ -1109,3 +1114,4 @@ gai_addr2scopetype(struct sockaddr *sa) return(-1); } } +#endif From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 18 08:34:22 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 931A8D6D; Fri, 18 Jan 2013 08:34:22 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 858E4688; Fri, 18 Jan 2013 08:34:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0I8YMqZ017421; Fri, 18 Jan 2013 08:34:22 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0I8YMG6017420; Fri, 18 Jan 2013 08:34:22 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201301180834.r0I8YMG6017420@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 18 Jan 2013 08:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245592 - stable/8/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 08:34:22 -0000 Author: pluknet Date: Fri Jan 18 08:34:21 2013 New Revision: 245592 URL: http://svnweb.freebsd.org/changeset/base/245592 Log: MFC r243102: Sort SEE ALSO xrefs by the manual section number and add a missing comma. Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Jan 18 08:27:12 2013 (r245591) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Jan 18 08:34:21 2013 (r245592) @@ -1927,8 +1927,8 @@ Discarded approximately 29 seconds of tr .Ed .El .Sh SEE ALSO +.Xr zpool-features 7 , .Xr zfs 8 -.Xr zpool-features 7 .Sh AUTHORS This manual page is a .Xr mdoc 7 From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 18 17:48:11 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8B74A9DA; Fri, 18 Jan 2013 17:48:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D269C1C; Fri, 18 Jan 2013 17:48:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IHmBa3083261; Fri, 18 Jan 2013 17:48:11 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IHmBqI083260; Fri, 18 Jan 2013 17:48:11 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201301181748.r0IHmBqI083260@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 18 Jan 2013 17:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245608 - stable/8/usr.sbin/pkg X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 17:48:11 -0000 Author: bapt Date: Fri Jan 18 17:48:10 2013 New Revision: 245608 URL: http://svnweb.freebsd.org/changeset/base/245608 Log: MFC: r245412 Directly uses calloc(3) instread of malloc(3) + memset(3) Reported by: Jeremy Chadwick Modified: stable/8/usr.sbin/pkg/dns_utils.c Directory Properties: stable/8/usr.sbin/pkg/ (props changed) Modified: stable/8/usr.sbin/pkg/dns_utils.c ============================================================================== --- stable/8/usr.sbin/pkg/dns_utils.c Fri Jan 18 16:32:33 2013 (r245607) +++ stable/8/usr.sbin/pkg/dns_utils.c Fri Jan 18 17:48:10 2013 (r245608) @@ -66,10 +66,9 @@ dns_getsrvinfo(const char *zone) p += len + NS_QFIXEDSZ; } - res = malloc(sizeof(struct dns_srvinfo) * ancount); + res = calloc(ancount, sizeof(struct dns_srvinfo)); if (res == NULL) return (NULL); - memset(res, 0, sizeof(struct dns_srvinfo) * ancount); n = 0; while (ancount > 0 && p < end) {