From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:05:51 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9CF6DBF88;
Tue, 3 Sep 2019 14:05:51 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl1cSyz4NvM;
Tue, 3 Sep 2019 14:05:51 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 4365F19CA8; Tue, 3 Sep 2019 14:05:49 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 6078F1E6CE;
Fri, 29 Mar 2019 01:41:58 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 2A1686EAF5;
Fri, 29 Mar 2019 01:41:58 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 135301E6CD; Fri, 29 Mar 2019 01:41:58 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 23E611E6C7
for ;
Fri, 29 Mar 2019 01:41:55 +0000 (UTC)
(envelope-from philip@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id F32D06EAE2;
Fri, 29 Mar 2019 01:41:54 +0000 (UTC)
(envelope-from philip@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D080427C5B;
Fri, 29 Mar 2019 01:41:54 +0000 (UTC)
(envelope-from philip@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2T1fs9v041840;
Fri, 29 Mar 2019 01:41:54 GMT (envelope-from philip@FreeBSD.org)
Received: (from philip@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2T1fqh0041823;
Fri, 29 Mar 2019 01:41:52 GMT (envelope-from philip@FreeBSD.org)
Message-Id: <201903290141.x2T1fqh0041823@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: philip set sender to
philip@FreeBSD.org using -f
From: Philip Paeps
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r345671 - stable/10/contrib/tzdata
X-SVN-Group: stable-10
X-SVN-Commit-Author: philip
X-SVN-Commit-Paths: stable/10/contrib/tzdata
X-SVN-Commit-Revision: 345671
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 2A1686EAF5
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.97 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.995,0];
NEURAL_HAM_SHORT(-0.98)[-0.976,0];
ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:05:52 -0000
X-Original-Date: Fri, 29 Mar 2019 01:41:52 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:05:52 -0000
Author: philip
Date: Fri Mar 29 01:41:51 2019
New Revision: 345671
URL: https://svnweb.freebsd.org/changeset/base/345671
Log:
MFC r345524: Import tzdata 2019a
Modified:
stable/10/contrib/tzdata/Makefile
stable/10/contrib/tzdata/NEWS
stable/10/contrib/tzdata/README
stable/10/contrib/tzdata/africa
stable/10/contrib/tzdata/asia
stable/10/contrib/tzdata/backward
stable/10/contrib/tzdata/backzone
stable/10/contrib/tzdata/etcetera
stable/10/contrib/tzdata/europe
stable/10/contrib/tzdata/leap-seconds.list
stable/10/contrib/tzdata/leapseconds
stable/10/contrib/tzdata/northamerica
stable/10/contrib/tzdata/theory.html
stable/10/contrib/tzdata/version
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/tzdata/Makefile
==============================================================================
--- stable/10/contrib/tzdata/Makefile Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/Makefile Fri Mar 29 01:41:51 2019 (r345671)
@@ -12,7 +12,10 @@ VERSION= unknown
# Email address for bug reports.
BUGEMAIL= tz@iana.org
-# Choose source data features. To get new features right away, use:
+# DATAFORM selects the data format.
+# Available formats represent essentially the same data, albeit
+# possibly with minor discrepancies that users are not likely to notice.
+# To get new features and the best data right away, use:
# DATAFORM= vanguard
# To wait a while before using new features, to give downstream users
# time to upgrade zic (the default), use:
@@ -33,11 +36,11 @@ DATAFORM= main
LOCALTIME= GMT
# If you want something other than Eastern United States time as a template
-# for handling POSIX-style timezone environment variables,
+# for handling ruleless POSIX-style timezone environment variables,
# change the line below (after finding the timezone you want in the
# one of the $(TDATA) source files, or adding it to a source file).
-# When a POSIX-style environment variable is handled, the rules in the
-# template file are used to determine "spring forward" and "fall back" days and
+# A ruleless environment setting like TZ='CST6CDT' uses the rules in the
+# template file to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UT offsets of standard and
# daylight saving time.
# Alternatively, if you discover you've got the wrong timezone, you can just
@@ -46,7 +49,6 @@ LOCALTIME= GMT
# Use the command
# make zonenames
# to get a list of the values you can use for POSIXRULES.
-# If you want POSIX compatibility, use "America/New_York".
POSIXRULES= America/New_York
@@ -113,8 +115,8 @@ TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TI
TIME_T_ALTERNATIVES_HEAD = int64_t
TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
-# What kind of TZif data files to generate.
-# (TZif is the binary time zone data format that zic generates.)
+# What kind of TZif data files to generate. (TZif is the binary time
+# zone data format that zic generates; see Internet RFC 8536.)
# If you want only POSIX time, with time values interpreted as
# seconds since the epoch (not counting leap seconds), use
# REDO= posix_only
@@ -360,6 +362,9 @@ LEAPSECONDS=
zic= ./zic
ZIC= $(zic) $(ZFLAGS)
+# To shrink the size of installed TZif files,
+# append "-r @N" to omit data before N-seconds-after-the-Epoch.
+# See the zic man page for more about -r.
ZFLAGS=
# How to use zic to install TZif files.
@@ -491,7 +496,8 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t
COMMON= calendars CONTRIBUTING LICENSE Makefile \
NEWS README theory.html version
WEB_PAGES= tz-art.html tz-how-to.html tz-link.html
-CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html
+CHECK_WEB_PAGES=check_theory.html check_tz-art.html \
+ check_tz-how-to.html check_tz-link.html
DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
@@ -804,9 +810,10 @@ check_tzs: $(TZS) $(TZS_NEW)
touch $@
check_web: $(CHECK_WEB_PAGES)
+check_theory.html: theory.html
check_tz-art.html: tz-art.html
check_tz-link.html: tz-link.html
-check_tz-art.html check_tz-link.html:
+check_theory.html check_tz-art.html check_tz-link.html:
$(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \
-F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \
test ! -s $@.out || { cat $@.out; exit 1; }
@@ -840,11 +847,13 @@ check_zishrink_posix check_zishrink_right: \
touch $@
clean_misc:
+ rm -fr check_*.dir
rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
check_* core typecheck_* \
date tzselect version.h zdump zic yearistype libtz.a
clean: clean_misc
- rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)
+ rm -fr *.dir tzdb-*/
+ rm -f *.zi $(TZS_NEW)
maintainer-clean: clean
@echo 'This command is intended for maintainers to use; it'
Modified: stable/10/contrib/tzdata/NEWS
==============================================================================
--- stable/10/contrib/tzdata/NEWS Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/NEWS Fri Mar 29 01:41:51 2019 (r345671)
@@ -1,5 +1,53 @@
News for the tz database
+Release 20198 - 2019-03-25 22:01:33 -0700
+
+ Briefly:
+ Palestine "springs forward" on 2019-03-30 instead of 2019-03-23.
+ Metlakatla "fell back" to rejoin Alaska Time on 2019-01-20 at 02:00.
+
+ Changes to past and future timestamps
+
+ Palestine will not start DST until 2019-03-30, instead of 2019-03-23 as
+ previously predicted. Adjust our prediction by guessing that spring
+ transitions will be between 24 and 30 March, which matches recent practice
+ since 2016. (Thanks to Even Scharning and Tim Parenti.)
+
+ Metlakatla ended its observance of Pacific standard time,
+ rejoining Alaska Time, on 2019-01-20 at 02:00. (Thanks to Ryan
+ Stanley and Tim Parenti.)
+
+ Changes to past timestamps
+
+ Israel observed DST in 1980 (08-02/09-13) and 1984 (05-05/08-25).
+ (Thanks to Alois Treindl and Isaac Starkman.)
+
+ Changes to time zone abbreviations
+
+ Etc/UCT is now a backward-compatibility link to Etc/UTC, instead
+ of being a separate zone that generates the abbreviation "UCT",
+ which nowadays is typically a typo. (Problem reported by Isiah
+ Meadows.)
+
+ Changes to code
+
+ zic now has an -r option to limit the time range of output data.
+ For example, 'zic -r @1000000000' limits the output data to
+ timestamps starting 1000000000 seconds after the Epoch.
+ This helps shrink output size and can be useful for applications
+ not needing the full timestamp history, such as TZDIST truncation;
+ see Internet RFC 8536 section 5.1. (Inspired by a feature request
+ from Christopher Wong, helped along by bug reports from Wong and
+ from Tim Parenti.)
+
+ Changes to documentation
+
+ Mention Internet RFC 8536 (February 2019), which documents TZif.
+
+ tz-link.html now cites tzdata-meta
+ .
+
+
Release 2018i - 2018-12-30 11:05:43 -0800
Briefly:
@@ -400,8 +448,9 @@ Release 2018d - 2018-03-22 07:05:46 -0700
downstream parsers do not support it.
* The build procedure constructs three files vanguard.zi, main.zi,
- and rearguard.zi, one for each format. The files represent the
- same data as closely as the formats allow. These three files
+ and rearguard.zi, one for each format. Although the files
+ represent essentially the same data, they may have minor
+ discrepancies that users are not likely to notice. The files
are intended for downstream data consumers and are not
installed. Zoneinfo parsers that do not support negative SAVE values
should start using rearguard.zi, so that they will be unaffected
Modified: stable/10/contrib/tzdata/README
==============================================================================
--- stable/10/contrib/tzdata/README Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/README Fri Mar 29 01:41:51 2019 (r345671)
@@ -1,7 +1,7 @@
README for the tz distribution
-"What time is it?" -- Richard Deacon as The King
-"Any time you want it to be." -- Frank Baxter as The Scientist
+"Where do I set the hands of the clock?" -- Les Tremayne as The King
+"Oh that--you can set them any place you want." -- Frank Baxter as The Scientist
(from the Bell System film "About Time")
The Time Zone Database (called tz, tzdb or zoneinfo) contains code and
Modified: stable/10/contrib/tzdata/africa
==============================================================================
--- stable/10/contrib/tzdata/africa Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/africa Fri Mar 29 01:41:51 2019 (r345671)
@@ -364,6 +364,11 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
# See Africa/Lagos.
# Eritrea
+# See Africa/Nairobi.
+
+# Eswatini (formerly Swaziland)
+# See Africa/Johannesburg.
+
# Ethiopia
# See Africa/Nairobi.
#
@@ -1188,7 +1193,7 @@ Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8
1:30 - SAST 1903 Mar
2:00 SA SAST
Link Africa/Johannesburg Africa/Maseru # Lesotho
-Link Africa/Johannesburg Africa/Mbabane # Swaziland
+Link Africa/Johannesburg Africa/Mbabane # Eswatini
#
# Marion and Prince Edward Is
# scientific station since 1947
@@ -1229,9 +1234,6 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931
Zone Africa/Juba 2:06:28 - LMT 1931
2:00 Sudan CA%sT 2000 Jan 15 12:00
3:00 - EAT
-
-# Swaziland
-# See Africa/Johannesburg.
# Tanzania
# See Africa/Nairobi.
Modified: stable/10/contrib/tzdata/asia
==============================================================================
--- stable/10/contrib/tzdata/asia Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/asia Fri Mar 29 01:41:51 2019 (r345671)
@@ -1620,6 +1620,24 @@ Rule Zion 1974 only - Jul 7 0:00 1:00 D
Rule Zion 1974 only - Oct 13 0:00 0 S
Rule Zion 1975 only - Apr 20 0:00 1:00 D
Rule Zion 1975 only - Aug 31 0:00 0 S
+
+# From Alois Treindl (2019-03-06):
+# http://www.moin.gov.il/Documents/שעון קיץ/clock-50-years-7-2014.pdf
+# From Isaac Starkman (2019-03-06):
+# Summer time was in that period in 1980 and 1984, see
+# https://www.ynet.co.il/articles/0,7340,L-3951073,00.html
+# You can of course read it in translation.
+# I checked the local newspapers for that years.
+# It started on midnight and end at 01.00 am.
+# From Paul Eggert (2019-03-06):
+# Also see this thread about the moin.gov.il URL:
+# https://mm.icann.org/pipermail/tz/2018-November/027194.html
+Rule Zion 1980 only - Aug 2 0:00 1:00 D
+Rule Zion 1980 only - Sep 13 1:00 0 S
+Rule Zion 1984 only - May 5 0:00 1:00 D
+Rule Zion 1984 only - Aug 25 1:00 0 S
+
+# From Shanks & Pottenger:
Rule Zion 1985 only - Apr 14 0:00 1:00 D
Rule Zion 1985 only - Sep 15 0:00 0 S
Rule Zion 1986 only - May 18 0:00 1:00 D
@@ -3071,9 +3089,15 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# the official website, though the decree did not specify the exact
# time of the time shift.
# http://www.palestinecabinet.gov.ps/Website/AR/NDecrees/ViewFile.ashx?ID=e7a42ab7-ee23-435a-b9c8-a4f7e81f3817
+
+# From Even Scharning (2019-03-23):
+# DST in Palestine will start on 30 March this year, not 23 March as the time
+# zone database predicted.
+# https://ramallah.news/post/123610
#
-# From Paul Eggert (2018-03-16):
-# For 2016 on, predict spring transitions on March's fourth Saturday at 01:00.
+# From Tim Parenti (2019-03-23):
+# Combining this with the rules observed since 2016, adjust our spring
+# transition guess to Mar Sat>=24.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
@@ -3104,7 +3128,7 @@ Rule Palestine 2012 only - Sep 21 1:00 0 -
Rule Palestine 2013 only - Sep Fri>=21 0:00 0 -
Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 -
Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S
-Rule Palestine 2016 max - Mar Sat>=22 1:00 1:00 S
+Rule Palestine 2016 max - Mar Sat>=24 1:00 1:00 S
Rule Palestine 2016 max - Oct lastSat 1:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -3595,6 +3619,18 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
7:00 - +07 1959 Dec 31 23:00
8:00 - +08 1975 Jun 13
7:00 - +07
+
+# From Paul Eggert (2019-02-19):
+#
+# The Ho Chi Minh entry suffices for most purposes as it agrees with all of
+# Vietnam since 1975-06-13. Presumably clocks often changed in south Vietnam
+# in the early 1970s as locations changed hands during the war; however the
+# details are unknown and would likely be too voluminous for this database.
+#
+# For timestamps in north Vietnam back to 1970 (the tzdb cutoff),
+# use Asia/Bangkok; see the VN entries in the file zone1970.tab.
+# For timestamps before 1970, see Asia/Hanoi in the file 'backzone'.
+
# Yemen
# See Asia/Riyadh.
Modified: stable/10/contrib/tzdata/backward
==============================================================================
--- stable/10/contrib/tzdata/backward Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/backward Fri Mar 29 01:41:51 2019 (r345671)
@@ -77,6 +77,7 @@ Link Pacific/Easter Chile/EasterIsland
Link America/Havana Cuba
Link Africa/Cairo Egypt
Link Europe/Dublin Eire
+Link Etc/UTC Etc/UCT
Link Europe/London Europe/Belfast
Link Europe/Chisinau Europe/Tiraspol
Link Europe/London GB
@@ -111,7 +112,7 @@ Link Asia/Taipei ROC
Link Asia/Seoul ROK
Link Asia/Singapore Singapore
Link Europe/Istanbul Turkey
-Link Etc/UCT UCT
+Link Etc/UTC UCT
Link America/Anchorage US/Alaska
Link America/Adak US/Aleutian
Link America/Phoenix US/Arizona
Modified: stable/10/contrib/tzdata/backzone
==============================================================================
--- stable/10/contrib/tzdata/backzone Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/backzone Fri Mar 29 01:41:51 2019 (r345671)
@@ -204,7 +204,7 @@ Zone Africa/Maseru 1:50:00 - LMT 1903 Mar
2:00 1:00 SAST 1944 Mar 19 2:00
2:00 - SAST
-# Swaziland
+# Eswatini (formerly Swaziland)
Zone Africa/Mbabane 2:04:24 - LMT 1903 Mar
2:00 - SAST
@@ -625,7 +625,7 @@ Zone Europe/Sarajevo 1:13:40 - LMT 1884
1:00 - CET 1982 Nov 27
1:00 EU CE%sT
-# Macedonia
+# North Macedonia
Zone Europe/Skopje 1:25:44 - LMT 1884
1:00 - CET 1941 Apr 18 23:00
1:00 C-Eur CE%sT 1945 May 8 2:00s
Modified: stable/10/contrib/tzdata/etcetera
==============================================================================
--- stable/10/contrib/tzdata/etcetera Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/etcetera Fri Mar 29 01:41:51 2019 (r345671)
@@ -19,7 +19,6 @@
Zone Etc/GMT 0 - GMT
Zone Etc/UTC 0 - UTC
-Zone Etc/UCT 0 - UCT
# The following link uses older naming conventions,
# but it belongs here, not in the file 'backward',
Modified: stable/10/contrib/tzdata/europe
==============================================================================
--- stable/10/contrib/tzdata/europe Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/europe Fri Mar 29 01:41:51 2019 (r345671)
@@ -1855,7 +1855,7 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
1:00 Belgium CE%sT 1977
1:00 EU CE%sT
-# Macedonia
+# North Macedonia
# See Europe/Belgrade.
# Malta
@@ -3359,7 +3359,7 @@ Zone Europe/Belgrade 1:22:00 - LMT 1884
Link Europe/Belgrade Europe/Ljubljana # Slovenia
Link Europe/Belgrade Europe/Podgorica # Montenegro
Link Europe/Belgrade Europe/Sarajevo # Bosnia and Herzegovina
-Link Europe/Belgrade Europe/Skopje # Macedonia
+Link Europe/Belgrade Europe/Skopje # North Macedonia
Link Europe/Belgrade Europe/Zagreb # Croatia
# Slovakia
Modified: stable/10/contrib/tzdata/leap-seconds.list
==============================================================================
--- stable/10/contrib/tzdata/leap-seconds.list Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/leap-seconds.list Fri Mar 29 01:41:51 2019 (r345671)
@@ -204,10 +204,10 @@
# current -- the update time stamp, the data and the name of the file
# will not change.
#
-# Updated through IERS Bulletin C56
-# File expires on: 28 June 2019
+# Updated through IERS Bulletin C57
+# File expires on: 28 December 2019
#
-#@ 3770668800
+#@ 3786480000
#
2272060800 10 # 1 Jan 1972
2287785600 11 # 1 Jul 1972
@@ -252,4 +252,4 @@
# the hash line is also ignored in the
# computation.
#
-#h 62ca19f6 96a4ae0a 3708451c 9f8693f4 016604eb
+#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a
Modified: stable/10/contrib/tzdata/leapseconds
==============================================================================
--- stable/10/contrib/tzdata/leapseconds Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/leapseconds Fri Mar 29 01:41:51 2019 (r345671)
@@ -63,7 +63,7 @@ Leap 2016 Dec 31 23:59:60 + S
# POSIX timestamps for the data in this file:
#updated 1467936000
-#expires 1561680000
+#expires 1577491200
-# Updated through IERS Bulletin C56
-# File expires on: 28 June 2019
+# Updated through IERS Bulletin C57
+# File expires on: 28 December 2019
Modified: stable/10/contrib/tzdata/northamerica
==============================================================================
--- stable/10/contrib/tzdata/northamerica Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/northamerica Fri Mar 29 01:41:51 2019 (r345671)
@@ -609,6 +609,15 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12
# In a 2018-12-11 special election, Metlakatla voted to go back to
# Alaska time (including daylight saving time) starting next year.
# https://www.krbd.org/2018/12/12/metlakatla-to-follow-alaska-standard-time-allow-liquor-sales/
+#
+# From Ryan Stanley (2019-01-11):
+# The community will be changing back on the 20th of this month...
+# From Tim Parenti (2019-01-11):
+# Per an announcement on the Metlakatla community's official Facebook page, the
+# "fall back" will be on Sunday 2019-01-20 at 02:00:
+# https://www.facebook.com/141055983004923/photos/607150969728753/
+# So they won't be waiting for Alaska to join them on 2019-03-10, but will
+# rather change their clocks twice in seven weeks.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Juneau 15:02:19 - LMT 1867 Oct 19 15:33:32
@@ -637,7 +646,7 @@ Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 19 15
-8:00 US P%sT 1983 Oct 30 2:00
-8:00 - PST 2015 Nov 1 2:00
-9:00 US AK%sT 2018 Nov 4 2:00
- -8:00 - PST 2019 Mar Sun>=8 3:00
+ -8:00 - PST 2019 Jan 20 2:00
-9:00 US AK%sT
Zone America/Yakutat 14:41:05 - LMT 1867 Oct 19 15:12:18
-9:18:55 - LMT 1900 Aug 20 12:00
Modified: stable/10/contrib/tzdata/theory.html
==============================================================================
--- stable/10/contrib/tzdata/theory.html Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/theory.html Fri Mar 29 01:41:51 2019 (r345671)
@@ -15,7 +15,7 @@
- Scope of the
tz
database
- - Names of timezones
+ - Timezone identifiers
- Time zone abbreviations
- Accuracy of the
tz
database
@@ -107,9 +107,9 @@ It does not always make sense to talk about a timezone
- Names of timezones
+ Timezone identifiers
-Each timezone has a unique name.
+Each timezone has a name that uniquely identifies the timezone.
Inexperienced users are not expected to select these names unaided.
Distributors should provide documentation and/or a simple selection
interface that explains each name via a map or via descriptive text like
@@ -142,10 +142,12 @@ among the following goals:
-
Be robust in the presence of political changes.
- For example, names of countries are ordinarily not used, to avoid
+ For example, names are typically not tied to countries, to avoid
incompatibilities when countries change their name (e.g.,
- Zaire→Congo) or when locations change countries (e.g., Hong
+ Swaziland→Eswatini) or when locations change countries (e.g., Hong
Kong from UK colony to China).
+ There is no requirement that every country or national
+ capital must have a timezone name.
-
Be portable to a wide variety of implementations.
@@ -215,19 +217,18 @@ in decreasing order of importance:
do not need locations, since local time is not defined there.
-
- There should typically be at least one name for each ISO
- 3166-1 officially assigned two-letter code for an inhabited
- country or territory.
-
- -
If all the clocks in a timezone have agreed since 1970,
do not bother to include more than one timezone
even if some of the clocks disagreed before 1970.
Otherwise these tables would become annoyingly large.
-
+ If boundaries between regions are fluid, such as during a war or
+ insurrection, do not bother to create a new timezone merely
+ because of yet another boundary change. This helps prevent table
+ bloat and simplifies maintenance.
+
+ -
If a name is ambiguous, use a less ambiguous alternative;
e.g., many cities are named San José and Georgetown, so
prefer
America/Costa_Rica
to
@@ -299,29 +300,23 @@ in decreasing order of importance:
-The file 'zone1970.tab
' lists geographical locations used
-to name timezones.
-It is intended to be an exhaustive list of names for geographic
-regions as described above; this is a subset of the timezones in the data.
-Although a 'zone1970.tab
' location's
-longitude
-corresponds to
-its local mean
-time (LMT) offset with one hour for every 15°
-east longitude, this relationship is not exact.
+Guidelines have evolved with time, and names following old versions of
+this guideline might not follow the current version. When guidelines
+have changed, old names continue to be supported. Guideline changes
+have included the following:
-
-Older versions of this package used a different naming scheme,
-and these older names are still supported.
+
+-
+Older versions of this package used a different naming scheme.
See the file '
backward
' for most of these older names
(e.g., 'US/Eastern
' instead of 'America/New_York
').
The other old-fashioned names still supported are
'WET
', 'CET
', 'MET
', and
'EET
' (see the file 'europe
').
-
+
-
+
Older versions of this package defined legacy names that are
incompatible with the first guideline of location names, but which are
still supported.
@@ -332,6 +327,31 @@ Also, the file 'backward
' defines the leg
and the file 'northamerica
' defines the legacy names
'EST5EDT
', 'CST6CDT
',
'MST7MDT
', and 'PST8PDT
'.
+
+
+
+Older versions of this guideline said that
+there should typically be at least one name for each ISO
+3166-1 officially assigned two-letter code for an inhabited
+country or territory.
+This old guideline has been dropped, as it was not needed to handle
+timestamps correctly and it increased maintenance burden.
+
+
+
+
+The file 'zone1970.tab
' lists geographical locations used
+to name timezones.
+It is intended to be an exhaustive list of names for geographic
+regions as described above; this is a subset of the timezones in the data.
+Although a 'zone1970.tab
' location's
+longitude
+corresponds to
+its local mean
+time (LMT) offset with one hour for every 15°
+east longitude, this relationship is not exact.
@@ -983,7 +1003,9 @@ an older zic
.
constrained to be a string containing abbreviations
and numeric data as described above.
The file's format is TZif,
- a timezone information format that contains binary data.
+ a timezone information format that contains binary data; see
+ Internet
+ RFC 8536.
The daylight saving time rules to be used for a
particular timezone are encoded in the
TZif file; the format of the file allows US,
@@ -1166,7 +1188,7 @@ The tz
code and data supply
-
A set of timezone names as per
- "Names of timezones" above.
+ "Timezone identifiers" above.
-
Library functions described in "Time and date
@@ -1212,6 +1234,17 @@ Interfaces not listed above are less stable.
For example, users should not rely on particular UT
offsets or abbreviations for timestamps, as data entries are often
based on guesswork and these guesses may be corrected or improved.
+
+
+
+Timezone boundaries are not part of the stable interface.
+For example, even though the Asia/Bangkok timezone
+currently includes Chang Mai, Hanoi, and Phnom Penh, this is not part
+of the stable interface and the timezone can split at any time.
+If a calendar application records a future event in some location other
+than Bangkok by putting "Asia/Bangkok" in the event's record,
+the application should be robust in the presence of timezone splits
+between now and the future time.
Modified: stable/10/contrib/tzdata/version
==============================================================================
--- stable/10/contrib/tzdata/version Fri Mar 29 01:40:44 2019 (r345670)
+++ stable/10/contrib/tzdata/version Fri Mar 29 01:41:51 2019 (r345671)
@@ -1 +1 @@
-2018i
+2019a
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:06:01 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BD08DC1CA;
Tue, 3 Sep 2019 14:06:01 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yw1z9Hz4P5M;
Tue, 3 Sep 2019 14:06:00 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 051B019F6B; Tue, 3 Sep 2019 14:05:54 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 9B835786B;
Mon, 1 Apr 2019 07:54:29 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id C9CA78A654;
Mon, 1 Apr 2019 07:54:28 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id A88BF77F5; Mon, 1 Apr 2019 07:54:28 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 9C3D977F3
for ;
Mon, 1 Apr 2019 07:54:28 +0000 (UTC)
(envelope-from avos@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 555088A650;
Mon, 1 Apr 2019 07:54:28 +0000 (UTC)
(envelope-from avos@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B5FEB659;
Mon, 1 Apr 2019 07:54:28 +0000 (UTC)
(envelope-from avos@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x317sSmj041386;
Mon, 1 Apr 2019 07:54:28 GMT (envelope-from avos@FreeBSD.org)
Received: (from avos@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x317sSnL041385;
Mon, 1 Apr 2019 07:54:28 GMT (envelope-from avos@FreeBSD.org)
Message-Id: <201904010754.x317sSnL041385@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avos set sender to
avos@FreeBSD.org using -f
From: Andriy Voskoboinyk
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r345761 - in stable: 10/sys/net80211 11/sys/net80211
12/sys/net80211
X-SVN-Group: stable-10
X-SVN-Commit-Author: avos
X-SVN-Commit-Paths: in stable: 10/sys/net80211 11/sys/net80211 12/sys/net80211
X-SVN-Commit-Revision: 345761
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: C9CA78A654
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.96 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.998,0];
NEURAL_HAM_SHORT(-0.96)[-0.965,0];
ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:06:01 -0000
X-Original-Date: Mon, 1 Apr 2019 07:54:28 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:06:01 -0000
Author: avos
Date: Mon Apr 1 07:54:27 2019
New Revision: 345761
URL: https://svnweb.freebsd.org/changeset/base/345761
Log:
MFC r345252:
net80211: correct check for SMPS node flags updates
Update node flags when driver supports SMPS, not when it is disabled or
in dynamic mode ((iv_htcaps & HTCAP_SMPS) != 0).
Was checked with RTL8188EE (1T1R), STA mode - 'smps' word should disappear
from 'ifconfig wlan0' output.
Modified:
stable/10/sys/net80211/ieee80211_ht.c
Directory Properties:
stable/10/ (props changed)
Changes in other areas also in this revision:
Modified:
stable/11/sys/net80211/ieee80211_ht.c
stable/12/sys/net80211/ieee80211_ht.c
Directory Properties:
stable/11/ (props changed)
stable/12/ (props changed)
Modified: stable/10/sys/net80211/ieee80211_ht.c
==============================================================================
--- stable/10/sys/net80211/ieee80211_ht.c Mon Apr 1 07:46:41 2019 (r345760)
+++ stable/10/sys/net80211/ieee80211_ht.c Mon Apr 1 07:54:27 2019 (r345761)
@@ -1542,7 +1542,7 @@ ieee80211_ht_updateparams(struct ieee80211_node *ni,
int ret = 0;
ieee80211_parse_htcap(ni, htcapie);
- if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
+ if (vap->iv_htcaps & IEEE80211_HTC_SMPS)
htcap_update_mimo_ps(ni);
htcap_update_shortgi(ni);
@@ -1584,7 +1584,7 @@ ieee80211_ht_updatehtcap(struct ieee80211_node *ni, co
int htflags;
ieee80211_parse_htcap(ni, htcapie);
- if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
+ if (vap->iv_htcaps & IEEE80211_HTC_SMPS)
htcap_update_mimo_ps(ni);
htcap_update_shortgi(ni);
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:06:07 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6667DDC39B;
Tue, 3 Sep 2019 14:06:07 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z309mKz4PCm;
Tue, 3 Sep 2019 14:06:07 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 589D11A159; Tue, 3 Sep 2019 14:05:58 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 7E1D513792;
Wed, 3 Apr 2019 06:37:29 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 2BB4F953BF;
Wed, 3 Apr 2019 06:37:29 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 194E613790; Wed, 3 Apr 2019 06:37:29 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id A943C13788
for ;
Wed, 3 Apr 2019 06:37:26 +0000 (UTC)
(envelope-from rpokala@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 76A9A953B2;
Wed, 3 Apr 2019 06:37:26 +0000 (UTC)
(envelope-from rpokala@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24EFFA01E;
Wed, 3 Apr 2019 06:37:26 +0000 (UTC)
(envelope-from rpokala@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x336bQoo022502;
Wed, 3 Apr 2019 06:37:26 GMT (envelope-from rpokala@FreeBSD.org)
Received: (from rpokala@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x336bQKN022501;
Wed, 3 Apr 2019 06:37:26 GMT (envelope-from rpokala@FreeBSD.org)
Message-Id: <201904030637.x336bQKN022501@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rpokala set sender to
rpokala@FreeBSD.org using -f
From: Ravi Pokala
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r345838 - stable/10/sys/dev/jedec_dimm
X-SVN-Group: stable-10
X-SVN-Commit-Author: rpokala
X-SVN-Commit-Paths: stable/10/sys/dev/jedec_dimm
X-SVN-Commit-Revision: 345838
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 2BB4F953BF
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.97 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.97)[-0.969,0];
ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:06:07 -0000
X-Original-Date: Wed, 3 Apr 2019 06:37:26 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:06:07 -0000
Author: rpokala
Date: Wed Apr 3 06:37:25 2019
New Revision: 345838
URL: https://svnweb.freebsd.org/changeset/base/345838
Log:
MFC r345611:
Teach jedec_dimm(4) to be more forgiving of non-fatal errors.
It looks like some DIMMs claim to have a TSOD, but actually don't. Some
claim they weren't able to change the SPD page, but they did. Neither of
those should be fatal errors.
Modified:
stable/10/sys/dev/jedec_dimm/jedec_dimm.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/jedec_dimm/jedec_dimm.c
==============================================================================
--- stable/10/sys/dev/jedec_dimm/jedec_dimm.c Wed Apr 3 06:37:03 2019 (r345837)
+++ stable/10/sys/dev/jedec_dimm/jedec_dimm.c Wed Apr 3 06:37:25 2019 (r345838)
@@ -271,12 +271,16 @@ jedec_dimm_attach(device_t dev)
}
/* The MSBit of the TSOD-presence byte reports whether or not the TSOD
- * is in fact present. If it is, read manufacturer and device info from
- * it to confirm that it's a valid TSOD device. It's an error if any of
- * those bytes are unreadable; it's not an error if the device is simply
- * not known to us (tsod_match == NULL).
- * While DDR3 and DDR4 don't explicitly require a TSOD, essentially all
- * DDR3 and DDR4 DIMMs include one.
+ * is in fact present. (While DDR3 and DDR4 don't explicitly require a
+ * TSOD, essentially all DDR3 and DDR4 DIMMs include one.) But, as
+ * discussed in [PR 235944], it turns out that some DIMMs claim to have
+ * a TSOD when they actually don't. (Or maybe the firmware blocks it?)
+ *
+ * If the SPD data says the TSOD is present, try to read manufacturer
+ * and device info from it to confirm that it's a valid TSOD device.
+ * If the data is unreadable, just continue as if the TSOD isn't there.
+ * If the data was read successfully, see if it is a known TSOD device;
+ * it's okay if it isn't (tsod_match == NULL).
*/
rc = smbus_readb(sc->smbus, sc->spd_addr, tsod_present_offset, &byte);
if (rc != 0) {
@@ -290,12 +294,14 @@ jedec_dimm_attach(device_t dev)
if (rc != 0) {
device_printf(dev,
"failed to read TSOD Manufacturer ID\n");
- goto out;
+ rc = 0;
+ goto no_tsod;
}
rc = jedec_dimm_readw_be(sc, TSOD_REG_DEV_REV, &devid);
if (rc != 0) {
device_printf(dev, "failed to read TSOD Device ID\n");
- goto out;
+ rc = 0;
+ goto no_tsod;
}
tsod_match = jedec_dimm_tsod_match(vendorid, devid);
@@ -310,6 +316,7 @@ jedec_dimm_attach(device_t dev)
}
}
} else {
+no_tsod:
tsod_match = NULL;
tsod_present = false;
}
@@ -622,9 +629,12 @@ jedec_dimm_dump(struct jedec_dimm_softc *sc, enum dram
rc = smbus_writeb(sc->smbus,
(JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), 0, 0);
if (rc != 0) {
+ /* Some SPD devices (or SMBus controllers?) claim the
+ * page-change command failed when it actually
+ * succeeded. Log a message but soldier on.
+ */
device_printf(sc->dev, "unable to change page: %d\n",
rc);
- goto out;
}
/* Add 256 to the store location, because we're in the second
* page.
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:06:09 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90356DC462;
Tue, 3 Sep 2019 14:06:09 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z46Wyhz4PFV;
Tue, 3 Sep 2019 14:06:08 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 82A671A1F1; Tue, 3 Sep 2019 14:05:59 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 1FA809150;
Thu, 4 Apr 2019 02:08:41 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 3B4D1775A0;
Thu, 4 Apr 2019 02:08:40 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 0C4A7911B; Thu, 4 Apr 2019 02:08:40 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id AAD57910D
for ;
Thu, 4 Apr 2019 02:08:37 +0000 (UTC)
(envelope-from markj@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 7720877590;
Thu, 4 Apr 2019 02:08:37 +0000 (UTC)
(envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53A0C1EB1C;
Thu, 4 Apr 2019 02:08:37 +0000 (UTC)
(envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3428b7r045600;
Thu, 4 Apr 2019 02:08:37 GMT (envelope-from markj@FreeBSD.org)
Received: (from markj@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3428bTk045599;
Thu, 4 Apr 2019 02:08:37 GMT (envelope-from markj@FreeBSD.org)
Message-Id: <201904040208.x3428bTk045599@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markj set sender to
markj@FreeBSD.org using -f
From: Mark Johnston
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r345869 - in stable/10/sys/cddl/dev/dtrace: amd64 i386
X-SVN-Group: stable-10
X-SVN-Commit-Author: markj
X-SVN-Commit-Paths: in stable/10/sys/cddl/dev/dtrace: amd64 i386
X-SVN-Commit-Revision: 345869
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 3B4D1775A0
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.98 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.98)[-0.983,0];
ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:06:09 -0000
X-Original-Date: Thu, 4 Apr 2019 02:08:37 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:06:09 -0000
Author: markj
Date: Thu Apr 4 02:08:36 2019
New Revision: 345869
URL: https://svnweb.freebsd.org/changeset/base/345869
Log:
MFC r345359, r345384:
Don't attempt to measure TSC skew when running as a VM guest.
PR: 218452
Modified:
stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
stable/10/sys/cddl/dev/dtrace/i386/dtrace_subr.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==============================================================================
--- stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Apr 4 02:07:24 2019 (r345868)
+++ stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Apr 4 02:08:36 2019 (r345869)
@@ -405,6 +405,9 @@ dtrace_gethrtime_init(void *arg)
*/
nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f;
+ if (vm_guest != VM_GUEST_NO)
+ return;
+
/* The current CPU is the reference one. */
sched_pin();
tsc_skew[curcpu] = 0;
Modified: stable/10/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==============================================================================
--- stable/10/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Apr 4 02:07:24 2019 (r345868)
+++ stable/10/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Apr 4 02:08:36 2019 (r345869)
@@ -414,6 +414,9 @@ dtrace_gethrtime_init(void *arg)
*/
nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f;
+ if (vm_guest != VM_GUEST_NO)
+ return;
+
/* The current CPU is the reference one. */
sched_pin();
tsc_skew[curcpu] = 0;
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:06:16 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60410DC655;
Tue, 3 Sep 2019 14:06:16 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N7zC4Rw5z4PMJ;
Tue, 3 Sep 2019 14:06:15 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 374A71A3AE; Tue, 3 Sep 2019 14:06:03 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 7F56D98CE;
Fri, 5 Apr 2019 11:36:02 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 30B418D096;
Fri, 5 Apr 2019 11:36:02 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 0FF4F98AD; Fri, 5 Apr 2019 11:36:02 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 4AF8F98A3
for ;
Fri, 5 Apr 2019 11:35:59 +0000 (UTC)
(envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 045CE8D086;
Fri, 5 Apr 2019 11:35:59 +0000 (UTC)
(envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8685C8DE;
Fri, 5 Apr 2019 11:35:58 +0000 (UTC)
(envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x35BZw3w013761;
Fri, 5 Apr 2019 11:35:58 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BZwtJ013760;
Fri, 5 Apr 2019 11:35:58 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201904051135.x35BZwtJ013760@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
hselasky@FreeBSD.org using -f
From: Hans Petter Selasky
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r345943 - stable/10/sys/sys
X-SVN-Group: stable-10
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: stable/10/sys/sys
X-SVN-Commit-Revision: 345943
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 30B418D096
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.94 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.94)[-0.945,0];
ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:06:16 -0000
X-Original-Date: Fri, 5 Apr 2019 11:35:58 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:06:16 -0000
Author: hselasky
Date: Fri Apr 5 11:35:58 2019
New Revision: 345943
URL: https://svnweb.freebsd.org/changeset/base/345943
Log:
MFC r345499:
Change all kernel C-type macros into static inline functions.
The current kernel C-type macros might obscurely hide the fact that
the input argument might be used multiple times.
This breaks code like:
isalpha(*ptr++)
Use static inline functions instead of macros to fix this.
Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D19694
Sponsored by: Mellanox Technologies
Modified:
stable/10/sys/sys/ctype.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/sys/ctype.h
==============================================================================
--- stable/10/sys/sys/ctype.h Fri Apr 5 11:35:02 2019 (r345942)
+++ stable/10/sys/sys/ctype.h Fri Apr 5 11:35:58 2019 (r345943)
@@ -39,19 +39,65 @@
#ifdef _KERNEL
-#define isspace(c) ((c) == ' ' || ((c) >= '\t' && (c) <= '\r'))
-#define isascii(c) (((c) & ~0x7f) == 0)
-#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
-#define islower(c) ((c) >= 'a' && (c) <= 'z')
-#define isalpha(c) (isupper(c) || islower(c))
-#define isdigit(c) ((c) >= '0' && (c) <= '9')
-#define isxdigit(c) (isdigit(c) \
- || ((c) >= 'A' && (c) <= 'F') \
- || ((c) >= 'a' && (c) <= 'f'))
-#define isprint(c) ((c) >= ' ' && (c) <= '~')
+static __inline int
+isspace(int c)
+{
+ return (c == ' ' || (c >= '\t' && c <= '\r'));
+}
-#define toupper(c) ((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z')))
-#define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z')))
+static __inline int
+isascii(int c)
+{
+ return ((c & ~0x7f) == 0);
+}
+
+static __inline int
+isupper(int c)
+{
+ return (c >= 'A' && c <= 'Z');
+}
+
+static __inline int
+islower(int c)
+{
+ return (c >= 'a' && c <= 'z');
+}
+
+static __inline int
+isalpha(int c)
+{
+ return (isupper(c) || islower(c));
+}
+
+static __inline int
+isdigit(int c)
+{
+ return (c >= '0' && c <= '9');
+}
+
+static __inline int
+isxdigit(int c)
+{
+ return (isdigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'));
+}
+
+static __inline int
+isprint(int c)
+{
+ return (c >= ' ' && c <= '~');
+}
+
+static __inline int
+toupper(int c)
+{
+ return (c - 0x20 * ((c >= 'a') && (c <= 'z')));
+}
+
+static __inline int
+tolower(int c)
+{
+ return (c + 0x20 * ((c >= 'A') && (c <= 'Z')));
+}
#endif
#endif /* !_SYS_CTYPE_H_ */
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:06:39 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5A18DCD50;
Tue, 3 Sep 2019 14:06:39 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N7zg2rVFz4Pmd;
Tue, 3 Sep 2019 14:06:39 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id BF35B1A9AB; Tue, 3 Sep 2019 14:06:13 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 8906018042;
Wed, 10 Apr 2019 21:46:36 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 37D3E8D3DE;
Wed, 10 Apr 2019 21:46:36 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 1681418041; Wed, 10 Apr 2019 21:46:36 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id AEA3718022
for ;
Wed, 10 Apr 2019 21:46:32 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 0683B8D3B1;
Wed, 10 Apr 2019 21:46:31 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D25FE8B4;
Wed, 10 Apr 2019 21:46:30 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ALkUtu089534;
Wed, 10 Apr 2019 21:46:30 GMT (envelope-from mm@FreeBSD.org)
Received: (from mm@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ALkS77089522;
Wed, 10 Apr 2019 21:46:28 GMT (envelope-from mm@FreeBSD.org)
Message-Id: <201904102146.x3ALkS77089522@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org
using -f
From: Martin Matuska
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r346105 - in stable/10: contrib/libarchive/libarchive
contrib/libarchive/libarchive/test lib/libarchive/tests
X-SVN-Group: stable-10
X-SVN-Commit-Author: mm
X-SVN-Commit-Paths: in stable/10: contrib/libarchive/libarchive
contrib/libarchive/libarchive/test lib/libarchive/tests
X-SVN-Commit-Revision: 346105
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 37D3E8D3DE
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.92 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.93)[-0.925,0];
ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:06:40 -0000
X-Original-Date: Wed, 10 Apr 2019 21:46:28 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:06:40 -0000
Author: mm
Date: Wed Apr 10 21:46:28 2019
New Revision: 346105
URL: https://svnweb.freebsd.org/changeset/base/346105
Log:
MFC r345497:
Sync libarchive with vendor.
Relevant vendor changes:
PR #1153: fixed 2 bugs in ZIP reader [1]
PR #1143: ensure archive_read_disk_entry_from_file() uses ARCHIVE_READ_DISK
Changes to file flags code, support more file flags on FreeBSD:
UF_OFFLINE, UF_READONLY, UF_SPARSE, UF_REPARSE, UF_SYSTEM
UF_ARCHIVE is not supported by intention (yet)
PR: 236300 [1]
Added:
stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_bz2_hang.zip.uu
- copied unchanged from r345497, head/contrib/libarchive/libarchive/test/test_read_format_zip_bz2_hang.zip.uu
stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_ppmd8_crash_1.zipx.uu
- copied unchanged from r345497, head/contrib/libarchive/libarchive/test/test_read_format_zip_ppmd8_crash_1.zipx.uu
stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_ppmd8_crash_2.zipx.uu
- copied unchanged from r345497, head/contrib/libarchive/libarchive/test/test_read_format_zip_ppmd8_crash_2.zipx.uu
Modified:
stable/10/contrib/libarchive/libarchive/archive_blake2sp_ref.c
stable/10/contrib/libarchive/libarchive/archive_entry.c
stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c
stable/10/contrib/libarchive/libarchive/archive_string.c
stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c
stable/10/contrib/libarchive/libarchive/archive_write_set_format_7zip.c
stable/10/contrib/libarchive/libarchive/test/test_entry.c
stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c
stable/10/contrib/libarchive/libarchive/test/test_read_format_xar.c
stable/10/contrib/libarchive/libarchive/test/test_read_format_zip.c
stable/10/lib/libarchive/tests/Makefile
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/libarchive/libarchive/archive_blake2sp_ref.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/archive_blake2sp_ref.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/archive_blake2sp_ref.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -89,7 +89,7 @@ int blake2sp_init( blake2sp_state *S, size_t outlen )
return -1;
for( i = 0; i < PARALLELISM_DEGREE; ++i )
- if( blake2sp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1;
+ if( blake2sp_init_leaf( S->S[i], outlen, 0, (uint32_t)i ) < 0 ) return -1;
S->R->last_node = 1;
S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
@@ -112,7 +112,7 @@ int blake2sp_init_key( blake2sp_state *S, size_t outle
return -1;
for( i = 0; i < PARALLELISM_DEGREE; ++i )
- if( blake2sp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1;
+ if( blake2sp_init_leaf( S->S[i], outlen, keylen, (uint32_t)i ) < 0 ) return -1;
S->R->last_node = 1;
S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
@@ -230,7 +230,7 @@ int blake2sp( void *out, size_t outlen, const void *in
if( keylen > BLAKE2S_KEYBYTES ) return -1;
for( i = 0; i < PARALLELISM_DEGREE; ++i )
- if( blake2sp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1;
+ if( blake2sp_init_leaf( S[i], outlen, keylen, (uint32_t)i ) < 0 ) return -1;
S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */
Modified: stable/10/contrib/libarchive/libarchive/archive_entry.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/archive_entry.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/archive_entry.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -1632,6 +1632,51 @@ _archive_entry_acl_text_l(struct archive_entry *entry,
* SUCH DAMAGE.
*/
+/*
+ * Supported file flags on FreeBSD and Mac OS:
+ * sappnd,sappend SF_APPEND
+ * arch,archived SF_ARCHIVED
+ * schg,schange,simmutable SF_IMMUTABLE
+ * sunlnk,sunlink SF_NOUNLINK (FreeBSD only)
+ * uappnd,uappend UF_APPEND
+ * compressed UF_COMPRESSED (Mac OS only)
+ * hidden,uhidden UF_HIDDEN
+ * uchg,uchange,uimmutable UF_IMMUTABLE
+ * nodump UF_NODUMP
+ * uunlnk,uunlink UF_NOUNLINK (FreeBSD only)
+ * offline,uoffline UF_OFFLINE (FreeBSD only)
+ * opaque UF_OPAQUE
+ * rdonly,urdonly,readonly UF_READONLY (FreeBSD only)
+ * reparse,ureparse UF_REPARSE (FreeBSD only)
+ * sparse,usparse UF_SPARSE (FreeBSD only)
+ * system,usystem UF_SYSTEM (FreeBSD only)
+ *
+ * See chflags(2) for more information
+ *
+ * Supported file attributes on Linux:
+ * a append only FS_APPEND_FL sappnd
+ * A no atime updates FS_NOATIME_FL atime
+ * c compress FS_COMPR_FL compress
+ * C no copy on write FS_NOCOW_FL cow
+ * d no dump FS_NODUMP_FL dump
+ * D synchronous directory updates FS_DIRSYNC_FL dirsync
+ * i immutable FS_IMMUTABLE_FL schg
+ * j data journalling FS_JOURNAL_DATA_FL journal
+ * P project hierarchy FS_PROJINHERIT_FL projinherit
+ * s secure deletion FS_SECRM_FL securedeletion
+ * S synchronous updates FS_SYNC_FL sync
+ * t no tail-merging FS_NOTAIL_FL tail
+ * T top of directory hierarchy FS_TOPDIR_FL topdir
+ * u undeletable FS_UNRM_FL undel
+ *
+ * See ioctl_iflags(2) for more information
+ *
+ * Equivalent file flags supported on FreeBSD / Mac OS and Linux:
+ * SF_APPEND FS_APPEND_FL sappnd
+ * SF_IMMUTABLE FS_IMMUTABLE_FL schg
+ * UF_NODUMP FS_NODUMP_FL nodump
+ */
+
static const struct flag {
const char *name;
const wchar_t *wname;
@@ -1640,190 +1685,149 @@ static const struct flag {
} flags[] = {
/* Preferred (shorter) names per flag first, all prefixed by "no" */
#ifdef SF_APPEND
- { "nosappnd", L"nosappnd", SF_APPEND, 0 },
- { "nosappend", L"nosappend", SF_APPEND, 0 },
+ { "nosappnd", L"nosappnd", SF_APPEND, 0},
+ { "nosappend", L"nosappend", SF_APPEND, 0},
#endif
#if defined(FS_APPEND_FL) /* 'a' */
- { "nosappnd", L"nosappnd", FS_APPEND_FL, 0 },
- { "nosappend", L"nosappend", FS_APPEND_FL, 0 },
+ { "nosappnd", L"nosappnd", FS_APPEND_FL, 0},
+ { "nosappend", L"nosappend", FS_APPEND_FL, 0},
#elif defined(EXT2_APPEND_FL) /* 'a' */
- { "nosappnd", L"nosappnd", EXT2_APPEND_FL, 0 },
- { "nosappend", L"nosappend", EXT2_APPEND_FL, 0 },
+ { "nosappnd", L"nosappnd", EXT2_APPEND_FL, 0},
+ { "nosappend", L"nosappend", EXT2_APPEND_FL, 0},
#endif
#ifdef SF_ARCHIVED
- { "noarch", L"noarch", SF_ARCHIVED, 0 },
- { "noarchived", L"noarchived", SF_ARCHIVED, 0 },
+ { "noarch", L"noarch", SF_ARCHIVED, 0},
+ { "noarchived", L"noarchived", SF_ARCHIVED, 0},
#endif
#ifdef SF_IMMUTABLE
- { "noschg", L"noschg", SF_IMMUTABLE, 0 },
- { "noschange", L"noschange", SF_IMMUTABLE, 0 },
- { "nosimmutable", L"nosimmutable", SF_IMMUTABLE, 0 },
+ { "noschg", L"noschg", SF_IMMUTABLE, 0},
+ { "noschange", L"noschange", SF_IMMUTABLE, 0},
+ { "nosimmutable", L"nosimmutable", SF_IMMUTABLE, 0},
#endif
#if defined(FS_IMMUTABLE_FL) /* 'i' */
- { "noschg", L"noschg", FS_IMMUTABLE_FL, 0 },
- { "noschange", L"noschange", FS_IMMUTABLE_FL, 0 },
- { "nosimmutable", L"nosimmutable", FS_IMMUTABLE_FL, 0 },
+ { "noschg", L"noschg", FS_IMMUTABLE_FL, 0},
+ { "noschange", L"noschange", FS_IMMUTABLE_FL, 0},
+ { "nosimmutable", L"nosimmutable", FS_IMMUTABLE_FL, 0},
#elif defined(EXT2_IMMUTABLE_FL) /* 'i' */
- { "noschg", L"noschg", EXT2_IMMUTABLE_FL, 0 },
- { "noschange", L"noschange", EXT2_IMMUTABLE_FL, 0 },
- { "nosimmutable", L"nosimmutable", EXT2_IMMUTABLE_FL, 0 },
+ { "noschg", L"noschg", EXT2_IMMUTABLE_FL, 0},
+ { "noschange", L"noschange", EXT2_IMMUTABLE_FL, 0},
+ { "nosimmutable", L"nosimmutable", EXT2_IMMUTABLE_FL, 0},
#endif
#ifdef SF_NOUNLINK
- { "nosunlnk", L"nosunlnk", SF_NOUNLINK, 0 },
- { "nosunlink", L"nosunlink", SF_NOUNLINK, 0 },
+ { "nosunlnk", L"nosunlnk", SF_NOUNLINK, 0},
+ { "nosunlink", L"nosunlink", SF_NOUNLINK, 0},
#endif
-#ifdef SF_SNAPSHOT
- { "nosnapshot", L"nosnapshot", SF_SNAPSHOT, 0 },
-#endif
#ifdef UF_APPEND
- { "nouappnd", L"nouappnd", UF_APPEND, 0 },
- { "nouappend", L"nouappend", UF_APPEND, 0 },
+ { "nouappnd", L"nouappnd", UF_APPEND, 0},
+ { "nouappend", L"nouappend", UF_APPEND, 0},
#endif
#ifdef UF_IMMUTABLE
- { "nouchg", L"nouchg", UF_IMMUTABLE, 0 },
- { "nouchange", L"nouchange", UF_IMMUTABLE, 0 },
- { "nouimmutable", L"nouimmutable", UF_IMMUTABLE, 0 },
+ { "nouchg", L"nouchg", UF_IMMUTABLE, 0},
+ { "nouchange", L"nouchange", UF_IMMUTABLE, 0},
+ { "nouimmutable", L"nouimmutable", UF_IMMUTABLE, 0},
#endif
#ifdef UF_NODUMP
{ "nodump", L"nodump", 0, UF_NODUMP},
#endif
#if defined(FS_NODUMP_FL) /* 'd' */
{ "nodump", L"nodump", 0, FS_NODUMP_FL},
-#elif defined(EXT2_NODUMP_FL) /* 'd' */
+#elif defined(EXT2_NODUMP_FL)
{ "nodump", L"nodump", 0, EXT2_NODUMP_FL},
#endif
#ifdef UF_OPAQUE
- { "noopaque", L"noopaque", UF_OPAQUE, 0 },
+ { "noopaque", L"noopaque", UF_OPAQUE, 0},
#endif
#ifdef UF_NOUNLINK
- { "nouunlnk", L"nouunlnk", UF_NOUNLINK, 0 },
- { "nouunlink", L"nouunlink", UF_NOUNLINK, 0 },
+ { "nouunlnk", L"nouunlnk", UF_NOUNLINK, 0},
+ { "nouunlink", L"nouunlink", UF_NOUNLINK, 0},
#endif
#ifdef UF_COMPRESSED
- { "nocompressed",L"nocompressed", UF_COMPRESSED, 0 },
+ /* Mac OS */
+ { "nocompressed", L"nocompressed", UF_COMPRESSED, 0},
#endif
#ifdef UF_HIDDEN
- { "nohidden", L"nohidden", UF_HIDDEN, 0 },
+ { "nohidden", L"nohidden", UF_HIDDEN, 0},
+ { "nouhidden", L"nouhidden", UF_HIDDEN, 0},
#endif
-#if defined(FS_UNRM_FL)
- { "nouunlink", L"nouunlink", FS_UNRM_FL, 0},
-#elif defined(EXT2_UNRM_FL)
- { "nouunlink", L"nouunlink", EXT2_UNRM_FL, 0},
+#ifdef UF_OFFLINE
+ { "nooffline", L"nooffline", UF_OFFLINE, 0},
+ { "nouoffline", L"nouoffline", UF_OFFLINE, 0},
#endif
-
-#if defined(FS_BTREE_FL)
- { "nobtree", L"nobtree", FS_BTREE_FL, 0 },
-#elif defined(EXT2_BTREE_FL)
- { "nobtree", L"nobtree", EXT2_BTREE_FL, 0 },
+#ifdef UF_READONLY
+ { "nordonly", L"nordonly", UF_READONLY, 0},
+ { "nourdonly", L"nourdonly", UF_READONLY, 0},
+ { "noreadonly", L"noreadonly", UF_READONLY, 0},
#endif
-
-#if defined(FS_ECOMPR_FL)
- { "nocomperr", L"nocomperr", FS_ECOMPR_FL, 0 },
-#elif defined(EXT2_ECOMPR_FL)
- { "nocomperr", L"nocomperr", EXT2_ECOMPR_FL, 0 },
+#ifdef UF_SPARSE
+ { "nosparse", L"nosparse", UF_SPARSE, 0},
+ { "nousparse", L"nousparse", UF_SPARSE, 0},
#endif
-
-#if defined(FS_COMPR_FL) /* 'c' */
- { "nocompress", L"nocompress", FS_COMPR_FL, 0 },
-#elif defined(EXT2_COMPR_FL) /* 'c' */
- { "nocompress", L"nocompress", EXT2_COMPR_FL, 0 },
+#ifdef UF_REPARSE
+ { "noreparse", L"noreparse", UF_REPARSE, 0},
+ { "noureparse", L"noureparse", UF_REPARSE, 0},
#endif
-
-#if defined(FS_NOATIME_FL) /* 'A' */
- { "noatime", L"noatime", 0, FS_NOATIME_FL},
-#elif defined(EXT2_NOATIME_FL) /* 'A' */
- { "noatime", L"noatime", 0, EXT2_NOATIME_FL},
+#ifdef UF_SYSTEM
+ { "nosystem", L"nosystem", UF_SYSTEM, 0},
+ { "nousystem", L"nousystem", UF_SYSTEM, 0},
#endif
+#if defined(FS_UNRM_FL) /* 'u' */
+ { "noundel", L"noundel", FS_UNRM_FL, 0},
+#elif defined(EXT2_UNRM_FL)
+ { "noundel", L"noundel", EXT2_UNRM_FL, 0},
+#endif
-#if defined(FS_DIRTY_FL)
- { "nocompdirty",L"nocompdirty", FS_DIRTY_FL, 0},
-#elif defined(EXT2_DIRTY_FL)
- { "nocompdirty",L"nocompdirty", EXT2_DIRTY_FL, 0},
+#if defined(FS_COMPR_FL) /* 'c' */
+ { "nocompress", L"nocompress", FS_COMPR_FL, 0},
+#elif defined(EXT2_COMPR_FL)
+ { "nocompress", L"nocompress", EXT2_COMPR_FL, 0},
#endif
-#if defined(FS_COMPRBLK_FL)
-#if defined(FS_NOCOMPR_FL)
- { "nocomprblk", L"nocomprblk", FS_COMPRBLK_FL, FS_NOCOMPR_FL},
-#else
- { "nocomprblk", L"nocomprblk", FS_COMPRBLK_FL, 0},
+#if defined(FS_NOATIME_FL) /* 'A' */
+ { "noatime", L"noatime", 0, FS_NOATIME_FL},
+#elif defined(EXT2_NOATIME_FL)
+ { "noatime", L"noatime", 0, EXT2_NOATIME_FL},
#endif
-#elif defined(EXT2_COMPRBLK_FL)
-#if defined(EXT2_NOCOMPR_FL)
- { "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, EXT2_NOCOMPR_FL},
-#else
- { "nocomprblk", L"nocomprblk", EXT2_COMPRBLK_FL, 0},
-#endif
-#endif
-#if defined(FS_DIRSYNC_FL)
- { "nodirsync", L"nodirsync", FS_DIRSYNC_FL, 0},
+#if defined(FS_DIRSYNC_FL) /* 'D' */
+ { "nodirsync", L"nodirsync", FS_DIRSYNC_FL, 0},
#elif defined(EXT2_DIRSYNC_FL)
- { "nodirsync", L"nodirsync", EXT2_DIRSYNC_FL, 0},
+ { "nodirsync", L"nodirsync", EXT2_DIRSYNC_FL, 0},
#endif
-#if defined(FS_INDEX_FL)
- { "nohashidx", L"nohashidx", FS_INDEX_FL, 0},
-#elif defined(EXT2_INDEX_FL)
- { "nohashidx", L"nohashidx", EXT2_INDEX_FL, 0},
-#endif
-#if defined(FS_IMAGIC_FL)
- { "noimagic", L"noimagic", FS_IMAGIC_FL, 0},
-#elif defined(EXT2_IMAGIC_FL)
- { "noimagic", L"noimagic", EXT2_IMAGIC_FL, 0},
-#endif
-#if defined(FS_JOURNAL_DATA_FL)
- { "nojournal", L"nojournal", FS_JOURNAL_DATA_FL, 0},
+#if defined(FS_JOURNAL_DATA_FL) /* 'j' */
+ { "nojournal-data",L"nojournal-data", FS_JOURNAL_DATA_FL, 0},
+ { "nojournal", L"nojournal", FS_JOURNAL_DATA_FL, 0},
#elif defined(EXT3_JOURNAL_DATA_FL)
- { "nojournal", L"nojournal", EXT3_JOURNAL_DATA_FL, 0},
+ { "nojournal-data",L"nojournal-data", EXT3_JOURNAL_DATA_FL, 0},
+ { "nojournal", L"nojournal", EXT3_JOURNAL_DATA_FL, 0},
#endif
-#if defined(FS_SECRM_FL)
- { "nosecuredeletion",L"nosecuredeletion",FS_SECRM_FL, 0},
+#if defined(FS_SECRM_FL) /* 's' */
+ { "nosecdel", L"nosecdel", FS_SECRM_FL, 0},
+ { "nosecuredeletion",L"nosecuredeletion",FS_SECRM_FL, 0},
#elif defined(EXT2_SECRM_FL)
- { "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL, 0},
+ { "nosecdel", L"nosecdel", EXT2_SECRM_FL, 0},
+ { "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL, 0},
#endif
-#if defined(FS_SYNC_FL)
- { "nosync", L"nosync", FS_SYNC_FL, 0},
+#if defined(FS_SYNC_FL) /* 'S' */
+ { "nosync", L"nosync", FS_SYNC_FL, 0},
#elif defined(EXT2_SYNC_FL)
- { "nosync", L"nosync", EXT2_SYNC_FL, 0},
+ { "nosync", L"nosync", EXT2_SYNC_FL, 0},
#endif
-#if defined(FS_NOTAIL_FL)
- { "notail", L"notail", 0, FS_NOTAIL_FL},
+#if defined(FS_NOTAIL_FL) /* 't' */
+ { "notail", L"notail", 0, FS_NOTAIL_FL},
#elif defined(EXT2_NOTAIL_FL)
- { "notail", L"notail", 0, EXT2_NOTAIL_FL},
+ { "notail", L"notail", 0, EXT2_NOTAIL_FL},
#endif
-#if defined(FS_TOPDIR_FL)
- { "notopdir", L"notopdir", FS_TOPDIR_FL, 0},
+#if defined(FS_TOPDIR_FL) /* 'T' */
+ { "notopdir", L"notopdir", FS_TOPDIR_FL, 0},
#elif defined(EXT2_TOPDIR_FL)
- { "notopdir", L"notopdir", EXT2_TOPDIR_FL, 0},
+ { "notopdir", L"notopdir", EXT2_TOPDIR_FL, 0},
#endif
-#ifdef FS_ENCRYPT_FL
- { "noencrypt", L"noencrypt", FS_ENCRYPT_FL, 0},
+#ifdef FS_NOCOW_FL /* 'C' */
+ { "nocow", L"nocow", 0, FS_NOCOW_FL},
#endif
-#ifdef FS_HUGE_FILE_FL
- { "nohugefile", L"nohugefile", FS_HUGE_FILE_FL, 0},
+#ifdef FS_PROJINHERIT_FL /* 'P' */
+ { "noprojinherit",L"noprojinherit", FS_PROJINHERIT_FL, 0},
#endif
-#ifdef FS_EXTENT_FL
- { "noextent", L"noextent", FS_EXTENT_FL, 0},
-#endif
-#ifdef FS_EA_INODE_FL
- { "noeainode", L"noeainode", FS_EA_INODE_FL, 0},
-#endif
-#ifdef FS_EOFBLOCKS_FL
- { "noeofblocks",L"noeofblocks", FS_EOFBLOCKS_FL, 0},
-#endif
-#ifdef FS_NOCOW_FL
- { "nocow", L"nocow", FS_NOCOW_FL, 0},
-#endif
-#ifdef FS_INLINE_DATA_FL
- { "noinlinedata",L"noinlinedata", FS_INLINE_DATA_FL, 0},
-#endif
-#ifdef FS_PROJINHERIT_FL
- { "noprojinherit",L"noprojinherit", FS_PROJINHERIT_FL, 0},
-#endif
-#if defined(FS_RESERVED_FL)
- { "noreserved", L"noreserved", FS_RESERVED_FL, 0},
-#elif defined(EXT2_RESERVED_FL)
- { "noreserved", L"noreserved", EXT2_RESERVED_FL, 0},
-#endif
- { NULL, NULL, 0, 0 }
+ { NULL, NULL, 0, 0}
};
/*
Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -163,6 +163,9 @@ archive_read_disk_entry_from_file(struct archive *_a,
int initial_fd = fd;
int r, r1;
+ archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC, ARCHIVE_STATE_ANY,
+ "archive_read_disk_entry_from_file");
+
archive_clear_error(_a);
path = archive_entry_sourcepath(entry);
if (path == NULL)
Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -507,15 +507,16 @@ static int run_e8e9_filter(struct rar5* rar, struct fi
const uint32_t file_size = 0x1000000;
ssize_t i;
+ const int mask = (int)rar->cstate.window_mask;
circular_memcpy(rar->cstate.filtered_buf,
rar->cstate.window_buf,
- rar->cstate.window_mask,
+ mask,
rar->cstate.solid_offset + flt->block_start,
rar->cstate.solid_offset + flt->block_start + flt->block_length);
for(i = 0; i < flt->block_length - 4;) {
uint8_t b = rar->cstate.window_buf[(rar->cstate.solid_offset +
- flt->block_start + i++) & rar->cstate.window_mask];
+ flt->block_start + i++) & mask];
/* 0xE8 = x86's call (function call)
* 0xE9 = x86's jmp (unconditional jump) */
@@ -524,17 +525,17 @@ static int run_e8e9_filter(struct rar5* rar, struct fi
uint32_t addr;
uint32_t offset = (i + flt->block_start) % file_size;
- addr = read_filter_data(rar, (rar->cstate.solid_offset +
+ addr = read_filter_data(rar, (uint32_t)(rar->cstate.solid_offset +
flt->block_start + i) & rar->cstate.window_mask);
if(addr & 0x80000000) {
if(((addr + offset) & 0x80000000) == 0) {
- write_filter_data(rar, i, addr + file_size);
+ write_filter_data(rar, (uint32_t)i, addr + file_size);
}
} else {
if((addr - file_size) & 0x80000000) {
uint32_t naddr = addr - offset;
- write_filter_data(rar, i, naddr);
+ write_filter_data(rar, (uint32_t)i, naddr);
}
}
@@ -548,11 +549,11 @@ static int run_e8e9_filter(struct rar5* rar, struct fi
static int run_arm_filter(struct rar5* rar, struct filter_info* flt) {
ssize_t i = 0;
uint32_t offset;
- const int mask = rar->cstate.window_mask;
+ const int mask = (int)rar->cstate.window_mask;
circular_memcpy(rar->cstate.filtered_buf,
rar->cstate.window_buf,
- rar->cstate.window_mask,
+ mask,
rar->cstate.solid_offset + flt->block_start,
rar->cstate.solid_offset + flt->block_start + flt->block_length);
@@ -567,7 +568,7 @@ static int run_arm_filter(struct rar5* rar, struct fil
offset -= (uint32_t) ((i + flt->block_start) / 4);
offset = (offset & 0x00ffffff) | 0xeb000000;
- write_filter_data(rar, i, offset);
+ write_filter_data(rar, (uint32_t)i, offset);
}
}
@@ -633,7 +634,7 @@ static int run_filter(struct archive_read* a, struct f
static void push_data(struct archive_read* a, struct rar5* rar,
const uint8_t* buf, int64_t idx_begin, int64_t idx_end)
{
- const int wmask = rar->cstate.window_mask;
+ const int wmask = (int)rar->cstate.window_mask;
const ssize_t solid_write_ptr = (rar->cstate.solid_offset +
rar->cstate.last_write_ptr) & wmask;
@@ -1703,8 +1704,8 @@ static int process_base_block(struct archive_read* a,
rar->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
rar->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
- rar->generic.size = hdr_size;
- rar->generic.last_header_id = header_id;
+ rar->generic.size = (int)hdr_size;
+ rar->generic.last_header_id = (int)header_id;
rar->main.endarc = 0;
/* Those are possible header ids in RARv5. */
@@ -1920,7 +1921,7 @@ static int create_decode_tables(uint8_t* bit_length,
}
}
- quick_data_size = 1 << table->quick_bits;
+ quick_data_size = (int64_t)1 << table->quick_bits;
cur_len = 1;
for(code = 0; code < quick_data_size; code++) {
int bit_field = code << (16 - table->quick_bits);
@@ -2351,7 +2352,7 @@ static int decode_code_length(struct rar5* rar, const
static int copy_string(struct archive_read* a, int len, int dist) {
struct rar5* rar = get_context(a);
- const int cmask = rar->cstate.window_mask;
+ const int cmask = (int)rar->cstate.window_mask;
const int64_t write_ptr = rar->cstate.write_ptr + rar->cstate.solid_offset;
int i;
@@ -2377,7 +2378,7 @@ static int do_uncompress_block(struct archive_read* a,
uint16_t num;
int ret;
- const int cmask = rar->cstate.window_mask;
+ const int cmask = (int)rar->cstate.window_mask;
const struct compressed_block_header* hdr = &rar->last_block_hdr;
const uint8_t bit_size = 1 + hdr->block_flags.bit_size;
Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -194,6 +194,7 @@ struct zip {
ssize_t zipx_ppmd_read_compressed;
CPpmd8 ppmd8;
char ppmd8_valid;
+ char ppmd8_stream_failed;
struct archive_string_conv *sconv;
struct archive_string_conv *sconv_default;
@@ -254,9 +255,15 @@ ppmd_read(void* p) {
/* Get the handle to current decompression context. */
struct archive_read *a = ((IByteIn*)p)->a;
struct zip *zip = (struct zip*) a->format->data;
+ ssize_t bytes_avail = 0;
/* Fetch next byte. */
- const uint8_t* data = __archive_read_ahead(a, 1, NULL);
+ const uint8_t* data = __archive_read_ahead(a, 1, &bytes_avail);
+ if(bytes_avail < 1) {
+ zip->ppmd8_stream_failed = 1;
+ return 0;
+ }
+
__archive_read_consume(a, 1);
/* Increment the counter. */
@@ -1750,6 +1757,7 @@ zipx_ppmd8_init(struct archive_read *a, struct zip *zi
/* Create a new decompression context. */
__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
+ zip->ppmd8_stream_failed = 0;
/* Setup function pointers required by Ppmd8 decompressor. The
* 'ppmd_read' function will feed new bytes to the decompressor,
@@ -1869,6 +1877,14 @@ zip_read_data_zipx_ppmd(struct archive_read *a, const
break;
}
+ /* This field is set by ppmd_read() when there was no more data
+ * to be read. */
+ if(zip->ppmd8_stream_failed) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Truncated PPMd8 file body");
+ return (ARCHIVE_FATAL);
+ }
+
zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
++consumed_bytes;
} while(consumed_bytes < zip->uncompressed_buffer_size);
@@ -1902,7 +1918,7 @@ zipx_bzip2_init(struct archive_read *a, struct zip *zi
{
int r;
- /* Deallocate already existing BZ2 decompression context if it
+ /* Deallocate already existing BZ2 decompression context if it
* exists. */
if(zip->bzstream_valid) {
BZ2_bzDecompressEnd(&zip->bzstream);
@@ -1968,6 +1984,15 @@ zip_read_data_zipx_bzip2(struct archive_read *a, const
}
in_bytes = zipmin(zip->entry_bytes_remaining, bytes_avail);
+ if(in_bytes < 1) {
+ /* libbz2 doesn't complain when caller feeds avail_in == 0. It will
+ * actually return success in this case, which is undesirable. This is
+ * why we need to make this check manually. */
+
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Truncated bzip2 file body");
+ return (ARCHIVE_FATAL);
+ }
/* Setup buffer boundaries. */
zip->bzstream.next_in = (char*)(uintptr_t) compressed_buff;
Modified: stable/10/contrib/libarchive/libarchive/archive_string.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/archive_string.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/archive_string.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -1512,8 +1512,10 @@ get_current_codepage(void)
p = strrchr(locale, '.');
if (p == NULL)
return (GetACP());
+ if (strcmp(p+1, "utf8") == 0)
+ return CP_UTF8;
cp = my_atoi(p+1);
- if (cp <= 0)
+ if ((int)cp <= 0)
return (GetACP());
return (cp);
}
@@ -4050,6 +4052,7 @@ archive_mstring_copy_utf8(struct archive_mstring *aes,
{
if (utf8 == NULL) {
aes->aes_set = 0;
+ return (0);
}
aes->aes_set = AES_SET_UTF8;
archive_string_empty(&(aes->aes_mbs));
@@ -4064,6 +4067,7 @@ archive_mstring_copy_wcs_len(struct archive_mstring *a
{
if (wcs == NULL) {
aes->aes_set = 0;
+ return (0);
}
aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
archive_string_empty(&(aes->aes_mbs));
Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -2563,8 +2563,11 @@ check_symlinks_fsobj(char *path, int *a_eno, struct ar
*/
restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC);
__archive_ensure_cloexec_flag(restore_pwd);
- if (restore_pwd < 0)
+ if (restore_pwd < 0) {
+ fsobj_error(a_eno, a_estr, errno,
+ "Could not open ", path);
return (ARCHIVE_FATAL);
+ }
head = path;
tail = path;
last = 0;
@@ -3103,12 +3106,14 @@ create_dir(struct archive_write_disk *a, char *path)
static int
set_ownership(struct archive_write_disk *a)
{
-#ifndef __CYGWIN__
-/* unfortunately, on win32 there is no 'root' user with uid 0,
- so we just have to try the chown and see if it works */
-
- /* If we know we can't change it, don't bother trying. */
- if (a->user_uid != 0 && a->user_uid != a->uid) {
+#if !defined(__CYGWIN__) && !defined(__linux__)
+/*
+ * On Linux, a process may have the CAP_CHOWN capability.
+ * On Windows there is no 'root' user with uid 0.
+ * Elsewhere we can skip calling chown if we are not root and the desired
+ * user id does not match the current user.
+ */
+ if (a->user_uid != 0 && a->user_uid != a->uid) {
archive_set_error(&a->archive, errno,
"Can't set UID=%jd", (intmax_t)a->uid);
return (ARCHIVE_WARN);
@@ -3475,9 +3480,7 @@ set_fflags(struct archive_write_disk *a)
struct fixup_entry *le;
unsigned long set, clear;
int r;
- int critical_flags;
mode_t mode = archive_entry_mode(a->entry);
-
/*
* Make 'critical_flags' hold all file flags that can't be
* immediately restored. For example, on BSD systems,
@@ -3493,33 +3496,33 @@ set_fflags(struct archive_write_disk *a)
* other programs that might try to muck with files as they're
* being restored.
*/
- /* Hopefully, the compiler will optimize this mess into a constant. */
- critical_flags = 0;
+ const int critical_flags = 0
#ifdef SF_IMMUTABLE
- critical_flags |= SF_IMMUTABLE;
+ | SF_IMMUTABLE
#endif
#ifdef UF_IMMUTABLE
- critical_flags |= UF_IMMUTABLE;
+ | UF_IMMUTABLE
#endif
#ifdef SF_APPEND
- critical_flags |= SF_APPEND;
+ | SF_APPEND
#endif
#ifdef UF_APPEND
- critical_flags |= UF_APPEND;
+ | UF_APPEND
#endif
#if defined(FS_APPEND_FL)
- critical_flags |= FS_APPEND_FL;
+ | FS_APPEND_FL
#elif defined(EXT2_APPEND_FL)
- critical_flags |= EXT2_APPEND_FL;
+ | EXT2_APPEND_FL
#endif
#if defined(FS_IMMUTABLE_FL)
- critical_flags |= FS_IMMUTABLE_FL;
+ | FS_IMMUTABLE_FL
#elif defined(EXT2_IMMUTABLE_FL)
- critical_flags |= EXT2_IMMUTABLE_FL;
+ | EXT2_IMMUTABLE_FL
#endif
#ifdef FS_JOURNAL_DATA_FL
- critical_flags |= FS_JOURNAL_DATA_FL;
+ | FS_JOURNAL_DATA_FL
#endif
+ ;
if (a->todo & TODO_FFLAGS) {
archive_entry_fflags(a->entry, &set, &clear);
@@ -3550,29 +3553,27 @@ set_fflags(struct archive_write_disk *a)
static int
clear_nochange_fflags(struct archive_write_disk *a)
{
- int nochange_flags;
mode_t mode = archive_entry_mode(a->entry);
-
- /* Hopefully, the compiler will optimize this mess into a constant. */
- nochange_flags = 0;
+ const int nochange_flags = 0
#ifdef SF_IMMUTABLE
- nochange_flags |= SF_IMMUTABLE;
+ | SF_IMMUTABLE
#endif
#ifdef UF_IMMUTABLE
- nochange_flags |= UF_IMMUTABLE;
+ | UF_IMMUTABLE
#endif
#ifdef SF_APPEND
- nochange_flags |= SF_APPEND;
+ | SF_APPEND
#endif
#ifdef UF_APPEND
- nochange_flags |= UF_APPEND;
+ | UF_APPEND
#endif
#ifdef EXT2_APPEND_FL
- nochange_flags |= EXT2_APPEND_FL;
+ | EXT2_APPEND_FL
#endif
#ifdef EXT2_IMMUTABLE_FL
- nochange_flags |= EXT2_IMMUTABLE_FL;
+ | EXT2_IMMUTABLE_FL
#endif
+ ;
return (set_fflags_platform(a, a->fd, a->name, mode, 0,
nochange_flags));
@@ -3588,8 +3589,22 @@ set_fflags_platform(struct archive_write_disk *a, int
mode_t mode, unsigned long set, unsigned long clear)
{
int r;
-
+ const int sf_mask = 0
+#ifdef SF_APPEND
+ | SF_APPEND
+#endif
+#ifdef SF_ARCHIVED
+ | SF_ARCHIVED
+#endif
+#ifdef SF_IMMUTABLE
+ | SF_IMMUTABLE
+#endif
+#ifdef SF_NOUNLINK
+ | SF_NOUNLINK
+#endif
+ ;
(void)mode; /* UNUSED */
+
if (set == 0 && clear == 0)
return (ARCHIVE_OK);
@@ -3604,6 +3619,12 @@ set_fflags_platform(struct archive_write_disk *a, int
a->st.st_flags &= ~clear;
a->st.st_flags |= set;
+
+ /* Only super-user may change SF_* flags */
+
+ if (a->user_uid != 0)
+ a->st.st_flags &= ~sf_mask;
+
#ifdef HAVE_FCHFLAGS
/* If platform has fchflags() and we were given an fd, use it. */
if (fd >= 0 && fchflags(fd, a->st.st_flags) == 0)
@@ -3645,22 +3666,6 @@ set_fflags_platform(struct archive_write_disk *a, int
int ret;
int myfd = fd;
int newflags, oldflags;
- int sf_mask = 0;
-
- if (set == 0 && clear == 0)
- return (ARCHIVE_OK);
- /* Only regular files and dirs can have flags. */
- if (!S_ISREG(mode) && !S_ISDIR(mode))
- return (ARCHIVE_OK);
-
- /* If we weren't given an fd, open it ourselves. */
- if (myfd < 0) {
- myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY | O_CLOEXEC);
- __archive_ensure_cloexec_flag(myfd);
- }
- if (myfd < 0)
- return (ARCHIVE_OK);
-
/*
* Linux has no define for the flags that are only settable by
* the root user. This code may seem a little complex, but
@@ -3668,19 +3673,36 @@ set_fflags_platform(struct archive_write_disk *a, int
* defines. (?) The code below degrades reasonably gracefully
* if sf_mask is incomplete.
*/
+ const int sf_mask = 0
#if defined(FS_IMMUTABLE_FL)
- sf_mask |= FS_IMMUTABLE_FL;
+ | FS_IMMUTABLE_FL
#elif defined(EXT2_IMMUTABLE_FL)
- sf_mask |= EXT2_IMMUTABLE_FL;
+ | EXT2_IMMUTABLE_FL
#endif
#if defined(FS_APPEND_FL)
- sf_mask |= FS_APPEND_FL;
+ | FS_APPEND_FL
#elif defined(EXT2_APPEND_FL)
- sf_mask |= EXT2_APPEND_FL;
+ | EXT2_APPEND_FL
#endif
#if defined(FS_JOURNAL_DATA_FL)
- sf_mask |= FS_JOURNAL_DATA_FL;
+ | FS_JOURNAL_DATA_FL
#endif
+ ;
+
+ if (set == 0 && clear == 0)
+ return (ARCHIVE_OK);
+ /* Only regular files and dirs can have flags. */
+ if (!S_ISREG(mode) && !S_ISDIR(mode))
+ return (ARCHIVE_OK);
+
+ /* If we weren't given an fd, open it ourselves. */
+ if (myfd < 0) {
+ myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY | O_CLOEXEC);
+ __archive_ensure_cloexec_flag(myfd);
+ }
+ if (myfd < 0)
+ return (ARCHIVE_OK);
+
/*
* XXX As above, this would be way simpler if we didn't have
* to read the current flags from disk. XXX
Modified: stable/10/contrib/libarchive/libarchive/archive_write_set_format_7zip.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/archive_write_set_format_7zip.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/archive_write_set_format_7zip.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -439,7 +439,8 @@ _7z_write_header(struct archive_write *a, struct archi
r = file_new(a, entry, &file);
if (r < ARCHIVE_WARN) {
- file_free(file);
+ if (file != NULL)
+ file_free(file);
return (r);
}
if (file->size == 0 && file->dir) {
Modified: stable/10/contrib/libarchive/libarchive/test/test_entry.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/test/test_entry.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/test/test_entry.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -336,7 +336,7 @@ DEFINE_TEST(test_entry)
/* Converting fflags bitmap to string is currently system-dependent. */
/* TODO: Make this system-independent. */
assertEqualString(archive_entry_fflags_text(e),
- "uappnd,nouchg,nodump,noopaque,uunlnk");
+ "uappnd,nouchg,nodump,noopaque,uunlnk,nosystem");
/* Test archive_entry_copy_fflags_text_w() */
archive_entry_copy_fflags_text_w(e, L" ,nouappnd, nouchg, dump,uunlnk");
archive_entry_fflags(e, &set, &clear);
Modified: stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -95,7 +95,7 @@ int extract_one(struct archive* a, struct archive_entr
int ret = 1;
uint32_t computed_crc;
- fsize = archive_entry_size(ae);
+ fsize = (la_ssize_t) archive_entry_size(ae);
buf = malloc(fsize);
if(buf == NULL)
return 1;
@@ -109,13 +109,13 @@ int extract_one(struct archive* a, struct archive_entr
computed_crc = crc32(0, buf, fsize);
assertEqualInt(computed_crc, crc);
ret = 0;
-
+
fn_exit:
free(buf);
return ret;
}
-DEFINE_TEST(test_read_format_rar5_stored)
+DEFINE_TEST(test_read_format_rar5_stored)
{
const char helloworld_txt[] = "hello libarchive test suite!\n";
la_ssize_t file_size = sizeof(helloworld_txt) - 1;
@@ -142,7 +142,7 @@ DEFINE_TEST(test_read_format_rar5_stored)
DEFINE_TEST(test_read_format_rar5_compressed)
{
const int DATA_SIZE = 1200;
- uint8_t buff[DATA_SIZE];
+ uint8_t buff[1200];
PROLOGUE("test_read_format_rar5_compressed.rar");
@@ -160,7 +160,7 @@ DEFINE_TEST(test_read_format_rar5_compressed)
DEFINE_TEST(test_read_format_rar5_multiple_files)
{
const int DATA_SIZE = 4096;
- uint8_t buff[DATA_SIZE];
+ uint8_t buff[4096];
PROLOGUE("test_read_format_rar5_multiple_files.rar");
@@ -172,7 +172,7 @@ DEFINE_TEST(test_read_format_rar5_multiple_files)
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
assertA(verify_data(buff, 1, DATA_SIZE));
-
+
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test2.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
@@ -206,7 +206,7 @@ DEFINE_TEST(test_read_format_rar5_multiple_files)
DEFINE_TEST(test_read_format_rar5_multiple_files_solid)
{
const int DATA_SIZE = 4096;
- uint8_t buff[DATA_SIZE];
+ uint8_t buff[4096];
PROLOGUE("test_read_format_rar5_multiple_files_solid.rar");
@@ -215,7 +215,7 @@ DEFINE_TEST(test_read_format_rar5_multiple_files_solid
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
assertA(verify_data(buff, 1, DATA_SIZE));
-
+
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test2.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
@@ -308,7 +308,7 @@ DEFINE_TEST(test_read_format_rar5_multiarchive_skip_al
DEFINE_TEST(test_read_format_rar5_blake2)
{
const la_ssize_t proper_size = 814;
- uint8_t buf[proper_size];
+ uint8_t buf[814];
PROLOGUE("test_read_format_rar5_blake2.rar");
assertA(0 == archive_read_next_header(a, &ae));
@@ -333,7 +333,7 @@ DEFINE_TEST(test_read_format_rar5_arm_filter)
* test. */
const la_ssize_t proper_size = 90808;
- uint8_t buf[proper_size];
+ uint8_t buf[90808];
PROLOGUE("test_read_format_rar5_arm.rar");
assertA(0 == archive_read_next_header(a, &ae));
@@ -597,7 +597,7 @@ DEFINE_TEST(test_read_format_rar5_multiarchive_solid_s
EPILOGUE();
}
-DEFINE_TEST(test_read_format_rar5_solid_skip_all)
+DEFINE_TEST(test_read_format_rar5_solid_skip_all)
{
const char* reffile = "test_read_format_rar5_solid.rar";
@@ -622,7 +622,7 @@ DEFINE_TEST(test_read_format_rar5_solid_skip_all)
EPILOGUE();
}
-DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_first)
+DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_first)
{
const char* reffile = "test_read_format_rar5_solid.rar";
@@ -648,7 +648,7 @@ DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_f
EPILOGUE();
}
-DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_second)
+DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_second)
{
const char* reffile = "test_read_format_rar5_solid.rar";
Modified: stable/10/contrib/libarchive/libarchive/test/test_read_format_xar.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/test/test_read_format_xar.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/test/test_read_format_xar.c Wed Apr 10 21:46:28 2019 (r346105)
@@ -799,7 +799,7 @@ static void verify(unsigned char *d, size_t s,
static void verifyB(unsigned char *d, size_t s) {
struct archive* a;
struct archive_entry *entry = NULL;
- la_int64_t buf_size;
+ size_t buf_size;
unsigned char *buf;
assert((a = archive_read_new()) != NULL);
@@ -826,20 +826,20 @@ static void verifyB(unsigned char *d, size_t s) {
// f1, content "onetwothree\n", size 12 bytes
assertA(0 == archive_read_next_header(a, &entry));
- buf_size = archive_entry_size(entry);
+ buf_size = (size_t) archive_entry_size(entry);
assertA(buf_size == 12);
buf = (unsigned char*) malloc(buf_size);
assertA(NULL != buf);
- assertA(buf_size == archive_read_data(a, buf, buf_size));
+ assertA(buf_size == (size_t) archive_read_data(a, buf, buf_size));
free(buf);
// f2, content "fourfivesix\n", size 12 bytes
assertA(0 == archive_read_next_header(a, &entry));
- buf_size = archive_entry_size(entry);
+ buf_size = (size_t) archive_entry_size(entry);
assertA(buf_size == 12);
buf = (unsigned char*) malloc(buf_size);
assertA(NULL != buf);
- assertA(buf_size == archive_read_data(a, buf, buf_size));
+ assertA(buf_size == (size_t) archive_read_data(a, buf, buf_size));
free(buf);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
Modified: stable/10/contrib/libarchive/libarchive/test/test_read_format_zip.c
==============================================================================
--- stable/10/contrib/libarchive/libarchive/test/test_read_format_zip.c Wed Apr 10 21:46:06 2019 (r346104)
+++ stable/10/contrib/libarchive/libarchive/test/test_read_format_zip.c Wed Apr 10 21:46:28 2019 (r346105)
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:06:56 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id A75E1DD1BF;
Tue, 3 Sep 2019 14:06:56 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N80023Lgz4Q3l;
Tue, 3 Sep 2019 14:06:56 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 19A8E1ADBC; Tue, 3 Sep 2019 14:06:22 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id DACB0137EA;
Tue, 16 Apr 2019 02:48:08 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 404336EFB3;
Tue, 16 Apr 2019 02:48:08 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 0F5871378F; Tue, 16 Apr 2019 02:48:08 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 863BB1378D
for ;
Tue, 16 Apr 2019 02:48:05 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 527D06EFAF;
Tue, 16 Apr 2019 02:48:05 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2892B1951A;
Tue, 16 Apr 2019 02:48:05 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3G2m50P067537;
Tue, 16 Apr 2019 02:48:05 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3G2m5p0067536;
Tue, 16 Apr 2019 02:48:05 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904160248.x3G2m5p0067536@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
rmacklem@FreeBSD.org using -f
From: Rick Macklem
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r346262 - stable/10/sys/rpc/rpcsec_gss
X-SVN-Group: stable-10
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: stable/10/sys/rpc/rpcsec_gss
X-SVN-Commit-Revision: 346262
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 404336EFB3
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.95 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.95)[-0.949,0];
ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:06:57 -0000
X-Original-Date: Tue, 16 Apr 2019 02:48:05 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:06:57 -0000
Author: rmacklem
Date: Tue Apr 16 02:48:04 2019
New Revision: 346262
URL: https://svnweb.freebsd.org/changeset/base/346262
Log:
MFC: r345818, r345828
Fix a race in the RPCSEC_GSS server code that caused crashes.
When a new client structure was allocated, it was added to the list
so that it was visible to other threads before the expiry time was
initialized, with only a single reference count.
The caller would increment the reference count, but it was possible
for another thread to decrement the reference count to zero and free
the structure before the caller incremented the reference count.
This could occur because the expiry time was still set to zero when
the new client structure was inserted in the list and the list was
unlocked.
This patch fixes the race by initializing the reference count to two
and initializing all fields, including the expiry time, before inserting
it in the list.
Modified:
stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==============================================================================
--- stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Apr 16 02:46:21 2019 (r346261)
+++ stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Tue Apr 16 02:48:04 2019 (r346262)
@@ -543,18 +543,17 @@ svc_rpc_gss_create_client(void)
client = mem_alloc(sizeof(struct svc_rpc_gss_client));
memset(client, 0, sizeof(struct svc_rpc_gss_client));
- refcount_init(&client->cl_refs, 1);
+
+ /*
+ * Set the initial value of cl_refs to two. One for the caller
+ * and the other to hold onto the client structure until it expires.
+ */
+ refcount_init(&client->cl_refs, 2);
sx_init(&client->cl_lock, "GSS-client");
getcredhostid(curthread->td_ucred, &hostid);
client->cl_id.ci_hostid = hostid;
client->cl_id.ci_boottime = boottime.tv_sec;
client->cl_id.ci_id = svc_rpc_gss_next_clientid++;
- list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE];
- sx_xlock(&svc_rpc_gss_lock);
- TAILQ_INSERT_HEAD(list, client, cl_link);
- TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink);
- svc_rpc_gss_client_count++;
- sx_xunlock(&svc_rpc_gss_lock);
/*
* Start the client off with a short expiration time. We will
@@ -564,6 +563,12 @@ svc_rpc_gss_create_client(void)
client->cl_locked = FALSE;
client->cl_expiration = time_uptime + 5*60;
+ list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE];
+ sx_xlock(&svc_rpc_gss_lock);
+ TAILQ_INSERT_HEAD(list, client, cl_link);
+ TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink);
+ svc_rpc_gss_client_count++;
+ sx_xunlock(&svc_rpc_gss_lock);
return (client);
}
@@ -1261,7 +1266,6 @@ svc_rpc_gss(struct svc_req *rqst, struct rpc_msg *msg)
goto out;
}
client = svc_rpc_gss_create_client();
- refcount_acquire(&client->cl_refs);
} else {
struct svc_rpc_gss_clientid *p;
if (gc.gc_handle.length != sizeof(*p)) {
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:07:04 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84777DD40B;
Tue, 3 Sep 2019 14:07:04 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N8074jQZz4QC8;
Tue, 3 Sep 2019 14:07:03 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 29F431B016; Tue, 3 Sep 2019 14:06:27 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 8BF651E821;
Thu, 18 Apr 2019 02:54:10 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 30B7371B3F;
Thu, 18 Apr 2019 02:54:10 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 1A8CC1E81F; Thu, 18 Apr 2019 02:54:10 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id CDF5F1E81D
for ;
Thu, 18 Apr 2019 02:54:07 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 9C4BA71B3A;
Thu, 18 Apr 2019 02:54:07 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77ACB18AF6;
Thu, 18 Apr 2019 02:54:07 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3I2s7Cr098908;
Thu, 18 Apr 2019 02:54:07 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3I2s7bS098907;
Thu, 18 Apr 2019 02:54:07 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904180254.x3I2s7bS098907@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
rmacklem@FreeBSD.org using -f
From: Rick Macklem
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r346344 - stable/10/sys/rpc/rpcsec_gss
X-SVN-Group: stable-10
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: stable/10/sys/rpc/rpcsec_gss
X-SVN-Commit-Revision: 346344
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 30B7371B3F
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.97 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.97)[-0.972,0];
NEURAL_HAM_LONG(-1.00)[-1.000,0];
ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:07:05 -0000
X-Original-Date: Thu, 18 Apr 2019 02:54:07 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:07:05 -0000
Author: rmacklem
Date: Thu Apr 18 02:54:07 2019
New Revision: 346344
URL: https://svnweb.freebsd.org/changeset/base/346344
Log:
MFC: r345866
Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled.
The code enabled when "DEBUG" is defined uses mem_alloc(), which is a
malloc(.., M_RPC, M_WAITOK | M_ZERO), but then calls gss_release_buffer()
which does a free(.., M_GSSAPI) to free the memory.
This patch fixes the problem by replacing mem_alloc() with a
malloc(.., M_GSSAPI, M_WAITOK | M_ZERO).
This bug affects almost no one, since the sources are not normally built
with "DEBUG" defined.
Modified:
stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==============================================================================
--- stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Thu Apr 18 02:47:59 2019 (r346343)
+++ stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Thu Apr 18 02:54:07 2019 (r346344)
@@ -738,7 +738,7 @@ gss_oid_to_str(OM_uint32 *minor_status, gss_OID oid, g
* here for "{ " and "}\0".
*/
string_length += 4;
- if ((bp = (char *) mem_alloc(string_length))) {
+ if ((bp = malloc(string_length, M_GSSAPI, M_WAITOK | M_ZERO))) {
strcpy(bp, "{ ");
number = (unsigned long) cp[0];
sprintf(numstr, "%ld ", number/40);
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:07:15 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 377F9DD73D;
Tue, 3 Sep 2019 14:07:15 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N80K6d08z4QNx;
Tue, 3 Sep 2019 14:07:13 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 210261B30D; Tue, 3 Sep 2019 14:06:33 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id AADB716A41;
Sun, 21 Apr 2019 01:16:00 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 7024684140;
Sun, 21 Apr 2019 01:15:59 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 141C7169F7; Sun, 21 Apr 2019 01:15:59 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 88AFE169F5
for ;
Sun, 21 Apr 2019 01:15:56 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 08BB68413B;
Sun, 21 Apr 2019 01:15:56 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D22821E34E;
Sun, 21 Apr 2019 01:15:55 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3L1FtoX046442;
Sun, 21 Apr 2019 01:15:55 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3L1Fsal046438;
Sun, 21 Apr 2019 01:15:54 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904210115.x3L1Fsal046438@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
rmacklem@FreeBSD.org using -f
From: Rick Macklem
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r346466 - in stable/10/sys: fs/nfs modules/nfscommon
X-SVN-Group: stable-10
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: in stable/10/sys: fs/nfs modules/nfscommon
X-SVN-Commit-Revision: 346466
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 7024684140
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.97 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.97)[-0.971,0];
ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:07:15 -0000
X-Original-Date: Sun, 21 Apr 2019 01:15:54 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:07:15 -0000
Author: rmacklem
Date: Sun Apr 21 01:15:54 2019
New Revision: 346466
URL: https://svnweb.freebsd.org/changeset/base/346466
Log:
MFC: r345992, r346087
Add INET6 support for the upcalls to the nfsuserd daemon.
The kernel code uses UDP to do upcalls to the nfsuserd(8) daemon to get
updates to the username<->uid and groupname<->gid mappings.
A change to AF_LOCAL last year had to be reverted, since it could result
in vnode locking issues on the AF_LOCAL socket.
This patch adds INET6 support and the required #ifdef INET and INET6
to the code.
Modified:
stable/10/sys/fs/nfs/nfs.h
stable/10/sys/fs/nfs/nfs_commonport.c
stable/10/sys/fs/nfs/nfs_commonsubs.c
stable/10/sys/fs/nfs/nfs_var.h
stable/10/sys/modules/nfscommon/Makefile
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/fs/nfs/nfs.h
==============================================================================
--- stable/10/sys/fs/nfs/nfs.h Sun Apr 21 00:59:21 2019 (r346465)
+++ stable/10/sys/fs/nfs/nfs.h Sun Apr 21 01:15:54 2019 (r346466)
@@ -212,6 +212,11 @@ struct nfsd_oidargs {
int nid_namelen; /* and its length */
};
+struct nfsuserd_args {
+ sa_family_t nuserd_family; /* Address family to use */
+ u_short nuserd_port; /* Port# */
+};
+
struct nfsd_clid {
int nclid_idlen; /* Length of client id */
u_char nclid_id[NFSV4_OPAQUELIMIT]; /* and name */
Modified: stable/10/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- stable/10/sys/fs/nfs/nfs_commonport.c Sun Apr 21 00:59:21 2019 (r346465)
+++ stable/10/sys/fs/nfs/nfs_commonport.c Sun Apr 21 01:15:54 2019 (r346466)
@@ -536,11 +536,24 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap,
goto out;
} else if (uap->flag & NFSSVC_NFSUSERDPORT) {
u_short sockport;
+ struct nfsuserd_args nargs;
- error = copyin(uap->argp, (caddr_t)&sockport,
- sizeof (u_short));
+ if ((uap->flag & NFSSVC_NEWSTRUCT) == 0) {
+ error = copyin(uap->argp, (caddr_t)&sockport,
+ sizeof (u_short));
+ if (error == 0) {
+ nargs.nuserd_family = AF_INET;
+ nargs.nuserd_port = sockport;
+ }
+ } else {
+ /*
+ * New nfsuserd_args structure, which indicates
+ * which IP version to use along with the port#.
+ */
+ error = copyin(uap->argp, &nargs, sizeof(nargs));
+ }
if (!error)
- error = nfsrv_nfsuserdport(sockport, p);
+ error = nfsrv_nfsuserdport(&nargs, p);
} else if (uap->flag & NFSSVC_NFSUSERDDELPORT) {
nfsrv_nfsuserddelport();
error = 0;
Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- stable/10/sys/fs/nfs/nfs_commonsubs.c Sun Apr 21 00:59:21 2019 (r346465)
+++ stable/10/sys/fs/nfs/nfs_commonsubs.c Sun Apr 21 01:15:54 2019 (r346466)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
* copy data between mbuf chains and uio lists.
*/
#ifndef APPLEKEXT
+#include "opt_inet.h"
#include "opt_inet6.h"
#include
@@ -3071,10 +3072,16 @@ nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len)
* Set the port for the nfsuserd.
*/
APPLESTATIC int
-nfsrv_nfsuserdport(u_short port, NFSPROC_T *p)
+nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p)
{
struct nfssockreq *rp;
+#ifdef INET
struct sockaddr_in *ad;
+#endif
+#ifdef INET6
+ struct sockaddr_in6 *ad6;
+ const struct in6_addr in6loopback = IN6ADDR_LOOPBACK_INIT;
+#endif
int error;
NFSLOCKNAMEID();
@@ -3094,17 +3101,39 @@ nfsrv_nfsuserdport(u_short port, NFSPROC_T *p)
rp->nr_soproto = IPPROTO_UDP;
rp->nr_lock = (NFSR_RESERVEDPORT | NFSR_LOCALHOST);
rp->nr_cred = NULL;
- NFSSOCKADDRALLOC(rp->nr_nam);
- NFSSOCKADDRSIZE(rp->nr_nam, sizeof (struct sockaddr_in));
- ad = NFSSOCKADDR(rp->nr_nam, struct sockaddr_in *);
- ad->sin_family = AF_INET;
- ad->sin_addr.s_addr = htonl((u_int32_t)0x7f000001); /* 127.0.0.1 */
- ad->sin_port = port;
rp->nr_prog = RPCPROG_NFSUSERD;
+ error = 0;
+ switch (nargs->nuserd_family) {
+#ifdef INET
+ case AF_INET:
+ rp->nr_nam = malloc(sizeof(struct sockaddr_in), M_SONAME,
+ M_WAITOK | M_ZERO);
+ ad = (struct sockaddr_in *)rp->nr_nam;
+ ad->sin_len = sizeof(struct sockaddr_in);
+ ad->sin_family = AF_INET;
+ ad->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ ad->sin_port = nargs->nuserd_port;
+ break;
+#endif
+#ifdef INET6
+ case AF_INET6:
+ rp->nr_nam = malloc(sizeof(struct sockaddr_in6), M_SONAME,
+ M_WAITOK | M_ZERO);
+ ad6 = (struct sockaddr_in6 *)rp->nr_nam;
+ ad6->sin6_len = sizeof(struct sockaddr_in6);
+ ad6->sin6_family = AF_INET6;
+ ad6->sin6_addr = in6loopback;
+ ad6->sin6_port = nargs->nuserd_port;
+ break;
+#endif
+ default:
+ error = ENXIO;
+ }
rp->nr_vers = RPCNFSUSERD_VERS;
- error = newnfs_connect(NULL, rp, NFSPROCCRED(p), p, 0);
+ if (error == 0)
+ error = newnfs_connect(NULL, rp, NFSPROCCRED(p), p, 0);
if (error) {
- NFSSOCKADDRFREE(rp->nr_nam);
+ free(rp->nr_nam, M_SONAME);
nfsrv_nfsuserd = 0;
}
out:
Modified: stable/10/sys/fs/nfs/nfs_var.h
==============================================================================
--- stable/10/sys/fs/nfs/nfs_var.h Sun Apr 21 00:59:21 2019 (r346465)
+++ stable/10/sys/fs/nfs/nfs_var.h Sun Apr 21 01:15:54 2019 (r346466)
@@ -130,7 +130,7 @@ int nfsrv_checksetattr(vnode_t, struct nfsrv_descript
NFSPROC_T *);
int nfsrv_checkgetattr(struct nfsrv_descript *, vnode_t,
struct nfsvattr *, nfsattrbit_t *, struct ucred *, NFSPROC_T *);
-int nfsrv_nfsuserdport(u_short, NFSPROC_T *);
+int nfsrv_nfsuserdport(struct nfsuserd_args *, NFSPROC_T *);
void nfsrv_nfsuserddelport(void);
void nfsrv_throwawayallstate(NFSPROC_T *);
int nfsrv_checksequence(struct nfsrv_descript *, uint32_t, uint32_t *,
Modified: stable/10/sys/modules/nfscommon/Makefile
==============================================================================
--- stable/10/sys/modules/nfscommon/Makefile Sun Apr 21 00:59:21 2019 (r346465)
+++ stable/10/sys/modules/nfscommon/Makefile Sun Apr 21 01:15:54 2019 (r346466)
@@ -7,6 +7,7 @@ SRCS= vnode_if.h \
nfs_commonkrpc.c \
nfs_commonport.c \
nfs_commonsubs.c \
+ opt_inet.h \
opt_inet6.h \
opt_kdtrace.h \
opt_kgssapi.h \
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:07:15 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F4BBDD733;
Tue, 3 Sep 2019 14:07:15 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N80L0NFHz4QPB;
Tue, 3 Sep 2019 14:07:14 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 2D66D1B31A; Tue, 3 Sep 2019 14:06:33 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 1EEAF16DD7;
Sun, 21 Apr 2019 01:33:18 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 4A48584AF8;
Sun, 21 Apr 2019 01:33:17 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 1297616D97; Sun, 21 Apr 2019 01:33:17 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 9682316D95
for ;
Sun, 21 Apr 2019 01:33:14 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 5B73A84AF3;
Sun, 21 Apr 2019 01:33:14 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30FCB1E69E;
Sun, 21 Apr 2019 01:33:14 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3L1XDEm057293;
Sun, 21 Apr 2019 01:33:13 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3L1XDfi057292;
Sun, 21 Apr 2019 01:33:13 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904210133.x3L1XDfi057292@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
rmacklem@FreeBSD.org using -f
From: Rick Macklem
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r346468 - stable/10/usr.sbin/nfsuserd
X-SVN-Group: stable-10
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: stable/10/usr.sbin/nfsuserd
X-SVN-Commit-Revision: 346468
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 4A48584AF8
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.95 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.95)[-0.954,0];
ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:07:15 -0000
X-Original-Date: Sun, 21 Apr 2019 01:33:13 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:07:15 -0000
Author: rmacklem
Date: Sun Apr 21 01:33:13 2019
New Revision: 346468
URL: https://svnweb.freebsd.org/changeset/base/346468
Log:
MFC: r345995
Delete the BUGS entry related to failing when jails are enabled.
r345994 has finally fixed the bug that caused the nfsuserd(8) daemon to
fail when jails were enabled, so delete the BUGS entry from the man page.
Modified:
stable/10/usr.sbin/nfsuserd/nfsuserd.8
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8
==============================================================================
--- stable/10/usr.sbin/nfsuserd/nfsuserd.8 Sun Apr 21 01:25:27 2019 (r346467)
+++ stable/10/usr.sbin/nfsuserd/nfsuserd.8 Sun Apr 21 01:33:13 2019 (r346468)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 4, 2017
+.Dd April 6, 2019
.Dt NFSUSERD 8
.Os
.Sh NAME
@@ -126,9 +126,3 @@ those requests fail and the library functions don't re
and
.Xr passwd 5
for more information on how the databases are accessed.
-.Pp
-Since the kernel communicates with the
-.Nm
-daemon via an upcall that uses the IP address 127.0.0.1, it does not work correctly when
-.Xr jail 8
-are used and can crash the system.
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:07:15 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD246DD76A;
Tue, 3 Sep 2019 14:07:15 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N80M0586z4QPq;
Tue, 3 Sep 2019 14:07:14 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 9FF0B1B346; Tue, 3 Sep 2019 14:06:33 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 0EADF1D4AF;
Sun, 21 Apr 2019 14:45:22 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 3061474665;
Sun, 21 Apr 2019 14:45:21 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 100D51D473; Sun, 21 Apr 2019 14:45:21 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id DFADE1D471
for ;
Sun, 21 Apr 2019 14:45:18 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 98B5C7465F;
Sun, 21 Apr 2019 14:45:18 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73B1026C9D;
Sun, 21 Apr 2019 14:45:18 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3LEjIdp072203;
Sun, 21 Apr 2019 14:45:18 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3LEjIet072202;
Sun, 21 Apr 2019 14:45:18 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904211445.x3LEjIet072202@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
rmacklem@FreeBSD.org using -f
From: Rick Macklem
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r346487 - stable/10/usr.sbin/nfsuserd
X-SVN-Group: stable-10
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: stable/10/usr.sbin/nfsuserd
X-SVN-Commit-Revision: 346487
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 3061474665
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.95 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
NEURAL_HAM_SHORT(-0.96)[-0.955,0];
ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:07:16 -0000
X-Original-Date: Sun, 21 Apr 2019 14:45:18 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:07:16 -0000
Author: rmacklem
Date: Sun Apr 21 14:45:18 2019
New Revision: 346487
URL: https://svnweb.freebsd.org/changeset/base/346487
Log:
Fix Makefile after r346467 merged incorrect include file.
Modified:
stable/10/usr.sbin/nfsuserd/Makefile
Modified: stable/10/usr.sbin/nfsuserd/Makefile
==============================================================================
--- stable/10/usr.sbin/nfsuserd/Makefile Sun Apr 21 10:33:09 2019 (r346486)
+++ stable/10/usr.sbin/nfsuserd/Makefile Sun Apr 21 14:45:18 2019 (r346487)
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include
+.include
PROG= nfsuserd
MAN= nfsuserd.8
From owner-svn-src-stable-10@freebsd.org Tue Sep 3 14:07:15 2019
Return-Path:
Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54B65DD750;
Tue, 3 Sep 2019 14:07:15 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 46N80L1fzzz4QPJ;
Tue, 3 Sep 2019 14:07:14 +0000 (UTC)
(envelope-from yuripv@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1452)
id 2948C1B317; Tue, 3 Sep 2019 14:06:33 +0000 (UTC)
X-Original-To: yuripv@localmail.freebsd.org
Delivered-To: yuripv@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id AC28816C2A;
Sun, 21 Apr 2019 01:25:31 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
[IPv6:2610:1c1:1:6074::16:84])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "freefall.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 307B5846C1;
Sun, 21 Apr 2019 01:25:31 +0000 (UTC)
(envelope-from owner-src-committers@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 538)
id 0EEF916C28; Sun, 21 Apr 2019 01:25:31 +0000 (UTC)
Delivered-To: src-committers@localmail.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mx1.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by freefall.freebsd.org (Postfix) with ESMTPS id 5ACCF16C26
for ;
Sun, 21 Apr 2019 01:25:28 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
[IPv6:2610:1c1:1:606c::19:3])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
server-signature RSA-PSS (4096 bits)
client-signature RSA-PSS (4096 bits) client-digest SHA256)
(Client CN "mxrelay.nyi.freebsd.org",
Issuer "Let's Encrypt Authority X3" (verified OK))
by mx1.freebsd.org (Postfix) with ESMTPS id 0FC08846BE;
Sun, 21 Apr 2019 01:25:28 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
[IPv6:2610:1c1:1:6068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client did not present a certificate)
by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCB891E4F8;
Sun, 21 Apr 2019 01:25:27 +0000 (UTC)
(envelope-from rmacklem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3L1PR0T052391;
Sun, 21 Apr 2019 01:25:27 GMT (envelope-from rmacklem@FreeBSD.org)
Received: (from rmacklem@localhost)
by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3L1PRsb052390;
Sun, 21 Apr 2019 01:25:27 GMT (envelope-from rmacklem@FreeBSD.org)
Message-Id: <201904210125.x3L1PRsb052390@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to
rmacklem@FreeBSD.org using -f
From: Rick Macklem
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r346467 - stable/10/usr.sbin/nfsuserd
X-SVN-Group: stable-10
X-SVN-Commit-Author: rmacklem
X-SVN-Commit-Paths: stable/10/usr.sbin/nfsuserd
X-SVN-Commit-Revision: 346467
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Loop: FreeBSD.org
Sender: owner-src-committers@freebsd.org
X-Rspamd-Queue-Id: 307B5846C1
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.97 / 15.00];
local_wl_from(0.00)[freebsd.org];
NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
NEURAL_HAM_SHORT(-0.97)[-0.973,0];
ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
NEURAL_HAM_LONG(-1.00)[-1.000,0]
Status: O
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.29
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Date: Tue, 03 Sep 2019 14:07:16 -0000
X-Original-Date: Sun, 21 Apr 2019 01:25:27 +0000 (UTC)
X-List-Received-Date: Tue, 03 Sep 2019 14:07:16 -0000
Author: rmacklem
Date: Sun Apr 21 01:25:27 2019
New Revision: 346467
URL: https://svnweb.freebsd.org/changeset/base/346467
Log:
MFC: r345994
Fix nfsuserd so that it handles the mapped localhost address when jails
are enabled.
The nfsuserd(8) daemon does not function correctly when jails are enabled,
since localhost gets mapped to another IP address and, as such, the upcall
RPC fails.
This patch fixes the problem by doing a getsockname(2) of a socket mapped
to localhost to find out what the correct address is for the comparison
test with the upcall's from IP address.
This patch also adds INET6 support and the required #ifdef's for INET and
INET6. It now uses INET6 by default for the upcalls, if the kernel has
INET6 support and the daemon is also built with INET6 support.
Modified:
stable/10/usr.sbin/nfsuserd/Makefile
stable/10/usr.sbin/nfsuserd/nfsuserd.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/nfsuserd/Makefile
==============================================================================
--- stable/10/usr.sbin/nfsuserd/Makefile Sun Apr 21 01:15:54 2019 (r346466)
+++ stable/10/usr.sbin/nfsuserd/Makefile Sun Apr 21 01:25:27 2019 (r346467)
@@ -1,7 +1,16 @@
# $FreeBSD$
+.include
+
PROG= nfsuserd
MAN= nfsuserd.8
WARNS?= 3
+
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+= -DINET
+.endif
+.if ${MK_INET6_SUPPORT} != "no"
+CFLAGS+= -DINET6
+.endif
.include
Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.c
==============================================================================
--- stable/10/usr.sbin/nfsuserd/nfsuserd.c Sun Apr 21 01:15:54 2019 (r346466)
+++ stable/10/usr.sbin/nfsuserd/nfsuserd.c Sun Apr 21 01:25:27 2019 (r346467)
@@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$");
#include
#include
+#include
+
+#include
+
#include
#include
@@ -72,6 +76,7 @@ static void nfsuserdsrv(struct svc_req *, SVCXPRT *);
static bool_t xdr_getid(XDR *, caddr_t);
static bool_t xdr_getname(XDR *, caddr_t);
static bool_t xdr_retval(XDR *, caddr_t);
+static int nfsbind_localhost(void);
#define MAXNAME 1024
#define MAXNFSUSERD 20
@@ -94,6 +99,10 @@ gid_t defaultgid = 65533;
int verbose = 0, im_a_slave = 0, nfsuserdcnt = -1, forcestart = 0;
int defusertimeout = DEFUSERTIMEOUT, manage_gids = 0;
pid_t slaves[MAXNFSUSERD];
+static struct sockaddr_storage fromip;
+#ifdef INET6
+static struct in6_addr in6loopback = IN6ADDR_LOOPBACK_INIT;
+#endif
int
main(int argc, char *argv[])
@@ -105,13 +114,20 @@ main(int argc, char *argv[])
struct group *grp;
int sock, one = 1;
SVCXPRT *udptransp;
- u_short portnum;
+ struct nfsuserd_args nargs;
sigset_t signew;
char hostname[MAXHOSTNAMELEN + 1], *cp;
struct addrinfo *aip, hints;
static uid_t check_dups[MAXUSERMAX];
gid_t grps[NGROUPS];
int ngroup;
+#ifdef INET
+ struct sockaddr_in *sin;
+#endif
+#ifdef INET6
+ struct sockaddr_in6 *sin6;
+#endif
+ int s;
if (modfind("nfscommon") < 0) {
/* Not present in kernel, try loading it */
@@ -144,6 +160,37 @@ main(int argc, char *argv[])
}
}
}
+
+ /*
+ * See if this server handles IPv4 or IPv6 and set up the default
+ * localhost address.
+ */
+ s = -1;
+#ifdef INET6
+ s = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (s >= 0) {
+ fromip.ss_family = AF_INET6;
+ fromip.ss_len = sizeof(struct sockaddr_in6);
+ sin6 = (struct sockaddr_in6 *)&fromip;
+ sin6->sin6_addr = in6loopback;
+ close(s);
+ }
+#endif /* INET6 */
+#ifdef INET
+ if (s < 0) {
+ s = socket(PF_INET, SOCK_DGRAM, 0);
+ if (s >= 0) {
+ fromip.ss_family = AF_INET;
+ fromip.ss_len = sizeof(struct sockaddr_in);
+ sin = (struct sockaddr_in *)&fromip;
+ sin->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ close(s);
+ }
+ }
+#endif /* INET */
+ if (s < 0)
+ err(1, "Can't create a inet/inet6 socket");
+
nid.nid_usermax = DEFUSERMAX;
nid.nid_usertimeout = defusertimeout;
@@ -245,11 +292,12 @@ main(int argc, char *argv[])
for (i = 0; i < nfsuserdcnt; i++)
slaves[i] = (pid_t)-1;
+ nargs.nuserd_family = fromip.ss_family;
/*
* Set up the service port to accept requests via UDP from
- * localhost (127.0.0.1).
+ * localhost (INADDR_LOOPBACK or IN6ADDR_LOOPBACK_INIT).
*/
- if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+ if ((sock = socket(nargs.nuserd_family, SOCK_DGRAM, IPPROTO_UDP)) < 0)
err(1, "cannot create udp socket");
/*
@@ -272,11 +320,11 @@ main(int argc, char *argv[])
/*
* Tell the kernel what my port# is.
*/
- portnum = htons(udptransp->xp_port);
+ nargs.nuserd_port = htons(udptransp->xp_port);
#ifdef DEBUG
- printf("portnum=0x%x\n", portnum);
+ printf("portnum=0x%x\n", nargs.nuserd_port);
#else
- if (nfssvc(NFSSVC_NFSUSERDPORT, (caddr_t)&portnum) < 0) {
+ if (nfssvc(NFSSVC_NFSUSERDPORT | NFSSVC_NEWSTRUCT, &nargs) < 0) {
if (errno == EPERM) {
fprintf(stderr,
"Can't start nfsuserd when already running");
@@ -455,27 +503,92 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
struct passwd *pwd;
struct group *grp;
int error;
+#if defined(INET) || defined(INET6)
u_short sport;
+ int ret;
+#endif
struct info info;
struct nfsd_idargs nid;
- u_int32_t saddr;
gid_t grps[NGROUPS];
int ngroup;
+#ifdef INET
+ struct sockaddr_in *fromsin, *sin;
+#endif
+#ifdef INET6
+ struct sockaddr_in6 *fromsin6, *sin6;
+ char buf[INET6_ADDRSTRLEN];
+#endif
/*
- * Only handle requests from 127.0.0.1 on a reserved port number.
+ * Only handle requests from localhost on a reserved port number.
+ * If the upcall is from a different address, call nfsbind_localhost()
+ * to check for a remapping of localhost, due to jails.
* (Since a reserved port # at localhost implies a client with
* local root, there won't be a security breach. This is about
* the only case I can think of where a reserved port # means
* something.)
*/
- sport = ntohs(transp->xp_raddr.sin_port);
- saddr = ntohl(transp->xp_raddr.sin_addr.s_addr);
- if ((rqstp->rq_proc != NULLPROC && sport >= IPPORT_RESERVED) ||
- saddr != 0x7f000001) {
- syslog(LOG_ERR, "req from ip=0x%x port=%d\n", saddr, sport);
- svcerr_weakauth(transp);
- return;
+ if (rqstp->rq_proc != NULLPROC) {
+ switch (fromip.ss_family) {
+#ifdef INET
+ case AF_INET:
+ if (transp->xp_rtaddr.len < sizeof(*sin)) {
+ syslog(LOG_ERR, "xp_rtaddr too small");
+ svcerr_weakauth(transp);
+ return;
+ }
+ sin = (struct sockaddr_in *)transp->xp_rtaddr.buf;
+ fromsin = (struct sockaddr_in *)&fromip;
+ sport = ntohs(sin->sin_port);
+ if (sport >= IPPORT_RESERVED) {
+ syslog(LOG_ERR, "not a reserved port#");
+ svcerr_weakauth(transp);
+ return;
+ }
+ ret = 1;
+ if (sin->sin_addr.s_addr != fromsin->sin_addr.s_addr)
+ ret = nfsbind_localhost();
+ if (ret == 0 || sin->sin_addr.s_addr !=
+ fromsin->sin_addr.s_addr) {
+ syslog(LOG_ERR, "bad from ip %s",
+ inet_ntoa(sin->sin_addr));
+ svcerr_weakauth(transp);
+ return;
+ }
+ break;
+#endif /* INET */
+#ifdef INET6
+ case AF_INET6:
+ if (transp->xp_rtaddr.len < sizeof(*sin6)) {
+ syslog(LOG_ERR, "xp_rtaddr too small");
+ svcerr_weakauth(transp);
+ return;
+ }
+ sin6 = (struct sockaddr_in6 *)transp->xp_rtaddr.buf;
+ fromsin6 = (struct sockaddr_in6 *)&fromip;
+ sport = ntohs(sin6->sin6_port);
+ if (sport >= IPV6PORT_RESERVED) {
+ syslog(LOG_ERR, "not a reserved port#");
+ svcerr_weakauth(transp);
+ return;
+ }
+ ret = 1;
+ if (!IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr,
+ &fromsin6->sin6_addr))
+ ret = nfsbind_localhost();
+ if (ret == 0 || !IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr,
+ &fromsin6->sin6_addr)) {
+ if (inet_ntop(AF_INET6, &sin6->sin6_addr, buf,
+ INET6_ADDRSTRLEN) != NULL)
+ syslog(LOG_ERR, "bad from ip %s", buf);
+ else
+ syslog(LOG_ERR, "bad from ip6 addr");
+ svcerr_weakauth(transp);
+ return;
+ }
+ break;
+#endif /* INET6 */
+ }
}
switch (rqstp->rq_proc) {
case NULLPROC:
@@ -714,6 +827,67 @@ cleanup_term(int signo __unused)
exit(1);
}
exit(0);
+}
+
+/*
+ * Get the IP address that the localhost address maps to.
+ * This is needed when jails map localhost to another IP address.
+ */
+static int
+nfsbind_localhost(void)
+{
+#ifdef INET
+ struct sockaddr_in sin;
+#endif
+#ifdef INET6
+ struct sockaddr_in6 sin6;
+#endif
+ socklen_t slen;
+ int ret, s;
+
+ switch (fromip.ss_family) {
+#ifdef INET6
+ case AF_INET6:
+ s = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (s < 0)
+ return (0);
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_len = sizeof(sin6);
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_addr = in6loopback;
+ sin6.sin6_port = 0;
+ ret = bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
+ if (ret < 0) {
+ close(s);
+ return (0);
+ }
+ break;
+#endif /* INET6 */
+#ifdef INET
+ case AF_INET:
+ s = socket(PF_INET, SOCK_DGRAM, 0);
+ if (s < 0)
+ return (0);
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ sin.sin_port = 0;
+ ret = bind(s, (struct sockaddr *)&sin, sizeof(sin));
+ if (ret < 0) {
+ close(s);
+ return (0);
+ }
+ break;
+#endif /* INET */
+ }
+ memset(&fromip, 0, sizeof(fromip));
+ slen = sizeof(fromip);
+ ret = getsockname(s, (struct sockaddr *)&fromip, &slen);
+ close(s);
+ if (ret < 0)
+ return (0);
+ return (1);
}
static void