Re: svn commit: r365619 - in stable/12/sys: conf sys

2021-01-14 Thread Xin Li via svn-src-all
On 1/14/21 06:17, Kyle Evans wrote:
> On Thu, Sep 10, 2020 at 7:04 PM Glen Barber  wrote:
>>
>> Author: gjb
>> Date: Fri Sep 11 00:04:23 2020
>> New Revision: 365619
>> URL: https://svnweb.freebsd.org/changeset/base/365619
>>
>> Log:
>>   Rename stable/12 to -STABLE, and bump __FreeBSD_version after
>>   releng/12.2 had been created.
>>
> 
> I had wondered this before, and now I wonder again after a recent
> pkgbase discussion about versioning schemes. Why do we rename stable
> to -PRERELEASE at all? It's decidedly a (minor) downgrade to try to go
> from -PRERELEASE to -RELEASE since anyone that manages to get a
> -PRERELEASE build is still along -STABLE.

-PRERELEASE indicates that the stable branch is currently in code freeze
in preparation of a release.  The expectation here is that whatever you
are seeing in the build would end up in an upcoming release (X.Y),
unless they were reverted (for -STABLE, they would go to the next
release, or X.Y+1, or never, if X.Y is the last release).

I believe traditionally we also bump __FreeBSD_version when -STABLE
become -PRERELEASE, which typically happens when we enter a code freeze,
but more recent -STABLE branches seems to have moved to doing
__FreeBSD_version bumps at the time of -BETA, but technically I think we
do want to bump __FreeBSD_version as early as we promoted -STABLE to
-PRERELEASE to match the hardcoded version number...

Cheers,



OpenPGP_signature
Description: OpenPGP digital signature


svn commit: r368751 - in head/contrib/unbound: services util

2020-12-17 Thread Xin LI
Author: delphij
Date: Fri Dec 18 04:23:20 2020
New Revision: 368751
URL: https://svnweb.freebsd.org/changeset/base/368751

Log:
  MFV r368746:
  
  Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69:
  
  Fix error cases when udp-connect is set and send() returns an error
  
  Obtained from:unbound git
  MFC after:3 days

Modified:
  head/contrib/unbound/services/authzone.c
  head/contrib/unbound/services/outside_network.c
  head/contrib/unbound/util/netevent.c
  head/contrib/unbound/util/netevent.h
Directory Properties:
  head/contrib/unbound/   (props changed)

Modified: head/contrib/unbound/services/authzone.c
==
--- head/contrib/unbound/services/authzone.cFri Dec 18 04:01:05 2020
(r368750)
+++ head/contrib/unbound/services/authzone.cFri Dec 18 04:23:20 2020
(r368751)
@@ -6093,7 +6093,7 @@ xfr_probe_send_probe(struct auth_xfer* xfr, struct mod
 
/* send udp packet */
if(!comm_point_send_udp_msg(xfr->task_probe->cp, env->scratch_buffer,
-   (struct sockaddr*)&addr, addrlen)) {
+   (struct sockaddr*)&addr, addrlen, 0)) {
char zname[255+1], as[256];
dname_str(xfr->name, zname);
addr_to_str(&addr, addrlen, as, sizeof(as));

Modified: head/contrib/unbound/services/outside_network.c
==
--- head/contrib/unbound/services/outside_network.c Fri Dec 18 04:01:05 
2020(r368750)
+++ head/contrib/unbound/services/outside_network.c Fri Dec 18 04:23:20 
2020(r368751)
@@ -1870,17 +1870,10 @@ randomize_and_send_udp(struct pending* pend, sldns_buf
log_assert(pend->pc && pend->pc->cp);
 
/* send it over the commlink */
-   if(outnet->udp_connect) {
-   if(!comm_point_send_udp_msg(pend->pc->cp, packet, NULL, 0)) {
-   portcomm_loweruse(outnet, pend->pc);
-   return 0;
-   }
-   } else {
-   if(!comm_point_send_udp_msg(pend->pc->cp, packet,
-   (struct sockaddr*)&pend->addr, pend->addrlen)) {
-   portcomm_loweruse(outnet, pend->pc);
-   return 0;
-   }
+   if(!comm_point_send_udp_msg(pend->pc->cp, packet,
+   (struct sockaddr*)&pend->addr, pend->addrlen, 
outnet->udp_connect)) {
+   portcomm_loweruse(outnet, pend->pc);
+   return 0;
}
 
/* system calls to set timeout after sending UDP to make roundtrip

Modified: head/contrib/unbound/util/netevent.c
==
--- head/contrib/unbound/util/netevent.cFri Dec 18 04:01:05 2020
(r368750)
+++ head/contrib/unbound/util/netevent.cFri Dec 18 04:23:20 2020
(r368751)
@@ -333,7 +333,7 @@ int tcp_connect_errno_needs_log(struct sockaddr* addr,
 /* send a UDP reply */
 int
 comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
-   struct sockaddr* addr, socklen_t addrlen) 
+   struct sockaddr* addr, socklen_t addrlen, int is_connected)
 {
ssize_t sent;
log_assert(c->fd != -1);
@@ -341,8 +341,8 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_bu
if(sldns_buffer_remaining(packet) == 0)
log_err("error: send empty UDP packet");
 #endif
-   if(addr) {
-   log_assert(addr && addrlen > 0);
+   log_assert(addr && addrlen > 0);
+   if(!is_connected) {
sent = sendto(c->fd, (void*)sldns_buffer_begin(packet),
sldns_buffer_remaining(packet), 0,
addr, addrlen);
@@ -367,9 +367,14 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_bu
 #endif
int e;
fd_set_block(c->fd);
-   sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), 
-   sldns_buffer_remaining(packet), 0,
-   addr, addrlen);
+   if (!is_connected) {
+   sent = sendto(c->fd, 
(void*)sldns_buffer_begin(packet),
+   sldns_buffer_remaining(packet), 0,
+   addr, addrlen);
+   } else {
+   sent = send(c->fd, 
(void*)sldns_buffer_begin(packet),
+   sldns_buffer_remaining(packet), 0);
+   }
e = errno;
fd_set_nonblock(c->fd);
errno = e;
@@ -378,8 +383,12 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_bu
if(sent == -1) {
if(!udp_send_errno_needs_log(addr, addrlen))
return 0;
-   verbose(VERB_O

svn commit: r368746 - in vendor/unbound/dist: services testcode util

2020-12-17 Thread Xin LI
Author: delphij
Date: Thu Dec 17 23:35:18 2020
New Revision: 368746
URL: https://svnweb.freebsd.org/changeset/base/368746

Log:
  Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69:
  
  Fix error cases when udp-connect is set and send() returns an error
  
  Approved by:  git-admin (uqs)

Modified:
  vendor/unbound/dist/services/authzone.c
  vendor/unbound/dist/services/outside_network.c
  vendor/unbound/dist/testcode/fake_event.c
  vendor/unbound/dist/util/netevent.c
  vendor/unbound/dist/util/netevent.h

Modified: vendor/unbound/dist/services/authzone.c
==
--- vendor/unbound/dist/services/authzone.c Thu Dec 17 22:53:45 2020
(r368745)
+++ vendor/unbound/dist/services/authzone.c Thu Dec 17 23:35:18 2020
(r368746)
@@ -6093,7 +6093,7 @@ xfr_probe_send_probe(struct auth_xfer* xfr, struct mod
 
/* send udp packet */
if(!comm_point_send_udp_msg(xfr->task_probe->cp, env->scratch_buffer,
-   (struct sockaddr*)&addr, addrlen)) {
+   (struct sockaddr*)&addr, addrlen, 0)) {
char zname[255+1], as[256];
dname_str(xfr->name, zname);
addr_to_str(&addr, addrlen, as, sizeof(as));

Modified: vendor/unbound/dist/services/outside_network.c
==
--- vendor/unbound/dist/services/outside_network.c  Thu Dec 17 22:53:45 
2020(r368745)
+++ vendor/unbound/dist/services/outside_network.c  Thu Dec 17 23:35:18 
2020(r368746)
@@ -1870,17 +1870,10 @@ randomize_and_send_udp(struct pending* pend, sldns_buf
log_assert(pend->pc && pend->pc->cp);
 
/* send it over the commlink */
-   if(outnet->udp_connect) {
-   if(!comm_point_send_udp_msg(pend->pc->cp, packet, NULL, 0)) {
-   portcomm_loweruse(outnet, pend->pc);
-   return 0;
-   }
-   } else {
-   if(!comm_point_send_udp_msg(pend->pc->cp, packet,
-   (struct sockaddr*)&pend->addr, pend->addrlen)) {
-   portcomm_loweruse(outnet, pend->pc);
-   return 0;
-   }
+   if(!comm_point_send_udp_msg(pend->pc->cp, packet,
+   (struct sockaddr*)&pend->addr, pend->addrlen, 
outnet->udp_connect)) {
+   portcomm_loweruse(outnet, pend->pc);
+   return 0;
}
 
/* system calls to set timeout after sending UDP to make roundtrip

Modified: vendor/unbound/dist/testcode/fake_event.c
==
--- vendor/unbound/dist/testcode/fake_event.c   Thu Dec 17 22:53:45 2020
(r368745)
+++ vendor/unbound/dist/testcode/fake_event.c   Thu Dec 17 23:35:18 2020
(r368746)
@@ -1765,7 +1765,7 @@ struct comm_point* outnet_comm_point_for_http(struct o
 }
 
 int comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
-   struct sockaddr* addr, socklen_t addrlen) 
+   struct sockaddr* addr, socklen_t addrlen, int ATTR_UNUSED(is_connected))
 {
struct fake_commpoint* fc = (struct fake_commpoint*)c;
struct replay_runtime* runtime = fc->runtime;

Modified: vendor/unbound/dist/util/netevent.c
==
--- vendor/unbound/dist/util/netevent.c Thu Dec 17 22:53:45 2020
(r368745)
+++ vendor/unbound/dist/util/netevent.c Thu Dec 17 23:35:18 2020
(r368746)
@@ -333,7 +333,7 @@ int tcp_connect_errno_needs_log(struct sockaddr* addr,
 /* send a UDP reply */
 int
 comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
-   struct sockaddr* addr, socklen_t addrlen) 
+   struct sockaddr* addr, socklen_t addrlen, int is_connected)
 {
ssize_t sent;
log_assert(c->fd != -1);
@@ -341,8 +341,8 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_bu
if(sldns_buffer_remaining(packet) == 0)
log_err("error: send empty UDP packet");
 #endif
-   if(addr) {
-   log_assert(addr && addrlen > 0);
+   log_assert(addr && addrlen > 0);
+   if(!is_connected) {
sent = sendto(c->fd, (void*)sldns_buffer_begin(packet),
sldns_buffer_remaining(packet), 0,
addr, addrlen);
@@ -367,9 +367,14 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_bu
 #endif
int e;
fd_set_block(c->fd);
-   sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), 
-   sldns_buffer_remaining(packet), 0,
-   addr, addrlen);
+   if (!is_connected) {
+   sent = sendto(c->fd, 
(void*)sldns_buffer_begin(packet),
+   sldns_buffer_remaining(p

svn commit: r368574 - head/bin/setfacl

2020-12-11 Thread Xin LI
Author: delphij
Date: Sat Dec 12 02:26:43 2020
New Revision: 368574
URL: https://svnweb.freebsd.org/changeset/base/368574

Log:
  Remove unused headers.
  
  MFC after:2 weeks

Modified:
  head/bin/setfacl/mask.c
  head/bin/setfacl/merge.c
  head/bin/setfacl/remove.c
  head/bin/setfacl/util.c

Modified: head/bin/setfacl/mask.c
==
--- head/bin/setfacl/mask.c Sat Dec 12 02:24:33 2020(r368573)
+++ head/bin/setfacl/mask.c Sat Dec 12 02:26:43 2020(r368574)
@@ -32,9 +32,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
-#include 
-#include 
 
 #include "setfacl.h"
 

Modified: head/bin/setfacl/merge.c
==
--- head/bin/setfacl/merge.cSat Dec 12 02:24:33 2020(r368573)
+++ head/bin/setfacl/merge.cSat Dec 12 02:26:43 2020(r368574)
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 
 #include "setfacl.h"
 

Modified: head/bin/setfacl/remove.c
==
--- head/bin/setfacl/remove.c   Sat Dec 12 02:24:33 2020(r368573)
+++ head/bin/setfacl/remove.c   Sat Dec 12 02:26:43 2020(r368574)
@@ -32,8 +32,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
-#include 
 
 #include "setfacl.h"
 

Modified: head/bin/setfacl/util.c
==
--- head/bin/setfacl/util.c Sat Dec 12 02:24:33 2020(r368573)
+++ head/bin/setfacl/util.c Sat Dec 12 02:26:43 2020(r368574)
@@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 
 #include "setfacl.h"
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368573 - head/bin/stty

2020-12-11 Thread Xin LI
Author: delphij
Date: Sat Dec 12 02:24:33 2020
New Revision: 368573
URL: https://svnweb.freebsd.org/changeset/base/368573

Log:
  Remove unneeded headers.
  
  MFC after:2 weeks

Modified:
  head/bin/stty/cchar.c
  head/bin/stty/key.c
  head/bin/stty/modes.c
  head/bin/stty/stty.c
  head/bin/stty/util.c

Modified: head/bin/stty/cchar.c
==
--- head/bin/stty/cchar.c   Sat Dec 12 01:05:31 2020(r368572)
+++ head/bin/stty/cchar.c   Sat Dec 12 02:24:33 2020(r368573)
@@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 

Modified: head/bin/stty/key.c
==
--- head/bin/stty/key.c Sat Dec 12 01:05:31 2020(r368572)
+++ head/bin/stty/key.c Sat Dec 12 02:24:33 2020(r368573)
@@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/bin/stty/modes.c
==
--- head/bin/stty/modes.c   Sat Dec 12 01:05:31 2020(r368572)
+++ head/bin/stty/modes.c   Sat Dec 12 02:24:33 2020(r368573)
@@ -36,7 +36,6 @@ static char sccsid[] = "@(#)modes.c   8.3 (Berkeley) 4/2
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 #include "stty.h"
 

Modified: head/bin/stty/stty.c
==
--- head/bin/stty/stty.cSat Dec 12 01:05:31 2020(r368572)
+++ head/bin/stty/stty.cSat Dec 12 02:24:33 2020(r368573)
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/bin/stty/util.c
==
--- head/bin/stty/util.cSat Dec 12 01:05:31 2020(r368572)
+++ head/bin/stty/util.cSat Dec 12 02:24:33 2020(r368573)
@@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
-#include 
 #include 
 
 #include "stty.h"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367516 - stable/11/contrib/less

2020-11-08 Thread Xin LI
Author: delphij
Date: Mon Nov  9 05:20:02 2020
New Revision: 367516
URL: https://svnweb.freebsd.org/changeset/base/367516

Log:
  MFC r367005: MFV r366990: less v563.
  
  Relnotes: yes

Modified:
  stable/11/contrib/less/NEWS
  stable/11/contrib/less/README
  stable/11/contrib/less/brac.c
  stable/11/contrib/less/ch.c
  stable/11/contrib/less/charset.c
  stable/11/contrib/less/charset.h
  stable/11/contrib/less/cmd.h
  stable/11/contrib/less/cmdbuf.c
  stable/11/contrib/less/command.c
  stable/11/contrib/less/compose.uni
  stable/11/contrib/less/cvt.c
  stable/11/contrib/less/decode.c
  stable/11/contrib/less/edit.c
  stable/11/contrib/less/filename.c
  stable/11/contrib/less/fmt.uni
  stable/11/contrib/less/forwback.c
  stable/11/contrib/less/funcs.h
  stable/11/contrib/less/help.c
  stable/11/contrib/less/ifile.c
  stable/11/contrib/less/input.c
  stable/11/contrib/less/jump.c
  stable/11/contrib/less/less.h
  stable/11/contrib/less/less.nro
  stable/11/contrib/less/lessecho.c
  stable/11/contrib/less/lessecho.nro
  stable/11/contrib/less/lesskey.c
  stable/11/contrib/less/lesskey.h
  stable/11/contrib/less/lesskey.nro
  stable/11/contrib/less/lglob.h
  stable/11/contrib/less/line.c
  stable/11/contrib/less/linenum.c
  stable/11/contrib/less/lsystem.c
  stable/11/contrib/less/main.c
  stable/11/contrib/less/mark.c
  stable/11/contrib/less/mkutable
  stable/11/contrib/less/optfunc.c
  stable/11/contrib/less/option.c
  stable/11/contrib/less/option.h
  stable/11/contrib/less/opttbl.c
  stable/11/contrib/less/os.c
  stable/11/contrib/less/output.c
  stable/11/contrib/less/pattern.c
  stable/11/contrib/less/pattern.h
  stable/11/contrib/less/pckeys.h
  stable/11/contrib/less/position.c
  stable/11/contrib/less/position.h
  stable/11/contrib/less/prompt.c
  stable/11/contrib/less/screen.c
  stable/11/contrib/less/scrsize.c
  stable/11/contrib/less/search.c
  stable/11/contrib/less/signal.c
  stable/11/contrib/less/tags.c
  stable/11/contrib/less/ttyin.c
  stable/11/contrib/less/ubin.uni
  stable/11/contrib/less/version.c
  stable/11/contrib/less/wide.uni
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/less/NEWS
==
--- stable/11/contrib/less/NEWS Mon Nov  9 05:17:23 2020(r367515)
+++ stable/11/contrib/less/NEWS Mon Nov  9 05:20:02 2020(r367516)
@@ -11,6 +11,31 @@
 
 ==
 
+   Major changes between "less" versions 551 and 563
+
+* Update Unicode tables.
+
+* Treat Hangul Jamo medial vowels and final consonants as zero width.
+
+* Display error message immediately when -o is toggled and 
+  input is not a pipe.
+
+* Fix regression: make screen repaint when "squished" and 
+  a no-movement command is given.
+
+* Fix erroneous EOF calculation when F command is interrupted.
+
+* Make WIN32C version include this fix from 551:
+  Don't count lines in initial screen if using -X with -F.
+
+* Fix display bug in WIN32C version.
+
+* Fix memory corruption when built with libtermcap.
+
+* Support libtinfow.
+
+==
+
Major changes between "less" versions 530 and 551
 
 * Add --mouse option.

Modified: stable/11/contrib/less/README
==
--- stable/11/contrib/less/README   Mon Nov  9 05:17:23 2020
(r367515)
+++ stable/11/contrib/less/README   Mon Nov  9 05:20:02 2020
(r367516)
@@ -7,9 +7,9 @@
 **
 **
 
-Less, version 551
+Less, version 563
 
-This is the distribution of less, version 551, released 11 Jun 2019.
+This is the distribution of less, version 563, released 13 Jun 2020.
 This program is part of the GNU project (http://www.gnu.org).
 
 This program is free software.  You may redistribute it and/or
@@ -32,6 +32,14 @@ This is the distribution of "less", a paginator simila
 The formatted manual page is in less.man.
 The manual page nroff source is in less.nro.
 Major changes made since the last posted version are in NEWS.
+
+===
+PRE-INSTALLATION (when using git)
+
+If you are building from a clone of a git repository,
+type "make -f Makefile.aut".
+If you are building from a numbered release package (a tar or zip file 
+with a name like less-999.tar.gz or less-999.zip), you should skip this step. 
 
 ===
 INSTALLATION (Unix systems only):

Modified: stable/11/contrib/less/brac.c
==
--- stable/11/contrib/less/brac.c   Mon Nov  9

svn commit: r367515 - stable/12/contrib/less

2020-11-08 Thread Xin LI
Author: delphij
Date: Mon Nov  9 05:17:23 2020
New Revision: 367515
URL: https://svnweb.freebsd.org/changeset/base/367515

Log:
  MFC r367005: MFV r366990: less v563.
  
  Relnotes: yes

Modified:
  stable/12/contrib/less/NEWS
  stable/12/contrib/less/README
  stable/12/contrib/less/brac.c
  stable/12/contrib/less/ch.c
  stable/12/contrib/less/charset.c
  stable/12/contrib/less/charset.h
  stable/12/contrib/less/cmd.h
  stable/12/contrib/less/cmdbuf.c
  stable/12/contrib/less/command.c
  stable/12/contrib/less/compose.uni
  stable/12/contrib/less/cvt.c
  stable/12/contrib/less/decode.c
  stable/12/contrib/less/edit.c
  stable/12/contrib/less/filename.c
  stable/12/contrib/less/fmt.uni
  stable/12/contrib/less/forwback.c
  stable/12/contrib/less/funcs.h
  stable/12/contrib/less/help.c
  stable/12/contrib/less/ifile.c
  stable/12/contrib/less/input.c
  stable/12/contrib/less/jump.c
  stable/12/contrib/less/less.h
  stable/12/contrib/less/less.nro
  stable/12/contrib/less/lessecho.c
  stable/12/contrib/less/lessecho.nro
  stable/12/contrib/less/lesskey.c
  stable/12/contrib/less/lesskey.h
  stable/12/contrib/less/lesskey.nro
  stable/12/contrib/less/lglob.h
  stable/12/contrib/less/line.c
  stable/12/contrib/less/linenum.c
  stable/12/contrib/less/lsystem.c
  stable/12/contrib/less/main.c
  stable/12/contrib/less/mark.c
  stable/12/contrib/less/mkutable
  stable/12/contrib/less/optfunc.c
  stable/12/contrib/less/option.c
  stable/12/contrib/less/option.h
  stable/12/contrib/less/opttbl.c
  stable/12/contrib/less/os.c
  stable/12/contrib/less/output.c
  stable/12/contrib/less/pattern.c
  stable/12/contrib/less/pattern.h
  stable/12/contrib/less/pckeys.h
  stable/12/contrib/less/position.c
  stable/12/contrib/less/position.h
  stable/12/contrib/less/prompt.c
  stable/12/contrib/less/screen.c
  stable/12/contrib/less/scrsize.c
  stable/12/contrib/less/search.c
  stable/12/contrib/less/signal.c
  stable/12/contrib/less/tags.c
  stable/12/contrib/less/ttyin.c
  stable/12/contrib/less/ubin.uni
  stable/12/contrib/less/version.c
  stable/12/contrib/less/wide.uni
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/less/NEWS
==
--- stable/12/contrib/less/NEWS Mon Nov  9 03:02:34 2020(r367514)
+++ stable/12/contrib/less/NEWS Mon Nov  9 05:17:23 2020(r367515)
@@ -11,6 +11,31 @@
 
 ==
 
+   Major changes between "less" versions 551 and 563
+
+* Update Unicode tables.
+
+* Treat Hangul Jamo medial vowels and final consonants as zero width.
+
+* Display error message immediately when -o is toggled and 
+  input is not a pipe.
+
+* Fix regression: make screen repaint when "squished" and 
+  a no-movement command is given.
+
+* Fix erroneous EOF calculation when F command is interrupted.
+
+* Make WIN32C version include this fix from 551:
+  Don't count lines in initial screen if using -X with -F.
+
+* Fix display bug in WIN32C version.
+
+* Fix memory corruption when built with libtermcap.
+
+* Support libtinfow.
+
+==
+
Major changes between "less" versions 530 and 551
 
 * Add --mouse option.

Modified: stable/12/contrib/less/README
==
--- stable/12/contrib/less/README   Mon Nov  9 03:02:34 2020
(r367514)
+++ stable/12/contrib/less/README   Mon Nov  9 05:17:23 2020
(r367515)
@@ -7,9 +7,9 @@
 **
 **
 
-Less, version 551
+Less, version 563
 
-This is the distribution of less, version 551, released 11 Jun 2019.
+This is the distribution of less, version 563, released 13 Jun 2020.
 This program is part of the GNU project (http://www.gnu.org).
 
 This program is free software.  You may redistribute it and/or
@@ -32,6 +32,14 @@ This is the distribution of "less", a paginator simila
 The formatted manual page is in less.man.
 The manual page nroff source is in less.nro.
 Major changes made since the last posted version are in NEWS.
+
+===
+PRE-INSTALLATION (when using git)
+
+If you are building from a clone of a git repository,
+type "make -f Makefile.aut".
+If you are building from a numbered release package (a tar or zip file 
+with a name like less-999.tar.gz or less-999.zip), you should skip this step. 
 
 ===
 INSTALLATION (Unix systems only):

Modified: stable/12/contrib/less/brac.c
==
--- stable/12/contrib/less/brac.c   Mon Nov  9

svn commit: r367513 - stable/11/sys/sys

2020-11-08 Thread Xin LI
Author: delphij
Date: Mon Nov  9 01:57:07 2020
New Revision: 367513
URL: https://svnweb.freebsd.org/changeset/base/367513

Log:
  Bump __FreeBSD_version after ptsname_r addition.

Modified:
  stable/11/sys/sys/param.h

Modified: stable/11/sys/sys/param.h
==
--- stable/11/sys/sys/param.h   Mon Nov  9 01:56:06 2020(r367512)
+++ stable/11/sys/sys/param.h   Mon Nov  9 01:57:07 2020(r367513)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1104509  /* Master, propagated to newvers */
+#define __FreeBSD_version 1104510  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367512 - in stable/11: include lib/libc/stdlib

2020-11-08 Thread Xin LI
Author: delphij
Date: Mon Nov  9 01:56:06 2020
New Revision: 367512
URL: https://svnweb.freebsd.org/changeset/base/367512

Log:
  MFC r366781, r366866: Implement ptsname_r.

Modified:
  stable/11/include/stdlib.h
  stable/11/lib/libc/stdlib/Makefile.inc
  stable/11/lib/libc/stdlib/Symbol.map
  stable/11/lib/libc/stdlib/ptsname.3
  stable/11/lib/libc/stdlib/ptsname.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/include/stdlib.h
==
--- stable/11/include/stdlib.h  Mon Nov  9 01:55:30 2020(r367511)
+++ stable/11/include/stdlib.h  Mon Nov  9 01:56:06 2020(r367512)
@@ -205,7 +205,6 @@ double   drand48(void);
 double  erand48(unsigned short[3]);
 /* char*fcvt(double, int, int * __restrict, int * __restrict); */
 /* char*gcvt(double, int, int * __restrict, int * __restrict); */
-int grantpt(int);
 char   *initstate(unsigned long /* XSI requires u_int */, char *, long);
 longjrand48(unsigned short[3]);
 char   *l64a(long);
@@ -217,8 +216,6 @@ char*mktemp(char *);
 #endif
 longmrand48(void);
 longnrand48(unsigned short[3]);
-int posix_openpt(int);
-char   *ptsname(int);
 int putenv(char *);
 longrandom(void);
 unsigned short
@@ -230,8 +227,18 @@ int setkey(const char *);
 char   *setstate(/* const */ char *);
 voidsrand48(long);
 voidsrandom(unsigned long);
+#endif /* __XSI_VISIBLE */
+
+#if __XSI_VISIBLE
+int grantpt(int);
+int posix_openpt(int);
+char   *ptsname(int);
 int unlockpt(int);
 #endif /* __XSI_VISIBLE */
+#if __BSD_VISIBLE
+/* ptsname_r will be included in POSIX issue 8 */
+int ptsname_r(int, char *, size_t);
+#endif
 
 #if __BSD_VISIBLE
 extern const char *malloc_conf;

Modified: stable/11/lib/libc/stdlib/Makefile.inc
==
--- stable/11/lib/libc/stdlib/Makefile.inc  Mon Nov  9 01:55:30 2020
(r367511)
+++ stable/11/lib/libc/stdlib/Makefile.inc  Mon Nov  9 01:56:06 2020
(r367512)
@@ -50,7 +50,7 @@ MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3
 MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3
 MLINKS+=insque.3 remque.3
 MLINKS+=lsearch.3 lfind.3
-MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3
+MLINKS+=ptsname.3 grantpt.3 ptsname.3 ptsname_r.3 ptsname.3 unlockpt.3
 MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3
 MLINKS+=rand.3 rand_r.3 rand.3 srand.3 rand.3 sranddev.3
 MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \

Modified: stable/11/lib/libc/stdlib/Symbol.map
==
--- stable/11/lib/libc/stdlib/Symbol.mapMon Nov  9 01:55:30 2020
(r367511)
+++ stable/11/lib/libc/stdlib/Symbol.mapMon Nov  9 01:56:06 2020
(r367512)
@@ -124,6 +124,10 @@ FBSD_1.5 {
set_constraint_handler_s;
 };
 
+FBSD_1.6 {
+   ptsname_r;
+};
+
 FBSDprivate_1.0 {
__system;
_system;

Modified: stable/11/lib/libc/stdlib/ptsname.3
==
--- stable/11/lib/libc/stdlib/ptsname.3 Mon Nov  9 01:55:30 2020
(r367511)
+++ stable/11/lib/libc/stdlib/ptsname.3 Mon Nov  9 01:56:06 2020
(r367512)
@@ -31,12 +31,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 20, 2008
+.Dd October 17, 2020
 .Dt PTSNAME 3
 .Os
 .Sh NAME
 .Nm grantpt ,
 .Nm ptsname ,
+.Nm ptsname_r ,
 .Nm unlockpt
 .Nd pseudo-terminal access functions
 .Sh LIBRARY
@@ -47,6 +48,8 @@
 .Fn grantpt "int fildes"
 .Ft "char *"
 .Fn ptsname "int fildes"
+.Ft "int"
+.Fn ptsname_r "int fildes" "char *buffer" "size_t buflen"
 .Ft int
 .Fn unlockpt "int fildes"
 .Sh DESCRIPTION
@@ -87,12 +90,23 @@ and
 have been called.
 .Pp
 The
+.Fn ptsname_r
+function is the thread-safe version of
+.Fn ptsname .
+The caller must provide storage for the results of the full pathname of
+the slave device in the
+.Fa buffer
+and
+.Fa bufsize
+arguments.
+.Pp
+The
 .Fn unlockpt
 function clears the lock held on the pseudo-terminal pair
 for the master device specified with
 .Fa fildes .
 .Sh RETURN VALUES
-.Rv -std grantpt unlockpt
+.Rv -std grantpt ptsname_r unlockpt
 .Pp
 The
 .Fn ptsname
@@ -103,7 +117,8 @@ pointer is returned.
 .Sh ERRORS
 The
 .Fn grantpt ,
-.Fn ptsname
+.Fn ptsname ,
+.Fn ptsname_r
 and
 .Fn unlockpt
 functions may fail and set
@@ -116,6 +131,16 @@ is not a valid open file descriptor.
 .It Bq Er EINVAL
 .Fa fildes
 is not a master pseudo-terminal device.
+.El
+.Pp
+In addition, the
+.Fn ptsname_r
+function may set
+.Va errno
+to:
+.Bl -tag -width Er
+.It Bq Er ERANGE
+The buffer was too small.
 .El
 .Pp
 In addition, the

Modified: stable/11/lib/libc/stdlib/ptsname.c
==
--- stable/11/lib/libc/stdlib/ptsname.c Mon Nov  9 01:55:30 2020

svn commit: r367511 - stable/12/sys/sys

2020-11-08 Thread Xin LI
Author: delphij
Date: Mon Nov  9 01:55:30 2020
New Revision: 367511
URL: https://svnweb.freebsd.org/changeset/base/367511

Log:
  Bump __FreeBSD_version after ptsname_r addition.

Modified:
  stable/12/sys/sys/param.h

Modified: stable/12/sys/sys/param.h
==
--- stable/12/sys/sys/param.h   Mon Nov  9 01:52:15 2020(r367510)
+++ stable/12/sys/sys/param.h   Mon Nov  9 01:55:30 2020(r367511)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1202503  /* Master, propagated to newvers */
+#define __FreeBSD_version 1202504  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367510 - in stable/12: include lib/libc/stdlib

2020-11-08 Thread Xin LI
Author: delphij
Date: Mon Nov  9 01:52:15 2020
New Revision: 367510
URL: https://svnweb.freebsd.org/changeset/base/367510

Log:
  MFC r366781, r366866: Implement ptsname_r.

Modified:
  stable/12/include/stdlib.h
  stable/12/lib/libc/stdlib/Makefile.inc
  stable/12/lib/libc/stdlib/Symbol.map
  stable/12/lib/libc/stdlib/ptsname.3
  stable/12/lib/libc/stdlib/ptsname.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/include/stdlib.h
==
--- stable/12/include/stdlib.h  Mon Nov  9 01:41:55 2020(r367509)
+++ stable/12/include/stdlib.h  Mon Nov  9 01:52:15 2020(r367510)
@@ -207,7 +207,6 @@ double   drand48(void);
 double  erand48(unsigned short[3]);
 /* char*fcvt(double, int, int * __restrict, int * __restrict); */
 /* char*gcvt(double, int, int * __restrict, int * __restrict); */
-int grantpt(int);
 char   *initstate(unsigned int, char *, size_t);
 longjrand48(unsigned short[3]);
 char   *l64a(long);
@@ -219,8 +218,6 @@ char*mktemp(char *);
 #endif
 longmrand48(void);
 longnrand48(unsigned short[3]);
-int posix_openpt(int);
-char   *ptsname(int);
 int putenv(char *);
 longrandom(void);
 unsigned short
@@ -228,8 +225,18 @@ unsigned short
 char   *setstate(/* const */ char *);
 voidsrand48(long);
 voidsrandom(unsigned int);
+#endif /* __XSI_VISIBLE */
+
+#if __XSI_VISIBLE
+int grantpt(int);
+int posix_openpt(int);
+char   *ptsname(int);
 int unlockpt(int);
 #endif /* __XSI_VISIBLE */
+#if __BSD_VISIBLE
+/* ptsname_r will be included in POSIX issue 8 */
+int ptsname_r(int, char *, size_t);
+#endif
 
 #if __BSD_VISIBLE
 extern const char *malloc_conf;

Modified: stable/12/lib/libc/stdlib/Makefile.inc
==
--- stable/12/lib/libc/stdlib/Makefile.inc  Mon Nov  9 01:41:55 2020
(r367509)
+++ stable/12/lib/libc/stdlib/Makefile.inc  Mon Nov  9 01:52:15 2020
(r367510)
@@ -50,7 +50,7 @@ MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3
 MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3
 MLINKS+=insque.3 remque.3
 MLINKS+=lsearch.3 lfind.3
-MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3
+MLINKS+=ptsname.3 grantpt.3 ptsname.3 ptsname_r.3 ptsname.3 unlockpt.3
 MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3
 MLINKS+=rand.3 rand_r.3 rand.3 srand.3 rand.3 sranddev.3
 MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \

Modified: stable/12/lib/libc/stdlib/Symbol.map
==
--- stable/12/lib/libc/stdlib/Symbol.mapMon Nov  9 01:41:55 2020
(r367509)
+++ stable/12/lib/libc/stdlib/Symbol.mapMon Nov  9 01:52:15 2020
(r367510)
@@ -124,6 +124,10 @@ FBSD_1.5 {
set_constraint_handler_s;
 };
 
+FBSD_1.6 {
+   ptsname_r;
+};
+
 FBSDprivate_1.0 {
__system;
_system;

Modified: stable/12/lib/libc/stdlib/ptsname.3
==
--- stable/12/lib/libc/stdlib/ptsname.3 Mon Nov  9 01:41:55 2020
(r367509)
+++ stable/12/lib/libc/stdlib/ptsname.3 Mon Nov  9 01:52:15 2020
(r367510)
@@ -31,12 +31,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 20, 2008
+.Dd October 17, 2020
 .Dt PTSNAME 3
 .Os
 .Sh NAME
 .Nm grantpt ,
 .Nm ptsname ,
+.Nm ptsname_r ,
 .Nm unlockpt
 .Nd pseudo-terminal access functions
 .Sh LIBRARY
@@ -47,6 +48,8 @@
 .Fn grantpt "int fildes"
 .Ft "char *"
 .Fn ptsname "int fildes"
+.Ft "int"
+.Fn ptsname_r "int fildes" "char *buffer" "size_t buflen"
 .Ft int
 .Fn unlockpt "int fildes"
 .Sh DESCRIPTION
@@ -87,12 +90,23 @@ and
 have been called.
 .Pp
 The
+.Fn ptsname_r
+function is the thread-safe version of
+.Fn ptsname .
+The caller must provide storage for the results of the full pathname of
+the slave device in the
+.Fa buffer
+and
+.Fa bufsize
+arguments.
+.Pp
+The
 .Fn unlockpt
 function clears the lock held on the pseudo-terminal pair
 for the master device specified with
 .Fa fildes .
 .Sh RETURN VALUES
-.Rv -std grantpt unlockpt
+.Rv -std grantpt ptsname_r unlockpt
 .Pp
 The
 .Fn ptsname
@@ -103,7 +117,8 @@ pointer is returned.
 .Sh ERRORS
 The
 .Fn grantpt ,
-.Fn ptsname
+.Fn ptsname ,
+.Fn ptsname_r
 and
 .Fn unlockpt
 functions may fail and set
@@ -116,6 +131,16 @@ is not a valid open file descriptor.
 .It Bq Er EINVAL
 .Fa fildes
 is not a master pseudo-terminal device.
+.El
+.Pp
+In addition, the
+.Fn ptsname_r
+function may set
+.Va errno
+to:
+.Bl -tag -width Er
+.It Bq Er ERANGE
+The buffer was too small.
 .El
 .Pp
 In addition, the

Modified: stable/12/lib/libc/stdlib/ptsname.c
==
--- stable/12/lib/libc/stdlib/ptsname.c Mon Nov  9 01:41:55 2020
(r367509)
+++ stable/12/lib/libc/stdlib/pts

svn commit: r367508 - in stable/11: share/man/man4 sys/dev/arcmsr

2020-11-08 Thread Xin LI
Author: delphij
Date: Mon Nov  9 01:39:55 2020
New Revision: 367508
URL: https://svnweb.freebsd.org/changeset/base/367508

Log:
  MFC r358477,365113,366767: arcmsr(4) 1.50.00.00.

Modified:
  stable/11/share/man/man4/arcmsr.4
  stable/11/sys/dev/arcmsr/arcmsr.c
  stable/11/sys/dev/arcmsr/arcmsr.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/arcmsr.4
==
--- stable/11/share/man/man4/arcmsr.4   Mon Nov  9 01:38:02 2020
(r367507)
+++ stable/11/share/man/man4/arcmsr.4   Mon Nov  9 01:39:55 2020
(r367508)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 8, 2017
+.Dd October 15, 2020
 .Dt ARCMSR 4
 .Os
 .Sh NAME
@@ -153,6 +153,8 @@ ARC-1882
 ARC-1883
 .It
 ARC-1884
+.It
+ARC-1886
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /dev/arcmsr?" -compact

Modified: stable/11/sys/dev/arcmsr/arcmsr.c
==
--- stable/11/sys/dev/arcmsr/arcmsr.c   Mon Nov  9 01:38:02 2020
(r367507)
+++ stable/11/sys/dev/arcmsr/arcmsr.c   Mon Nov  9 01:39:55 2020
(r367508)
@@ -79,6 +79,7 @@
 ** 1.30.00.00   11/30/2015  Ching Huang Added support ARC1203
 ** 1.40.00.00   07/11/2017  Ching Huang Added support ARC1884
 ** 1.40.00.01   10/30/2017  Ching Huang Fixed release memory resource
+** 1.50.00.00   09/30/2020  Ching Huang Added support ARC-1886, 
NVMe/SAS/SATA controller
 
**
 */
 
@@ -128,29 +129,15 @@ __FBSDID("$FreeBSD$");
 **
 **
 */
-#if __FreeBSD_version >= 55
-   #include 
-   #include 
-   #include 
-   #include 
-   #include 
-#else
-   #include 
-   #include 
-   #include 
-#endif
+#include 
+#include 
+#include 
+#include 
+#include 
 
-#if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025
-#defineCAM_NEW_TRAN_CODE   1
-#endif
-
-#if __FreeBSD_version > 50
 #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1);
-#else
-#define arcmsr_callout_init(a) callout_init(a);
-#endif
 
-#define ARCMSR_DRIVER_VERSION  "arcmsr version 1.40.00.01 2017-10-30"
+#define ARCMSR_DRIVER_VERSION  "arcmsr version 1.50.00.00 2020-09-30"
 #include 
 /*
 **
@@ -188,6 +175,7 @@ static void arcmsr_polling_devmap(void *arg);
 static void arcmsr_srb_timeout(void *arg);
 static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb);
 static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb);
+static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb);
 static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock 
*acb);
 #ifdef ARCMSR_DEBUG1
 static void arcmsr_dump_data(struct AdapterControlBlock *acb);
@@ -218,12 +206,7 @@ static device_method_t arcmsr_methods[]={
DEVMETHOD(device_shutdown,  arcmsr_shutdown),
DEVMETHOD(device_suspend,   arcmsr_suspend),
DEVMETHOD(device_resume,arcmsr_resume),
-
-#if __FreeBSD_version >= 803000
DEVMETHOD_END
-#else
-   { 0, 0 }
-#endif
 };
 
 static driver_t arcmsr_driver={
@@ -237,59 +220,23 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1);
 #ifndef BUS_DMA_COHERENT   
#define BUS_DMA_COHERENT0x04/* hint: map memory in a 
coherent way */
 #endif
-#if __FreeBSD_version >= 501000
 static struct cdevsw arcmsr_cdevsw={
-   #if __FreeBSD_version >= 503000
.d_version = D_VERSION, 
-   #endif
-   #if (__FreeBSD_version>=503000 && __FreeBSD_version<600034)
-   .d_flags   = D_NEEDGIANT, 
-   #endif
.d_open= arcmsr_open,   /* open */
.d_close   = arcmsr_close,  /* close*/
.d_ioctl   = arcmsr_ioctl,  /* ioctl*/
.d_name= "arcmsr",  /* name */
};
-#else
-   #define ARCMSR_CDEV_MAJOR   180
-
-static struct cdevsw arcmsr_cdevsw = {
-   arcmsr_open,/* open */
-   arcmsr_close,   /* close*/
-   noread, /* read */
-   nowrite,/* write*/
-   arcmsr_ioctl,   /* ioctl*/
-   nopoll, /* poll */
-   nommap, /* mmap */
-   nostrategy, /* strategy */
-   "arcmsr",   /* name */
-   ARCMSR_CDEV_MAJOR,  /* major*/
-   nodump, /* dump */
-   nopsize, 

svn commit: r367507 - in stable/12: share/man/man4 sys/dev/arcmsr

2020-11-08 Thread Xin LI
Author: delphij
Date: Mon Nov  9 01:38:02 2020
New Revision: 367507
URL: https://svnweb.freebsd.org/changeset/base/367507

Log:
  MFC r358477,365113,366767: arcmsr(4) 1.50.00.00.

Modified:
  stable/12/share/man/man4/arcmsr.4
  stable/12/sys/dev/arcmsr/arcmsr.c
  stable/12/sys/dev/arcmsr/arcmsr.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/arcmsr.4
==
--- stable/12/share/man/man4/arcmsr.4   Mon Nov  9 01:14:22 2020
(r367506)
+++ stable/12/share/man/man4/arcmsr.4   Mon Nov  9 01:38:02 2020
(r367507)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 8, 2017
+.Dd October 15, 2020
 .Dt ARCMSR 4
 .Os
 .Sh NAME
@@ -153,6 +153,8 @@ ARC-1882
 ARC-1883
 .It
 ARC-1884
+.It
+ARC-1886
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /dev/arcmsr?" -compact

Modified: stable/12/sys/dev/arcmsr/arcmsr.c
==
--- stable/12/sys/dev/arcmsr/arcmsr.c   Mon Nov  9 01:14:22 2020
(r367506)
+++ stable/12/sys/dev/arcmsr/arcmsr.c   Mon Nov  9 01:38:02 2020
(r367507)
@@ -81,6 +81,7 @@
 ** 1.30.00.00   11/30/2015  Ching Huang Added support ARC1203
 ** 1.40.00.00   07/11/2017  Ching Huang Added support ARC1884
 ** 1.40.00.01   10/30/2017  Ching Huang Fixed release memory resource
+** 1.50.00.00   09/30/2020  Ching Huang Added support ARC-1886, 
NVMe/SAS/SATA controller
 
**
 */
 
@@ -130,29 +131,15 @@ __FBSDID("$FreeBSD$");
 **
 **
 */
-#if __FreeBSD_version >= 55
-   #include 
-   #include 
-   #include 
-   #include 
-   #include 
-#else
-   #include 
-   #include 
-   #include 
-#endif
+#include 
+#include 
+#include 
+#include 
+#include 
 
-#if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025
-#defineCAM_NEW_TRAN_CODE   1
-#endif
-
-#if __FreeBSD_version > 50
 #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1);
-#else
-#define arcmsr_callout_init(a) callout_init(a);
-#endif
 
-#define ARCMSR_DRIVER_VERSION  "arcmsr version 1.40.00.01 2017-10-30"
+#define ARCMSR_DRIVER_VERSION  "arcmsr version 1.50.00.00 2020-09-30"
 #include 
 /*
 **
@@ -190,6 +177,7 @@ static void arcmsr_polling_devmap(void *arg);
 static void arcmsr_srb_timeout(void *arg);
 static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb);
 static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb);
+static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb);
 static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock 
*acb);
 #ifdef ARCMSR_DEBUG1
 static void arcmsr_dump_data(struct AdapterControlBlock *acb);
@@ -220,12 +208,7 @@ static device_method_t arcmsr_methods[]={
DEVMETHOD(device_shutdown,  arcmsr_shutdown),
DEVMETHOD(device_suspend,   arcmsr_suspend),
DEVMETHOD(device_resume,arcmsr_resume),
-
-#if __FreeBSD_version >= 803000
DEVMETHOD_END
-#else
-   { 0, 0 }
-#endif
 };
 
 static driver_t arcmsr_driver={
@@ -239,59 +222,23 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1);
 #ifndef BUS_DMA_COHERENT   
#define BUS_DMA_COHERENT0x04/* hint: map memory in a 
coherent way */
 #endif
-#if __FreeBSD_version >= 501000
 static struct cdevsw arcmsr_cdevsw={
-   #if __FreeBSD_version >= 503000
.d_version = D_VERSION, 
-   #endif
-   #if (__FreeBSD_version>=503000 && __FreeBSD_version<600034)
-   .d_flags   = D_NEEDGIANT, 
-   #endif
.d_open= arcmsr_open,   /* open */
.d_close   = arcmsr_close,  /* close*/
.d_ioctl   = arcmsr_ioctl,  /* ioctl*/
.d_name= "arcmsr",  /* name */
};
-#else
-   #define ARCMSR_CDEV_MAJOR   180
-
-static struct cdevsw arcmsr_cdevsw = {
-   arcmsr_open,/* open */
-   arcmsr_close,   /* close*/
-   noread, /* read */
-   nowrite,/* write*/
-   arcmsr_ioctl,   /* ioctl*/
-   nopoll, /* poll */
-   nommap, /* mmap */
-   nostrategy, /* strategy */
-   "arcmsr",   /* name */
-   ARCMSR_CDEV_MAJOR,  /* major*/
-   nodump, /* dump */
-   nopsize, 

svn commit: r367005 - head/contrib/less

2020-10-24 Thread Xin LI
Author: delphij
Date: Sat Oct 24 15:58:42 2020
New Revision: 367005
URL: https://svnweb.freebsd.org/changeset/base/367005

Log:
  MFV r366990: less v563.
  
  MFC after:2 weeks
  Relnotes: yes

Modified:
  head/contrib/less/NEWS
  head/contrib/less/README
  head/contrib/less/brac.c
  head/contrib/less/ch.c
  head/contrib/less/charset.c
  head/contrib/less/charset.h
  head/contrib/less/cmd.h
  head/contrib/less/cmdbuf.c
  head/contrib/less/command.c
  head/contrib/less/compose.uni
  head/contrib/less/cvt.c
  head/contrib/less/decode.c
  head/contrib/less/edit.c
  head/contrib/less/filename.c
  head/contrib/less/fmt.uni
  head/contrib/less/forwback.c
  head/contrib/less/funcs.h
  head/contrib/less/help.c
  head/contrib/less/ifile.c
  head/contrib/less/input.c
  head/contrib/less/jump.c
  head/contrib/less/less.h
  head/contrib/less/less.nro
  head/contrib/less/lessecho.c
  head/contrib/less/lessecho.nro
  head/contrib/less/lesskey.c
  head/contrib/less/lesskey.h
  head/contrib/less/lesskey.nro
  head/contrib/less/lglob.h
  head/contrib/less/line.c
  head/contrib/less/linenum.c
  head/contrib/less/lsystem.c
  head/contrib/less/main.c
  head/contrib/less/mark.c
  head/contrib/less/mkutable
  head/contrib/less/optfunc.c
  head/contrib/less/option.c
  head/contrib/less/option.h
  head/contrib/less/opttbl.c
  head/contrib/less/os.c
  head/contrib/less/output.c
  head/contrib/less/pattern.c
  head/contrib/less/pattern.h
  head/contrib/less/pckeys.h
  head/contrib/less/position.c
  head/contrib/less/position.h
  head/contrib/less/prompt.c
  head/contrib/less/screen.c
  head/contrib/less/scrsize.c
  head/contrib/less/search.c
  head/contrib/less/signal.c
  head/contrib/less/tags.c
  head/contrib/less/ttyin.c
  head/contrib/less/ubin.uni
  head/contrib/less/version.c
  head/contrib/less/wide.uni
Directory Properties:
  head/contrib/less/   (props changed)

Modified: head/contrib/less/NEWS
==
--- head/contrib/less/NEWS  Sat Oct 24 15:38:04 2020(r367004)
+++ head/contrib/less/NEWS  Sat Oct 24 15:58:42 2020(r367005)
@@ -11,6 +11,31 @@
 
 ==
 
+   Major changes between "less" versions 551 and 563
+
+* Update Unicode tables.
+
+* Treat Hangul Jamo medial vowels and final consonants as zero width.
+
+* Display error message immediately when -o is toggled and 
+  input is not a pipe.
+
+* Fix regression: make screen repaint when "squished" and 
+  a no-movement command is given.
+
+* Fix erroneous EOF calculation when F command is interrupted.
+
+* Make WIN32C version include this fix from 551:
+  Don't count lines in initial screen if using -X with -F.
+
+* Fix display bug in WIN32C version.
+
+* Fix memory corruption when built with libtermcap.
+
+* Support libtinfow.
+
+==
+
Major changes between "less" versions 530 and 551
 
 * Add --mouse option.

Modified: head/contrib/less/README
==
--- head/contrib/less/READMESat Oct 24 15:38:04 2020(r367004)
+++ head/contrib/less/READMESat Oct 24 15:58:42 2020(r367005)
@@ -7,9 +7,9 @@
 **
 **
 
-Less, version 551
+Less, version 563
 
-This is the distribution of less, version 551, released 11 Jun 2019.
+This is the distribution of less, version 563, released 13 Jun 2020.
 This program is part of the GNU project (http://www.gnu.org).
 
 This program is free software.  You may redistribute it and/or
@@ -32,6 +32,14 @@ This is the distribution of "less", a paginator simila
 The formatted manual page is in less.man.
 The manual page nroff source is in less.nro.
 Major changes made since the last posted version are in NEWS.
+
+===
+PRE-INSTALLATION (when using git)
+
+If you are building from a clone of a git repository,
+type "make -f Makefile.aut".
+If you are building from a numbered release package (a tar or zip file 
+with a name like less-999.tar.gz or less-999.zip), you should skip this step. 
 
 ===
 INSTALLATION (Unix systems only):

Modified: head/contrib/less/brac.c
==
--- head/contrib/less/brac.cSat Oct 24 15:38:04 2020(r367004)
+++ head/contrib/less/brac.cSat Oct 24 15:58:42 2020(r367005)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1984-2019  Mark Nudelman
+ * Copyright (C) 1984-2020  Mark Nudelman
  *
  * You may distribute under the terms of either the GNU General Public
  * License or

svn commit: r366991 - vendor/less/v563

2020-10-23 Thread Xin LI
Author: delphij
Date: Sat Oct 24 05:26:58 2020
New Revision: 366991
URL: https://svnweb.freebsd.org/changeset/base/366991

Log:
  Tag less v563.

Added:
  vendor/less/v563/
 - copied from r366990, vendor/less/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366990 - vendor/less/dist

2020-10-23 Thread Xin LI
Author: delphij
Date: Sat Oct 24 05:25:54 2020
New Revision: 366990
URL: https://svnweb.freebsd.org/changeset/base/366990

Log:
  Vendor import of less v563.

Modified:
  vendor/less/dist/Makefile.aut
  vendor/less/dist/Makefile.wnm
  vendor/less/dist/NEWS
  vendor/less/dist/README
  vendor/less/dist/brac.c
  vendor/less/dist/ch.c
  vendor/less/dist/charset.c
  vendor/less/dist/charset.h
  vendor/less/dist/cmd.h
  vendor/less/dist/cmdbuf.c
  vendor/less/dist/command.c
  vendor/less/dist/compose.uni
  vendor/less/dist/configure
  vendor/less/dist/configure.ac
  vendor/less/dist/cvt.c
  vendor/less/dist/decode.c
  vendor/less/dist/defines.ds
  vendor/less/dist/defines.o2
  vendor/less/dist/defines.o9
  vendor/less/dist/defines.wn
  vendor/less/dist/edit.c
  vendor/less/dist/filename.c
  vendor/less/dist/fmt.uni
  vendor/less/dist/forwback.c
  vendor/less/dist/funcs.h
  vendor/less/dist/help.c
  vendor/less/dist/ifile.c
  vendor/less/dist/input.c
  vendor/less/dist/jump.c
  vendor/less/dist/less.h
  vendor/less/dist/less.man
  vendor/less/dist/less.nro
  vendor/less/dist/lessecho.c
  vendor/less/dist/lessecho.man
  vendor/less/dist/lessecho.nro
  vendor/less/dist/lesskey.c
  vendor/less/dist/lesskey.h
  vendor/less/dist/lesskey.man
  vendor/less/dist/lesskey.nro
  vendor/less/dist/lglob.h
  vendor/less/dist/line.c
  vendor/less/dist/linenum.c
  vendor/less/dist/lsystem.c
  vendor/less/dist/main.c
  vendor/less/dist/mark.c
  vendor/less/dist/mkutable
  vendor/less/dist/optfunc.c
  vendor/less/dist/option.c
  vendor/less/dist/option.h
  vendor/less/dist/opttbl.c
  vendor/less/dist/os.c
  vendor/less/dist/output.c
  vendor/less/dist/pattern.c
  vendor/less/dist/pattern.h
  vendor/less/dist/pckeys.h
  vendor/less/dist/position.c
  vendor/less/dist/position.h
  vendor/less/dist/prompt.c
  vendor/less/dist/screen.c
  vendor/less/dist/scrsize.c
  vendor/less/dist/search.c
  vendor/less/dist/signal.c
  vendor/less/dist/tags.c
  vendor/less/dist/ttyin.c
  vendor/less/dist/ubin.uni
  vendor/less/dist/version.c
  vendor/less/dist/wide.uni

Modified: vendor/less/dist/Makefile.aut
==
--- vendor/less/dist/Makefile.aut   Sat Oct 24 01:59:01 2020
(r366989)
+++ vendor/less/dist/Makefile.aut   Sat Oct 24 05:25:54 2020
(r366990)
@@ -4,7 +4,7 @@ EMAIL = bug-l...@gnu.org
 HOMEPAGE = http://www.greenwoodsoftware.com/less
 SHELL = /bin/sh
 GIT = git
-NROFF = nroff -man
+NROFF = nroff -t -man
 
 srcdir = .
 
@@ -52,8 +52,7 @@ help.c: less.hlp 
${srcdir}/mkhelp.pl < less.hlp > help.c
if cmp -s help.c help.c.old; then mv -f help.c.old help.c; fi
 
-${srcdir}/configure: ${srcdir}/configure.ac \
-   ${srcdir}/Makefile.in
+${srcdir}/configure ${srcdir}/defines.h.in: ${srcdir}/configure.ac 
${srcdir}/Makefile.in
cd ${srcdir}; autoheader; autoconf
 
 funcs.h: ${SRC:%=${srcdir}/%}
@@ -66,6 +65,7 @@ lint:
 
 clean: 
rm -f Makefile config.status config.log config.cache defines.h stamp-h \
+   configure defines.h.in funcs.h help.c \
README NEWS \
less.nro less.man lesskey.nro lesskey.man lessecho.nro 
lessecho.man 
 
@@ -93,8 +93,6 @@ ${srcdir}/lesskey.nro: ${srcdir}/lesskey.nro.VER ${src
${REPLACE_VERSION} ${srcdir}/lesskey.nro.VER
 ${srcdir}/lessecho.nro: ${srcdir}/lessecho.nro.VER ${srcdir}/version.c
${REPLACE_VERSION} ${srcdir}/lessecho.nro.VER
-${srcdir}/less.hlp: ${srcdir}/less.hlp.VER ${srcdir}/version.c
-   ${REPLACE_VERSION} ${srcdir}/less.hlp.VER
 
 ${srcdir}/less.man: ${srcdir}/less.nro
${NROFF} ${srcdir}/less.nro >${srcdir}/less.man
@@ -114,10 +112,10 @@ wide.uni: unicode/EastAsianWidth.txt
 
 unicode/UnicodeData.txt:
mkdir -p unicode
-   curl -s -o $@ ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
+   curl -s -u 'anonymous:${EMAIL}' -o $@ 
ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
 unicode/EastAsianWidth.txt:
mkdir -p unicode
-   curl -s -o $@ ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt
+   curl -s -u 'anonymous:${EMAIL}' -o $@ 
ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt
 
 distfiles: ${DISTFILES}
 

Modified: vendor/less/dist/Makefile.wnm
==
--- vendor/less/dist/Makefile.wnm   Sat Oct 24 01:59:01 2020
(r366989)
+++ vendor/less/dist/Makefile.wnm   Sat Oct 24 05:25:54 2020
(r366990)
@@ -7,11 +7,11 @@ CC = cl
 
 # Normal flags
 CFLAGS = /nologo /MD /W3 /EHsc /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" 
/c 
-LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
+LDFLAGS = /nologo /subsystem:console /incremental:no
 
 # Debugging flags
 #CFLAGS = /nologo /MDd /W3 /GX /Od /Gm /Zi /I "." /D "WIN32" /D "NDEBUG" /D 
"_CONSOLE" /c
-#LDFLAGS = /nologo /subsystem:console /incremental:yes /debug /machine:I386
+#LDFLAGS = /nologo /subsystem:con

svn commit: r366866 - in head: include lib/libc/stdlib

2020-10-19 Thread Xin LI
Author: delphij
Date: Tue Oct 20 01:29:45 2020
New Revision: 366866
URL: https://svnweb.freebsd.org/changeset/base/366866

Log:
  Further refinements of ptsname_r(3) interface:
  
   - Hide ptsname_r under __BSD_VISIBLE for now as the specification
 is not finalized at this time.
   - Keep Symbol.map sorted.
   - Avoid the interposing of ptsname_r(3) from an user application
 from breaking ptsname(3) by making the implementation a static
 method and call the static function from ptsname(3) instead.
  
  Reported by:  kib
  Reviewed by:  kib, jilles
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D26845

Modified:
  head/include/stdlib.h
  head/lib/libc/stdlib/Symbol.map
  head/lib/libc/stdlib/ptsname.c

Modified: head/include/stdlib.h
==
--- head/include/stdlib.h   Mon Oct 19 22:32:36 2020(r366865)
+++ head/include/stdlib.h   Tue Oct 20 01:29:45 2020(r366866)
@@ -211,7 +211,6 @@ double   drand48(void);
 double  erand48(unsigned short[3]);
 /* char*fcvt(double, int, int * __restrict, int * __restrict); */
 /* char*gcvt(double, int, int * __restrict, int * __restrict); */
-int grantpt(int);
 char   *initstate(unsigned int, char *, size_t);
 longjrand48(unsigned short[3]);
 char   *l64a(long);
@@ -223,9 +222,6 @@ char*mktemp(char *);
 #endif
 longmrand48(void);
 longnrand48(unsigned short[3]);
-int posix_openpt(int);
-char   *ptsname(int);
-int ptsname_r(int, char *, size_t);
 int putenv(char *);
 longrandom(void);
 unsigned short
@@ -233,8 +229,18 @@ unsigned short
 char   *setstate(/* const */ char *);
 voidsrand48(long);
 voidsrandom(unsigned int);
+#endif /* __XSI_VISIBLE */
+
+#if __XSI_VISIBLE
+int grantpt(int);
+int posix_openpt(int);
+char   *ptsname(int);
 int unlockpt(int);
 #endif /* __XSI_VISIBLE */
+#if __BSD_VISIBLE
+/* ptsname_r will be included in POSIX issue 8 */
+int ptsname_r(int, char *, size_t);
+#endif
 
 #if __BSD_VISIBLE
 extern const char *malloc_conf;

Modified: head/lib/libc/stdlib/Symbol.map
==
--- head/lib/libc/stdlib/Symbol.map Mon Oct 19 22:32:36 2020
(r366865)
+++ head/lib/libc/stdlib/Symbol.map Tue Oct 20 01:29:45 2020
(r366866)
@@ -122,10 +122,10 @@ FBSD_1.5 {
 };
 
 FBSD_1.6 {
+   ptsname_r;
qsort_s;
rand;
srand;
-   ptsname_r;
 };
 
 FBSDprivate_1.0 {

Modified: head/lib/libc/stdlib/ptsname.c
==
--- head/lib/libc/stdlib/ptsname.c  Mon Oct 19 22:32:36 2020
(r366865)
+++ head/lib/libc/stdlib/ptsname.c  Tue Oct 20 01:29:45 2020
(r366866)
@@ -76,7 +76,7 @@ __strong_reference(__isptmaster, unlockpt);
  *  associated with the specified master.
  */
 int
-ptsname_r(int fildes, char *buffer, size_t buflen)
+__ptsname_r(int fildes, char *buffer, size_t buflen)
 {
 
if (buflen <= sizeof(_PATH_DEV)) {
@@ -101,6 +101,8 @@ ptsname_r(int fildes, char *buffer, size_t buflen)
return (0);
 }
 
+__strong_reference(__ptsname_r, ptsname_r);
+
 /*
  * ptsname():  return the pathname of the slave pseudo-terminal device
  * associated with the specified master.
@@ -108,10 +110,10 @@ ptsname_r(int fildes, char *buffer, size_t buflen)
 char *
 ptsname(int fildes)
 {
-   static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN];
+   static char pt_slave[sizeof(_PATH_DEV) + SPECNAMELEN];
 
-   if (ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0)
+   if (__ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0)
return (pt_slave);
-   else
-   return (NULL);
+
+   return (NULL);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366781 - in head: include lib/libc/stdlib

2020-10-18 Thread Xin Li via svn-src-all
Hi,

Thanks very much for the feedback.  I have created a new change for
review at https://reviews.freebsd.org/D26845 , could you please take a
look and let me know if it's satisfactory?

On 10/16/20 11:53 PM, Konstantin Belousov wrote:
[...]>> +int ptsname_r(int, char *, size_t);
> This declaration appears in the __XSI_VISIBLE block, but I do not see the
> function description in the IEEE Std 1003.1™-2017 text (base issue 7).
> 
> Review mentioned that the function is scheduled for issue 8, but shouldn't
> it put under BSD_VISIBLE until specification is finalized ?

Good point, fixed in the proposed change.

[...]
>> Modified: head/lib/libc/stdlib/Symbol.map
>> ==
>> --- head/lib/libc/stdlib/Symbol.map  Sat Oct 17 01:06:04 2020
>> (r366780)
>> +++ head/lib/libc/stdlib/Symbol.map  Sat Oct 17 04:14:38 2020
>> (r366781)
>> @@ -125,6 +125,7 @@ FBSD_1.6 {
>>  qsort_s;
>>  rand;
>>  srand;
>> +ptsname_r;
> This is unsorted now.

Fixed in the proposed change.

[...]
>> +{
>> +static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN];
> We usually write sizeof(_PATH_DEV).

This was from previous code so I leave it as-is, but fixed in the
proposed change.

>> +
>> +if (ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0)
> Since ptsname_r is non-standard and exported, userspace is allowed to
> interpose the symbol, which would break ptsname().

Thanks for pointing it out -- I should have paid more attention here.
Fixed in the proposed change.

>> +return (pt_slave);
>> +else
> 'else' is redundand.

Removed else and used a straight return instead.

Cheers,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366782 - head/sys/sys

2020-10-16 Thread Xin LI
Author: delphij
Date: Sat Oct 17 04:14:46 2020
New Revision: 366782
URL: https://svnweb.freebsd.org/changeset/base/366782

Log:
  Bump __FreeBSD_version after ptsname_r addition.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hSat Oct 17 04:14:38 2020(r366781)
+++ head/sys/sys/param.hSat Oct 17 04:14:46 2020(r366782)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300121  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300122  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366781 - in head: include lib/libc/stdlib

2020-10-16 Thread Xin LI
Author: delphij
Date: Sat Oct 17 04:14:38 2020
New Revision: 366781
URL: https://svnweb.freebsd.org/changeset/base/366781

Log:
  Implement ptsname_r.
  
  MFC after:2 weeks
  PR:   250062
  Reviewed by:  jilles, 0mp, Ray 
  Differential Revision:https://reviews.freebsd.org/D26647

Modified:
  head/include/stdlib.h
  head/lib/libc/stdlib/Makefile.inc
  head/lib/libc/stdlib/Symbol.map
  head/lib/libc/stdlib/ptsname.3
  head/lib/libc/stdlib/ptsname.c

Modified: head/include/stdlib.h
==
--- head/include/stdlib.h   Sat Oct 17 01:06:04 2020(r366780)
+++ head/include/stdlib.h   Sat Oct 17 04:14:38 2020(r366781)
@@ -225,6 +225,7 @@ long mrand48(void);
 longnrand48(unsigned short[3]);
 int posix_openpt(int);
 char   *ptsname(int);
+int ptsname_r(int, char *, size_t);
 int putenv(char *);
 longrandom(void);
 unsigned short

Modified: head/lib/libc/stdlib/Makefile.inc
==
--- head/lib/libc/stdlib/Makefile.inc   Sat Oct 17 01:06:04 2020
(r366780)
+++ head/lib/libc/stdlib/Makefile.inc   Sat Oct 17 04:14:38 2020
(r366781)
@@ -50,7 +50,7 @@ MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3
 MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3
 MLINKS+=insque.3 remque.3
 MLINKS+=lsearch.3 lfind.3
-MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3
+MLINKS+=ptsname.3 grantpt.3 ptsname.3 ptsname_r.3 ptsname.3 unlockpt.3
 MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 \
qsort.3 qsort_s.3
 MLINKS+=rand.3 rand_r.3 rand.3 srand.3

Modified: head/lib/libc/stdlib/Symbol.map
==
--- head/lib/libc/stdlib/Symbol.map Sat Oct 17 01:06:04 2020
(r366780)
+++ head/lib/libc/stdlib/Symbol.map Sat Oct 17 04:14:38 2020
(r366781)
@@ -125,6 +125,7 @@ FBSD_1.6 {
qsort_s;
rand;
srand;
+   ptsname_r;
 };
 
 FBSDprivate_1.0 {

Modified: head/lib/libc/stdlib/ptsname.3
==
--- head/lib/libc/stdlib/ptsname.3  Sat Oct 17 01:06:04 2020
(r366780)
+++ head/lib/libc/stdlib/ptsname.3  Sat Oct 17 04:14:38 2020
(r366781)
@@ -31,12 +31,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 20, 2008
+.Dd October 17, 2020
 .Dt PTSNAME 3
 .Os
 .Sh NAME
 .Nm grantpt ,
 .Nm ptsname ,
+.Nm ptsname_r ,
 .Nm unlockpt
 .Nd pseudo-terminal access functions
 .Sh LIBRARY
@@ -47,6 +48,8 @@
 .Fn grantpt "int fildes"
 .Ft "char *"
 .Fn ptsname "int fildes"
+.Ft "int"
+.Fn ptsname_r "int fildes" "char *buffer" "size_t buflen"
 .Ft int
 .Fn unlockpt "int fildes"
 .Sh DESCRIPTION
@@ -87,12 +90,23 @@ and
 have been called.
 .Pp
 The
+.Fn ptsname_r
+function is the thread-safe version of
+.Fn ptsname .
+The caller must provide storage for the results of the full pathname of
+the slave device in the
+.Fa buffer
+and
+.Fa bufsize
+arguments.
+.Pp
+The
 .Fn unlockpt
 function clears the lock held on the pseudo-terminal pair
 for the master device specified with
 .Fa fildes .
 .Sh RETURN VALUES
-.Rv -std grantpt unlockpt
+.Rv -std grantpt ptsname_r unlockpt
 .Pp
 The
 .Fn ptsname
@@ -103,7 +117,8 @@ pointer is returned.
 .Sh ERRORS
 The
 .Fn grantpt ,
-.Fn ptsname
+.Fn ptsname ,
+.Fn ptsname_r
 and
 .Fn unlockpt
 functions may fail and set
@@ -116,6 +131,16 @@ is not a valid open file descriptor.
 .It Bq Er EINVAL
 .Fa fildes
 is not a master pseudo-terminal device.
+.El
+.Pp
+In addition, the
+.Fn ptsname_r
+function may set
+.Va errno
+to:
+.Bl -tag -width Er
+.It Bq Er ERANGE
+The buffer was too small.
 .El
 .Pp
 In addition, the

Modified: head/lib/libc/stdlib/ptsname.c
==
--- head/lib/libc/stdlib/ptsname.c  Sat Oct 17 01:06:04 2020
(r366780)
+++ head/lib/libc/stdlib/ptsname.c  Sat Oct 17 04:14:38 2020
(r366781)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include "un-namespace.h"
 
 /*
@@ -71,23 +72,46 @@ __strong_reference(__isptmaster, grantpt);
 __strong_reference(__isptmaster, unlockpt);
 
 /*
- * ptsname():  return the pathname of the slave pseudo-terminal device
- * associated with the specified master.
+ * ptsname_r(): return the pathname of the slave pseudo-terminal device
+ *  associated with the specified master.
  */
-char *
-ptsname(int fildes)
+int
+ptsname_r(int fildes, char *buffer, size_t buflen)
 {
-   static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV;
-   char *ret = NULL;
 
+   if (buflen <= sizeof(_PATH_DEV)) {
+   errno = ERANGE;
+   return (-1);
+   }
+
/* Make sure fildes points to a master device. */
if (__isptmaster(fildes) != 0)
-

svn commit: r366767 - in head: share/man/man4 sys/dev/arcmsr

2020-10-16 Thread Xin LI
Author: delphij
Date: Fri Oct 16 15:55:06 2020
New Revision: 366767
URL: https://svnweb.freebsd.org/changeset/base/366767

Log:
  Update arcmsr(4) to 1.50.00.00:
  
  Add support for ARC-1886, NVMe/SAS/SATA controller.
  
  Many thanks to Areca for continuing to support FreeBSD.
  
  Submitted by:   黃清隆 
  MFC after:  2 weeks

Modified:
  head/share/man/man4/arcmsr.4
  head/sys/dev/arcmsr/arcmsr.c
  head/sys/dev/arcmsr/arcmsr.h

Modified: head/share/man/man4/arcmsr.4
==
--- head/share/man/man4/arcmsr.4Fri Oct 16 15:16:23 2020
(r366766)
+++ head/share/man/man4/arcmsr.4Fri Oct 16 15:55:06 2020
(r366767)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 8, 2017
+.Dd October 15, 2020
 .Dt ARCMSR 4
 .Os
 .Sh NAME
@@ -153,6 +153,8 @@ ARC-1882
 ARC-1883
 .It
 ARC-1884
+.It
+ARC-1886
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /dev/arcmsr?" -compact

Modified: head/sys/dev/arcmsr/arcmsr.c
==
--- head/sys/dev/arcmsr/arcmsr.cFri Oct 16 15:16:23 2020
(r366766)
+++ head/sys/dev/arcmsr/arcmsr.cFri Oct 16 15:55:06 2020
(r366767)
@@ -81,6 +81,7 @@
 ** 1.30.00.00   11/30/2015  Ching Huang Added support ARC1203
 ** 1.40.00.00   07/11/2017  Ching Huang Added support ARC1884
 ** 1.40.00.01   10/30/2017  Ching Huang Fixed release memory resource
+** 1.50.00.00   09/30/2020  Ching Huang Added support ARC-1886, 
NVMe/SAS/SATA controller
 
**
 */
 
@@ -138,7 +139,7 @@ __FBSDID("$FreeBSD$");
 
 #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1);
 
-#define ARCMSR_DRIVER_VERSION  "arcmsr version 1.40.00.01 2017-10-30"
+#define ARCMSR_DRIVER_VERSION  "arcmsr version 1.50.00.00 2020-09-30"
 #include 
 /*
 **
@@ -176,6 +177,7 @@ static void arcmsr_polling_devmap(void *arg);
 static void arcmsr_srb_timeout(void *arg);
 static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb);
 static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb);
+static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb);
 static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock 
*acb);
 #ifdef ARCMSR_DEBUG1
 static void arcmsr_dump_data(struct AdapterControlBlock *acb);
@@ -294,19 +296,20 @@ static u_int32_t arcmsr_disable_allintr( struct Adapte
break;
case ACB_ADAPTER_TYPE_C: {
/* disable all outbound interrupt */
-   intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, 
host_int_mask); /* disable outbound message0 int */
+   intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, 
host_int_mask); /* disable outbound message0 int */
CHIP_REG_WRITE32(HBC_MessageUnit, 0, host_int_mask, 
intmask_org|ARCMSR_HBCMU_ALL_INTMASKENABLE);
}
break;
case ACB_ADAPTER_TYPE_D: {
/* disable all outbound interrupt */
-   intmask_org = CHIP_REG_READ32(HBD_MessageUnit, 0, 
pcief0_int_enable); /* disable outbound message0 int */
+   intmask_org = CHIP_REG_READ32(HBD_MessageUnit, 0, 
pcief0_int_enable); /* disable outbound message0 int */
CHIP_REG_WRITE32(HBD_MessageUnit, 0, pcief0_int_enable, 
ARCMSR_HBDMU_ALL_INT_DISABLE);
}
break;
-   case ACB_ADAPTER_TYPE_E: {
+   case ACB_ADAPTER_TYPE_E:
+   case ACB_ADAPTER_TYPE_F: {
/* disable all outbound interrupt */
-   intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, 
host_int_mask); /* disable outbound message0 int */
+   intmask_org = CHIP_REG_READ32(HBE_MessageUnit, 0, 
host_int_mask); /* disable outbound message0 int */
CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, 
intmask_org | ARCMSR_HBEMU_ALL_INTMASKENABLE);
}
break;
@@ -352,7 +355,8 @@ static void arcmsr_enable_allintr( struct AdapterContr
acb->outbound_int_enable = mask;
}
break;
-   case ACB_ADAPTER_TYPE_E: {
+   case ACB_ADAPTER_TYPE_E:
+   case ACB_ADAPTER_TYPE_F: {
/* enable outbound Post Queue, outbound doorbell 
Interrupt */
mask = ~(ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR | 
ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR);
CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, 
intmask_org & mask);
@@ -577,7 +581,8 @@ static void arcmsr_flush_adapter_cache(struct AdapterC
arcmsr_flush_hbd_cache(acb);
}
break;
-   case ACB_ADAPTE

svn commit: r366338 - releng/12.2/sbin/fsck_msdosfs

2020-10-01 Thread Xin LI
Author: delphij
Date: Thu Oct  1 18:58:06 2020
New Revision: 366338
URL: https://svnweb.freebsd.org/changeset/base/366338

Log:
  MFS r366305: MFC r366064, r366065, r366215
  
  sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms
  
  Approved by:  re (gjb)

Modified:
  releng/12.2/sbin/fsck_msdosfs/dir.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sbin/fsck_msdosfs/dir.c
==
--- releng/12.2/sbin/fsck_msdosfs/dir.c Thu Oct  1 18:56:44 2020
(r366337)
+++ releng/12.2/sbin/fsck_msdosfs/dir.c Thu Oct  1 18:58:06 2020
(r366338)
@@ -388,7 +388,8 @@ static int
 checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir)
 {
int ret = FSOK;
-   size_t physicalSize;
+   size_t chainsize;
+   u_int64_t physicalSize;
struct bootblock *boot;
 
boot = fat_get_boot(fat);
@@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
} else {
if (!fat_is_valid_cl(fat, dir->head))
return FSERROR;
-   ret = checkchain(fat, dir->head, &physicalSize);
+   ret = checkchain(fat, dir->head, &chainsize);
/*
-* Upon return, physicalSize would hold the chain length
+* Upon return, chainsize would hold the chain length
 * that checkchain() was able to validate, but if the user
 * refused the proposed repair, it would be unsafe to
 * proceed with directory entry fix, so bail out in that
@@ -412,11 +413,17 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
if (ret == FSERROR) {
return (FSERROR);
}
-   physicalSize *= boot->ClusterSize;
+   /*
+* The maximum file size on FAT32 is 4GiB - 1, which
+* will occupy a cluster chain of exactly 4GiB in
+* size.  On 32-bit platforms, since size_t is 32-bit,
+* it would wrap back to 0.
+*/
+   physicalSize = (u_int64_t)chainsize * boot->ClusterSize;
}
if (physicalSize < dir->size) {
-   pwarn("size of %s is %u, should at most be %zu\n",
- fullpath(dir), dir->size, physicalSize);
+   pwarn("size of %s is %u, should at most be %ju\n",
+ fullpath(dir), dir->size, (uintmax_t)physicalSize);
if (ask(1, "Truncate")) {
dir->size = physicalSize;
p[28] = (u_char)physicalSize;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366306 - stable/11/sbin/fsck_msdosfs

2020-09-30 Thread Xin LI
Author: delphij
Date: Thu Oct  1 03:10:42 2020
New Revision: 366306
URL: https://svnweb.freebsd.org/changeset/base/366306

Log:
  MFC r366064, r366065, r366215: sbin/fsck_msdosfs: Fix an integer
  overflow on 32-bit platforms

Modified:
  stable/11/sbin/fsck_msdosfs/dir.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/fsck_msdosfs/dir.c
==
--- stable/11/sbin/fsck_msdosfs/dir.c   Thu Oct  1 03:08:23 2020
(r366305)
+++ stable/11/sbin/fsck_msdosfs/dir.c   Thu Oct  1 03:10:42 2020
(r366306)
@@ -388,7 +388,8 @@ static int
 checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir)
 {
int ret = FSOK;
-   size_t physicalSize;
+   size_t chainsize;
+   u_int64_t physicalSize;
struct bootblock *boot;
 
boot = fat_get_boot(fat);
@@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
} else {
if (!fat_is_valid_cl(fat, dir->head))
return FSERROR;
-   ret = checkchain(fat, dir->head, &physicalSize);
+   ret = checkchain(fat, dir->head, &chainsize);
/*
-* Upon return, physicalSize would hold the chain length
+* Upon return, chainsize would hold the chain length
 * that checkchain() was able to validate, but if the user
 * refused the proposed repair, it would be unsafe to
 * proceed with directory entry fix, so bail out in that
@@ -412,11 +413,17 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
if (ret == FSERROR) {
return (FSERROR);
}
-   physicalSize *= boot->ClusterSize;
+   /*
+* The maximum file size on FAT32 is 4GiB - 1, which
+* will occupy a cluster chain of exactly 4GiB in
+* size.  On 32-bit platforms, since size_t is 32-bit,
+* it would wrap back to 0.
+*/
+   physicalSize = (u_int64_t)chainsize * boot->ClusterSize;
}
if (physicalSize < dir->size) {
-   pwarn("size of %s is %u, should at most be %zu\n",
- fullpath(dir), dir->size, physicalSize);
+   pwarn("size of %s is %u, should at most be %ju\n",
+ fullpath(dir), dir->size, (uintmax_t)physicalSize);
if (ask(1, "Truncate")) {
dir->size = physicalSize;
p[28] = (u_char)physicalSize;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366305 - stable/12/sbin/fsck_msdosfs

2020-09-30 Thread Xin LI
Author: delphij
Date: Thu Oct  1 03:08:23 2020
New Revision: 366305
URL: https://svnweb.freebsd.org/changeset/base/366305

Log:
  MFC r366064, r366065, r366215: sbin/fsck_msdosfs: Fix an integer
  overflow on 32-bit platforms

Modified:
  stable/12/sbin/fsck_msdosfs/dir.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/fsck_msdosfs/dir.c
==
--- stable/12/sbin/fsck_msdosfs/dir.c   Thu Oct  1 01:10:51 2020
(r366304)
+++ stable/12/sbin/fsck_msdosfs/dir.c   Thu Oct  1 03:08:23 2020
(r366305)
@@ -388,7 +388,8 @@ static int
 checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir)
 {
int ret = FSOK;
-   size_t physicalSize;
+   size_t chainsize;
+   u_int64_t physicalSize;
struct bootblock *boot;
 
boot = fat_get_boot(fat);
@@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
} else {
if (!fat_is_valid_cl(fat, dir->head))
return FSERROR;
-   ret = checkchain(fat, dir->head, &physicalSize);
+   ret = checkchain(fat, dir->head, &chainsize);
/*
-* Upon return, physicalSize would hold the chain length
+* Upon return, chainsize would hold the chain length
 * that checkchain() was able to validate, but if the user
 * refused the proposed repair, it would be unsafe to
 * proceed with directory entry fix, so bail out in that
@@ -412,11 +413,17 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
if (ret == FSERROR) {
return (FSERROR);
}
-   physicalSize *= boot->ClusterSize;
+   /*
+* The maximum file size on FAT32 is 4GiB - 1, which
+* will occupy a cluster chain of exactly 4GiB in
+* size.  On 32-bit platforms, since size_t is 32-bit,
+* it would wrap back to 0.
+*/
+   physicalSize = (u_int64_t)chainsize * boot->ClusterSize;
}
if (physicalSize < dir->size) {
-   pwarn("size of %s is %u, should at most be %zu\n",
- fullpath(dir), dir->size, physicalSize);
+   pwarn("size of %s is %u, should at most be %ju\n",
+ fullpath(dir), dir->size, (uintmax_t)physicalSize);
if (ask(1, "Truncate")) {
dir->size = physicalSize;
p[28] = (u_char)physicalSize;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366215 - head/sbin/fsck_msdosfs

2020-09-27 Thread Xin LI
Author: delphij
Date: Mon Sep 28 04:30:31 2020
New Revision: 366215
URL: https://svnweb.freebsd.org/changeset/base/366215

Log:
  Use %ju and cast to (uintmax_t) to avoid using PRI* macros.
  
  Suggested by: kevlo

Modified:
  head/sbin/fsck_msdosfs/dir.c

Modified: head/sbin/fsck_msdosfs/dir.c
==
--- head/sbin/fsck_msdosfs/dir.cMon Sep 28 00:54:50 2020
(r366214)
+++ head/sbin/fsck_msdosfs/dir.cMon Sep 28 04:30:31 2020
(r366215)
@@ -422,8 +422,8 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
physicalSize = (u_int64_t)chainsize * boot->ClusterSize;
}
if (physicalSize < dir->size) {
-   pwarn("size of %s is %u, should at most be %" PRIu64 "\n",
- fullpath(dir), dir->size, physicalSize);
+   pwarn("size of %s is %u, should at most be %ju\n",
+ fullpath(dir), dir->size, (uintmax_t)physicalSize);
if (ask(1, "Truncate")) {
dir->size = physicalSize;
p[28] = (u_char)physicalSize;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366065 - head/sbin/fsck_msdosfs

2020-09-23 Thread Xin LI
Author: delphij
Date: Wed Sep 23 07:27:12 2020
New Revision: 366065
URL: https://svnweb.freebsd.org/changeset/base/366065

Log:
  Fix build.
  
  Pointy hat to:delphij
  MFC after:3 days

Modified:
  head/sbin/fsck_msdosfs/dir.c

Modified: head/sbin/fsck_msdosfs/dir.c
==
--- head/sbin/fsck_msdosfs/dir.cWed Sep 23 06:52:22 2020
(r366064)
+++ head/sbin/fsck_msdosfs/dir.cWed Sep 23 07:27:12 2020
(r366065)
@@ -422,7 +422,7 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
physicalSize = (u_int64_t)chainsize * boot->ClusterSize;
}
if (physicalSize < dir->size) {
-   pwarn("size of %s is %u, should at most be %zu\n",
+   pwarn("size of %s is %u, should at most be %" PRIu64 "\n",
  fullpath(dir), dir->size, physicalSize);
if (ask(1, "Truncate")) {
dir->size = physicalSize;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366064 - head/sbin/fsck_msdosfs

2020-09-22 Thread Xin LI
Author: delphij
Date: Wed Sep 23 06:52:22 2020
New Revision: 366064
URL: https://svnweb.freebsd.org/changeset/base/366064

Log:
  sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms.
  
  The purpose of checksize() is to verify that the referenced cluster
  chain size matches the recorded file size (up to 2^32 - 1) in the
  directory entry. We follow the cluster chain, then multiple the
  cluster count by bytes per cluster to get the physical size, then
  check it against the recorded size.
  
  When a file is close to 4 GiB (between 4GiB - cluster size and 4GiB,
  both non-inclusive), the product of cluster count and bytes per
  cluster would be exactly 4 GiB. On 32-bit systems, because size_t
  is 32-bit, this would wrap back to 0, which will cause the file be
  truncated to 0.
  
  Fix this by using 64-bit physicalSize instead.
  
  This fix is inspired by an Android change request at
  
https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/1428461
  
  PR:   249533
  Reviewed by:  kevlo
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D26524

Modified:
  head/sbin/fsck_msdosfs/dir.c

Modified: head/sbin/fsck_msdosfs/dir.c
==
--- head/sbin/fsck_msdosfs/dir.cWed Sep 23 04:09:02 2020
(r366063)
+++ head/sbin/fsck_msdosfs/dir.cWed Sep 23 06:52:22 2020
(r366064)
@@ -388,7 +388,8 @@ static int
 checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir)
 {
int ret = FSOK;
-   size_t physicalSize;
+   size_t chainsize;
+   u_int64_t physicalSize;
struct bootblock *boot;
 
boot = fat_get_boot(fat);
@@ -401,9 +402,9 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
} else {
if (!fat_is_valid_cl(fat, dir->head))
return FSERROR;
-   ret = checkchain(fat, dir->head, &physicalSize);
+   ret = checkchain(fat, dir->head, &chainsize);
/*
-* Upon return, physicalSize would hold the chain length
+* Upon return, chainsize would hold the chain length
 * that checkchain() was able to validate, but if the user
 * refused the proposed repair, it would be unsafe to
 * proceed with directory entry fix, so bail out in that
@@ -412,7 +413,13 @@ checksize(struct fat_descriptor *fat, u_char *p, struc
if (ret == FSERROR) {
return (FSERROR);
}
-   physicalSize *= boot->ClusterSize;
+   /*
+* The maximum file size on FAT32 is 4GiB - 1, which
+* will occupy a cluster chain of exactly 4GiB in
+* size.  On 32-bit platforms, since size_t is 32-bit,
+* it would wrap back to 0.
+*/
+   physicalSize = (u_int64_t)chainsize * boot->ClusterSize;
}
if (physicalSize < dir->size) {
pwarn("size of %s is %u, should at most be %zu\n",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365354 - head/libexec/rc/rc.d

2020-09-04 Thread Xin LI
Author: delphij
Date: Sat Sep  5 00:45:46 2020
New Revision: 365354
URL: https://svnweb.freebsd.org/changeset/base/365354

Log:
  Declare dependency relationship once instead of twice for zpool
  and zvol.

Modified:
  head/libexec/rc/rc.d/zpool

Modified: head/libexec/rc/rc.d/zpool
==
--- head/libexec/rc/rc.d/zpool  Sat Sep  5 00:28:21 2020(r365353)
+++ head/libexec/rc/rc.d/zpool  Sat Sep  5 00:45:46 2020(r365354)
@@ -5,7 +5,7 @@
 
 # PROVIDE: zpool
 # REQUIRE: hostid disks
-# BEFORE: zvol mountcritlocal
+# BEFORE: mountcritlocal
 # KEYWORD: nojail
 
 . /etc/rc.subr
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365348 - head/libexec/rc/rc.d

2020-09-04 Thread Xin LI
Author: delphij
Date: Fri Sep  4 23:36:43 2020
New Revision: 365348
URL: https://svnweb.freebsd.org/changeset/base/365348

Log:
  Make zpool on GELI work again.
  
  After OpenZFS import, zpool auto import behavior was moved to an
  explicit "zpool import -a", and the zpool rc.d script was added
  as a prerequisite of zvol.
  
  However, in r299839, zvol was added as a prerequisite of dumpon,
  making it to start very early and before all 'disks' providers.
  At this time, dumping on a zvol is not supported, so remove this
  requirement and make zpool depend on disks to allow zpool on
  full disk encryption work.
  
  Reviewed by:  allanjude
  Differential Revision:https://reviews.freebsd.org/D26333

Modified:
  head/libexec/rc/rc.d/zpool
  head/libexec/rc/rc.d/zvol

Modified: head/libexec/rc/rc.d/zpool
==
--- head/libexec/rc/rc.d/zpool  Fri Sep  4 22:25:14 2020(r365347)
+++ head/libexec/rc/rc.d/zpool  Fri Sep  4 23:36:43 2020(r365348)
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: zpool
-# REQUIRE: hostid
+# REQUIRE: hostid disks
 # BEFORE: zvol mountcritlocal
 # KEYWORD: nojail
 

Modified: head/libexec/rc/rc.d/zvol
==
--- head/libexec/rc/rc.d/zvol   Fri Sep  4 22:25:14 2020(r365347)
+++ head/libexec/rc/rc.d/zvol   Fri Sep  4 23:36:43 2020(r365348)
@@ -5,7 +5,6 @@
 
 # PROVIDE: zvol
 # REQUIRE: zpool
-# BEFORE: dumpon
 # KEYWORD: nojail
 
 . /etc/rc.subr
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364292 - in head: lib/libc/tests/sys lib/libfetch lib/libpam/libpam lib/msun/tests libexec/rtld-elf usr.bin/fetch usr.bin/unzip

2020-08-16 Thread Xin LI
Author: delphij
Date: Mon Aug 17 05:57:02 2020
New Revision: 364292
URL: https://svnweb.freebsd.org/changeset/base/364292

Log:
  Don't explicitly specify c99 or gnu99 as the default is now gnu99.
  
  MFC after:2 weeks

Modified:
  head/lib/libc/tests/sys/Makefile
  head/lib/libfetch/Makefile
  head/lib/libpam/libpam/Makefile
  head/lib/msun/tests/Makefile
  head/libexec/rtld-elf/Makefile
  head/usr.bin/fetch/Makefile
  head/usr.bin/unzip/Makefile

Modified: head/lib/libc/tests/sys/Makefile
==
--- head/lib/libc/tests/sys/MakefileSun Aug 16 23:55:23 2020
(r364291)
+++ head/lib/libc/tests/sys/MakefileMon Aug 17 05:57:02 2020
(r364292)
@@ -70,8 +70,6 @@ NETBSD_ATF_TESTS_C+=  wait_noproc_test
 NETBSD_ATF_TESTS_C+=   wait_noproc_wnohang_test
 NETBSD_ATF_TESTS_C+=   write_test
 
-CSTD?= c99
-
 LIBADD.getpid_test+=   pthread
 LIBADD.timer_create_test+= rt
 

Modified: head/lib/libfetch/Makefile
==
--- head/lib/libfetch/Makefile  Sun Aug 16 23:55:23 2020(r364291)
+++ head/lib/libfetch/Makefile  Mon Aug 17 05:57:02 2020(r364292)
@@ -23,8 +23,6 @@ LIBADD+=  md
 
 CFLAGS+=   -DFTP_COMBINE_CWDS
 
-CSTD?= c99
-
 SHLIB_MAJOR=6
 
 ftperr.h: ftp.errors ${.CURDIR}/Makefile

Modified: head/lib/libpam/libpam/Makefile
==
--- head/lib/libpam/libpam/Makefile Sun Aug 16 23:55:23 2020
(r364291)
+++ head/lib/libpam/libpam/Makefile Mon Aug 17 05:57:02 2020
(r364292)
@@ -156,7 +156,6 @@ MAN?=   openpam.3 \
 
 MLINKS?=   pam.conf.5 pam.d.5
 
-CSTD?= c99
 CFLAGS+= -I${OPENPAM}/include
 CFLAGS+= -DLIB_MAJ=${SHLIB_MAJOR}
 CFLAGS+= -DHAVE_DLFUNC=1

Modified: head/lib/msun/tests/Makefile
==
--- head/lib/msun/tests/MakefileSun Aug 16 23:55:23 2020
(r364291)
+++ head/lib/msun/tests/MakefileMon Aug 17 05:57:02 2020
(r364292)
@@ -75,8 +75,6 @@ ATF_TESTS_C+= trig_test
 CFLAGS+=   -O0
 .endif
 
-CSTD=  c99
-
 #COPTS+=   -Wfloat-equal
 
 IGNORE_PRAGMA=

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Sun Aug 16 23:55:23 2020
(r364291)
+++ head/libexec/rtld-elf/Makefile  Mon Aug 17 05:57:02 2020
(r364292)
@@ -29,7 +29,6 @@ SRCS= \
debug.c \
libmap.c
 MAN?=  rtld.1
-CSTD?= gnu99
 ACFLAGS+=  -DLOCORE
 CFLAGS+=   -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding
 CFLAGS+=   -I${SRCTOP}/lib/csu/common

Modified: head/usr.bin/fetch/Makefile
==
--- head/usr.bin/fetch/Makefile Sun Aug 16 23:55:23 2020(r364291)
+++ head/usr.bin/fetch/Makefile Mon Aug 17 05:57:02 2020(r364292)
@@ -1,7 +1,6 @@
 # $FreeBSD$
 
 PROG=  fetch
-CSTD?= c99
 LIBADD=fetch
 
 .include 

Modified: head/usr.bin/unzip/Makefile
==
--- head/usr.bin/unzip/Makefile Sun Aug 16 23:55:23 2020(r364291)
+++ head/usr.bin/unzip/Makefile Mon Aug 17 05:57:02 2020(r364292)
@@ -1,7 +1,6 @@
 # $FreeBSD$
 
 PROG = unzip
-CSTD = c99
 LIBADD=archive
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364293 - head/usr.sbin/edquota

2020-08-16 Thread Xin LI
Author: delphij
Date: Mon Aug 17 05:57:22 2020
New Revision: 364293
URL: https://svnweb.freebsd.org/changeset/base/364293

Log:
  edquota(8): Cleanup to make it WARNS=6 clean.
  
  Tested with:  make tinderbox
  MFC after:2 weeks

Modified:
  head/usr.sbin/edquota/Makefile
  head/usr.sbin/edquota/edquota.c

Modified: head/usr.sbin/edquota/Makefile
==
--- head/usr.sbin/edquota/Makefile  Mon Aug 17 05:57:02 2020
(r364292)
+++ head/usr.sbin/edquota/Makefile  Mon Aug 17 05:57:22 2020
(r364293)
@@ -4,9 +4,6 @@
 PROG=  edquota
 MAN=   edquota.8
 
-CSTD=  gnu99
-WARNS?=4
-
 LIBADD=util
 
 .include 

Modified: head/usr.sbin/edquota/edquota.c
==
--- head/usr.sbin/edquota/edquota.c Mon Aug 17 05:57:02 2020
(r364292)
+++ head/usr.sbin/edquota/edquota.c Mon Aug 17 05:57:22 2020
(r364293)
@@ -83,9 +83,9 @@ __FBSDID("$FreeBSD$");
 #define dbtokb(db) (db)
 #endif
 
-const char *qfextension[] = INITQFNAMES;
-char tmpfil[] = _PATH_TMP;
-int hflag;
+static const char *qfextension[] = INITQFNAMES;
+static char tmpfil[] = _PATH_TMP;
+static int hflag;
 
 struct quotause {
struct  quotause *next;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363585 - head/sys/geom

2020-07-26 Thread Xin LI
Author: delphij
Date: Sun Jul 26 22:30:55 2020
New Revision: 363585
URL: https://svnweb.freebsd.org/changeset/base/363585

Log:
  gctl_get_geom: Skip validation of g_class.
  
  The caller from kernel is expected to provide an valid g_class
  pointer, instead of traversing the global g_class list, just
  use that pointer directly instead.
  
  Reviewed by:  mav
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25811

Modified:
  head/sys/geom/geom.h
  head/sys/geom/geom_ctl.c

Modified: head/sys/geom/geom.h
==
--- head/sys/geom/geom.hSun Jul 26 22:30:01 2020(r363584)
+++ head/sys/geom/geom.hSun Jul 26 22:30:55 2020(r363585)
@@ -434,7 +434,7 @@ void *gctl_get_paraml(struct gctl_req *req, const char
 void *gctl_get_paraml_opt(struct gctl_req *req, const char *param, int len);
 int gctl_error(struct gctl_req *req, const char *fmt, ...) __printflike(2, 3);
 struct g_class *gctl_get_class(struct gctl_req *req, char const *arg);
-struct g_geom *gctl_get_geom(struct gctl_req *req, struct g_class *mpr, char 
const *arg);
+struct g_geom *gctl_get_geom(struct gctl_req *req, struct g_class *mp, char 
const *arg);
 struct g_provider *gctl_get_provider(struct gctl_req *req, char const *arg);
 
 #endif /* _GEOM_GEOM_H_ */

Modified: head/sys/geom/geom_ctl.c
==
--- head/sys/geom/geom_ctl.cSun Jul 26 22:30:01 2020(r363584)
+++ head/sys/geom/geom_ctl.cSun Jul 26 22:30:55 2020(r363585)
@@ -409,25 +409,20 @@ gctl_get_class(struct gctl_req *req, char const *arg)
 }
 
 struct g_geom *
-gctl_get_geom(struct gctl_req *req, struct g_class *mpr, char const *arg)
+gctl_get_geom(struct gctl_req *req, struct g_class *mp, char const *arg)
 {
char const *p;
-   struct g_class *mp;
struct g_geom *gp;
 
+   MPASS(mp != NULL);
p = gctl_get_asciiparam(req, arg);
if (p == NULL) {
gctl_error(req, "Missing %s argument", arg);
return (NULL);
}
-   LIST_FOREACH(mp, &g_classes, class) {
-   if (mpr != NULL && mpr != mp)
-   continue;
-   LIST_FOREACH(gp, &mp->geom, geom) {
-   if (!strcmp(p, gp->name))
-   return (gp);
-   }
-   }
+   LIST_FOREACH(gp, &mp->geom, geom)
+   if (!strcmp(p, gp->name))
+   return (gp);
gctl_error(req, "Geom not found: \"%s\"", p);
return (NULL);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363584 - head/sys/geom

2020-07-26 Thread Xin LI
Author: delphij
Date: Sun Jul 26 22:30:01 2020
New Revision: 363584
URL: https://svnweb.freebsd.org/changeset/base/363584

Log:
  geom_map and geom_redboot: Remove unused ctlreq handler.
  
  The two classes do not take any verbs and always gctl_error for
  all requests, so don't bother to provide a ctlreq handler.
  
  Reviewed by:  mav
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25810

Modified:
  head/sys/geom/geom_map.c
  head/sys/geom/geom_redboot.c

Modified: head/sys/geom/geom_map.c
==
--- head/sys/geom/geom_map.cSun Jul 26 19:51:42 2020(r363583)
+++ head/sys/geom/geom_map.cSun Jul 26 22:30:01 2020(r363584)
@@ -387,24 +387,11 @@ g_map_taste(struct g_class *mp, struct g_provider *pp,
return (gp);
 }
 
-static void
-g_map_config(struct gctl_req *req, struct g_class *mp, const char *verb)
-{
-   struct g_geom *gp;
-
-   g_topology_assert();
-   gp = gctl_get_geom(req, mp, "geom");
-   if (gp == NULL)
-   return;
-   gctl_error(req, "Unknown verb");
-}
-
 static struct g_class g_map_class = {
.name = MAP_CLASS_NAME,
.version = G_VERSION,
.taste = g_map_taste,
.dumpconf = g_map_dumpconf,
-   .ctlreq = g_map_config,
 };
 DECLARE_GEOM_CLASS(g_map_class, g_map);
 MODULE_VERSION(geom_map, 0);

Modified: head/sys/geom/geom_redboot.c
==
--- head/sys/geom/geom_redboot.cSun Jul 26 19:51:42 2020
(r363583)
+++ head/sys/geom/geom_redboot.cSun Jul 26 22:30:01 2020
(r363584)
@@ -336,24 +336,11 @@ again:
return (gp);
 }
 
-static void
-g_redboot_config(struct gctl_req *req, struct g_class *mp, const char *verb)
-{
-   struct g_geom *gp;
-
-   g_topology_assert();
-   gp = gctl_get_geom(req, mp, "geom");
-   if (gp == NULL)
-   return;
-   gctl_error(req, "Unknown verb");
-}
-
 static struct g_class g_redboot_class  = {
.name   = REDBOOT_CLASS_NAME,
.version= G_VERSION,
.taste  = g_redboot_taste,
.dumpconf   = g_redboot_dumpconf,
-   .ctlreq = g_redboot_config,
.ioctl  = g_redboot_ioctl,
 };
 DECLARE_GEOM_CLASS(g_redboot_class, g_redboot);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363540 - in head/sys/geom: . part virstor

2020-07-25 Thread Xin LI
Author: delphij
Date: Sun Jul 26 01:45:26 2020
New Revision: 363540
URL: https://svnweb.freebsd.org/changeset/base/363540

Log:
  Use snprintf instead of sprintf.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/geom_ccd.c
  head/sys/geom/part/g_part_vtoc8.c
  head/sys/geom/virstor/g_virstor.c

Modified: head/sys/geom/geom_ccd.c
==
--- head/sys/geom/geom_ccd.cSun Jul 26 01:11:30 2020(r363539)
+++ head/sys/geom/geom_ccd.cSun Jul 26 01:45:26 2020(r363540)
@@ -771,7 +771,7 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp)
 
/* Check all providers are valid */
for (i = 0; i < *nprovider; i++) {
-   sprintf(buf, "provider%d", i);
+   snprintf(buf, sizeof(buf), "provider%d", i);
pp = gctl_get_provider(req, buf);
if (pp == NULL)
return;
@@ -788,7 +788,7 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp)
 
/* Create consumers and attach to all providers */
for (i = 0; i < *nprovider; i++) {
-   sprintf(buf, "provider%d", i);
+   snprintf(buf, sizeof(buf), "provider%d", i);
pp = gctl_get_provider(req, buf);
cp = g_new_consumer(gp);
error = g_attach(cp, pp);

Modified: head/sys/geom/part/g_part_vtoc8.c
==
--- head/sys/geom/part/g_part_vtoc8.c   Sun Jul 26 01:11:30 2020
(r363539)
+++ head/sys/geom/part/g_part_vtoc8.c   Sun Jul 26 01:45:26 2020
(r363540)
@@ -224,7 +224,8 @@ g_part_vtoc8_create(struct g_part_table *basetable, st
ncyls = pcyls - acyls;
msize = ncyls * table->secpercyl;
 
-   sprintf(table->vtoc.ascii, "FreeBSD%lldM cyl %u alt %u hd %u sec %u",
+   snprintf(table->vtoc.ascii, sizeof(table->vtoc.ascii),
+   "FreeBSD%lldM cyl %u alt %u hd %u sec %u",
(long long)(msize / 2048), ncyls, acyls, basetable->gpt_heads,
basetable->gpt_sectors);
be32enc(&table->vtoc.version, VTOC_VERSION);
@@ -338,7 +339,8 @@ vtoc8_set_rawsize(struct g_part_table *basetable, stru
basetable->gpt_last = msize - 1;
 
bzero(table->vtoc.ascii, sizeof(table->vtoc.ascii));
-   sprintf(table->vtoc.ascii, "FreeBSD%lldM cyl %u alt %u hd %u sec %u",
+   snprintf(table->vtoc.ascii, sizeof(table->vtoc.ascii),
+   "FreeBSD%lldM cyl %u alt %u hd %u sec %u",
(long long)(msize / 2048), ncyls, acyls, basetable->gpt_heads,
basetable->gpt_sectors);
be16enc(&table->vtoc.physcyls, pcyls);

Modified: head/sys/geom/virstor/g_virstor.c
==
--- head/sys/geom/virstor/g_virstor.c   Sun Jul 26 01:11:30 2020
(r363539)
+++ head/sys/geom/virstor/g_virstor.c   Sun Jul 26 01:45:26 2020
(r363540)
@@ -227,7 +227,7 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class 
struct g_virstor_softc *sc;
int error;
 
-   sprintf(param, "arg%d", i);
+   snprintf(param, sizeof(param), "arg%d", i);
name = gctl_get_asciiparam(req, param);
if (name == NULL) {
gctl_error(req, "No 'arg%d' argument", i);
@@ -565,7 +565,7 @@ virstor_ctl_remove(struct gctl_req *req, struct g_clas
int j, found;
struct g_virstor_component *newcomp, *compbak;
 
-   sprintf(param, "arg%d", i);
+   snprintf(param, sizeof(param), "arg%d", i);
prov_name = gctl_get_asciiparam(req, param);
if (prov_name == NULL) {
gctl_error(req, "Error fetching argument '%s'", param);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363537 - head/sys/geom/label

2020-07-25 Thread Xin LI
Author: delphij
Date: Sun Jul 26 00:44:59 2020
New Revision: 363537
URL: https://svnweb.freebsd.org/changeset/base/363537

Log:
  geom_label: Make glabel labels more trivial by separating the tasting
  routines out.
  
  While there, also simplify the creation of label paths a little bit
  by requiring the / suffix for label directory prefixes (ld_dir renamed
  to ld_dirprefix to indicate the change) and stop defining macros for
  these when they are only used once.
  
  Reviewed by:  cem
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25597

Modified:
  head/sys/geom/label/g_label.c
  head/sys/geom/label/g_label.h
  head/sys/geom/label/g_label_disk_ident.c
  head/sys/geom/label/g_label_ext2fs.c
  head/sys/geom/label/g_label_flashmap.c
  head/sys/geom/label/g_label_gpt.c
  head/sys/geom/label/g_label_iso9660.c
  head/sys/geom/label/g_label_msdosfs.c
  head/sys/geom/label/g_label_ntfs.c
  head/sys/geom/label/g_label_reiserfs.c
  head/sys/geom/label/g_label_ufs.c

Modified: head/sys/geom/label/g_label.c
==
--- head/sys/geom/label/g_label.c   Sat Jul 25 23:08:51 2020
(r363536)
+++ head/sys/geom/label/g_label.c   Sun Jul 26 00:44:59 2020
(r363537)
@@ -63,9 +63,12 @@ static int g_label_destroy_geom(struct gctl_req *req, 
 static int g_label_destroy(struct g_geom *gp, boolean_t force);
 static struct g_geom *g_label_taste(struct g_class *mp, struct g_provider *pp,
 int flags __unused);
+static void g_label_generic_taste(struct g_consumer *, char *, size_t);
 static void g_label_config(struct gctl_req *req, struct g_class *mp,
 const char *verb);
 
+#defineG_LABEL_DIRPREFIX   "label/"
+
 struct g_class g_label_class = {
.name = G_LABEL_CLASS_NAME,
.version = G_VERSION,
@@ -74,6 +77,12 @@ struct g_class g_label_class = {
.destroy_geom = g_label_destroy_geom
 };
 
+static struct g_label_desc g_label_generic = {
+.ld_taste = g_label_generic_taste,
+.ld_dirprefix = G_LABEL_DIRPREFIX,
+.ld_enabled = 1
+};
+
 /*
  * To add a new file system where you want to look for volume labels,
  * you have to:
@@ -99,6 +108,7 @@ const struct g_label_desc *g_labels[] = {
&g_label_disk_ident,
&g_label_flashmap,
 #endif
+   &g_label_generic,
NULL
 };
 
@@ -213,7 +223,7 @@ g_label_mangle_name(char *label, size_t size)
 
 static struct g_geom *
 g_label_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp,
-const char *label, const char *dir, off_t mediasize)
+const char *label, const char *dirprefix, off_t mediasize)
 {
struct g_geom *gp;
struct g_provider *pp2;
@@ -232,7 +242,7 @@ g_label_create(struct gctl_req *req, struct g_class *m
}
gp = NULL;
cp = NULL;
-   if (snprintf(name, sizeof(name), "%s/%s", dir, label) >= sizeof(name)) {
+   if (snprintf(name, sizeof(name), "%s%s", dirprefix, label) >= 
sizeof(name)) {
if (req != NULL)
gctl_error(req, "Label name %s is too long.", label);
return (NULL);
@@ -300,13 +310,9 @@ g_label_read_metadata(struct g_consumer *cp, struct g_
u_char *buf;
int error;
 
-   g_topology_assert();
-
pp = cp->provider;
-   g_topology_unlock();
buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize,
&error);
-   g_topology_lock();
if (buf == NULL)
return (error);
/* Decode metadata. */
@@ -339,12 +345,43 @@ g_label_access_taste(struct g_provider *pp __unused, i
return (EOPNOTSUPP);
 }
 
+static void
+g_label_generic_taste(struct g_consumer *cp, char *label, size_t size)
+{
+   struct g_provider *pp;
+   struct g_label_metadata md;
+
+   g_topology_assert_not();
+   label[0] = '\0';
+   pp = cp->provider;
+
+   if (g_label_read_metadata(cp, &md) != 0)
+   return;
+
+   if (strcmp(md.md_magic, G_LABEL_MAGIC) != 0)
+   return;
+
+   if (md.md_version > G_LABEL_VERSION) {
+   printf("geom_label.ko module is too old to handle %s.\n",
+   pp->name);
+   return;
+   }
+   /*
+* Backward compatibility: there was no md_provsize field in
+* earlier versions of metadata, so only check if we have it.
+*/
+   if (md.md_version >= 2 && md.md_provsize != pp->mediasize)
+   return;
+
+   strlcpy(label, md.md_label, size);
+}
+
 static struct g_geom *
 g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
 {
-   struct g_label_metadata md;
struct g_consumer *cp;
struct g_geom *gp;
+   off_t mediasize;
int i;
 
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
@@ -367,33 +404,6 @@ g_label_taste(struct g_class *mp, struc

svn commit: r363411 - in head/sys/geom: cache concat eli label mirror mountver nop raid3 stripe virstor

2020-07-21 Thread Xin LI
Author: delphij
Date: Wed Jul 22 02:15:21 2020
New Revision: 363411
URL: https://svnweb.freebsd.org/changeset/base/363411

Log:
  Consistently use gctl_get_provider instead of home-grown variants.
  
  Reviewed by:  cem, imp
  MFC after:2 weeks
  Differential revision:https://reviews.freebsd.org/D25739

Modified:
  head/sys/geom/cache/g_cache.c
  head/sys/geom/concat/g_concat.c
  head/sys/geom/eli/g_eli_ctl.c
  head/sys/geom/label/g_label.c
  head/sys/geom/mirror/g_mirror_ctl.c
  head/sys/geom/mountver/g_mountver.c
  head/sys/geom/nop/g_nop.c
  head/sys/geom/raid3/g_raid3_ctl.c
  head/sys/geom/stripe/g_stripe.c
  head/sys/geom/virstor/g_virstor.c

Modified: head/sys/geom/cache/g_cache.c
==
--- head/sys/geom/cache/g_cache.c   Wed Jul 22 02:14:27 2020
(r363410)
+++ head/sys/geom/cache/g_cache.c   Wed Jul 22 02:15:21 2020
(r363411)
@@ -757,19 +757,9 @@ g_cache_ctl_create(struct gctl_req *req, struct g_clas
/* This field is not important here. */
md.md_provsize = 0;
 
-   name = gctl_get_asciiparam(req, "arg1");
-   if (name == NULL) {
-   gctl_error(req, "No 'arg1' argument");
+   pp = gctl_get_provider(req, "arg1");
+   if (pp == NULL)
return;
-   }
-   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
-   name += strlen(_PATH_DEV);
-   pp = g_provider_by_name(name);
-   if (pp == NULL) {
-   G_CACHE_DEBUG(1, "Provider %s is invalid.", name);
-   gctl_error(req, "Provider %s is invalid.", name);
-   return;
-   }
gp = g_cache_create(mp, pp, &md, G_CACHE_TYPE_MANUAL);
if (gp == NULL) {
gctl_error(req, "Can't create %s.", md.md_name);

Modified: head/sys/geom/concat/g_concat.c
==
--- head/sys/geom/concat/g_concat.c Wed Jul 22 02:14:27 2020
(r363410)
+++ head/sys/geom/concat/g_concat.c Wed Jul 22 02:15:21 2020
(r363411)
@@ -840,19 +840,9 @@ g_concat_ctl_create(struct gctl_req *req, struct g_cla
/* Check all providers are valid */
for (no = 1; no < *nargs; no++) {
snprintf(param, sizeof(param), "arg%u", no);
-   name = gctl_get_asciiparam(req, param);
-   if (name == NULL) {
-   gctl_error(req, "No 'arg%u' argument.", no);
+   pp = gctl_get_provider(req, param);
+   if (pp == NULL)
return;
-   }
-   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
-   name += strlen(_PATH_DEV);
-   pp = g_provider_by_name(name);
-   if (pp == NULL) {
-   G_CONCAT_DEBUG(1, "Disk %s is invalid.", name);
-   gctl_error(req, "Disk %s is invalid.", name);
-   return;
-   }
}
 
gp = g_concat_create(mp, &md, G_CONCAT_TYPE_MANUAL);
@@ -866,15 +856,13 @@ g_concat_ctl_create(struct gctl_req *req, struct g_cla
sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name);
for (attached = 0, no = 1; no < *nargs; no++) {
snprintf(param, sizeof(param), "arg%u", no);
-   name = gctl_get_asciiparam(req, param);
-   if (name == NULL) {
-   gctl_error(req, "No 'arg%d' argument.", no);
-   return;
+   pp = gctl_get_provider(req, param);
+   if (pp == NULL) {
+   name = gctl_get_asciiparam(req, param);
+   MPASS(name != NULL);
+   sbuf_printf(sb, " %s", name);
+   continue;
}
-   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
-   name += strlen(_PATH_DEV);
-   pp = g_provider_by_name(name);
-   KASSERT(pp != NULL, ("Provider %s disappear?!", name));
if (g_concat_add_disk(sc, pp, no - 1) != 0) {
G_CONCAT_DEBUG(1, "Disk %u (%s) not attached to %s.",
no, pp->name, gp->name);

Modified: head/sys/geom/eli/g_eli_ctl.c
==
--- head/sys/geom/eli/g_eli_ctl.c   Wed Jul 22 02:14:27 2020
(r363410)
+++ head/sys/geom/eli/g_eli_ctl.c   Wed Jul 22 02:15:21 2020
(r363411)
@@ -58,7 +58,6 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class 
 {
struct g_eli_metadata md;
struct g_provider *pp;
-   const char *name;
u_char *key, mkey[G_ELI_DATAIVKEYLEN];
int *nargs, *detach, *readonly, *dryrunp;
int keysize, error, nkey, dryrun, dummy;
@@ -115,22 +114,13 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class 
  

svn commit: r363410 - head/sys/geom

2020-07-21 Thread Xin LI
Author: delphij
Date: Wed Jul 22 02:14:27 2020
New Revision: 363410
URL: https://svnweb.freebsd.org/changeset/base/363410

Log:
  gctl_get_class, gctl_get_geom and gctl_get_provider: provide feedback
  when the requested argument is missing.
  
  Reviewed by:  cem
  MFC after:2 weeks
  Differential revision:https://reviews.freebsd.org/D25738

Modified:
  head/sys/geom/geom_ctl.c

Modified: head/sys/geom/geom_ctl.c
==
--- head/sys/geom/geom_ctl.cWed Jul 22 02:09:10 2020(r363409)
+++ head/sys/geom/geom_ctl.cWed Jul 22 02:14:27 2020(r363410)
@@ -396,12 +396,15 @@ gctl_get_class(struct gctl_req *req, char const *arg)
struct g_class *cp;
 
p = gctl_get_asciiparam(req, arg);
-   if (p == NULL)
+   if (p == NULL) {
+   gctl_error(req, "Missing %s argument", arg);
return (NULL);
+   }
LIST_FOREACH(cp, &g_classes, class) {
if (!strcmp(p, cp->name))
return (cp);
}
+   gctl_error(req, "Class not found: \"%s\"", p);
return (NULL);
 }
 
@@ -413,8 +416,10 @@ gctl_get_geom(struct gctl_req *req, struct g_class *mp
struct g_geom *gp;
 
p = gctl_get_asciiparam(req, arg);
-   if (p == NULL)
+   if (p == NULL) {
+   gctl_error(req, "Missing %s argument", arg);
return (NULL);
+   }
LIST_FOREACH(mp, &g_classes, class) {
if (mpr != NULL && mpr != mp)
continue;
@@ -434,8 +439,10 @@ gctl_get_provider(struct gctl_req *req, char const *ar
struct g_provider *pp;
 
p = gctl_get_asciiparam(req, arg);
-   if (p == NULL)
+   if (p == NULL) {
+   gctl_error(req, "Missing '%s' argument", arg);
return (NULL);
+   }
pp = g_provider_by_name(p);
if (pp != NULL)
return (pp);
@@ -453,10 +460,8 @@ g_ctl_req(void *arg, int flag __unused)
g_topology_assert();
req = arg;
mp = gctl_get_class(req, "class");
-   if (mp == NULL) {
-   gctl_error(req, "Class not found");
+   if (mp == NULL)
return;
-   }
if (mp->ctlreq == NULL) {
gctl_error(req, "Class takes no requests");
return;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363360 - head/sys/geom

2020-07-19 Thread Xin LI
Author: delphij
Date: Mon Jul 20 01:55:19 2020
New Revision: 363360
URL: https://svnweb.freebsd.org/changeset/base/363360

Log:
  Fix indent for if clause.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/geom_ccd.c

Modified: head/sys/geom/geom_ccd.c
==
--- head/sys/geom/geom_ccd.cMon Jul 20 00:44:27 2020(r363359)
+++ head/sys/geom/geom_ccd.cMon Jul 20 01:55:19 2020(r363360)
@@ -917,7 +917,7 @@ g_ccd_config(struct gctl_req *req, struct g_class *mp,
} else if (!strcmp(verb, "destroy geom")) {
gp = gctl_get_geom(req, mp, "geom");
if (gp != NULL)
-   g_ccd_destroy_geom(req, mp, gp);
+   g_ccd_destroy_geom(req, mp, gp);
} else if (!strcmp(verb, "list")) {
g_ccd_list(req, mp);
} else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363317 - stable/11/sbin/newfs_msdos

2020-07-18 Thread Xin LI
Author: delphij
Date: Sun Jul 19 03:02:46 2020
New Revision: 363317
URL: https://svnweb.freebsd.org/changeset/base/363317

Log:
  MFC r362937: Use KERN_MAXPHYS.

Modified:
  stable/11/sbin/newfs_msdos/mkfs_msdos.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c
==
--- stable/11/sbin/newfs_msdos/mkfs_msdos.c Sun Jul 19 02:14:34 2020
(r363316)
+++ stable/11/sbin/newfs_msdos/mkfs_msdos.c Sun Jul 19 03:02:46 2020
(r363317)
@@ -36,8 +36,10 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -73,25 +75,6 @@ static const char rcsid[] =
 #defineMAXCLS16  0xfff4U   /* maximum FAT16 clusters */
 #defineMAXCLS32  0xff4U/* maximum FAT32 clusters */
 
-#ifndefCTASSERT
-#defineCTASSERT(x) _CTASSERT(x, __LINE__)
-#define_CTASSERT(x, y) __CTASSERT(x, y)
-#define__CTASSERT(x, y)typedef char __assert_ ## y [(x) ? 1 : 
-1]
-#endif
-
-/*
- * For better performance, we want to write larger chunks instead of
- * individual sectors (the size can only be 512, 1024, 2048 or 4096
- * bytes). Assert that MAXPHYS can always hold an integer number of
- * sectors by asserting that both are power of two numbers and the
- * MAXPHYS is greater than MAXBPS.
- */
-CTASSERT(powerof2(MAXPHYS));
-CTASSERT(powerof2(MAXBPS));
-CTASSERT(MAXPHYS > MAXBPS);
-
-const static ssize_t chunksize = MAXPHYS;
-
 #definemincls(fat)  ((fat) == 12 ? MINCLS12 :  \
  (fat) == 16 ? MINCLS16 :  \
MINCLS32)
@@ -235,6 +218,7 @@ static volatile sig_atomic_t got_siginfo;
 static void infohandler(int);
 
 static int check_mounted(const char *, mode_t);
+static ssize_t getchunksize(void);
 static int getstdfmt(const char *, struct bpb *);
 static int getdiskinfo(int, const char *, const char *, int, struct bpb *);
 static void print_bpb(struct bpb *);
@@ -267,6 +251,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 bool set_res, set_spf, set_spc;
 int fd, fd1, rv;
 struct msdos_options o = *op;
+ssize_t chunksize;
 
 physbuf = NULL;
 rv = -1;
@@ -629,6 +614,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
tm = localtime(&now);
}
 
+   chunksize = getchunksize();
physbuf = malloc(chunksize);
if (physbuf == NULL) {
warn(NULL);
@@ -829,6 +815,47 @@ check_mounted(const char *fname, mode_t mode)
}
 }
 return 0;
+}
+
+/*
+ * Get optimal I/O size
+ */
+static ssize_t
+getchunksize(void)
+{
+   static int chunksize;
+
+   if (chunksize != 0)
+   return ((ssize_t)chunksize);
+
+#ifdef KERN_MAXPHYS
+   int mib[2];
+   size_t len;
+
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_MAXPHYS;
+   len = sizeof(chunksize);
+
+   if (sysctl(mib, 2, &chunksize, &len, NULL, 0) == -1) {
+   warn("sysctl: KERN_MAXPHYS, using %zu", (size_t)MAXPHYS);
+   chunksize = 0;
+   }
+#endif
+   if (chunksize == 0)
+   chunksize = MAXPHYS;
+
+   /*
+* For better performance, we want to write larger chunks instead of
+* individual sectors (the size can only be 512, 1024, 2048 or 4096
+* bytes). Assert that chunksize can always hold an integer number of
+* sectors by asserting that both are power of two numbers and the
+* chunksize is greater than MAXBPS.
+*/
+   static_assert(powerof2(MAXBPS), "MAXBPS is not power of 2");
+   assert(powerof2(chunksize));
+   assert(chunksize > MAXBPS);
+
+   return ((ssize_t)chunksize);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363315 - stable/12/sbin/newfs_msdos

2020-07-18 Thread Xin LI
Author: delphij
Date: Sun Jul 19 01:59:56 2020
New Revision: 363315
URL: https://svnweb.freebsd.org/changeset/base/363315

Log:
  MFC r362937: Use KERN_MAXPHYS.

Modified:
  stable/12/sbin/newfs_msdos/mkfs_msdos.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/newfs_msdos/mkfs_msdos.c
==
--- stable/12/sbin/newfs_msdos/mkfs_msdos.c Sat Jul 18 23:11:40 2020
(r363314)
+++ stable/12/sbin/newfs_msdos/mkfs_msdos.c Sun Jul 19 01:59:56 2020
(r363315)
@@ -36,8 +36,10 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -73,25 +75,6 @@ static const char rcsid[] =
 #defineMAXCLS16  0xfff4U   /* maximum FAT16 clusters */
 #defineMAXCLS32  0xff4U/* maximum FAT32 clusters */
 
-#ifndefCTASSERT
-#defineCTASSERT(x) _CTASSERT(x, __LINE__)
-#define_CTASSERT(x, y) __CTASSERT(x, y)
-#define__CTASSERT(x, y)typedef char __assert_ ## y [(x) ? 1 : 
-1]
-#endif
-
-/*
- * For better performance, we want to write larger chunks instead of
- * individual sectors (the size can only be 512, 1024, 2048 or 4096
- * bytes). Assert that MAXPHYS can always hold an integer number of
- * sectors by asserting that both are power of two numbers and the
- * MAXPHYS is greater than MAXBPS.
- */
-CTASSERT(powerof2(MAXPHYS));
-CTASSERT(powerof2(MAXBPS));
-CTASSERT(MAXPHYS > MAXBPS);
-
-const static ssize_t chunksize = MAXPHYS;
-
 #definemincls(fat)  ((fat) == 12 ? MINCLS12 :  \
  (fat) == 16 ? MINCLS16 :  \
MINCLS32)
@@ -235,6 +218,7 @@ static volatile sig_atomic_t got_siginfo;
 static void infohandler(int);
 
 static int check_mounted(const char *, mode_t);
+static ssize_t getchunksize(void);
 static int getstdfmt(const char *, struct bpb *);
 static int getdiskinfo(int, const char *, const char *, int, struct bpb *);
 static void print_bpb(struct bpb *);
@@ -267,6 +251,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 bool set_res, set_spf, set_spc;
 int fd, fd1, rv;
 struct msdos_options o = *op;
+ssize_t chunksize;
 
 physbuf = NULL;
 rv = -1;
@@ -629,6 +614,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
tm = localtime(&now);
}
 
+   chunksize = getchunksize();
physbuf = malloc(chunksize);
if (physbuf == NULL) {
warn(NULL);
@@ -829,6 +815,47 @@ check_mounted(const char *fname, mode_t mode)
}
 }
 return 0;
+}
+
+/*
+ * Get optimal I/O size
+ */
+static ssize_t
+getchunksize(void)
+{
+   static int chunksize;
+
+   if (chunksize != 0)
+   return ((ssize_t)chunksize);
+
+#ifdef KERN_MAXPHYS
+   int mib[2];
+   size_t len;
+
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_MAXPHYS;
+   len = sizeof(chunksize);
+
+   if (sysctl(mib, 2, &chunksize, &len, NULL, 0) == -1) {
+   warn("sysctl: KERN_MAXPHYS, using %zu", (size_t)MAXPHYS);
+   chunksize = 0;
+   }
+#endif
+   if (chunksize == 0)
+   chunksize = MAXPHYS;
+
+   /*
+* For better performance, we want to write larger chunks instead of
+* individual sectors (the size can only be 512, 1024, 2048 or 4096
+* bytes). Assert that chunksize can always hold an integer number of
+* sectors by asserting that both are power of two numbers and the
+* chunksize is greater than MAXBPS.
+*/
+   static_assert(powerof2(MAXBPS), "MAXBPS is not power of 2");
+   assert(powerof2(chunksize));
+   assert(chunksize > MAXBPS);
+
+   return ((ssize_t)chunksize);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363314 - stable/11/sbin/newfs_msdos

2020-07-18 Thread Xin LI
Author: delphij
Date: Sat Jul 18 23:11:40 2020
New Revision: 363314
URL: https://svnweb.freebsd.org/changeset/base/363314

Log:
  MFC r362936: Gather writes to larger chunks (MAXPHYS) instead of issuing
  them in sectors.

Modified:
  stable/11/sbin/newfs_msdos/mkfs_msdos.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c
==
--- stable/11/sbin/newfs_msdos/mkfs_msdos.c Sat Jul 18 23:05:16 2020
(r363313)
+++ stable/11/sbin/newfs_msdos/mkfs_msdos.c Sat Jul 18 23:11:40 2020
(r363314)
@@ -59,6 +59,7 @@ static const char rcsid[] =
 
 #defineDOSMAGIC  0xaa55/* DOS magic number */
 #defineMINBPS512   /* minimum bytes per sector */
+#defineMAXBPS4096  /* maximum bytes per sector */
 #defineMAXSPC128   /* maximum sectors per cluster */
 #defineMAXNFT16/* maximum number of FATs */
 #defineDEFBLK4096  /* default block size */
@@ -72,6 +73,25 @@ static const char rcsid[] =
 #defineMAXCLS16  0xfff4U   /* maximum FAT16 clusters */
 #defineMAXCLS32  0xff4U/* maximum FAT32 clusters */
 
+#ifndefCTASSERT
+#defineCTASSERT(x) _CTASSERT(x, __LINE__)
+#define_CTASSERT(x, y) __CTASSERT(x, y)
+#define__CTASSERT(x, y)typedef char __assert_ ## y [(x) ? 1 : 
-1]
+#endif
+
+/*
+ * For better performance, we want to write larger chunks instead of
+ * individual sectors (the size can only be 512, 1024, 2048 or 4096
+ * bytes). Assert that MAXPHYS can always hold an integer number of
+ * sectors by asserting that both are power of two numbers and the
+ * MAXPHYS is greater than MAXBPS.
+ */
+CTASSERT(powerof2(MAXPHYS));
+CTASSERT(powerof2(MAXBPS));
+CTASSERT(MAXPHYS > MAXBPS);
+
+const static ssize_t chunksize = MAXPHYS;
+
 #definemincls(fat)  ((fat) == 12 ? MINCLS12 :  \
  (fat) == 16 ? MINCLS16 :  \
MINCLS32)
@@ -238,6 +258,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 struct bsx *bsx;
 struct de *de;
 u_int8_t *img;
+u_int8_t *physbuf, *physbuf_end;
 const char *bname;
 ssize_t n;
 time_t now;
@@ -247,7 +268,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 int fd, fd1, rv;
 struct msdos_options o = *op;
 
-img = NULL;
+physbuf = NULL;
 rv = -1;
 fd = fd1 = -1;
 
@@ -332,15 +353,13 @@ mkfs_msdos(const char *fname, const char *dtype, const
bpb.bpbSecPerClust = 64;/* otherwise 32k */
}
 }
-if (!powerof2(bpb.bpbBytesPerSec)) {
-   warnx("bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec);
+if (bpb.bpbBytesPerSec < MINBPS ||
+bpb.bpbBytesPerSec > MAXBPS ||
+   !powerof2(bpb.bpbBytesPerSec)) {
+   warnx("Invalid bytes/sector (%u): must be 512, 1024, 2048 or 4096",
+   bpb.bpbBytesPerSec);
goto done;
 }
-if (bpb.bpbBytesPerSec < MINBPS) {
-   warnx("bytes/sector (%u) is too small; minimum is %u",
-bpb.bpbBytesPerSec, MINBPS);
-   goto done;
-}
 
 if (o.volume_label && !oklabel(o.volume_label)) {
warnx("%s: bad volume label", o.volume_label);
@@ -610,11 +629,14 @@ mkfs_msdos(const char *fname, const char *dtype, const
tm = localtime(&now);
}
 
-
-   if (!(img = malloc(bpb.bpbBytesPerSec))) {
+   physbuf = malloc(chunksize);
+   if (physbuf == NULL) {
warn(NULL);
goto done;
}
+   physbuf_end = physbuf + chunksize;
+   img = physbuf;
+
dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs :
   bpb.bpbBigFATsecs) * bpb.bpbFATs;
memset(&si_sa, 0, sizeof(si_sa));
@@ -737,19 +759,37 @@ mkfs_msdos(const char *fname, const char *dtype, const
(u_int)tm->tm_mday;
mk2(de->deMDate, x);
}
-   if ((n = write(fd, img, bpb.bpbBytesPerSec)) == -1) {
-   warn("%s", fname);
-   goto done;
+   /*
+* Issue a write of chunksize once we have collected
+* enough sectors.
+*/
+   img += bpb.bpbBytesPerSec;
+   if (img >= physbuf_end) {
+   n = write(fd, physbuf, chunksize);
+   if (n != chunksize) {
+   warnx("%s: can't write sector %u", fname, lsn);
+   goto done;
+   }
+   img = physbuf;
}
-   if ((unsigned)n != bpb.bpbBytesPerSec) {
-   warnx("%s: can't write sector %u", fname, lsn);
-   goto done;
-   }
}
+   /*
+* Write remaining sectors, if the last write didn't end
+* up filling a whole chunk.
+*/
+ 

svn commit: r363313 - stable/12/sbin/newfs_msdos

2020-07-18 Thread Xin LI
Author: delphij
Date: Sat Jul 18 23:05:16 2020
New Revision: 363313
URL: https://svnweb.freebsd.org/changeset/base/363313

Log:
  MFC r362936: Gather writes to larger chunks (MAXPHYS) instead of issuing
  them in sectors.

Modified:
  stable/12/sbin/newfs_msdos/mkfs_msdos.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/newfs_msdos/mkfs_msdos.c
==
--- stable/12/sbin/newfs_msdos/mkfs_msdos.c Sat Jul 18 20:17:40 2020
(r363312)
+++ stable/12/sbin/newfs_msdos/mkfs_msdos.c Sat Jul 18 23:05:16 2020
(r363313)
@@ -59,6 +59,7 @@ static const char rcsid[] =
 
 #defineDOSMAGIC  0xaa55/* DOS magic number */
 #defineMINBPS512   /* minimum bytes per sector */
+#defineMAXBPS4096  /* maximum bytes per sector */
 #defineMAXSPC128   /* maximum sectors per cluster */
 #defineMAXNFT16/* maximum number of FATs */
 #defineDEFBLK4096  /* default block size */
@@ -72,6 +73,25 @@ static const char rcsid[] =
 #defineMAXCLS16  0xfff4U   /* maximum FAT16 clusters */
 #defineMAXCLS32  0xff4U/* maximum FAT32 clusters */
 
+#ifndefCTASSERT
+#defineCTASSERT(x) _CTASSERT(x, __LINE__)
+#define_CTASSERT(x, y) __CTASSERT(x, y)
+#define__CTASSERT(x, y)typedef char __assert_ ## y [(x) ? 1 : 
-1]
+#endif
+
+/*
+ * For better performance, we want to write larger chunks instead of
+ * individual sectors (the size can only be 512, 1024, 2048 or 4096
+ * bytes). Assert that MAXPHYS can always hold an integer number of
+ * sectors by asserting that both are power of two numbers and the
+ * MAXPHYS is greater than MAXBPS.
+ */
+CTASSERT(powerof2(MAXPHYS));
+CTASSERT(powerof2(MAXBPS));
+CTASSERT(MAXPHYS > MAXBPS);
+
+const static ssize_t chunksize = MAXPHYS;
+
 #definemincls(fat)  ((fat) == 12 ? MINCLS12 :  \
  (fat) == 16 ? MINCLS16 :  \
MINCLS32)
@@ -238,6 +258,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 struct bsx *bsx;
 struct de *de;
 u_int8_t *img;
+u_int8_t *physbuf, *physbuf_end;
 const char *bname;
 ssize_t n;
 time_t now;
@@ -247,7 +268,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 int fd, fd1, rv;
 struct msdos_options o = *op;
 
-img = NULL;
+physbuf = NULL;
 rv = -1;
 fd = fd1 = -1;
 
@@ -332,15 +353,13 @@ mkfs_msdos(const char *fname, const char *dtype, const
bpb.bpbSecPerClust = 64;/* otherwise 32k */
}
 }
-if (!powerof2(bpb.bpbBytesPerSec)) {
-   warnx("bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec);
+if (bpb.bpbBytesPerSec < MINBPS ||
+bpb.bpbBytesPerSec > MAXBPS ||
+   !powerof2(bpb.bpbBytesPerSec)) {
+   warnx("Invalid bytes/sector (%u): must be 512, 1024, 2048 or 4096",
+   bpb.bpbBytesPerSec);
goto done;
 }
-if (bpb.bpbBytesPerSec < MINBPS) {
-   warnx("bytes/sector (%u) is too small; minimum is %u",
-bpb.bpbBytesPerSec, MINBPS);
-   goto done;
-}
 
 if (o.volume_label && !oklabel(o.volume_label)) {
warnx("%s: bad volume label", o.volume_label);
@@ -610,11 +629,14 @@ mkfs_msdos(const char *fname, const char *dtype, const
tm = localtime(&now);
}
 
-
-   if (!(img = malloc(bpb.bpbBytesPerSec))) {
+   physbuf = malloc(chunksize);
+   if (physbuf == NULL) {
warn(NULL);
goto done;
}
+   physbuf_end = physbuf + chunksize;
+   img = physbuf;
+
dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs :
   bpb.bpbBigFATsecs) * bpb.bpbFATs;
memset(&si_sa, 0, sizeof(si_sa));
@@ -737,19 +759,37 @@ mkfs_msdos(const char *fname, const char *dtype, const
(u_int)tm->tm_mday;
mk2(de->deMDate, x);
}
-   if ((n = write(fd, img, bpb.bpbBytesPerSec)) == -1) {
-   warn("%s", fname);
-   goto done;
+   /*
+* Issue a write of chunksize once we have collected
+* enough sectors.
+*/
+   img += bpb.bpbBytesPerSec;
+   if (img >= physbuf_end) {
+   n = write(fd, physbuf, chunksize);
+   if (n != chunksize) {
+   warnx("%s: can't write sector %u", fname, lsn);
+   goto done;
+   }
+   img = physbuf;
}
-   if ((unsigned)n != bpb.bpbBytesPerSec) {
-   warnx("%s: can't write sector %u", fname, lsn);
-   goto done;
-   }
}
+   /*
+* Write remaining sectors, if the last write didn't end
+* up filling a whole chunk.
+*/
+ 

svn commit: r363036 - head/sys/geom/concat

2020-07-09 Thread Xin LI
Author: delphij
Date: Thu Jul  9 08:00:46 2020
New Revision: 363036
URL: https://svnweb.freebsd.org/changeset/base/363036

Log:
  g_concat_find_device: trim /dev/ if it is present, like other GEOM
  classes.
  
  Reviewed by:  cem
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25596

Modified:
  head/sys/geom/concat/g_concat.c

Modified: head/sys/geom/concat/g_concat.c
==
--- head/sys/geom/concat/g_concat.c Thu Jul  9 03:46:07 2020
(r363035)
+++ head/sys/geom/concat/g_concat.c Thu Jul  9 08:00:46 2020
(r363036)
@@ -897,6 +897,9 @@ g_concat_find_device(struct g_class *mp, const char *n
struct g_concat_softc *sc;
struct g_geom *gp;
 
+   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+   name += strlen(_PATH_DEV);
+
LIST_FOREACH(gp, &mp->geom, geom) {
sc = gp->softc;
if (sc == NULL)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363034 - in head/sys/geom: . cache concat eli journal label mirror mountver multipath nop part raid raid3 stripe vinum virstor

2020-07-08 Thread Xin LI
Author: delphij
Date: Thu Jul  9 02:52:39 2020
New Revision: 363034
URL: https://svnweb.freebsd.org/changeset/base/363034

Log:
  sys/geom: consistently use _PATH_DEV instead of hardcoding "/dev/".
  
  Reviewed by:  cem
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25565

Modified:
  head/sys/geom/cache/g_cache.c
  head/sys/geom/concat/g_concat.c
  head/sys/geom/eli/g_eli_ctl.c
  head/sys/geom/geom.h
  head/sys/geom/geom_dev.c
  head/sys/geom/geom_subr.c
  head/sys/geom/journal/g_journal.c
  head/sys/geom/label/g_label.c
  head/sys/geom/mirror/g_mirror_ctl.c
  head/sys/geom/mountver/g_mountver.c
  head/sys/geom/multipath/g_multipath.c
  head/sys/geom/nop/g_nop.c
  head/sys/geom/part/g_part.c
  head/sys/geom/raid/g_raid.c
  head/sys/geom/raid/md_ddf.c
  head/sys/geom/raid/md_intel.c
  head/sys/geom/raid/md_jmicron.c
  head/sys/geom/raid/md_nvidia.c
  head/sys/geom/raid/md_promise.c
  head/sys/geom/raid/md_sii.c
  head/sys/geom/raid3/g_raid3_ctl.c
  head/sys/geom/stripe/g_stripe.c
  head/sys/geom/vinum/geom_vinum_share.c
  head/sys/geom/virstor/g_virstor.h

Modified: head/sys/geom/cache/g_cache.c
==
--- head/sys/geom/cache/g_cache.c   Thu Jul  9 00:34:07 2020
(r363033)
+++ head/sys/geom/cache/g_cache.c   Thu Jul  9 02:52:39 2020
(r363034)
@@ -762,8 +762,8 @@ g_cache_ctl_create(struct gctl_req *req, struct g_clas
gctl_error(req, "No 'arg1' argument");
return;
}
-   if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
-   name += strlen("/dev/");
+   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+   name += strlen(_PATH_DEV);
pp = g_provider_by_name(name);
if (pp == NULL) {
G_CACHE_DEBUG(1, "Provider %s is invalid.", name);

Modified: head/sys/geom/concat/g_concat.c
==
--- head/sys/geom/concat/g_concat.c Thu Jul  9 00:34:07 2020
(r363033)
+++ head/sys/geom/concat/g_concat.c Thu Jul  9 02:52:39 2020
(r363034)
@@ -845,8 +845,8 @@ g_concat_ctl_create(struct gctl_req *req, struct g_cla
gctl_error(req, "No 'arg%u' argument.", no);
return;
}
-   if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
-   name += strlen("/dev/");
+   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+   name += strlen(_PATH_DEV);
pp = g_provider_by_name(name);
if (pp == NULL) {
G_CONCAT_DEBUG(1, "Disk %s is invalid.", name);
@@ -871,8 +871,8 @@ g_concat_ctl_create(struct gctl_req *req, struct g_cla
gctl_error(req, "No 'arg%d' argument.", no);
return;
}
-   if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
-   name += strlen("/dev/");
+   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+   name += strlen(_PATH_DEV);
pp = g_provider_by_name(name);
KASSERT(pp != NULL, ("Provider %s disappear?!", name));
if (g_concat_add_disk(sc, pp, no - 1) != 0) {

Modified: head/sys/geom/eli/g_eli_ctl.c
==
--- head/sys/geom/eli/g_eli_ctl.c   Thu Jul  9 00:34:07 2020
(r363033)
+++ head/sys/geom/eli/g_eli_ctl.c   Thu Jul  9 02:52:39 2020
(r363034)
@@ -120,8 +120,8 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class 
gctl_error(req, "No 'arg%u' argument.", 0);
return;
}
-   if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
-   name += strlen("/dev/");
+   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+   name += strlen(_PATH_DEV);
pp = g_provider_by_name(name);
if (pp == NULL) {
gctl_error(req, "Provider %s is invalid.", name);
@@ -186,8 +186,8 @@ g_eli_find_device(struct g_class *mp, const char *prov
struct g_provider *pp;
struct g_consumer *cp;
 
-   if (strncmp(prov, "/dev/", strlen("/dev/")) == 0)
-   prov += strlen("/dev/");
+   if (strncmp(prov, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+   prov += strlen(_PATH_DEV);
LIST_FOREACH(gp, &mp->geom, geom) {
sc = gp->softc;
if (sc == NULL)
@@ -373,8 +373,8 @@ g_eli_ctl_onetime(struct gctl_req *req, struct g_class
gctl_error(req, "No 'arg%u' argument.", 0);
return;
}
-   if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
-   name += strlen("/dev/");
+   if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0)
+   name += strlen(_PATH_DEV);
  

svn commit: r362937 - head/sbin/newfs_msdos

2020-07-04 Thread Xin LI
Author: delphij
Date: Sun Jul  5 00:19:08 2020
New Revision: 362937
URL: https://svnweb.freebsd.org/changeset/base/362937

Log:
  Use KERN_MAXPHYS.
  
  Suggested by: imp
  Reviewed by:  imp, cem (earlier version), emaste
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25563

Modified:
  head/sbin/newfs_msdos/mkfs_msdos.c

Modified: head/sbin/newfs_msdos/mkfs_msdos.c
==
--- head/sbin/newfs_msdos/mkfs_msdos.c  Sat Jul  4 18:37:04 2020
(r362936)
+++ head/sbin/newfs_msdos/mkfs_msdos.c  Sun Jul  5 00:19:08 2020
(r362937)
@@ -41,8 +41,10 @@ static const char rcsid[] =
 #include 
 #endif
 #include 
+#include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -78,25 +80,6 @@ static const char rcsid[] =
 #defineMAXCLS16  0xfff4U   /* maximum FAT16 clusters */
 #defineMAXCLS32  0xff4U/* maximum FAT32 clusters */
 
-#ifndefCTASSERT
-#defineCTASSERT(x) _CTASSERT(x, __LINE__)
-#define_CTASSERT(x, y) __CTASSERT(x, y)
-#define__CTASSERT(x, y)typedef char __assert_ ## y [(x) ? 1 : 
-1]
-#endif
-
-/*
- * For better performance, we want to write larger chunks instead of
- * individual sectors (the size can only be 512, 1024, 2048 or 4096
- * bytes). Assert that MAXPHYS can always hold an integer number of
- * sectors by asserting that both are power of two numbers and the
- * MAXPHYS is greater than MAXBPS.
- */
-CTASSERT(powerof2(MAXPHYS));
-CTASSERT(powerof2(MAXBPS));
-CTASSERT(MAXPHYS > MAXBPS);
-
-const static ssize_t chunksize = MAXPHYS;
-
 #definemincls(fat)  ((fat) == 12 ? MINCLS12 :  \
  (fat) == 16 ? MINCLS16 :  \
MINCLS32)
@@ -240,6 +223,7 @@ static volatile sig_atomic_t got_siginfo;
 static void infohandler(int);
 
 static int check_mounted(const char *, mode_t);
+static ssize_t getchunksize(void);
 static int getstdfmt(const char *, struct bpb *);
 static int getdiskinfo(int, const char *, const char *, int, struct bpb *);
 static void print_bpb(struct bpb *);
@@ -272,6 +256,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 bool set_res, set_spf, set_spc;
 int fd, fd1, rv;
 struct msdos_options o = *op;
+ssize_t chunksize;
 
 physbuf = NULL;
 rv = -1;
@@ -640,6 +625,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
tm = localtime(&now);
}
 
+   chunksize = getchunksize();
physbuf = malloc(chunksize);
if (physbuf == NULL) {
warn(NULL);
@@ -848,6 +834,47 @@ check_mounted(const char *fname, mode_t mode)
 }
 #endif
 return 0;
+}
+
+/*
+ * Get optimal I/O size
+ */
+static ssize_t
+getchunksize(void)
+{
+   static int chunksize;
+
+   if (chunksize != 0)
+   return ((ssize_t)chunksize);
+
+#ifdef KERN_MAXPHYS
+   int mib[2];
+   size_t len;
+
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_MAXPHYS;
+   len = sizeof(chunksize);
+
+   if (sysctl(mib, 2, &chunksize, &len, NULL, 0) == -1) {
+   warn("sysctl: KERN_MAXPHYS, using %zu", (size_t)MAXPHYS);
+   chunksize = 0;
+   }
+#endif
+   if (chunksize == 0)
+   chunksize = MAXPHYS;
+
+   /*
+* For better performance, we want to write larger chunks instead of
+* individual sectors (the size can only be 512, 1024, 2048 or 4096
+* bytes). Assert that chunksize can always hold an integer number of
+* sectors by asserting that both are power of two numbers and the
+* chunksize is greater than MAXBPS.
+*/
+   static_assert(powerof2(MAXBPS), "MAXBPS is not power of 2");
+   assert(powerof2(chunksize));
+   assert(chunksize > MAXBPS);
+
+   return ((ssize_t)chunksize);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r362936 - head/sbin/newfs_msdos

2020-07-04 Thread Xin Li via svn-src-all


On 7/4/20 12:01 PM, Conrad Meyer wrote:
> Hi Xin Li,
> 
> Maybe we can use C11 static_assert instead of the CTASSERT array mechanism?

Good point, maybe https://reviews.freebsd.org/D25562 ?



signature.asc
Description: OpenPGP digital signature


svn commit: r362936 - head/sbin/newfs_msdos

2020-07-04 Thread Xin LI
Author: delphij
Date: Sat Jul  4 18:37:04 2020
New Revision: 362936
URL: https://svnweb.freebsd.org/changeset/base/362936

Log:
  Gather writes to larger chunks (MAXPHYS) instead of issuing them in
  sectors.
  
  On my SanDisk Cruzer Blade 16GB USB stick this made formatting much faster:
  
  x before
  + after
  +--+
  |+ |
  |+  x  |
  |+  x x|
  |A  MA||
  +--+
  N   Min   MaxMedian   AvgStddev
  x   3 15.89 16.3816 16.09 0.2570992
  +   3  0.32  0.37  0.350.3467   0.025166115
  Difference at 95.0% confidence
-15.7433 +/- 0.414029
-97.8455% +/- 0.25668%
(Student's t, pooled s = 0.182665)
  
  Reviewed by:  emaste
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D24508

Modified:
  head/sbin/newfs_msdos/mkfs_msdos.c

Modified: head/sbin/newfs_msdos/mkfs_msdos.c
==
--- head/sbin/newfs_msdos/mkfs_msdos.c  Sat Jul  4 18:01:29 2020
(r362935)
+++ head/sbin/newfs_msdos/mkfs_msdos.c  Sat Jul  4 18:37:04 2020
(r362936)
@@ -64,6 +64,7 @@ static const char rcsid[] =
 
 #defineDOSMAGIC  0xaa55/* DOS magic number */
 #defineMINBPS512   /* minimum bytes per sector */
+#defineMAXBPS4096  /* maximum bytes per sector */
 #defineMAXSPC128   /* maximum sectors per cluster */
 #defineMAXNFT16/* maximum number of FATs */
 #defineDEFBLK4096  /* default block size */
@@ -77,6 +78,25 @@ static const char rcsid[] =
 #defineMAXCLS16  0xfff4U   /* maximum FAT16 clusters */
 #defineMAXCLS32  0xff4U/* maximum FAT32 clusters */
 
+#ifndefCTASSERT
+#defineCTASSERT(x) _CTASSERT(x, __LINE__)
+#define_CTASSERT(x, y) __CTASSERT(x, y)
+#define__CTASSERT(x, y)typedef char __assert_ ## y [(x) ? 1 : 
-1]
+#endif
+
+/*
+ * For better performance, we want to write larger chunks instead of
+ * individual sectors (the size can only be 512, 1024, 2048 or 4096
+ * bytes). Assert that MAXPHYS can always hold an integer number of
+ * sectors by asserting that both are power of two numbers and the
+ * MAXPHYS is greater than MAXBPS.
+ */
+CTASSERT(powerof2(MAXPHYS));
+CTASSERT(powerof2(MAXBPS));
+CTASSERT(MAXPHYS > MAXBPS);
+
+const static ssize_t chunksize = MAXPHYS;
+
 #definemincls(fat)  ((fat) == 12 ? MINCLS12 :  \
  (fat) == 16 ? MINCLS16 :  \
MINCLS32)
@@ -243,6 +263,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 struct bsx *bsx;
 struct de *de;
 u_int8_t *img;
+u_int8_t *physbuf, *physbuf_end;
 const char *bname;
 ssize_t n;
 time_t now;
@@ -252,7 +273,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 int fd, fd1, rv;
 struct msdos_options o = *op;
 
-img = NULL;
+physbuf = NULL;
 rv = -1;
 fd = fd1 = -1;
 
@@ -343,15 +364,13 @@ mkfs_msdos(const char *fname, const char *dtype, const
bpb.bpbSecPerClust = 64;/* otherwise 32k */
}
 }
-if (!powerof2(bpb.bpbBytesPerSec)) {
-   warnx("bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec);
+if (bpb.bpbBytesPerSec < MINBPS ||
+bpb.bpbBytesPerSec > MAXBPS ||
+   !powerof2(bpb.bpbBytesPerSec)) {
+   warnx("Invalid bytes/sector (%u): must be 512, 1024, 2048 or 4096",
+   bpb.bpbBytesPerSec);
goto done;
 }
-if (bpb.bpbBytesPerSec < MINBPS) {
-   warnx("bytes/sector (%u) is too small; minimum is %u",
-bpb.bpbBytesPerSec, MINBPS);
-   goto done;
-}
 
 if (o.volume_label && !oklabel(o.volume_label)) {
warnx("%s: bad volume label", o.volume_label);
@@ -621,11 +640,14 @@ mkfs_msdos(const char *fname, const char *dtype, const
tm = localtime(&now);
}
 
-
-   if (!(img = malloc(bpb.bpbBytesPerSec))) {
+   physbuf = malloc(chunksize);
+   if (physbuf == NULL) {
warn(NULL);
goto done;
}
+   physbuf_end = physbuf + chunksize;
+   img = physbuf;
+
dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs :
   bpb.bpbBigFATsecs) * bpb.bpbFATs;
memset(&si_sa, 0, sizeof(si_sa));
@@ -750,19 +772,37 @@ mkfs_msdos(const char *fname, const char *dtype, 

svn commit: r362919 - stable/11/sys/sys

2020-07-03 Thread Xin LI
Author: delphij
Date: Sat Jul  4 03:30:19 2020
New Revision: 362919
URL: https://svnweb.freebsd.org/changeset/base/362919

Log:
  Bump __FreeBSD_version after making liblzma to use libmd implementation
  of SHA256.

Modified:
  stable/11/sys/sys/param.h

Modified: stable/11/sys/sys/param.h
==
--- stable/11/sys/sys/param.h   Sat Jul  4 03:29:19 2020(r362918)
+++ stable/11/sys/sys/param.h   Sat Jul  4 03:30:19 2020(r362919)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1104501  /* Master, propagated to newvers */
+#define __FreeBSD_version 1104502  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362918 - in stable/11: . contrib/xz/src/liblzma/check lib/liblzma share/mk

2020-07-03 Thread Xin LI
Author: delphij
Date: Sat Jul  4 03:29:19 2020
New Revision: 362918
URL: https://svnweb.freebsd.org/changeset/base/362918

Log:
  MFC r362452, r362478: liblzma: Make liblzma use libmd implementation of 
SHA256.

Deleted:
  stable/11/contrib/xz/src/liblzma/check/sha256.c
Modified:
  stable/11/Makefile.inc1
  stable/11/lib/liblzma/Makefile
  stable/11/lib/liblzma/Symbol.map
  stable/11/lib/liblzma/config.h
  stable/11/share/mk/src.libnames.mk
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/Makefile.inc1
==
--- stable/11/Makefile.inc1 Sat Jul  4 03:28:13 2020(r362917)
+++ stable/11/Makefile.inc1 Sat Jul  4 03:29:19 2020(r362918)
@@ -2231,7 +2231,7 @@ _lib_casper=  lib/libcasper
 
 lib/libpjdlog__L: lib/libutil__L
 lib/libcasper__L: lib/libnv__L
-lib/liblzma__L: lib/libthr__L
+lib/liblzma__L: lib/libmd__L lib/libthr__L
 
 _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} 
usr.bin/lex/lib
 .for _DIR in ${LOCAL_LIB_DIRS}

Modified: stable/11/lib/liblzma/Makefile
==
--- stable/11/lib/liblzma/Makefile  Sat Jul  4 03:28:13 2020
(r362917)
+++ stable/11/lib/liblzma/Makefile  Sat Jul  4 03:29:19 2020
(r362918)
@@ -78,8 +78,7 @@ SRCS+=common.c \
 .PATH: ${LZMADIR}/check
 SRCS+= check.c \
crc32_table.c \
-   crc64_table.c \
-   sha256.c
+   crc64_table.c
 .if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386"
 SRCS+= crc32_x86.S \
crc64_x86.S
@@ -125,11 +124,11 @@ SRCS+=simple_coder.c \
 
 .PATH: ${LZMADIR}
 
-VERSION_MAJOR!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MAJOR" 
{print $$3 } ' \
+VERSION_MAJOR!=sed -n '/define.*LZMA_VERSION_MAJOR/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
-VERSION_MINOR!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MINOR" 
{print $$3 } ' \
+VERSION_MINOR!=sed -n '/define.*LZMA_VERSION_MINOR/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
-VERSION_PATCH!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_PATCH" 
{print $$3 } ' \
+VERSION_PATCH!=sed -n '/define.*LZMA_VERSION_PATCH/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
 
 WARNS?=3
@@ -147,7 +146,7 @@ CFLAGS+=-DHAVE_CONFIG_H \
-I${LZMADIR}/simple \
-I${LZMADIR:H}/common
 
-LIBADD+=   pthread
+LIBADD+=   md pthread
 
 VERSION_DEF=   ${.CURDIR}/Versions.def
 SYMBOL_MAPS=   ${.CURDIR}/Symbol.map
@@ -160,10 +159,11 @@ FILESDIR= ${LIBDATADIR}/pkgconfig
 
 liblzma.pc: liblzma.pc.in
sed -e 's,@prefix@,/usr,g ; \
-   s,@exec_prefix@,/usr,g  ; \
+   s,@exec_prefix@,/usr,g ; \
s,@libdir@,/usr/lib,g ; \
s,@includedir@,/usr/include,g ; \
-   s,@PACKAGE_URL@,http://tukaani.org/xz/,g ; \
+   s,@LIBS@,-pthread -lmd,g ; \
+   s,@PACKAGE_URL@,https://tukaani.org/xz/,g ; \

s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \
s,@PTHREAD_CFLAGS@,,g ; \
s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET}

Modified: stable/11/lib/liblzma/Symbol.map
==
--- stable/11/lib/liblzma/Symbol.mapSat Jul  4 03:28:13 2020
(r362917)
+++ stable/11/lib/liblzma/Symbol.mapSat Jul  4 03:29:19 2020
(r362918)
@@ -180,9 +180,6 @@ XZprivate_1.0 {
lzma_raw_coder_memusage;
lzma_raw_decoder_init;
lzma_raw_encoder_init;
-   lzma_sha256_finish;
-   lzma_sha256_init;
-   lzma_sha256_update;
lzma_simple_arm_decoder_init;
lzma_simple_arm_encoder_init;
lzma_simple_armthumb_decoder_init;

Modified: stable/11/lib/liblzma/config.h
==
--- stable/11/lib/liblzma/config.h  Sat Jul  4 03:28:13 2020
(r362917)
+++ stable/11/lib/liblzma/config.h  Sat Jul  4 03:29:19 2020
(r362918)
@@ -211,16 +211,13 @@
 /* #undef HAVE_SHA256INIT */
 
 /* Define to 1 if the system has the type `SHA256_CTX'. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_CTX */
+#define HAVE_SHA256_CTX 1
 
 /* Define to 1 if you have the  header file. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_H */
+#define HAVE_SHA256_H 1
 
 /* Define to 1 if you have the `SHA256_Init' function. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_INIT */
+#define HAVE_SHA256_INIT 1
 
 /* Define to 1 if the system has the type `SHA2_CTX'. */
 /* #undef HAVE_SHA2_CTX */

Modified: stable/11/share/mk/src.libnames.mk

svn commit: r362916 - stable/12/sys/sys

2020-07-03 Thread Xin LI
Author: delphij
Date: Sat Jul  4 03:27:51 2020
New Revision: 362916
URL: https://svnweb.freebsd.org/changeset/base/362916

Log:
  Bump __FreeBSD_version after making liblzma to use libmd implementation
  of SHA256.

Modified:
  stable/12/sys/sys/param.h

Modified: stable/12/sys/sys/param.h
==
--- stable/12/sys/sys/param.h   Sat Jul  4 03:26:17 2020(r362915)
+++ stable/12/sys/sys/param.h   Sat Jul  4 03:27:51 2020(r362916)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1201518  /* Master, propagated to newvers */
+#define __FreeBSD_version 1201519  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362915 - in stable/12: . contrib/xz/src/liblzma/check lib/liblzma share/mk

2020-07-03 Thread Xin LI
Author: delphij
Date: Sat Jul  4 03:26:17 2020
New Revision: 362915
URL: https://svnweb.freebsd.org/changeset/base/362915

Log:
  MFC r362452, r362478: liblzma: Make liblzma use libmd implementation of 
SHA256.

Deleted:
  stable/12/contrib/xz/src/liblzma/check/sha256.c
Modified:
  stable/12/Makefile.inc1
  stable/12/lib/liblzma/Makefile
  stable/12/lib/liblzma/Symbol.map
  stable/12/lib/liblzma/config.h
  stable/12/share/mk/src.libnames.mk
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/Makefile.inc1
==
--- stable/12/Makefile.inc1 Fri Jul  3 20:32:53 2020(r362914)
+++ stable/12/Makefile.inc1 Sat Jul  4 03:26:17 2020(r362915)
@@ -2668,7 +2668,7 @@ _lib_casper=  lib/libcasper
 
 lib/libpjdlog__L: lib/libutil__L
 lib/libcasper__L: lib/libnv__L
-lib/liblzma__L: lib/libthr__L
+lib/liblzma__L: lib/libmd__L lib/libthr__L
 
 _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} 
usr.bin/lex/lib
 .if ${MK_IPFILTER} != "no"

Modified: stable/12/lib/liblzma/Makefile
==
--- stable/12/lib/liblzma/Makefile  Fri Jul  3 20:32:53 2020
(r362914)
+++ stable/12/lib/liblzma/Makefile  Sat Jul  4 03:26:17 2020
(r362915)
@@ -78,8 +78,7 @@ SRCS+=common.c \
 .PATH: ${LZMADIR}/check
 SRCS+= check.c \
crc32_table.c \
-   crc64_table.c \
-   sha256.c
+   crc64_table.c
 .if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386"
 SRCS+= crc32_x86.S \
crc64_x86.S
@@ -125,11 +124,11 @@ SRCS+=simple_coder.c \
 
 .PATH: ${LZMADIR}
 
-VERSION_MAJOR!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MAJOR" 
{print $$3 } ' \
+VERSION_MAJOR!=sed -n '/define.*LZMA_VERSION_MAJOR/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
-VERSION_MINOR!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MINOR" 
{print $$3 } ' \
+VERSION_MINOR!=sed -n '/define.*LZMA_VERSION_MINOR/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
-VERSION_PATCH!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_PATCH" 
{print $$3 } ' \
+VERSION_PATCH!=sed -n '/define.*LZMA_VERSION_PATCH/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
 
 WARNS?=3
@@ -147,7 +146,7 @@ CFLAGS+=-DHAVE_CONFIG_H \
-I${LZMADIR}/simple \
-I${LZMADIR:H}/common
 
-LIBADD+=   pthread
+LIBADD+=   md pthread
 
 VERSION_DEF=   ${.CURDIR}/Versions.def
 SYMBOL_MAPS=   ${.CURDIR}/Symbol.map
@@ -160,10 +159,11 @@ FILESDIR= ${LIBDATADIR}/pkgconfig
 
 liblzma.pc: liblzma.pc.in
sed -e 's,@prefix@,/usr,g ; \
-   s,@exec_prefix@,/usr,g  ; \
+   s,@exec_prefix@,/usr,g ; \
s,@libdir@,/usr/lib,g ; \
s,@includedir@,/usr/include,g ; \
-   s,@PACKAGE_URL@,http://tukaani.org/xz/,g ; \
+   s,@LIBS@,-pthread -lmd,g ; \
+   s,@PACKAGE_URL@,https://tukaani.org/xz/,g ; \

s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \
s,@PTHREAD_CFLAGS@,,g ; \
s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET}

Modified: stable/12/lib/liblzma/Symbol.map
==
--- stable/12/lib/liblzma/Symbol.mapFri Jul  3 20:32:53 2020
(r362914)
+++ stable/12/lib/liblzma/Symbol.mapSat Jul  4 03:26:17 2020
(r362915)
@@ -180,9 +180,6 @@ XZprivate_1.0 {
lzma_raw_coder_memusage;
lzma_raw_decoder_init;
lzma_raw_encoder_init;
-   lzma_sha256_finish;
-   lzma_sha256_init;
-   lzma_sha256_update;
lzma_simple_arm_decoder_init;
lzma_simple_arm_encoder_init;
lzma_simple_armthumb_decoder_init;

Modified: stable/12/lib/liblzma/config.h
==
--- stable/12/lib/liblzma/config.h  Fri Jul  3 20:32:53 2020
(r362914)
+++ stable/12/lib/liblzma/config.h  Sat Jul  4 03:26:17 2020
(r362915)
@@ -211,16 +211,13 @@
 /* #undef HAVE_SHA256INIT */
 
 /* Define to 1 if the system has the type `SHA256_CTX'. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_CTX */
+#define HAVE_SHA256_CTX 1
 
 /* Define to 1 if you have the  header file. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_H */
+#define HAVE_SHA256_H 1
 
 /* Define to 1 if you have the `SHA256_Init' function. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_INIT */
+#define HAVE_SHA256_INIT 1
 
 /* Define to 1 if the system has the type `SHA2_CTX'. */
 /* #undef HAVE_SHA2_CTX */

Modified: stable/12/share/mk/src.libnames.mk

svn commit: r362908 - stable/11/crypto/openssh

2020-07-03 Thread Xin LI
Author: delphij
Date: Fri Jul  3 07:25:26 2020
New Revision: 362908
URL: https://svnweb.freebsd.org/changeset/base/362908

Log:
  MFC r362642: Don't log normal login_getpwclass(3) result.

Modified:
  stable/11/crypto/openssh/auth2.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/crypto/openssh/auth2.c
==
--- stable/11/crypto/openssh/auth2.cFri Jul  3 07:22:34 2020
(r362907)
+++ stable/11/crypto/openssh/auth2.cFri Jul  3 07:25:26 2020
(r362908)
@@ -276,8 +276,6 @@ input_userauth_request(int type, u_int32_t seq, void *
 #ifdef HAVE_LOGIN_CAP
if (authctxt->pw != NULL &&
(lc = login_getpwclass(authctxt->pw)) != NULL) {
-   logit("user %s login class %s", authctxt->pw->pw_name,
-   authctxt->pw->pw_class);
from_host = auth_get_canonical_hostname(ssh, options.use_dns);
from_ip = ssh_remote_ipaddr(ssh);
if (!auth_hostok(lc, from_host, from_ip)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362907 - stable/12/crypto/openssh

2020-07-03 Thread Xin LI
Author: delphij
Date: Fri Jul  3 07:22:34 2020
New Revision: 362907
URL: https://svnweb.freebsd.org/changeset/base/362907

Log:
  MFC r362642: Don't log normal login_getpwclass(3) result.

Modified:
  stable/12/crypto/openssh/auth2.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/crypto/openssh/auth2.c
==
--- stable/12/crypto/openssh/auth2.cFri Jul  3 05:21:05 2020
(r362906)
+++ stable/12/crypto/openssh/auth2.cFri Jul  3 07:22:34 2020
(r362907)
@@ -317,8 +317,6 @@ input_userauth_request(int type, u_int32_t seq, struct
 #ifdef HAVE_LOGIN_CAP
if (authctxt->pw != NULL &&
(lc = PRIVSEP(login_getpwclass(authctxt->pw))) != NULL) {
-   logit("user %s login class %s", authctxt->pw->pw_name,
-   authctxt->pw->pw_class);
from_host = auth_get_canonical_hostname(ssh, options.use_dns);
from_ip = ssh_remote_ipaddr(ssh);
if (!auth_hostok(lc, from_host, from_ip)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362844 - in stable/11: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src lib/libmagic

2020-07-01 Thread Xin LI
Author: delphij
Date: Wed Jul  1 16:37:08 2020
New Revision: 362844
URL: https://svnweb.freebsd.org/changeset/base/362844

Log:
  MFC r362258, r362279: file 5.39
  
  Relnotes: yes

Added:
  stable/11/contrib/file/libmagic.pc.in
 - copied unchanged from r362258, head/contrib/file/libmagic.pc.in
  stable/11/contrib/file/magic/Magdir/asf
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/asf
  stable/11/contrib/file/magic/Magdir/dif
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/dif
  stable/11/contrib/file/magic/Magdir/sylk
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/sylk
  stable/11/contrib/file/magic/Magdir/unisig
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/unisig
  stable/11/contrib/file/magic/Magdir/usd
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/usd
  stable/11/contrib/file/magic/Magdir/web
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/web
Modified:
  stable/11/contrib/file/ChangeLog
  stable/11/contrib/file/Makefile.am
  stable/11/contrib/file/Makefile.in
  stable/11/contrib/file/configure
  stable/11/contrib/file/configure.ac
  stable/11/contrib/file/doc/file.man
  stable/11/contrib/file/doc/magic.man
  stable/11/contrib/file/magic/Magdir/animation
  stable/11/contrib/file/magic/Magdir/archive
  stable/11/contrib/file/magic/Magdir/cad
  stable/11/contrib/file/magic/Magdir/commands
  stable/11/contrib/file/magic/Magdir/compress
  stable/11/contrib/file/magic/Magdir/console
  stable/11/contrib/file/magic/Magdir/database
  stable/11/contrib/file/magic/Magdir/der
  stable/11/contrib/file/magic/Magdir/elf
  stable/11/contrib/file/magic/Magdir/filesystems
  stable/11/contrib/file/magic/Magdir/games
  stable/11/contrib/file/magic/Magdir/gnu
  stable/11/contrib/file/magic/Magdir/images
  stable/11/contrib/file/magic/Magdir/intel
  stable/11/contrib/file/magic/Magdir/kicad
  stable/11/contrib/file/magic/Magdir/linux
  stable/11/contrib/file/magic/Magdir/msdos
  stable/11/contrib/file/magic/Magdir/ole2compounddocs
  stable/11/contrib/file/magic/Magdir/parix
  stable/11/contrib/file/magic/Magdir/pascal
  stable/11/contrib/file/magic/Magdir/pdf
  stable/11/contrib/file/magic/Magdir/pgp
  stable/11/contrib/file/magic/Magdir/python
  stable/11/contrib/file/magic/Magdir/riff
  stable/11/contrib/file/magic/Magdir/rst
  stable/11/contrib/file/magic/Magdir/rtf
  stable/11/contrib/file/magic/Magdir/sgml
  stable/11/contrib/file/magic/Magdir/sniffer
  stable/11/contrib/file/magic/Magdir/ssh
  stable/11/contrib/file/magic/Magdir/ti-8x
  stable/11/contrib/file/magic/Magdir/tplink
  stable/11/contrib/file/magic/Magdir/troff
  stable/11/contrib/file/magic/Magdir/virtual
  stable/11/contrib/file/magic/Magdir/windows
  stable/11/contrib/file/magic/Magdir/wordprocessors
  stable/11/contrib/file/magic/Magdir/zip
  stable/11/contrib/file/magic/Makefile.am
  stable/11/contrib/file/magic/Makefile.in
  stable/11/contrib/file/src/apprentice.c
  stable/11/contrib/file/src/ascmagic.c
  stable/11/contrib/file/src/buffer.c
  stable/11/contrib/file/src/compress.c
  stable/11/contrib/file/src/der.c
  stable/11/contrib/file/src/file.c
  stable/11/contrib/file/src/file.h
  stable/11/contrib/file/src/file_opts.h
  stable/11/contrib/file/src/funcs.c
  stable/11/contrib/file/src/is_json.c
  stable/11/contrib/file/src/magic.c
  stable/11/contrib/file/src/print.c
  stable/11/contrib/file/src/readelf.c
  stable/11/contrib/file/src/seccomp.c
  stable/11/contrib/file/src/softmagic.c
  stable/11/lib/libmagic/Makefile
  stable/11/lib/libmagic/config.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/file/ChangeLog
==
--- stable/11/contrib/file/ChangeLogWed Jul  1 16:33:32 2020
(r362843)
+++ stable/11/contrib/file/ChangeLogWed Jul  1 16:37:08 2020
(r362844)
@@ -1,3 +1,83 @@
+2020-06-14  20:02  Christos Zoulas 
+
+   * release 5.39
+
+2020-06-07  20:00  Christos Zoulas 
+
+   * Remove unused subtype_mime (Steve Grubb)
+   * Remove unused check in okstat (Steve Grubb)
+   * Fix mime-type in elf binaries by making sure $x is set
+   * Fix indirect negative offsets broken by OFFNEGATIVE
+   * Fix GUID equality check
+   * PR/165: Handle empty array and strings in JSON
+   * PR/162: Add --exclude-quiet
+
+2020-06-06  15:33  Christos Zoulas 
+
+   * Fix memory leak in ascmagic (Steve Grubb)
+
+2020-06-04  00:21  Christos Zoulas 
+
+   * Fix string comparison length with ignore whitespace
+
+2020-05-31  00:11  Christos Zoulas 
+
+   * Fix mingwin 64 compilation
+
+2020-05-30  23:56  Christos Zoulas 
+
+   * PR/159: whitelist getpid needed for file_pipe2file()
+
+2020-05-09  18:57  Christos Zoulas 
+
+   * Indicate negative offsets with a flag OFFNEGATIVE
+ so that -0 works.
+   * Introduce "offset" magic type that can be 

svn commit: r362842 - in stable/12: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src lib/libmagic

2020-07-01 Thread Xin LI
Author: delphij
Date: Wed Jul  1 16:18:35 2020
New Revision: 362842
URL: https://svnweb.freebsd.org/changeset/base/362842

Log:
  MFC r362258, r362279: file 5.39
  
  Relnotes: yes

Added:
  stable/12/contrib/file/libmagic.pc.in
 - copied unchanged from r362258, head/contrib/file/libmagic.pc.in
  stable/12/contrib/file/magic/Magdir/asf
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/asf
  stable/12/contrib/file/magic/Magdir/dif
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/dif
  stable/12/contrib/file/magic/Magdir/sylk
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/sylk
  stable/12/contrib/file/magic/Magdir/unisig
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/unisig
  stable/12/contrib/file/magic/Magdir/usd
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/usd
  stable/12/contrib/file/magic/Magdir/web
 - copied unchanged from r362258, head/contrib/file/magic/Magdir/web
Modified:
  stable/12/contrib/file/ChangeLog
  stable/12/contrib/file/Makefile.am
  stable/12/contrib/file/Makefile.in
  stable/12/contrib/file/configure
  stable/12/contrib/file/configure.ac
  stable/12/contrib/file/doc/file.man
  stable/12/contrib/file/doc/magic.man
  stable/12/contrib/file/magic/Magdir/animation
  stable/12/contrib/file/magic/Magdir/archive
  stable/12/contrib/file/magic/Magdir/cad
  stable/12/contrib/file/magic/Magdir/commands
  stable/12/contrib/file/magic/Magdir/compress
  stable/12/contrib/file/magic/Magdir/console
  stable/12/contrib/file/magic/Magdir/database
  stable/12/contrib/file/magic/Magdir/der
  stable/12/contrib/file/magic/Magdir/elf
  stable/12/contrib/file/magic/Magdir/filesystems
  stable/12/contrib/file/magic/Magdir/games
  stable/12/contrib/file/magic/Magdir/gnu
  stable/12/contrib/file/magic/Magdir/images
  stable/12/contrib/file/magic/Magdir/intel
  stable/12/contrib/file/magic/Magdir/kicad
  stable/12/contrib/file/magic/Magdir/linux
  stable/12/contrib/file/magic/Magdir/msdos
  stable/12/contrib/file/magic/Magdir/ole2compounddocs
  stable/12/contrib/file/magic/Magdir/parix
  stable/12/contrib/file/magic/Magdir/pascal
  stable/12/contrib/file/magic/Magdir/pdf
  stable/12/contrib/file/magic/Magdir/pgp
  stable/12/contrib/file/magic/Magdir/python
  stable/12/contrib/file/magic/Magdir/riff
  stable/12/contrib/file/magic/Magdir/rst
  stable/12/contrib/file/magic/Magdir/rtf
  stable/12/contrib/file/magic/Magdir/sgml
  stable/12/contrib/file/magic/Magdir/sniffer
  stable/12/contrib/file/magic/Magdir/ssh
  stable/12/contrib/file/magic/Magdir/ti-8x
  stable/12/contrib/file/magic/Magdir/tplink
  stable/12/contrib/file/magic/Magdir/troff
  stable/12/contrib/file/magic/Magdir/virtual
  stable/12/contrib/file/magic/Magdir/windows
  stable/12/contrib/file/magic/Magdir/wordprocessors
  stable/12/contrib/file/magic/Magdir/zip
  stable/12/contrib/file/magic/Makefile.am
  stable/12/contrib/file/magic/Makefile.in
  stable/12/contrib/file/src/apprentice.c
  stable/12/contrib/file/src/ascmagic.c
  stable/12/contrib/file/src/buffer.c
  stable/12/contrib/file/src/compress.c
  stable/12/contrib/file/src/der.c
  stable/12/contrib/file/src/file.c
  stable/12/contrib/file/src/file.h
  stable/12/contrib/file/src/file_opts.h
  stable/12/contrib/file/src/funcs.c
  stable/12/contrib/file/src/is_json.c
  stable/12/contrib/file/src/magic.c
  stable/12/contrib/file/src/print.c
  stable/12/contrib/file/src/readelf.c
  stable/12/contrib/file/src/seccomp.c
  stable/12/contrib/file/src/softmagic.c
  stable/12/lib/libmagic/Makefile
  stable/12/lib/libmagic/config.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/file/ChangeLog
==
--- stable/12/contrib/file/ChangeLogWed Jul  1 16:17:51 2020
(r362841)
+++ stable/12/contrib/file/ChangeLogWed Jul  1 16:18:35 2020
(r362842)
@@ -1,3 +1,83 @@
+2020-06-14  20:02  Christos Zoulas 
+
+   * release 5.39
+
+2020-06-07  20:00  Christos Zoulas 
+
+   * Remove unused subtype_mime (Steve Grubb)
+   * Remove unused check in okstat (Steve Grubb)
+   * Fix mime-type in elf binaries by making sure $x is set
+   * Fix indirect negative offsets broken by OFFNEGATIVE
+   * Fix GUID equality check
+   * PR/165: Handle empty array and strings in JSON
+   * PR/162: Add --exclude-quiet
+
+2020-06-06  15:33  Christos Zoulas 
+
+   * Fix memory leak in ascmagic (Steve Grubb)
+
+2020-06-04  00:21  Christos Zoulas 
+
+   * Fix string comparison length with ignore whitespace
+
+2020-05-31  00:11  Christos Zoulas 
+
+   * Fix mingwin 64 compilation
+
+2020-05-30  23:56  Christos Zoulas 
+
+   * PR/159: whitelist getpid needed for file_pipe2file()
+
+2020-05-09  18:57  Christos Zoulas 
+
+   * Indicate negative offsets with a flag OFFNEGATIVE
+ so that -0 works.
+   * Introduce "offset" magic type that can be 

svn commit: r362642 - head/crypto/openssh

2020-06-25 Thread Xin LI
Author: delphij
Date: Fri Jun 26 04:46:45 2020
New Revision: 362642
URL: https://svnweb.freebsd.org/changeset/base/362642

Log:
  Don't log normal login_getpwclass(3) result.
  
  The logging was introduced in r314527 but doesn't appear to be useful
  for regular operation, and as the result, for users with no class set
  (very common) the administrator would see a message like this in their
  auth.log:
  
sshd[44251]: user root login class [preauth]
  
  (note that the class was "" because that's what's typically configured
  for most users; we would get 'default' if lc->lc_class is chosen)
  
  Remove this log as it can be annoying as the lookup happen before
  authentication and repeats, and our code is not acting upon lc_class
  or pw_class directly anyways.
  
  Reviewed by:  cem, imp
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D24997

Modified:
  head/crypto/openssh/auth2.c

Modified: head/crypto/openssh/auth2.c
==
--- head/crypto/openssh/auth2.c Fri Jun 26 03:18:10 2020(r362641)
+++ head/crypto/openssh/auth2.c Fri Jun 26 04:46:45 2020(r362642)
@@ -317,8 +317,6 @@ input_userauth_request(int type, u_int32_t seq, struct
 #ifdef HAVE_LOGIN_CAP
if (authctxt->pw != NULL &&
(lc = PRIVSEP(login_getpwclass(authctxt->pw))) != NULL) {
-   logit("user %s login class %s", authctxt->pw->pw_name,
-   authctxt->pw->pw_class);
from_host = auth_get_canonical_hostname(ssh, options.use_dns);
from_ip = ssh_remote_ipaddr(ssh);
if (!auth_hostok(lc, from_host, from_ip)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362453 - head/sys/sys

2020-06-20 Thread Xin LI
Author: delphij
Date: Sat Jun 20 21:32:14 2020
New Revision: 362453
URL: https://svnweb.freebsd.org/changeset/base/362453

Log:
  Bump __FreeBSD_version after making liblzma to use libmd implementation
  of SHA256.
  
  PR:   200142

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hSat Jun 20 21:32:07 2020(r362452)
+++ head/sys/sys/param.hSat Jun 20 21:32:14 2020(r362453)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300098  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300099  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362452 - in head: contrib/xz/src/liblzma/check lib/liblzma share/mk

2020-06-20 Thread Xin LI
Author: delphij
Date: Sat Jun 20 21:32:07 2020
New Revision: 362452
URL: https://svnweb.freebsd.org/changeset/base/362452

Log:
  liblzma: Make liblzma use libmd implementation of SHA256.
  
  MFC after:2 weeks
  PR:   200142

Deleted:
  head/contrib/xz/src/liblzma/check/sha256.c
Modified:
  head/lib/liblzma/Makefile
  head/lib/liblzma/Symbol.map
  head/lib/liblzma/config.h
  head/share/mk/src.libnames.mk

Modified: head/lib/liblzma/Makefile
==
--- head/lib/liblzma/Makefile   Sat Jun 20 21:06:02 2020(r362451)
+++ head/lib/liblzma/Makefile   Sat Jun 20 21:32:07 2020(r362452)
@@ -78,8 +78,7 @@ SRCS+=common.c \
 .PATH: ${LZMADIR}/check
 SRCS+= check.c \
crc32_table.c \
-   crc64_table.c \
-   sha256.c
+   crc64_table.c
 .if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386"
 SRCS+= crc32_x86.S \
crc64_x86.S
@@ -125,11 +124,11 @@ SRCS+=simple_coder.c \
 
 .PATH: ${LZMADIR}
 
-VERSION_MAJOR!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MAJOR" 
{print $$3 } ' \
+VERSION_MAJOR!=sed -n '/define.*LZMA_VERSION_MAJOR/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
-VERSION_MINOR!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_MINOR" 
{print $$3 } ' \
+VERSION_MINOR!=sed -n '/define.*LZMA_VERSION_MINOR/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
-VERSION_PATCH!=awk '$$1 == "\#define" && $$2 == "LZMA_VERSION_PATCH" 
{print $$3 } ' \
+VERSION_PATCH!=sed -n '/define.*LZMA_VERSION_PATCH/{s,[^0-9.],,gp;q;}' 
\
${LZMADIR}/api/lzma/version.h
 
 WARNS?=3
@@ -147,7 +146,7 @@ CFLAGS+=-DHAVE_CONFIG_H \
-I${LZMADIR}/simple \
-I${LZMADIR:H}/common
 
-LIBADD+=   pthread
+LIBADD+=   md pthread
 
 VERSION_DEF=   ${.CURDIR}/Versions.def
 SYMBOL_MAPS=   ${.CURDIR}/Symbol.map
@@ -160,10 +159,11 @@ FILESDIR= ${LIBDATADIR}/pkgconfig
 
 liblzma.pc: liblzma.pc.in
sed -e 's,@prefix@,/usr,g ; \
-   s,@exec_prefix@,/usr,g  ; \
+   s,@exec_prefix@,/usr,g ; \
s,@libdir@,/usr/lib,g ; \
s,@includedir@,/usr/include,g ; \
-   s,@PACKAGE_URL@,http://tukaani.org/xz/,g ; \
+   s,@LIBS@,-pthread -lmd,g ; \
+   s,@PACKAGE_URL@,https://tukaani.org/xz/,g ; \

s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \
s,@PTHREAD_CFLAGS@,,g ; \
s,@PTHREAD_LIBS@,,g' ${.ALLSRC} > ${.TARGET}

Modified: head/lib/liblzma/Symbol.map
==
--- head/lib/liblzma/Symbol.map Sat Jun 20 21:06:02 2020(r362451)
+++ head/lib/liblzma/Symbol.map Sat Jun 20 21:32:07 2020(r362452)
@@ -180,9 +180,6 @@ XZprivate_1.0 {
lzma_raw_coder_memusage;
lzma_raw_decoder_init;
lzma_raw_encoder_init;
-   lzma_sha256_finish;
-   lzma_sha256_init;
-   lzma_sha256_update;
lzma_simple_arm_decoder_init;
lzma_simple_arm_encoder_init;
lzma_simple_armthumb_decoder_init;

Modified: head/lib/liblzma/config.h
==
--- head/lib/liblzma/config.h   Sat Jun 20 21:06:02 2020(r362451)
+++ head/lib/liblzma/config.h   Sat Jun 20 21:32:07 2020(r362452)
@@ -211,16 +211,13 @@
 /* #undef HAVE_SHA256INIT */
 
 /* Define to 1 if the system has the type `SHA256_CTX'. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_CTX */
+#define HAVE_SHA256_CTX 1
 
 /* Define to 1 if you have the  header file. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_H */
+#define HAVE_SHA256_H 1
 
 /* Define to 1 if you have the `SHA256_Init' function. */
-/* FreeBSD - disabled libmd SHA256 for now */
-/* #undef HAVE_SHA256_INIT */
+#define HAVE_SHA256_INIT 1
 
 /* Define to 1 if the system has the type `SHA2_CTX'. */
 /* #undef HAVE_SHA2_CTX */

Modified: head/share/mk/src.libnames.mk
==
--- head/share/mk/src.libnames.mk   Sat Jun 20 21:06:02 2020
(r362451)
+++ head/share/mk/src.libnames.mk   Sat Jun 20 21:32:07 2020
(r362452)
@@ -350,7 +350,7 @@ _DP_heimipcs=   heimbase roken pthread
 _DP_kafs5= asn1 krb5 roken
 _DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc
 _DP_gssapi_krb5+=  gssapi krb5 crypto roken asn1 com_err
-_DP_lzma=  pthread
+_DP_lzma=  md pthread
 _DP_ucl=   m
 _DP_vmmapi=util
 _DP_opencsd=   cxxrt
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.or

Re: svn commit: r362261 - head/contrib/file/magic/Magdir

2020-06-17 Thread Xin Li via svn-src-all
Hi,

On 6/17/20 3:11 AM, Antoine Brodin wrote:
> Author: antoine
> Date: Wed Jun 17 10:11:54 2020
> New Revision: 362261
> URL: https://svnweb.freebsd.org/changeset/base/362261
> 
> Log:
>   Re-apply r333944 to unbreak ports

Could you please file a bug against the upstream (Christos cc'ed), as it
may also affect other users?

> Modified:
>   head/contrib/file/magic/Magdir/elf
> 
> Modified: head/contrib/file/magic/Magdir/elf
> ==
> --- head/contrib/file/magic/Magdir/elfWed Jun 17 08:35:35 2020
> (r362260)
> +++ head/contrib/file/magic/Magdir/elfWed Jun 17 10:11:54 2020
> (r362261)
> @@ -50,9 +50,8 @@
>  !:mime   application/x-object
>  >16  leshort 2   executable,
>  !:mime   application/x-executable
> ->16  leshort 3   ${x?pie executable:shared object},
> -
> -!:mime   application/x-${x?pie-executable:sharedlib}
> +>16  leshort 3   shared object,
> +!:mime   application/x-sharedlib
>  >16  leshort 4   core file,
>  !:mime   application/x-coredump
>  # OS-specific
> 



signature.asc
Description: OpenPGP digital signature


svn commit: r362279 - head/lib/libmagic

2020-06-17 Thread Xin LI
Author: delphij
Date: Wed Jun 17 15:57:59 2020
New Revision: 362279
URL: https://svnweb.freebsd.org/changeset/base/362279

Log:
  Fix installation of magic file.
  
  Reported by:  lwhsu
  MFC after:2 weeks
  X-MFC-with:   r362258

Modified:
  head/lib/libmagic/Makefile

Modified: head/lib/libmagic/Makefile
==
--- head/lib/libmagic/Makefile  Wed Jun 17 15:54:51 2020(r362278)
+++ head/lib/libmagic/Makefile  Wed Jun 17 15:57:59 2020(r362279)
@@ -86,7 +86,7 @@ ${inc}: ${inc}.in
sed -e 's,X.YY,${FILEVER:S,",,g:S,.,,g},g' ${.ALLSRC} > ${.TARGET}
 .endfor
 
-FILES= libmagic.pc
-FILESDIR=  ${LIBDATADIR}/pkgconfig
+FILES+=libmagic.pc
+FILESDIR_libmagic.pc=  ${LIBDATADIR}/pkgconfig
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362258 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src lib/libmagic

2020-06-17 Thread Xin LI
Author: delphij
Date: Wed Jun 17 07:41:28 2020
New Revision: 362258
URL: https://svnweb.freebsd.org/changeset/base/362258

Log:
  MFV r362254: file 5.39.
  
  MFC after:2 weeks

Added:
  head/contrib/file/libmagic.pc.in
 - copied unchanged from r362254, vendor/file/dist/libmagic.pc.in
  head/contrib/file/magic/Magdir/asf
 - copied unchanged from r362254, vendor/file/dist/magic/Magdir/asf
  head/contrib/file/magic/Magdir/dif
 - copied unchanged from r362254, vendor/file/dist/magic/Magdir/dif
  head/contrib/file/magic/Magdir/sylk
 - copied unchanged from r362254, vendor/file/dist/magic/Magdir/sylk
  head/contrib/file/magic/Magdir/unisig
 - copied unchanged from r362254, vendor/file/dist/magic/Magdir/unisig
  head/contrib/file/magic/Magdir/usd
 - copied unchanged from r362254, vendor/file/dist/magic/Magdir/usd
  head/contrib/file/magic/Magdir/web
 - copied unchanged from r362254, vendor/file/dist/magic/Magdir/web
Modified:
  head/contrib/file/ChangeLog
  head/contrib/file/Makefile.am
  head/contrib/file/Makefile.in
  head/contrib/file/configure
  head/contrib/file/configure.ac
  head/contrib/file/doc/file.man
  head/contrib/file/doc/magic.man
  head/contrib/file/magic/Magdir/animation
  head/contrib/file/magic/Magdir/archive
  head/contrib/file/magic/Magdir/cad
  head/contrib/file/magic/Magdir/commands
  head/contrib/file/magic/Magdir/compress
  head/contrib/file/magic/Magdir/console
  head/contrib/file/magic/Magdir/database
  head/contrib/file/magic/Magdir/der
  head/contrib/file/magic/Magdir/elf
  head/contrib/file/magic/Magdir/filesystems
  head/contrib/file/magic/Magdir/games
  head/contrib/file/magic/Magdir/gnu
  head/contrib/file/magic/Magdir/images
  head/contrib/file/magic/Magdir/intel
  head/contrib/file/magic/Magdir/kicad
  head/contrib/file/magic/Magdir/linux
  head/contrib/file/magic/Magdir/msdos
  head/contrib/file/magic/Magdir/ole2compounddocs
  head/contrib/file/magic/Magdir/parix
  head/contrib/file/magic/Magdir/pascal
  head/contrib/file/magic/Magdir/pdf
  head/contrib/file/magic/Magdir/pgp
  head/contrib/file/magic/Magdir/python
  head/contrib/file/magic/Magdir/riff
  head/contrib/file/magic/Magdir/rst
  head/contrib/file/magic/Magdir/rtf
  head/contrib/file/magic/Magdir/sgml
  head/contrib/file/magic/Magdir/sniffer
  head/contrib/file/magic/Magdir/ssh
  head/contrib/file/magic/Magdir/ti-8x
  head/contrib/file/magic/Magdir/tplink
  head/contrib/file/magic/Magdir/troff
  head/contrib/file/magic/Magdir/virtual
  head/contrib/file/magic/Magdir/windows
  head/contrib/file/magic/Magdir/wordprocessors
  head/contrib/file/magic/Magdir/zip
  head/contrib/file/magic/Makefile.am
  head/contrib/file/magic/Makefile.in
  head/contrib/file/src/apprentice.c
  head/contrib/file/src/ascmagic.c
  head/contrib/file/src/buffer.c
  head/contrib/file/src/compress.c
  head/contrib/file/src/der.c
  head/contrib/file/src/file.c
  head/contrib/file/src/file.h
  head/contrib/file/src/file_opts.h
  head/contrib/file/src/funcs.c
  head/contrib/file/src/is_json.c
  head/contrib/file/src/magic.c
  head/contrib/file/src/print.c
  head/contrib/file/src/readelf.c
  head/contrib/file/src/seccomp.c
  head/contrib/file/src/softmagic.c
  head/lib/libmagic/Makefile
  head/lib/libmagic/config.h
Directory Properties:
  head/contrib/file/   (props changed)

Modified: head/contrib/file/ChangeLog
==
--- head/contrib/file/ChangeLog Wed Jun 17 03:16:20 2020(r362257)
+++ head/contrib/file/ChangeLog Wed Jun 17 07:41:28 2020(r362258)
@@ -1,3 +1,83 @@
+2020-06-14  20:02  Christos Zoulas 
+
+   * release 5.39
+
+2020-06-07  20:00  Christos Zoulas 
+
+   * Remove unused subtype_mime (Steve Grubb)
+   * Remove unused check in okstat (Steve Grubb)
+   * Fix mime-type in elf binaries by making sure $x is set
+   * Fix indirect negative offsets broken by OFFNEGATIVE
+   * Fix GUID equality check
+   * PR/165: Handle empty array and strings in JSON
+   * PR/162: Add --exclude-quiet
+
+2020-06-06  15:33  Christos Zoulas 
+
+   * Fix memory leak in ascmagic (Steve Grubb)
+
+2020-06-04  00:21  Christos Zoulas 
+
+   * Fix string comparison length with ignore whitespace
+
+2020-05-31  00:11  Christos Zoulas 
+
+   * Fix mingwin 64 compilation
+
+2020-05-30  23:56  Christos Zoulas 
+
+   * PR/159: whitelist getpid needed for file_pipe2file()
+
+2020-05-09  18:57  Christos Zoulas 
+
+   * Indicate negative offsets with a flag OFFNEGATIVE
+ so that -0 works.
+   * Introduce "offset" magic type that can be used to
+ detect the file size, and bail on short files.
+   * document DER better in the magic man page.
+
+2020-03-11  21:53  Christos Zoulas 
+
+   * fix memory leaks (SonarQube)
+
+2020-03-08  21:33  Christos Zoulas 
+
+   * fix memory leaks (SonarQube)
+   * rewrite confusing loops (SonarQube)
+   * fix bogus test (SonarQube)
+   * 

svn commit: r362254 - in vendor/file/dist: . doc magic magic/Magdir src

2020-06-16 Thread Xin LI
Author: delphij
Date: Wed Jun 17 01:11:26 2020
New Revision: 362254
URL: https://svnweb.freebsd.org/changeset/base/362254

Log:
  Vendor import of file 5.39.

Added:
  vendor/file/dist/libmagic.pc.in   (contents, props changed)
  vendor/file/dist/magic/Magdir/asf
  vendor/file/dist/magic/Magdir/dif
  vendor/file/dist/magic/Magdir/sylk
  vendor/file/dist/magic/Magdir/unisig
  vendor/file/dist/magic/Magdir/usd
  vendor/file/dist/magic/Magdir/web
Modified:
  vendor/file/dist/ChangeLog
  vendor/file/dist/Makefile.am
  vendor/file/dist/Makefile.in
  vendor/file/dist/configure
  vendor/file/dist/configure.ac
  vendor/file/dist/doc/file.man
  vendor/file/dist/doc/magic.man
  vendor/file/dist/magic/Magdir/animation
  vendor/file/dist/magic/Magdir/archive
  vendor/file/dist/magic/Magdir/cad
  vendor/file/dist/magic/Magdir/commands
  vendor/file/dist/magic/Magdir/compress
  vendor/file/dist/magic/Magdir/console
  vendor/file/dist/magic/Magdir/database
  vendor/file/dist/magic/Magdir/der
  vendor/file/dist/magic/Magdir/elf
  vendor/file/dist/magic/Magdir/filesystems
  vendor/file/dist/magic/Magdir/games
  vendor/file/dist/magic/Magdir/gnu
  vendor/file/dist/magic/Magdir/images
  vendor/file/dist/magic/Magdir/intel
  vendor/file/dist/magic/Magdir/kicad
  vendor/file/dist/magic/Magdir/linux
  vendor/file/dist/magic/Magdir/msdos
  vendor/file/dist/magic/Magdir/ole2compounddocs
  vendor/file/dist/magic/Magdir/parix
  vendor/file/dist/magic/Magdir/pascal
  vendor/file/dist/magic/Magdir/pdf
  vendor/file/dist/magic/Magdir/pgp
  vendor/file/dist/magic/Magdir/python
  vendor/file/dist/magic/Magdir/riff
  vendor/file/dist/magic/Magdir/rst
  vendor/file/dist/magic/Magdir/rtf
  vendor/file/dist/magic/Magdir/sgml
  vendor/file/dist/magic/Magdir/sniffer
  vendor/file/dist/magic/Magdir/ssh
  vendor/file/dist/magic/Magdir/ti-8x
  vendor/file/dist/magic/Magdir/tplink
  vendor/file/dist/magic/Magdir/troff
  vendor/file/dist/magic/Magdir/virtual
  vendor/file/dist/magic/Magdir/windows
  vendor/file/dist/magic/Magdir/wordprocessors
  vendor/file/dist/magic/Magdir/zip
  vendor/file/dist/magic/Makefile.am
  vendor/file/dist/magic/Makefile.in
  vendor/file/dist/src/apprentice.c
  vendor/file/dist/src/ascmagic.c
  vendor/file/dist/src/buffer.c
  vendor/file/dist/src/compress.c
  vendor/file/dist/src/der.c
  vendor/file/dist/src/file.c
  vendor/file/dist/src/file.h
  vendor/file/dist/src/file_opts.h
  vendor/file/dist/src/funcs.c
  vendor/file/dist/src/is_json.c
  vendor/file/dist/src/magic.c
  vendor/file/dist/src/print.c
  vendor/file/dist/src/readelf.c
  vendor/file/dist/src/seccomp.c
  vendor/file/dist/src/softmagic.c

Modified: vendor/file/dist/ChangeLog
==
--- vendor/file/dist/ChangeLog  Tue Jun 16 22:53:56 2020(r362253)
+++ vendor/file/dist/ChangeLog  Wed Jun 17 01:11:26 2020(r362254)
@@ -1,3 +1,83 @@
+2020-06-14  20:02  Christos Zoulas 
+
+   * release 5.39
+
+2020-06-07  20:00  Christos Zoulas 
+
+   * Remove unused subtype_mime (Steve Grubb)
+   * Remove unused check in okstat (Steve Grubb)
+   * Fix mime-type in elf binaries by making sure $x is set
+   * Fix indirect negative offsets broken by OFFNEGATIVE
+   * Fix GUID equality check
+   * PR/165: Handle empty array and strings in JSON
+   * PR/162: Add --exclude-quiet
+
+2020-06-06  15:33  Christos Zoulas 
+
+   * Fix memory leak in ascmagic (Steve Grubb)
+
+2020-06-04  00:21  Christos Zoulas 
+
+   * Fix string comparison length with ignore whitespace
+
+2020-05-31  00:11  Christos Zoulas 
+
+   * Fix mingwin 64 compilation
+
+2020-05-30  23:56  Christos Zoulas 
+
+   * PR/159: whitelist getpid needed for file_pipe2file()
+
+2020-05-09  18:57  Christos Zoulas 
+
+   * Indicate negative offsets with a flag OFFNEGATIVE
+ so that -0 works.
+   * Introduce "offset" magic type that can be used to
+ detect the file size, and bail on short files.
+   * document DER better in the magic man page.
+
+2020-03-11  21:53  Christos Zoulas 
+
+   * fix memory leaks (SonarQube)
+
+2020-03-08  21:33  Christos Zoulas 
+
+   * fix memory leaks (SonarQube)
+   * rewrite confusing loops (SonarQube)
+   * fix bogus test (SonarQube)
+   * pass a sized buffer to file_fmttime() (SonarQube)
+
+   * fix memory leaks (SonarQube)
+
+2020-02-20  15:50  Christos Zoulas 
+
+   * Don't allow * in printf formats, or the code itself (Christoph Biedl)
+   * Introduce a printf output size checker to avoid DoS attacks
+
+2020-02-17  17:22  Christos Zoulas 
+
+   * Avoid memory leak on error (oss-fuzz)
+   * Check length of string on DER before derefercing and add new types
+   * Add missing DER string (oss-fuzz)
+
+2020-02-16  20:45  Christos Zoulas 
+
+   * Add missing DER types, and debugging
+
+2020-02-13  13:10  Christos Zoulas 
+
+   * PR/140: Avoid abort with hand-crafted magic file (gockelh

svn commit: r362255 - vendor/file/5.39

2020-06-16 Thread Xin LI
Author: delphij
Date: Wed Jun 17 01:11:47 2020
New Revision: 362255
URL: https://svnweb.freebsd.org/changeset/base/362255

Log:
  Tag file 5.39.

Added:
  vendor/file/5.39/
 - copied from r362254, vendor/file/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361396 - releng/11.4/etc/ntp

2020-05-22 Thread Xin LI
Author: delphij
Date: Fri May 22 17:30:36 2020
New Revision: 361396
URL: https://svnweb.freebsd.org/changeset/base/361396

Log:
  MFS r361354: MFC r361260: Update leap-seconds to leap-seconds.3676924800.
  
  Approved by:  re (gjb)

Modified:
  releng/11.4/etc/ntp/leap-seconds
Directory Properties:
  releng/11.4/   (props changed)

Modified: releng/11.4/etc/ntp/leap-seconds
==
--- releng/11.4/etc/ntp/leap-secondsFri May 22 17:23:43 2020
(r361395)
+++ releng/11.4/etc/ntp/leap-secondsFri May 22 17:30:36 2020
(r361396)
@@ -204,10 +204,10 @@
 #  current -- the update time stamp, the data and the name of the file
 #  will not change.
 #
-#  Updated through IERS Bulletin C58
-#  File expires on:  28 June 2020
+#  Updated through IERS Bulletin C59
+#  File expires on:  28 December 2020
 #
-#@ 3802291200
+#@ 3818102400
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -252,4 +252,4 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30
+#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361354 - stable/11/etc/ntp

2020-05-21 Thread Xin LI
Author: delphij
Date: Fri May 22 03:11:33 2020
New Revision: 361354
URL: https://svnweb.freebsd.org/changeset/base/361354

Log:
  MFC r361260: Update leap-seconds to leap-seconds.3676924800.

Modified:
  stable/11/etc/ntp/leap-seconds
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/ntp/leap-seconds
==
--- stable/11/etc/ntp/leap-seconds  Fri May 22 02:06:56 2020
(r361353)
+++ stable/11/etc/ntp/leap-seconds  Fri May 22 03:11:33 2020
(r361354)
@@ -204,10 +204,10 @@
 #  current -- the update time stamp, the data and the name of the file
 #  will not change.
 #
-#  Updated through IERS Bulletin C58
-#  File expires on:  28 June 2020
+#  Updated through IERS Bulletin C59
+#  File expires on:  28 December 2020
 #
-#@ 3802291200
+#@ 3818102400
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -252,4 +252,4 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30
+#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361353 - stable/12/usr.sbin/ntp/ntpd

2020-05-21 Thread Xin LI
Author: delphij
Date: Fri May 22 02:06:56 2020
New Revision: 361353
URL: https://svnweb.freebsd.org/changeset/base/361353

Log:
  MFC r361260: Update leap-seconds to leap-seconds.3676924800.

Modified:
  stable/12/usr.sbin/ntp/ntpd/leap-seconds
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/ntp/ntpd/leap-seconds
==
--- stable/12/usr.sbin/ntp/ntpd/leap-secondsFri May 22 01:18:55 2020
(r361352)
+++ stable/12/usr.sbin/ntp/ntpd/leap-secondsFri May 22 02:06:56 2020
(r361353)
@@ -204,10 +204,10 @@
 #  current -- the update time stamp, the data and the name of the file
 #  will not change.
 #
-#  Updated through IERS Bulletin C58
-#  File expires on:  28 June 2020
+#  Updated through IERS Bulletin C59
+#  File expires on:  28 December 2020
 #
-#@ 3802291200
+#@ 3818102400
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -252,4 +252,4 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30
+#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361260 - head/usr.sbin/ntp/ntpd

2020-05-19 Thread Xin LI
Author: delphij
Date: Tue May 19 16:06:03 2020
New Revision: 361260
URL: https://svnweb.freebsd.org/changeset/base/361260

Log:
  Update leap-seconds to leap-seconds.3676924800.
  
  Obtained from:ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800
  MFC after:3 days

Modified:
  head/usr.sbin/ntp/ntpd/leap-seconds

Modified: head/usr.sbin/ntp/ntpd/leap-seconds
==
--- head/usr.sbin/ntp/ntpd/leap-seconds Tue May 19 16:04:27 2020
(r361259)
+++ head/usr.sbin/ntp/ntpd/leap-seconds Tue May 19 16:06:03 2020
(r361260)
@@ -204,10 +204,10 @@
 #  current -- the update time stamp, the data and the name of the file
 #  will not change.
 #
-#  Updated through IERS Bulletin C58
-#  File expires on:  28 June 2020
+#  Updated through IERS Bulletin C59
+#  File expires on:  28 December 2020
 #
-#@ 3802291200
+#@ 3818102400
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -252,4 +252,4 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30
+#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361219 - releng/11.4/lib/libz

2020-05-18 Thread Xin LI
Author: delphij
Date: Mon May 18 16:33:32 2020
New Revision: 361219
URL: https://svnweb.freebsd.org/changeset/base/361219

Log:
  MFS r361069: MFC r360952: Generate zlib.pc from source.
  
  Approved by:  re (gjb)

Deleted:
  releng/11.4/lib/libz/zlib.pc
Modified:
  releng/11.4/lib/libz/Makefile
Directory Properties:
  releng/11.4/   (props changed)

Modified: releng/11.4/lib/libz/Makefile
==
--- releng/11.4/lib/libz/Makefile   Mon May 18 16:07:14 2020
(r361218)
+++ releng/11.4/lib/libz/Makefile   Mon May 18 16:33:32 2020
(r361219)
@@ -52,6 +52,17 @@ INCS=zconf.h zlib.h
 
 .PATH: ${ZLIBSRC}/test
 
+ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' 
${ZLIBSRC}/zlib.h
+
+zlib.pc: zlib.pc.in
+   sed -e 's,@prefix@,/usr,g ; \
+   s,@exec_prefix@,$${prefix},g ; \
+   s,@libdir@,$${exec_prefix}/lib,g ; \
+   s,@sharedlibdir@,$${libdir},g ; \
+   s,@includedir@,$${prefix}/include,g ; \
+   s,@VERSION@,${ZLIB_VERSION},g ;' \
+   ${.ALLSRC} > ${.TARGET}
+
 minigzip:  all minigzip.o
$(CC) -o minigzip minigzip.o -L. -lz
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361069 - stable/11/lib/libz

2020-05-14 Thread Xin LI
Author: delphij
Date: Fri May 15 00:51:30 2020
New Revision: 361069
URL: https://svnweb.freebsd.org/changeset/base/361069

Log:
  MFC r360952: Generate zlib.pc from source.

Deleted:
  stable/11/lib/libz/zlib.pc
Modified:
  stable/11/lib/libz/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libz/Makefile
==
--- stable/11/lib/libz/Makefile Fri May 15 00:50:52 2020(r361068)
+++ stable/11/lib/libz/Makefile Fri May 15 00:51:30 2020(r361069)
@@ -52,6 +52,17 @@ INCS=zconf.h zlib.h
 
 .PATH: ${ZLIBSRC}/test
 
+ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' 
${ZLIBSRC}/zlib.h
+
+zlib.pc: zlib.pc.in
+   sed -e 's,@prefix@,/usr,g ; \
+   s,@exec_prefix@,$${prefix},g ; \
+   s,@libdir@,$${exec_prefix}/lib,g ; \
+   s,@sharedlibdir@,$${libdir},g ; \
+   s,@includedir@,$${prefix}/include,g ; \
+   s,@VERSION@,${ZLIB_VERSION},g ;' \
+   ${.ALLSRC} > ${.TARGET}
+
 minigzip:  all minigzip.o
$(CC) -o minigzip minigzip.o -L. -lz
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361068 - stable/12/lib/libz

2020-05-14 Thread Xin LI
Author: delphij
Date: Fri May 15 00:50:52 2020
New Revision: 361068
URL: https://svnweb.freebsd.org/changeset/base/361068

Log:
  MFC r360952: Generate zlib.pc from source.

Deleted:
  stable/12/lib/libz/zlib.pc
Modified:
  stable/12/lib/libz/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libz/Makefile
==
--- stable/12/lib/libz/Makefile Fri May 15 00:02:24 2020(r361067)
+++ stable/12/lib/libz/Makefile Fri May 15 00:50:52 2020(r361068)
@@ -52,6 +52,17 @@ INCS=zconf.h zlib.h
 
 .PATH: ${ZLIBSRC}/test
 
+ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' 
${ZLIBSRC}/zlib.h
+
+zlib.pc: zlib.pc.in
+   sed -e 's,@prefix@,/usr,g ; \
+   s,@exec_prefix@,$${prefix},g ; \
+   s,@libdir@,$${exec_prefix}/lib,g ; \
+   s,@sharedlibdir@,$${libdir},g ; \
+   s,@includedir@,$${prefix}/include,g ; \
+   s,@VERSION@,${ZLIB_VERSION},g ;' \
+   ${.ALLSRC} > ${.TARGET}
+
 minigzip:  all minigzip.o
$(CC) -o minigzip minigzip.o -L. -lz
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360952 - head/lib/libz

2020-05-11 Thread Xin LI
Author: delphij
Date: Tue May 12 01:47:33 2020
New Revision: 360952
URL: https://svnweb.freebsd.org/changeset/base/360952

Log:
  Generate zlib.pc from source.
  
  Reviewed by:  bapt
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D24806

Deleted:
  head/lib/libz/zlib.pc
Modified:
  head/lib/libz/Makefile

Modified: head/lib/libz/Makefile
==
--- head/lib/libz/Makefile  Tue May 12 01:40:48 2020(r360951)
+++ head/lib/libz/Makefile  Tue May 12 01:47:33 2020(r360952)
@@ -53,6 +53,17 @@ INCS=zconf.h zlib.h
 
 .PATH: ${ZLIBSRC}/test
 
+ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' 
${ZLIBSRC}/zlib.h
+
+zlib.pc: zlib.pc.in
+   sed -e 's,@prefix@,/usr,g ; \
+   s,@exec_prefix@,$${prefix},g ; \
+   s,@libdir@,$${exec_prefix}/lib,g ; \
+   s,@sharedlibdir@,$${libdir},g ; \
+   s,@includedir@,$${prefix}/include,g ; \
+   s,@VERSION@,${ZLIB_VERSION},g ;' \
+   ${.ALLSRC} > ${.TARGET}
+
 minigzip:  all minigzip.o
$(CC) -o minigzip minigzip.o -L. -lz
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360893 - stable/11/sbin/swapon

2020-05-11 Thread Xin LI
Author: delphij
Date: Mon May 11 07:21:59 2020
New Revision: 360893
URL: https://svnweb.freebsd.org/changeset/base/360893

Log:
  MFC r360619:
   - Fix logic error in swapoff case: follow same handling of p and
 linelen in the swapon case.
   - Use strlcpy instead of strncpy.

Modified:
  stable/11/sbin/swapon/swapon.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/swapon/swapon.c
==
--- stable/11/sbin/swapon/swapon.c  Mon May 11 07:20:37 2020
(r360892)
+++ stable/11/sbin/swapon/swapon.c  Mon May 11 07:21:59 2020
(r360893)
@@ -527,8 +527,7 @@ swap_on_off_md(const char *name, char *mntops, int doi
ret = NULL;
goto err;
}
-   strncpy(linebuf, p, linelen);
-   linebuf[linelen - 1] = '\0';
+   strlcpy(linebuf, p, linelen);
errno = 0;
ul = strtoul(linebuf, &p, 10);
if (errno == 0) {
@@ -583,14 +582,13 @@ swap_on_off_md(const char *name, char *mntops, int doi
goto err;
}
p = fgetln(sfd, &linelen);
-   if (p == NULL &&
-   (linelen < 2 || linelen > sizeof(linebuf) - 1)) {
+   if (p == NULL ||
+   (linelen < 2 || linelen > sizeof(linebuf))) {
warn("mdconfig (list) unexpected output");
ret = NULL;
goto err;
}
-   strncpy(linebuf, p, linelen);
-   linebuf[linelen - 1] = '\0';
+   strlcpy(linebuf, p, linelen);
p = strchr(linebuf, ' ');
if (p != NULL)
*p = '\0';
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360892 - stable/12/sbin/swapon

2020-05-11 Thread Xin LI
Author: delphij
Date: Mon May 11 07:20:37 2020
New Revision: 360892
URL: https://svnweb.freebsd.org/changeset/base/360892

Log:
  MFC r360619:
   - Fix logic error in swapoff case: follow same handling of p and
 linelen in the swapon case.
   - Use strlcpy instead of strncpy.

Modified:
  stable/12/sbin/swapon/swapon.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/swapon/swapon.c
==
--- stable/12/sbin/swapon/swapon.c  Mon May 11 07:01:10 2020
(r360891)
+++ stable/12/sbin/swapon/swapon.c  Mon May 11 07:20:37 2020
(r360892)
@@ -548,8 +548,7 @@ swap_on_off_md(const char *name, char *mntops, int doi
ret = NULL;
goto err;
}
-   strncpy(linebuf, p, linelen);
-   linebuf[linelen - 1] = '\0';
+   strlcpy(linebuf, p, linelen);
errno = 0;
ul = strtoul(linebuf, &p, 10);
if (errno == 0) {
@@ -604,14 +603,13 @@ swap_on_off_md(const char *name, char *mntops, int doi
goto err;
}
p = fgetln(sfd, &linelen);
-   if (p == NULL &&
-   (linelen < 2 || linelen > sizeof(linebuf) - 1)) {
+   if (p == NULL ||
+   (linelen < 2 || linelen > sizeof(linebuf))) {
warn("mdconfig (list) unexpected output");
ret = NULL;
goto err;
}
-   strncpy(linebuf, p, linelen);
-   linebuf[linelen - 1] = '\0';
+   strlcpy(linebuf, p, linelen);
p = strchr(linebuf, ' ');
if (p != NULL)
*p = '\0';
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360619 - head/sbin/swapon

2020-05-03 Thread Xin LI
Author: delphij
Date: Mon May  4 05:49:11 2020
New Revision: 360619
URL: https://svnweb.freebsd.org/changeset/base/360619

Log:
   - Fix logic error in swapoff case: follow same handling of p and
 linelen in the swapon case.
   - Use strlcpy instead of strncpy.
  
  MFC after:1 week

Modified:
  head/sbin/swapon/swapon.c

Modified: head/sbin/swapon/swapon.c
==
--- head/sbin/swapon/swapon.c   Sun May  3 23:40:16 2020(r360618)
+++ head/sbin/swapon/swapon.c   Mon May  4 05:49:11 2020(r360619)
@@ -548,8 +548,7 @@ swap_on_off_md(const char *name, char *mntops, int doi
ret = NULL;
goto err;
}
-   strncpy(linebuf, p, linelen);
-   linebuf[linelen - 1] = '\0';
+   strlcpy(linebuf, p, linelen);
errno = 0;
ul = strtoul(linebuf, &p, 10);
if (errno == 0) {
@@ -604,14 +603,13 @@ swap_on_off_md(const char *name, char *mntops, int doi
goto err;
}
p = fgetln(sfd, &linelen);
-   if (p == NULL &&
-   (linelen < 2 || linelen > sizeof(linebuf) - 1)) {
+   if (p == NULL ||
+   (linelen < 2 || linelen > sizeof(linebuf))) {
warn("mdconfig (list) unexpected output");
ret = NULL;
goto err;
}
-   strncpy(linebuf, p, linelen);
-   linebuf[linelen - 1] = '\0';
+   strlcpy(linebuf, p, linelen);
p = strchr(linebuf, ' ');
if (p != NULL)
*p = '\0';
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360524 - stable/11/lib/liblzma

2020-05-01 Thread Xin LI
Author: delphij
Date: Fri May  1 06:10:09 2020
New Revision: 360524
URL: https://svnweb.freebsd.org/changeset/base/360524

Log:
  Fix build.

Modified:
  stable/11/lib/liblzma/config.h

Modified: stable/11/lib/liblzma/config.h
==
--- stable/11/lib/liblzma/config.h  Fri May  1 05:36:13 2020
(r360523)
+++ stable/11/lib/liblzma/config.h  Fri May  1 06:10:09 2020
(r360524)
@@ -312,6 +312,7 @@
 #define HAVE__MM_MOVEMASK_EPI8 1
 #endif
 
+#if defined(__clang__) && defined(__FreeBSD__)
 /* Define to 1 if the GNU C extension __builtin_assume_aligned is supported.
*/
 #define HAVE___BUILTIN_ASSUME_ALIGNED 1
@@ -319,6 +320,7 @@
 /* Define to 1 if the GNU C extensions __builtin_bswap16/32/64 are supported.
*/
 #define HAVE___BUILTIN_BSWAPXX 1
+#endif
 
 /* Define to the sub-directory where libtool stores uninstalled libraries. */
 #define LT_OBJDIR ".libs/"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360523 - in stable/11: contrib/xz contrib/xz/src/common contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblzma/common contrib/xz...

2020-04-30 Thread Xin LI
 would always be true, so
+this commit doesn't change the behavior there.
+
+ src/xz/coder.c | 30 +-
+ 1 file changed, 17 insertions(+), 13 deletions(-)
+
+commit ec26f3ace5f9b260ca91508030f07465ae2f9f78
+Author: Lasse Collin 
+Date:   2020-01-26 14:13:42 +0200
+
+xz: Fix semi-busy-waiting in xz --flush-timeout.
+
+When input blocked, xz --flush-timeout=1 would wake up every
+millisecond and initiate flushing which would have nothing to
+flush and thus would just waste CPU time. The fix disables the
+timeout when no input has been seen since the previous flush.
+
+ src/xz/coder.c   |  4 
+ src/xz/file_io.c | 15 +++
+ src/xz/file_io.h |  4 
+ 3 files changed, 19 insertions(+), 4 deletions(-)
+
+commit 38915703241e69a64f133ff9a02ec9100c6019c6
+Author: Lasse Collin 
+Date:   2020-01-26 13:47:31 +0200
+
+xz: Refactor io_read() a bit.
+
+ src/xz/file_io.c | 17 -
+ 1 file changed, 8 insertions(+), 9 deletions(-)
+
+commit f6d24245349cecfae6ec0d2366fa80716c9f6d37
+Author: Lasse Collin 
+Date:   2020-01-26 13:37:08 +0200
+
+xz: Update a comment in file_io.h.
+
+ src/xz/file_io.h | 5 -
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+commit 15b55d5c63d27f81776edb1abc05872a751fc674
+Author: Lasse Collin 
+Date:   2020-01-26 13:27:51 +0200
+
+xz: Move the setting of flush_needed in file_io.c to a nicer location.
+
+ src/xz/file_io.c | 6 ++
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+commit 609c7067859146ffc62ac655f6ba53599c891801
+Author: Lasse Collin 
+Date:   2020-02-05 19:56:09 +0200
+
+xz: Enable Capsicum sandboxing by default if available.
+
+It has been enabled in FreeBSD for a while and reported to work fine.
+
+Thanks to Xin Li.
+
+ INSTALL  | 6 --
+ configure.ac | 8 
+ 2 files changed, 4 insertions(+), 10 deletions(-)
+
+commit 00517d125cc26ecece0eebb84c1c3975cd19bee0
+Author: Lasse Collin 
+Date:   2019-12-31 22:41:45 +0200
+
+Rename unaligned_read32ne to read32ne, and similarly for the others.
+
+ src/common/tuklib_integer.h   | 64 +++
+ src/liblzma/common/alone_encoder.c|  2 +-
+ src/liblzma/common/block_header_decoder.c |  2 +-
+ src/liblzma/common/block_header_encoder.c |  2 +-
+ src/liblzma/common/memcmplen.h|  9 ++---
+ src/liblzma/common/stream_flags_decoder.c |  6 +--
+ src/liblzma/common/stream_flags_encoder.c |  8 ++--
+ src/liblzma/lz/lz_encoder_hash.h  |  2 +-
+ src/liblzma/lzma/lzma_decoder.c   |  2 +-
+ src/liblzma/lzma/lzma_encoder.c   |  2 +-
+ src/liblzma/lzma/lzma_encoder_private.h   |  3 +-
+ src/liblzma/simple/simple_decoder.c   |  2 +-
+ src/liblzma/simple/simple_encoder.c   |  2 +-
+ tests/test_block_header.c |  4 +-
+ tests/test_stream_flags.c |  6 +--
+ 15 files changed, 54 insertions(+), 62 deletions(-)
+
+commit 52d89d8443c4a31a69c0701062f2c7711d82bbed
+Author: Lasse Collin 
+Date:   2019-12-31 00:29:48 +0200
+
+Rename read32ne to aligned_read32ne, and similarly for the others.
+
+Using the aligned methods requires more care to ensure that
+the address really is aligned, so it's nicer if the aligned
+methods are prefixed. The next commit will remove the unaligned_
+prefix from the unaligned methods which in liblzma are used in
+more places than the aligned ones.
+
+ src/common/tuklib_integer.h| 56 +-
+ src/liblzma/check/crc32_fast.c |  4 +--
+ src/liblzma/check/crc64_fast.c |  4 +--
+ 3 files changed, 32 insertions(+), 32 deletions(-)
+
+commit 850620468b57d49f16093e5870d1050886fcb37a
+Author: Lasse Collin 
+Date:   2019-12-31 00:18:24 +0200
+
+Revise tuklib_integer.h and .m4.
+
+Add a configure option --enable-unsafe-type-punning to get the
+old non-conforming memory access methods. It can be useful with
+old compilers or in some other less typical situations but
+shouldn't normally be used.
+
+Omit the packed struct trick for unaligned access. While it's
+best in some cases, this is simpler. If the memcpy trick doesn't
+work, one can request unsafe type punning from configure.
+
+Because CRC32/CRC64 code needs fast aligned reads, if no very
+safe way to do it is found, type punning is used as a fallback.
+This sucks but since it currently works in practice, it seems to
+be the least bad option. It's never needed with GCC >= 4.7 or
+Clang >= 3.6 since these support __builtin_assume_aligned and
+thus fast aligned access can be done with the memcpy trick.
+
+Other things:
+  - Support GCC/Clang __builtin_bswapXX
+  - Cleaner bswap fallback macros
+  - Minor cleanups
+
+ m4/tuklib_integer.m4|  43 
+ src/common/tuklib_integer.h | 488 
+ 2 files changed, 314 insertions(+), 2

svn commit: r360522 - stable/11/lib/libc/nls

2020-04-30 Thread Xin LI
Author: delphij
Date: Fri May  1 04:59:40 2020
New Revision: 360522
URL: https://svnweb.freebsd.org/changeset/base/360522

Log:
  MFC r359118: Fix race condition in catopen(3).

Modified:
  stable/11/lib/libc/nls/msgcat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/nls/msgcat.c
==
--- stable/11/lib/libc/nls/msgcat.c Fri May  1 04:48:20 2020
(r360521)
+++ stable/11/lib/libc/nls/msgcat.c Fri May  1 04:59:40 2020
(r360522)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include  /* for ntohl() */
+#include 
 
 #include 
 #include 
@@ -76,19 +77,25 @@ __FBSDID("$FreeBSD$");
 
 #defineNLERR   ((nl_catd) -1)
 #define NLRETERR(errc)  { errno = errc; return (NLERR); }
-#define SAVEFAIL(n, l, e)  { WLOCK(NLERR); 
\
- np = malloc(sizeof(struct catentry)); 
\
+#define SAVEFAIL(n, l, e)  { np = calloc(1, sizeof(struct catentry));  
\
  if (np != NULL) { 
\
np->name = strdup(n);   
\
-   np->path = NULL;
\
np->catd = NLERR;   
\
-   np->refcount = 0;   
\
np->lang = (l == NULL) ? NULL : 
\
strdup(l);  
\
np->caterrno = e;   
\
-   SLIST_INSERT_HEAD(&cache, np, list);
\
+   if (np->name == NULL || 
\
+   (l != NULL && np->lang == NULL)) {  
\
+   free(np->name); 
\
+   free(np->lang); 
\
+   free(np);   
\
+   } else {
\
+   WLOCK(NLERR);   
\
+   SLIST_INSERT_HEAD(&cache, np,   
\
+   list);  
\
+   UNLOCK; 
\
+   }   
\
  } 
\
- UNLOCK;   
\
  errno = e;
\
}
 
@@ -152,7 +159,7 @@ catopen(const char *name, int type)
NLRETERR(np->caterrno);
} else {
/* Found cached successful entry */
-   np->refcount++;
+   atomic_add_int(&np->refcount, 1);
UNLOCK;
return (np->catd);
}
@@ -355,8 +362,7 @@ catclose(nl_catd catd)
WLOCK(-1);
SLIST_FOREACH(np, &cache, list) {
if (catd == np->catd) {
-   np->refcount--;
-   if (np->refcount == 0)
+   if (atomic_fetchadd_int(&np->refcount, -1) == 1)
catfree(np);
break;
}
@@ -376,6 +382,7 @@ load_msgcat(const char *path, const char *name, const 
nl_catd catd;
struct catentry *np;
void *data;
+   char *copy_path, *copy_name, *copy_lang;
int fd;
 
/* path/name will never be NULL here */
@@ -387,7 +394,7 @@ load_msgcat(const char *path, const char *name, const 
RLOCK(NLERR);
SLIST_FOREACH(np, &cache, list) {
if ((np->path != NULL) && (strcmp(np->path, path) == 0)) {
-   np->refcount++;
+   atomic_add_int(&np->refcount, 1);
UNLOCK;
return (np->catd);
}
@@ -432,7 +439,20 @@ load_msgcat(const char *path, const char *name, const 
NLRETERR(EFTYPE);
}
 
-   if ((catd = malloc(sizeof (*catd))) == NULL) {
+   copy_name = strdup(name);
+   copy_path = strdup(path);
+   copy_lang = (lang == NULL) ? NULL : strdup(lang);
+   catd = malloc(sizeof (*catd));
+   np = calloc(1, sizeof(struct catentry));
+
+   if (copy_name == NULL || copy_path == NULL ||
+ 

svn commit: r360521 - in stable/11: contrib/file contrib/file/doc contrib/file/m4 contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic

2020-04-30 Thread Xin LI
Author: delphij
Date: Fri May  1 04:48:20 2020
New Revision: 360521
URL: https://svnweb.freebsd.org/changeset/base/360521

Log:
  MFC r357757: MFV r357712: file 5.38.

Added:
  stable/11/contrib/file/magic/Magdir/forth
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/forth
  stable/11/contrib/file/magic/Magdir/git
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/git
  stable/11/contrib/file/magic/Magdir/modulefile
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/modulefile
  stable/11/contrib/file/magic/Magdir/openfst
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/openfst
  stable/11/contrib/file/magic/Magdir/opentimestamps
 - copied unchanged from r357757, 
head/contrib/file/magic/Magdir/opentimestamps
  stable/11/contrib/file/magic/Magdir/pmem
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/pmem
  stable/11/contrib/file/magic/Magdir/rst
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/rst
  stable/11/contrib/file/magic/Magdir/sosi
 - copied unchanged from r357757, head/contrib/file/magic/Magdir/sosi
  stable/11/contrib/file/src/is_csv.c
 - copied unchanged from r357757, head/contrib/file/src/is_csv.c
Modified:
  stable/11/contrib/file/ChangeLog
  stable/11/contrib/file/Makefile.in
  stable/11/contrib/file/README
  stable/11/contrib/file/aclocal.m4
  stable/11/contrib/file/compile
  stable/11/contrib/file/config.guess
  stable/11/contrib/file/config.h.in
  stable/11/contrib/file/config.sub
  stable/11/contrib/file/configure
  stable/11/contrib/file/configure.ac
  stable/11/contrib/file/depcomp
  stable/11/contrib/file/doc/Makefile.in
  stable/11/contrib/file/doc/file.man
  stable/11/contrib/file/doc/libmagic.man
  stable/11/contrib/file/doc/magic.man
  stable/11/contrib/file/ltmain.sh
  stable/11/contrib/file/m4/libtool.m4
  stable/11/contrib/file/m4/ltoptions.m4
  stable/11/contrib/file/m4/ltsugar.m4
  stable/11/contrib/file/m4/ltversion.m4
  stable/11/contrib/file/m4/lt~obsolete.m4
  stable/11/contrib/file/magic/Magdir/android
  stable/11/contrib/file/magic/Magdir/animation
  stable/11/contrib/file/magic/Magdir/apple
  stable/11/contrib/file/magic/Magdir/archive
  stable/11/contrib/file/magic/Magdir/audio
  stable/11/contrib/file/magic/Magdir/bsi
  stable/11/contrib/file/magic/Magdir/c-lang
  stable/11/contrib/file/magic/Magdir/cad
  stable/11/contrib/file/magic/Magdir/commands
  stable/11/contrib/file/magic/Magdir/compress
  stable/11/contrib/file/magic/Magdir/console
  stable/11/contrib/file/magic/Magdir/database
  stable/11/contrib/file/magic/Magdir/elf
  stable/11/contrib/file/magic/Magdir/espressif
  stable/11/contrib/file/magic/Magdir/filesystems
  stable/11/contrib/file/magic/Magdir/fonts
  stable/11/contrib/file/magic/Magdir/frame
  stable/11/contrib/file/magic/Magdir/games
  stable/11/contrib/file/magic/Magdir/gimp
  stable/11/contrib/file/magic/Magdir/icc
  stable/11/contrib/file/magic/Magdir/images
  stable/11/contrib/file/magic/Magdir/javascript
  stable/11/contrib/file/magic/Magdir/kml
  stable/11/contrib/file/magic/Magdir/linux
  stable/11/contrib/file/magic/Magdir/macintosh
  stable/11/contrib/file/magic/Magdir/mail.news
  stable/11/contrib/file/magic/Magdir/map
  stable/11/contrib/file/magic/Magdir/msdos
  stable/11/contrib/file/magic/Magdir/msooxml
  stable/11/contrib/file/magic/Magdir/ole2compounddocs
  stable/11/contrib/file/magic/Magdir/pdf
  stable/11/contrib/file/magic/Magdir/python
  stable/11/contrib/file/magic/Magdir/rpi
  stable/11/contrib/file/magic/Magdir/ruby
  stable/11/contrib/file/magic/Magdir/sgml
  stable/11/contrib/file/magic/Magdir/sniffer
  stable/11/contrib/file/magic/Magdir/ssh
  stable/11/contrib/file/magic/Magdir/uuencode
  stable/11/contrib/file/magic/Magdir/varied.script
  stable/11/contrib/file/magic/Magdir/vax
  stable/11/contrib/file/magic/Magdir/windows
  stable/11/contrib/file/magic/Magdir/wordprocessors
  stable/11/contrib/file/magic/Magdir/zip
  stable/11/contrib/file/magic/Makefile.am
  stable/11/contrib/file/magic/Makefile.in
  stable/11/contrib/file/missing
  stable/11/contrib/file/python/Makefile.in
  stable/11/contrib/file/src/Makefile.am
  stable/11/contrib/file/src/Makefile.in
  stable/11/contrib/file/src/apprentice.c
  stable/11/contrib/file/src/ascmagic.c
  stable/11/contrib/file/src/buffer.c
  stable/11/contrib/file/src/compress.c
  stable/11/contrib/file/src/encoding.c
  stable/11/contrib/file/src/file.c
  stable/11/contrib/file/src/file.h
  stable/11/contrib/file/src/file_opts.h
  stable/11/contrib/file/src/fsmagic.c
  stable/11/contrib/file/src/funcs.c
  stable/11/contrib/file/src/magic.h.in
  stable/11/contrib/file/src/readcdf.c
  stable/11/contrib/file/src/readelf.c
  stable/11/contrib/file/src/seccomp.c
  stable/11/contrib/file/src/vasprintf.c
  stable/11/contrib/file/tests/JW07022A.mp3.result
  stable/11/contrib/file/tests/Makefile.in
  stable/11/contrib/file/tests/test.c
  stable/11/lib/libmagic/Makefile

svn commit: r360520 - stable/12/sbin/fsck_msdosfs

2020-04-30 Thread Xin LI
Author: delphij
Date: Fri May  1 04:16:57 2020
New Revision: 360520
URL: https://svnweb.freebsd.org/changeset/base/360520

Log:
  MFC r360428: Do not overflow when calculating file system size.

Modified:
  stable/12/sbin/fsck_msdosfs/check.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/fsck_msdosfs/check.c
==
--- stable/12/sbin/fsck_msdosfs/check.c Fri May  1 01:31:19 2020
(r360519)
+++ stable/12/sbin/fsck_msdosfs/check.c Fri May  1 04:16:57 2020
(r360520)
@@ -54,6 +54,8 @@ checkfilesys(const char *fname)
int finish_dosdirsection=0;
int mod = 0;
int ret = 8;
+   int64_t freebytes;
+   int64_t badbytes;
 
rdonly = alwaysno;
if (!preen)
@@ -129,37 +131,33 @@ checkfilesys(const char *fname)
mod |= FSERROR;
}
 
+   freebytes = (int64_t)boot.NumFree * boot.ClusterSize;
+   badbytes = (int64_t)boot.NumBad * boot.ClusterSize;
+
 #ifdef HAVE_LIBUTIL_H
char freestr[7], badstr[7];
 
-   int64_t freebytes = boot.NumFree * boot.ClusterSize;
humanize_number(freestr, sizeof(freestr), freebytes, "",
HN_AUTOSCALE, HN_DECIMAL | HN_IEC_PREFIXES);
if (boot.NumBad) {
-   int64_t badbytes = boot.NumBad * boot.ClusterSize;
-
humanize_number(badstr, sizeof(badstr), badbytes, "",
HN_AUTOSCALE, HN_B | HN_DECIMAL | HN_IEC_PREFIXES);
 
pwarn("%d files, %sB free (%d clusters), %sB bad (%d 
clusters)\n",
- boot.NumFiles,
- freestr, boot.NumFree,
+ boot.NumFiles, freestr, boot.NumFree,
  badstr, boot.NumBad);
} else {
pwarn("%d files, %sB free (%d clusters)\n",
- boot.NumFiles,
- freestr, boot.NumFree);
+ boot.NumFiles, freestr, boot.NumFree);
}
 #else
if (boot.NumBad)
-   pwarn("%d files, %d KiB free (%d clusters), %d KiB bad (%d 
clusters)\n",
- boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree,
- boot.NumBad * boot.ClusterSize / 1024, boot.NumBad);
+   pwarn("%d files, %jd KiB free (%d clusters), %jd KiB bad (%d 
clusters)\n",
+ boot.NumFiles, (intmax_t)freebytes / 1024, boot.NumFree,
+ (intmax_t)badbytes / 1024, boot.NumBad);
else
-   pwarn("%d files, %d KiB free (%d clusters)\n",
- boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree);
+   pwarn("%d files, %jd KiB free (%d clusters)\n",
+ boot.NumFiles, (intmax_t)freebytes / 1024, boot.NumFree);
 #endif
 
if (mod && (mod & FSERROR) == 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360490 - stable/11/sbin/fsck_msdosfs

2020-04-29 Thread Xin LI
Author: delphij
Date: Thu Apr 30 06:34:34 2020
New Revision: 360490
URL: https://svnweb.freebsd.org/changeset/base/360490

Log:
  MFC r345839, r345894, r345897, r345900-r345901, r345976, r346220, r348602, 
r348767, r348967,
  r349047-r349048, r351204-r351205, r351502, r351623, r352364, r356249-r356250, 
r356313,
  r356434, r356628-r356629, r356636, r356657, r357421, r357716, r360359, 
r360428:
  
  r345839: Assert that q can't be NULL.  'empty' is always non-NULL when 
DIREMPTY
  r345894: Restore the ability of checking and fixing next free
  r345897: Restore lfcl when LOSTDIR's chain was corrupted and overwritten
  r345900: Implement checking of `.' and `..' entries of subdirectory.
  r345901: Fix build.
  r345976: Write string constant differently to improve readability.
  r346220: Don't cast result from malloc().
  r348602: Don't increment cl after increment.
  r348767: preen should work independently with alwaysyes and alwaysno.
  r348967: Avoid out of boundary access when checking invalid long filenames.
  r349047: Blankspace.  No actual code change.
  r349048: In ask(): override default option if any of 
alwaysyes/alwaysno/rdonly is
  r351204: Remove redundant check and wrong fix: fat.c checks already take care
  r351205: Use calloc().
  r351502: Comment boot block checks and perform additional sanity checks:
  r351623: Remove unneeded blank line.  No functional change.
  r352364: Avoid mixing cluster numbers and sector numbers. Makes code more 
readable.
  r356249: Reduce memory footprint of fsck_msdosfs.
  r356250: Revert r356249 for now as it broke GCC builds.
  r356313: Reduce memory footprint of fsck_msdosfs.
  r356434: fsck_msdosfs.8: document -M.
  r356628: Require FAT to occupy at least one sector.
  r356629: Apply typo fix from NetBSD, we have already applied all NetBSD 
changes so
  r356636: Correct off-by-two issue when determining FAT type.
  r356657: Tighten FAT checks and fix off-by-one error in corner case.
  r357421: Diff reduction against NetBSD, no functional change.
  r357716: Use humanize_number to format available and bad space sizes.
  r360359: Fix a bug with dirty file system handling.
  r360428: Do not overflow when calculating file system size.

Modified:
  stable/11/sbin/fsck_msdosfs/Makefile
  stable/11/sbin/fsck_msdosfs/boot.c
  stable/11/sbin/fsck_msdosfs/check.c
  stable/11/sbin/fsck_msdosfs/dir.c
  stable/11/sbin/fsck_msdosfs/dosfs.h
  stable/11/sbin/fsck_msdosfs/ext.h
  stable/11/sbin/fsck_msdosfs/fat.c
  stable/11/sbin/fsck_msdosfs/fsck_msdosfs.8
  stable/11/sbin/fsck_msdosfs/main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/fsck_msdosfs/Makefile
==
--- stable/11/sbin/fsck_msdosfs/MakefileThu Apr 30 05:28:48 2020
(r360489)
+++ stable/11/sbin/fsck_msdosfs/MakefileThu Apr 30 06:34:34 2020
(r360490)
@@ -9,6 +9,7 @@ PROG=   fsck_msdosfs
 MAN=   fsck_msdosfs.8
 SRCS=  main.c check.c boot.c fat.c dir.c fsutil.c
 
-CFLAGS+= -I${FSCK}
+CFLAGS+= -I${FSCK} -DHAVE_LIBUTIL_H
+LIBADD=util
 
 .include 

Modified: stable/11/sbin/fsck_msdosfs/boot.c
==
--- stable/11/sbin/fsck_msdosfs/boot.c  Thu Apr 30 05:28:48 2020
(r360489)
+++ stable/11/sbin/fsck_msdosfs/boot.c  Thu Apr 30 06:34:34 2020
(r360490)
@@ -28,11 +28,14 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: boot.c,v 1.11 2006/06/05 16:51:18 christos Exp ");
+__RCSID("$NetBSD: boot.c,v 1.22 2020/01/11 16:29:07 christos Exp $");
 static const char rcsid[] =
   "$FreeBSD$";
 #endif /* not lint */
 
+#include 
+
+#include 
 #include 
 #include 
 #include 
@@ -46,10 +49,8 @@ readboot(int dosfs, struct bootblock *boot)
 {
u_char block[DOSBOOTBLOCKSIZE];
u_char fsinfo[2 * DOSBOOTBLOCKSIZE];
-   u_char backup[DOSBOOTBLOCKSIZE];
int ret = FSOK;
-   int i;
-   
+
if ((size_t)read(dosfs, block, sizeof block) != sizeof block) {
perr("could not read boot block");
return FSFATAL;
@@ -64,61 +65,130 @@ readboot(int dosfs, struct bootblock *boot)
memset(boot, 0, sizeof *boot);
boot->ValidFat = -1;
 
-   /* decode bios parameter block */
+   /* Decode BIOS Parameter Block */
+
+   /* Bytes per sector: can only be  512, 1024, 2048 and 4096. */
boot->bpbBytesPerSec = block[11] + (block[12] << 8);
+   if (boot->bpbBytesPerSec < DOSBOOTBLOCKSIZE_REAL ||
+   boot->bpbBytesPerSec > DOSBOOTBLOCKSIZE ||
+   !powerof2(boot->bpbBytesPerSec)) {
+   pfatal("Invalid sector size: %u", boot->bpbBytesPerSec);
+   return FSFATAL;
+   }
+
+   /* Sectors per cluster: can only be: 1, 2, 4, 8, 16, 32, 64, 128. */
boot->bpbSecPerClust = block[13];
+   if (boot->bpbSecPerClust == 0 || !powerof2(boot->bpbSecPerClust)) {
+   pfatal("Invalid clus

svn commit: r360489 - stable/12/sys/sys

2020-04-29 Thread Xin LI
Author: delphij
Date: Thu Apr 30 05:28:48 2020
New Revision: 360489
URL: https://svnweb.freebsd.org/changeset/base/360489

Log:
  Fix build: redo MFC r360059 and revert unwanted portion.

Modified:
  stable/12/sys/sys/socketvar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/sys/socketvar.h
==
--- stable/12/sys/sys/socketvar.h   Thu Apr 30 04:00:53 2020
(r360488)
+++ stable/12/sys/sys/socketvar.h   Thu Apr 30 05:28:48 2020
(r360489)
@@ -173,10 +173,6 @@ struct socket {
short   sol_sbsnd_flags;
sbintime_t  sol_sbrcv_timeo;
sbintime_t  sol_sbsnd_timeo;
-
-   /* Information tracking listen queue overflows. */
-   struct timeval  sol_lastover;   /* (e) */
-   int sol_overcount;  /* (e) */
};
};
 };
@@ -185,13 +181,13 @@ struct socket {
 /*
  * Socket state bits.
  *
- * Historically, these bits were all kept in the so_state field.
- * They are now split into separate, lock-specific fields.
- * so_state maintains basic socket state protected by the socket lock.
- * so_qstate holds information about the socket accept queues.
- * Each socket buffer also has a state field holding information
- * relevant to that socket buffer (can't send, rcv).
- * Many fields will be read without locks to improve performance and avoid
+ * Historically, this bits were all kept in the so_state field.  For
+ * locking reasons, they are now in multiple fields, as they are
+ * locked differently.  so_state maintains basic socket state protected
+ * by the socket lock.  so_qstate holds information about the socket
+ * accept queues.  Each socket buffer also has a state field holding
+ * information relevant to that socket buffer (can't send, rcv).  Many
+ * fields will be read without locks to improve performance and avoid
  * lock order issues.  However, this approach must be used with caution.
  */
 #defineSS_NOFDREF  0x0001  /* no file table ref any more */
@@ -384,8 +380,7 @@ struct uio;
 /*
  * From uipc_socket and friends
  */
-intgetsockaddr(struct sockaddr **namp, const struct sockaddr *uaddr,
-   size_t len);
+intgetsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len);
 intgetsock_cap(struct thread *td, int fd, cap_rights_t *rightsp,
struct file **fpp, u_int *fflagp, struct filecaps *havecaps);
 void   soabort(struct socket *so);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360488 - stable/12/sbin/fsck_msdosfs

2020-04-29 Thread Xin LI
Author: delphij
Date: Thu Apr 30 04:00:53 2020
New Revision: 360488
URL: https://svnweb.freebsd.org/changeset/base/360488

Log:
  MFC r360359: Fix a bug with dirty file system handling.

Modified:
  stable/12/sbin/fsck_msdosfs/check.c
  stable/12/sbin/fsck_msdosfs/ext.h
  stable/12/sbin/fsck_msdosfs/fat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/fsck_msdosfs/check.c
==
--- stable/12/sbin/fsck_msdosfs/check.c Thu Apr 30 03:58:30 2020
(r360487)
+++ stable/12/sbin/fsck_msdosfs/check.c Thu Apr 30 04:00:53 2020
(r360488)
@@ -169,7 +169,7 @@ checkfilesys(const char *fname)
 
if (mod & FSDIRTY) {
pwarn("MARKING FILE SYSTEM CLEAN\n");
-   mod |= writefat(fat);
+   mod |= cleardirty(fat);
} else {
pwarn("\n* FILE SYSTEM IS LEFT MARKED AS 
DIRTY *\n");
mod |= FSERROR; /* file system not clean */

Modified: stable/12/sbin/fsck_msdosfs/ext.h
==
--- stable/12/sbin/fsck_msdosfs/ext.h   Thu Apr 30 03:58:30 2020
(r360487)
+++ stable/12/sbin/fsck_msdosfs/ext.h   Thu Apr 30 04:00:53 2020
(r360488)
@@ -90,6 +90,8 @@ int writefsinfo(int, struct bootblock *);
 /* Opaque type */
 struct fat_descriptor;
 
+int cleardirty(struct fat_descriptor *);
+
 void fat_clear_cl_head(struct fat_descriptor *, cl_t);
 bool fat_is_cl_head(struct fat_descriptor *, cl_t);
 

Modified: stable/12/sbin/fsck_msdosfs/fat.c
==
--- stable/12/sbin/fsck_msdosfs/fat.c   Thu Apr 30 03:58:30 2020
(r360487)
+++ stable/12/sbin/fsck_msdosfs/fat.c   Thu Apr 30 04:00:53 2020
(r360488)
@@ -578,7 +578,6 @@ valid_cl(struct fat_descriptor *fat, cl_t cl)
  * h = hard error flag (1 = ok; 0 = I/O error)
  * x = any value ok
  */
-
 int
 checkdirty(int fs, struct bootblock *boot)
 {
@@ -636,6 +635,53 @@ checkdirty(int fs, struct bootblock *boot)
if ((buffer[7] & 0x0c) == 0x0c)
ret = 1;
}
+
+err:
+   free(buffer);
+   return ret;
+}
+
+int
+cleardirty(struct fat_descriptor *fat)
+{
+   int fd, ret = FSERROR;
+   struct bootblock *boot;
+   u_char *buffer;
+   size_t len;
+   off_t off;
+
+   boot = boot_of_(fat);
+   fd = fd_of_(fat);
+
+   if (boot->ClustMask != CLUST16_MASK && boot->ClustMask != CLUST32_MASK)
+   return 0;
+
+   off = boot->bpbResSectors;
+   off *= boot->bpbBytesPerSec;
+
+   buffer = malloc(len = boot->bpbBytesPerSec);
+   if (buffer == NULL) {
+   perr("No memory for FAT sectors (%zu)", len);
+   return 1;
+   }
+
+   if ((size_t)pread(fd, buffer, len, off) != len) {
+   perr("Unable to read FAT");
+   goto err;
+   }
+
+   if (boot->ClustMask == CLUST16_MASK) {
+   buffer[3] |= 0x80;
+   } else {
+   buffer[7] |= 0x08;
+   }
+
+   if ((size_t)pwrite(fd, buffer, len, off) != len) {
+   perr("Unable to write FAT");
+   goto err;
+   }
+
+   ret = FSOK;
 
 err:
free(buffer);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360428 - head/sbin/fsck_msdosfs

2020-04-27 Thread Xin LI
Author: delphij
Date: Tue Apr 28 05:10:34 2020
New Revision: 360428
URL: https://svnweb.freebsd.org/changeset/base/360428

Log:
  Do not overflow when calculating file system size.
  
  Reported by:  Hyeongseok Kim 
  Reviewed by:  cem, Hyeongseok Kim
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D24603

Modified:
  head/sbin/fsck_msdosfs/check.c

Modified: head/sbin/fsck_msdosfs/check.c
==
--- head/sbin/fsck_msdosfs/check.c  Tue Apr 28 03:43:55 2020
(r360427)
+++ head/sbin/fsck_msdosfs/check.c  Tue Apr 28 05:10:34 2020
(r360428)
@@ -54,6 +54,8 @@ checkfilesys(const char *fname)
int finish_dosdirsection=0;
int mod = 0;
int ret = 8;
+   int64_t freebytes;
+   int64_t badbytes;
 
rdonly = alwaysno;
if (!preen)
@@ -129,37 +131,33 @@ checkfilesys(const char *fname)
mod |= FSERROR;
}
 
+   freebytes = (int64_t)boot.NumFree * boot.ClusterSize;
+   badbytes = (int64_t)boot.NumBad * boot.ClusterSize;
+
 #ifdef HAVE_LIBUTIL_H
char freestr[7], badstr[7];
 
-   int64_t freebytes = boot.NumFree * boot.ClusterSize;
humanize_number(freestr, sizeof(freestr), freebytes, "",
HN_AUTOSCALE, HN_DECIMAL | HN_IEC_PREFIXES);
if (boot.NumBad) {
-   int64_t badbytes = boot.NumBad * boot.ClusterSize;
-
humanize_number(badstr, sizeof(badstr), badbytes, "",
HN_AUTOSCALE, HN_B | HN_DECIMAL | HN_IEC_PREFIXES);
 
pwarn("%d files, %sB free (%d clusters), %sB bad (%d 
clusters)\n",
- boot.NumFiles,
- freestr, boot.NumFree,
+ boot.NumFiles, freestr, boot.NumFree,
  badstr, boot.NumBad);
} else {
pwarn("%d files, %sB free (%d clusters)\n",
- boot.NumFiles,
- freestr, boot.NumFree);
+ boot.NumFiles, freestr, boot.NumFree);
}
 #else
if (boot.NumBad)
-   pwarn("%d files, %d KiB free (%d clusters), %d KiB bad (%d 
clusters)\n",
- boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree,
- boot.NumBad * boot.ClusterSize / 1024, boot.NumBad);
+   pwarn("%d files, %jd KiB free (%d clusters), %jd KiB bad (%d 
clusters)\n",
+ boot.NumFiles, (intmax_t)freebytes / 1024, boot.NumFree,
+ (intmax_t)badbytes / 1024, boot.NumBad);
else
-   pwarn("%d files, %d KiB free (%d clusters)\n",
- boot.NumFiles,
- boot.NumFree * boot.ClusterSize / 1024, boot.NumFree);
+   pwarn("%d files, %jd KiB free (%d clusters)\n",
+ boot.NumFiles, (intmax_t)freebytes / 1024, boot.NumFree);
 #endif
 
if (mod && (mod & FSERROR) == 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360359 - head/sbin/fsck_msdosfs

2020-04-26 Thread Xin LI
Author: delphij
Date: Mon Apr 27 02:01:48 2020
New Revision: 360359
URL: https://svnweb.freebsd.org/changeset/base/360359

Log:
  Fix a bug with dirty file system handling.
  
  r356313 broke handling of dirty file system because we have restricted
  the correction of "odd" byte sequences to checkfat(), and as a result
  the dirty bit is never cleared.  The old fsck_msdosfs code would write
  FAT twice to fix the dirty bit, which is also not ideal.
  
  Fix this by introducing a new rountine, cleardirty() which will perform
  the set of clean bit only, and use it in checkfilesys() if we thought
  the file system was dirty.
  
  Reviewed by:  cem, emaste
  MFC after:3 day
  Differential Revision:https://reviews.freebsd.org/D24581

Modified:
  head/sbin/fsck_msdosfs/check.c
  head/sbin/fsck_msdosfs/ext.h
  head/sbin/fsck_msdosfs/fat.c

Modified: head/sbin/fsck_msdosfs/check.c
==
--- head/sbin/fsck_msdosfs/check.c  Sun Apr 26 22:08:47 2020
(r360358)
+++ head/sbin/fsck_msdosfs/check.c  Mon Apr 27 02:01:48 2020
(r360359)
@@ -169,7 +169,7 @@ checkfilesys(const char *fname)
 
if (mod & FSDIRTY) {
pwarn("MARKING FILE SYSTEM CLEAN\n");
-   mod |= writefat(fat);
+   mod |= cleardirty(fat);
} else {
pwarn("\n* FILE SYSTEM IS LEFT MARKED AS 
DIRTY *\n");
mod |= FSERROR; /* file system not clean */

Modified: head/sbin/fsck_msdosfs/ext.h
==
--- head/sbin/fsck_msdosfs/ext.hSun Apr 26 22:08:47 2020
(r360358)
+++ head/sbin/fsck_msdosfs/ext.hMon Apr 27 02:01:48 2020
(r360359)
@@ -90,6 +90,8 @@ int writefsinfo(int, struct bootblock *);
 /* Opaque type */
 struct fat_descriptor;
 
+int cleardirty(struct fat_descriptor *);
+
 void fat_clear_cl_head(struct fat_descriptor *, cl_t);
 bool fat_is_cl_head(struct fat_descriptor *, cl_t);
 

Modified: head/sbin/fsck_msdosfs/fat.c
==
--- head/sbin/fsck_msdosfs/fat.cSun Apr 26 22:08:47 2020
(r360358)
+++ head/sbin/fsck_msdosfs/fat.cMon Apr 27 02:01:48 2020
(r360359)
@@ -578,7 +578,6 @@ valid_cl(struct fat_descriptor *fat, cl_t cl)
  * h = hard error flag (1 = ok; 0 = I/O error)
  * x = any value ok
  */
-
 int
 checkdirty(int fs, struct bootblock *boot)
 {
@@ -636,6 +635,53 @@ checkdirty(int fs, struct bootblock *boot)
if ((buffer[7] & 0x0c) == 0x0c)
ret = 1;
}
+
+err:
+   free(buffer);
+   return ret;
+}
+
+int
+cleardirty(struct fat_descriptor *fat)
+{
+   int fd, ret = FSERROR;
+   struct bootblock *boot;
+   u_char *buffer;
+   size_t len;
+   off_t off;
+
+   boot = boot_of_(fat);
+   fd = fd_of_(fat);
+
+   if (boot->ClustMask != CLUST16_MASK && boot->ClustMask != CLUST32_MASK)
+   return 0;
+
+   off = boot->bpbResSectors;
+   off *= boot->bpbBytesPerSec;
+
+   buffer = malloc(len = boot->bpbBytesPerSec);
+   if (buffer == NULL) {
+   perr("No memory for FAT sectors (%zu)", len);
+   return 1;
+   }
+
+   if ((size_t)pread(fd, buffer, len, off) != len) {
+   perr("Unable to read FAT");
+   goto err;
+   }
+
+   if (boot->ClustMask == CLUST16_MASK) {
+   buffer[3] |= 0x80;
+   } else {
+   buffer[7] |= 0x08;
+   }
+
+   if ((size_t)pwrite(fd, buffer, len, off) != len) {
+   perr("Unable to write FAT");
+   goto err;
+   }
+
+   ret = FSOK;
 
 err:
free(buffer);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360327 - in stable: 11 12

2020-04-25 Thread Xin LI
Author: delphij
Date: Sat Apr 25 23:35:49 2020
New Revision: 360327
URL: https://svnweb.freebsd.org/changeset/base/360327

Log:
  MFC rr359961 (jkim): Do not attempt to remove backward compatibility
  timezones.

Modified:
  stable/11/ObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/ObsoleteFiles.inc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/ObsoleteFiles.inc
==
--- stable/11/ObsoleteFiles.inc Sat Apr 25 22:23:34 2020(r360326)
+++ stable/11/ObsoleteFiles.inc Sat Apr 25 23:35:49 2020(r360327)
@@ -2585,8 +2585,6 @@ OLD_FILES+=usr/lib32/libheimsqlite.a
 OLD_FILES+=usr/lib32/libheimsqlite.so
 OLD_LIBS+=usr/lib32/libheimsqlite.so.11
 OLD_FILES+=usr/lib32/libheimsqlite_p.a
-# 20150518: tzdata2015c update
-OLD_FILES+=usr/share/zoneinfo/America/Montreal
 # 20150506
 OLD_FILES+=usr/share/man/man9/NDHASGIANT.9.gz
 # 20150504
@@ -3090,10 +3088,6 @@ OLD_FILES+=etc/rc.d/hv_kvpd
 OLD_LIBS+=usr/lib/libnv.so.0
 # 20140829: rc.d/kerberos removed
 OLD_FILES+=etc/rc.d/kerberos
-# 20140827: tzdata2014f import
-OLD_FILES+=usr/share/zoneinfo/Asia/Chongqing
-OLD_FILES+=usr/share/zoneinfo/Asia/Harbin
-OLD_FILES+=usr/share/zoneinfo/Asia/Kashgar
 # 20140814: libopie version bump
 OLD_LIBS+=usr/lib/libopie.so.7
 OLD_LIBS+=usr/lib32/libopie.so.7
@@ -3384,9 +3378,6 @@ OLD_FILES+=usr/share/man/man2/extattr_get_list.2.gz
 # 20131107: example files removed
 OLD_FILES+=usr/share/examples/libusb20/aux.c
 OLD_FILES+=usr/share/examples/libusb20/aux.h
-# 20131105: tzdata 2013h import
-OLD_FILES+=usr/share/zoneinfo/America/Shiprock
-OLD_FILES+=usr/share/zoneinfo/Antarctica/South_Pole
 # 20131103: WITH_LIBICONV_COMPAT removal
 OLD_FILES+=usr/include/_libiconv_compat.h
 OLD_FILES+=usr/lib/libiconv.a
@@ -4327,9 +4318,6 @@ OLD_FILES+=usr/share/man/man3/ascftime.3.gz
 OLD_FILES+=usr/share/man/man3/cfree.3.gz
 OLD_FILES+=usr/share/man/man3/cftime.3.gz
 OLD_FILES+=usr/share/man/man3/getpw.3.gz
-# 20100801: tzdata2010k import
-OLD_FILES+=usr/share/zoneinfo/Pacific/Ponape
-OLD_FILES+=usr/share/zoneinfo/Pacific/Truk
 # 20100725: acpi_aiboost(4) removal.
 OLD_FILES+=usr/share/man/man4/acpi_aiboost.4.gz
 # 20100724: nfsclient/nfs_lock.h moved to nfs/nfs_lock.h
@@ -5006,8 +4994,6 @@ OLD_FILES+=usr/include/pccard/cis.h
 OLD_DIRS+=usr/include/pccard
 # 20090203: adding_user.8 moved to adding_user.7
 OLD_FILES+=usr/share/man/man8/adding_user.8.gz
-# 20090122: tzdata2009a import
-OLD_FILES+=usr/share/zoneinfo/Asia/Katmandu
 # 20090102: file 4.26 import
 OLD_FILES+=usr/share/misc/magic.mime
 OLD_FILES+=usr/share/misc/magic.mime.mgc
@@ -5240,9 +5226,6 @@ OLD_FILES+=usr/sbin/pkg_check
 OLD_FILES+=usr/sbin/pkg_sign
 OLD_FILES+=usr/share/man/man1/pkg_check.1.gz
 OLD_FILES+=usr/share/man/man1/pkg_sign.1.gz
-# 20080325: tzdata2008b import
-OLD_FILES+=usr/share/zoneinfo/Asia/Calcutta
-OLD_FILES+=usr/share/zoneinfo/Asia/Saigon
 # 20080314: stack_print(9) mlink fixed
 OLD_FILES+=usr/share/man/man9/stack_printf.9.gz
 # 20080312: libkse removal
@@ -9261,19 +9244,6 @@ OLD_FILES+=usr/share/misc/nslookup.help
 OLD_FILES+=usr/share/sendmail/cf/feature/nodns.m4
 OLD_FILES+=usr/share/syscons/keymaps/lat-amer.kbd
 OLD_FILES+=usr/share/vi/catalog/ru_SU.KOI8-R
-OLD_FILES+=usr/share/zoneinfo/Africa/Timbuktu
-OLD_FILES+=usr/share/zoneinfo/Africa/Asmera
-OLD_FILES+=usr/share/zoneinfo/America/Buenos_Aires
-OLD_FILES+=usr/share/zoneinfo/America/Cordoba
-OLD_FILES+=usr/share/zoneinfo/America/Jujuy
-OLD_FILES+=usr/share/zoneinfo/America/Catamarca
-OLD_FILES+=usr/share/zoneinfo/America/Mendoza
-OLD_FILES+=usr/share/zoneinfo/America/Indianapolis
-OLD_FILES+=usr/share/zoneinfo/America/Louisville
-OLD_FILES+=usr/share/zoneinfo/America/Argentina/ComodRivadavia
-OLD_FILES+=usr/share/zoneinfo/Atlantic/Faeroe
-OLD_FILES+=usr/share/zoneinfo/Europe/Belfast
-OLD_FILES+=usr/share/zoneinfo/Pacific/Yap
 OLD_FILES+=usr/share/zoneinfo/SystemV/YST9
 OLD_FILES+=usr/share/zoneinfo/SystemV/PST8
 OLD_FILES+=usr/share/zoneinfo/SystemV/EST5EDT
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360327 - in stable: 11 12

2020-04-25 Thread Xin LI
Author: delphij
Date: Sat Apr 25 23:35:49 2020
New Revision: 360327
URL: https://svnweb.freebsd.org/changeset/base/360327

Log:
  MFC rr359961 (jkim): Do not attempt to remove backward compatibility
  timezones.

Modified:
  stable/12/ObsoleteFiles.inc
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/ObsoleteFiles.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/ObsoleteFiles.inc
==
--- stable/12/ObsoleteFiles.inc Sat Apr 25 22:23:34 2020(r360326)
+++ stable/12/ObsoleteFiles.inc Sat Apr 25 23:35:49 2020(r360327)
@@ -4366,8 +4366,6 @@ OLD_FILES+=usr/lib32/libheimsqlite.a
 OLD_FILES+=usr/lib32/libheimsqlite.so
 OLD_LIBS+=usr/lib32/libheimsqlite.so.11
 OLD_FILES+=usr/lib32/libheimsqlite_p.a
-# 20150518: tzdata2015c update
-OLD_FILES+=usr/share/zoneinfo/America/Montreal
 # 20150506
 OLD_FILES+=usr/share/man/man9/NDHASGIANT.9.gz
 # 20150504
@@ -4871,10 +4869,6 @@ OLD_FILES+=etc/rc.d/hv_kvpd
 OLD_LIBS+=usr/lib/libnv.so.0
 # 20140829: rc.d/kerberos removed
 OLD_FILES+=etc/rc.d/kerberos
-# 20140827: tzdata2014f import
-OLD_FILES+=usr/share/zoneinfo/Asia/Chongqing
-OLD_FILES+=usr/share/zoneinfo/Asia/Harbin
-OLD_FILES+=usr/share/zoneinfo/Asia/Kashgar
 # 20140814: libopie version bump
 OLD_LIBS+=usr/lib/libopie.so.7
 OLD_LIBS+=usr/lib32/libopie.so.7
@@ -5165,9 +5159,6 @@ OLD_FILES+=usr/share/man/man2/extattr_get_list.2.gz
 # 20131107: example files removed
 OLD_FILES+=usr/share/examples/libusb20/aux.c
 OLD_FILES+=usr/share/examples/libusb20/aux.h
-# 20131105: tzdata 2013h import
-OLD_FILES+=usr/share/zoneinfo/America/Shiprock
-OLD_FILES+=usr/share/zoneinfo/Antarctica/South_Pole
 # 20131103: WITH_LIBICONV_COMPAT removal
 OLD_FILES+=usr/include/_libiconv_compat.h
 OLD_FILES+=usr/lib/libiconv.a
@@ -6106,9 +6097,6 @@ OLD_FILES+=usr/share/man/man3/ascftime.3.gz
 OLD_FILES+=usr/share/man/man3/cfree.3.gz
 OLD_FILES+=usr/share/man/man3/cftime.3.gz
 OLD_FILES+=usr/share/man/man3/getpw.3.gz
-# 20100801: tzdata2010k import
-OLD_FILES+=usr/share/zoneinfo/Pacific/Ponape
-OLD_FILES+=usr/share/zoneinfo/Pacific/Truk
 # 20100725: acpi_aiboost(4) removal.
 OLD_FILES+=usr/share/man/man4/acpi_aiboost.4.gz
 # 20100724: nfsclient/nfs_lock.h moved to nfs/nfs_lock.h
@@ -6785,8 +6773,6 @@ OLD_FILES+=usr/include/pccard/cis.h
 OLD_DIRS+=usr/include/pccard
 # 20090203: adding_user.8 moved to adding_user.7
 OLD_FILES+=usr/share/man/man8/adding_user.8.gz
-# 20090122: tzdata2009a import
-OLD_FILES+=usr/share/zoneinfo/Asia/Katmandu
 # 20090102: file 4.26 import
 OLD_FILES+=usr/share/misc/magic.mime
 OLD_FILES+=usr/share/misc/magic.mime.mgc
@@ -7019,9 +7005,6 @@ OLD_FILES+=usr/sbin/pkg_check
 OLD_FILES+=usr/sbin/pkg_sign
 OLD_FILES+=usr/share/man/man1/pkg_check.1.gz
 OLD_FILES+=usr/share/man/man1/pkg_sign.1.gz
-# 20080325: tzdata2008b import
-OLD_FILES+=usr/share/zoneinfo/Asia/Calcutta
-OLD_FILES+=usr/share/zoneinfo/Asia/Saigon
 # 20080314: stack_print(9) mlink fixed
 OLD_FILES+=usr/share/man/man9/stack_printf.9.gz
 # 20080312: libkse removal
@@ -11040,19 +11023,6 @@ OLD_FILES+=usr/share/misc/nslookup.help
 OLD_FILES+=usr/share/sendmail/cf/feature/nodns.m4
 OLD_FILES+=usr/share/syscons/keymaps/lat-amer.kbd
 OLD_FILES+=usr/share/vi/catalog/ru_SU.KOI8-R
-OLD_FILES+=usr/share/zoneinfo/Africa/Timbuktu
-OLD_FILES+=usr/share/zoneinfo/Africa/Asmera
-OLD_FILES+=usr/share/zoneinfo/America/Buenos_Aires
-OLD_FILES+=usr/share/zoneinfo/America/Cordoba
-OLD_FILES+=usr/share/zoneinfo/America/Jujuy
-OLD_FILES+=usr/share/zoneinfo/America/Catamarca
-OLD_FILES+=usr/share/zoneinfo/America/Mendoza
-OLD_FILES+=usr/share/zoneinfo/America/Indianapolis
-OLD_FILES+=usr/share/zoneinfo/America/Louisville
-OLD_FILES+=usr/share/zoneinfo/America/Argentina/ComodRivadavia
-OLD_FILES+=usr/share/zoneinfo/Atlantic/Faeroe
-OLD_FILES+=usr/share/zoneinfo/Europe/Belfast
-OLD_FILES+=usr/share/zoneinfo/Pacific/Yap
 OLD_FILES+=usr/share/zoneinfo/SystemV/YST9
 OLD_FILES+=usr/share/zoneinfo/SystemV/PST8
 OLD_FILES+=usr/share/zoneinfo/SystemV/EST5EDT
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360291 - stable/12/sys/dev/acpi_support

2020-04-24 Thread Xin LI
Author: delphij
Date: Sat Apr 25 06:42:46 2020
New Revision: 360291
URL: https://svnweb.freebsd.org/changeset/base/360291

Log:
  MFC r359795: Avoid using a variable solely for sizes that are never meant
  to be modified runtime.

Modified:
  stable/12/sys/dev/acpi_support/acpi_hp.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/acpi_support/acpi_hp.c
==
--- stable/12/sys/dev/acpi_support/acpi_hp.cSat Apr 25 05:51:58 2020
(r360290)
+++ stable/12/sys/dev/acpi_support/acpi_hp.cSat Apr 25 06:42:46 2020
(r360291)
@@ -960,10 +960,9 @@ acpi_hp_get_cmi_block(device_t wmi_dev, const char* gu
ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL };
int i;
int outlen;
-   int size = 255;
int has_enums = 0;
int valuebase = 0;
-   charstring_buffer[size];
+   charstring_buffer[255];
int enumbase;
 
outlen = 0;
@@ -1017,18 +1016,21 @@ acpi_hp_get_cmi_block(device_t wmi_dev, const char* gu
 
if (detail & ACPI_HP_CMI_DETAIL_PATHS) {
strlcat(outbuf, acpi_hp_get_string_from_object(
-   &obj->Package.Elements[2], string_buffer, size), outsize);
+   &obj->Package.Elements[2],
+   string_buffer, sizeof(string_buffer)), outsize);
outlen += 48;
while (strlen(outbuf) < outlen)
strlcat(outbuf, " ", outsize);
}
strlcat(outbuf, acpi_hp_get_string_from_object(
-   &obj->Package.Elements[0], string_buffer, size), outsize);
+   &obj->Package.Elements[0],
+   string_buffer, sizeof(string_buffer)), outsize);
outlen += 43;
while (strlen(outbuf) < outlen)
strlcat(outbuf, " ", outsize);
strlcat(outbuf, acpi_hp_get_string_from_object(
-   &obj->Package.Elements[valuebase], string_buffer, size), outsize);
+   &obj->Package.Elements[valuebase],
+   string_buffer, sizeof(string_buffer)), outsize);
outlen += 21;
while (strlen(outbuf) < outlen)
strlcat(outbuf, " ", outsize);
@@ -1039,7 +1041,8 @@ acpi_hp_get_cmi_block(device_t wmi_dev, const char* gu
for (i = enumbase + 1; i < enumbase + 1 +
obj->Package.Elements[enumbase].Integer.Value; ++i) {
acpi_hp_get_string_from_object(
-   &obj->Package.Elements[i], string_buffer, size);
+   &obj->Package.Elements[i],
+   string_buffer, sizeof(string_buffer));
if (strlen(string_buffer) > 1 ||
(strlen(string_buffer) == 1 &&
string_buffer[0] != ' ')) {
@@ -1209,8 +1212,7 @@ acpi_hp_hpcmi_read(struct cdev *dev, struct uio *buf, 
UINT8   instance;
UINT8   maxInstance;
UINT32  sequence;
-   int linesize = 1025;
-   charline[linesize];
+   charline[1025];
 
if (dev == NULL || dev->si_drv1 == NULL)
return (EBADF);
@@ -1235,7 +1237,7 @@ acpi_hp_hpcmi_read(struct cdev *dev, struct uio *buf, 
++instance) {
if (acpi_hp_get_cmi_block(sc->wmi_dev,
ACPI_HP_WMI_CMI_GUID, instance,
-   line, linesize, &sequence,
+   line, sizeof(line), &sequence,
sc->cmi_detail)) {
instance = maxInstance;
}
@@ -1268,7 +1270,7 @@ acpi_hp_hpcmi_read(struct cdev *dev, struct uio *buf, 
for (i=0; icmi_order_size; ++i) {
if (!acpi_hp_get_cmi_block(sc->wmi_dev,
ACPI_HP_WMI_CMI_GUID,
-   sc->cmi_order[i].instance, line, linesize,
+   sc->cmi_order[i].instance, line, 
sizeof(line),
&sequence, sc->cmi_detail)) {
sbuf_printf(&sc->hpcmi_sbuf, "%s\n", 
line);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360290 - in stable/11: etc/mtree share/mk share/zoneinfo share/zoneinfo/tests

2020-04-24 Thread Xin LI
Author: delphij
Date: Sat Apr 25 05:51:58 2020
New Revision: 360290
URL: https://svnweb.freebsd.org/changeset/base/360290

Log:
  MFC r359736: Always install backward compatibility timezones, as they
  are installed on all major Linux distributions as well as NetBSD and
  OpenBSD.

Modified:
  stable/11/etc/mtree/BSD.usr.dist
  stable/11/share/mk/src.opts.mk
  stable/11/share/zoneinfo/Makefile
  stable/11/share/zoneinfo/tests/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/mtree/BSD.usr.dist
==
--- stable/11/etc/mtree/BSD.usr.distSat Apr 25 02:18:59 2020
(r360289)
+++ stable/11/etc/mtree/BSD.usr.distSat Apr 25 05:51:58 2020
(r360290)
@@ -1491,15 +1491,25 @@
 ..
 Australia
 ..
+Brazil
+..
+Canada
+..
+Chile
+..
 Etc
 ..
 Europe
 ..
 Indian
 ..
+Mexico
+..
 Pacific
 ..
 SystemV
+..
+US
 ..
 ..
 ..

Modified: stable/11/share/mk/src.opts.mk
==
--- stable/11/share/mk/src.opts.mk  Sat Apr 25 02:18:59 2020
(r360289)
+++ stable/11/share/mk/src.opts.mk  Sat Apr 25 05:51:58 2020
(r360290)
@@ -210,7 +210,6 @@ __DEFAULT_NO_OPTIONS = \
 SORT_THREADS \
 SVN \
 ZONEINFO_LEAPSECONDS_SUPPORT \
-ZONEINFO_OLD_TIMEZONES_SUPPORT \
 
 
 #
@@ -457,7 +456,6 @@ MK_GROFF:=  no
 
 .if ${MK_ZONEINFO} == "no"
 MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no
-MK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no
 .endif
 
 .if ${MK_CROSS_COMPILER} == "no"

Modified: stable/11/share/zoneinfo/Makefile
==
--- stable/11/share/zoneinfo/Makefile   Sat Apr 25 02:18:59 2020
(r360289)
+++ stable/11/share/zoneinfo/Makefile   Sat Apr 25 05:51:58 2020
(r360290)
@@ -40,11 +40,6 @@ CONTRIBDIR=  ${.CURDIR}/../../contrib/tzdata/
 MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes
 .endif
 
-.if defined(OLDTIMEZONES)
-.warning "Using backwards compatibility variable for OLDTIMEZONES; please use 
WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT instead"
-MK_ZONEINFO_OLD_TIMEZONES_SUPPORT= yes
-.endif
-
 .if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no"
 LEAPFILE=  -L ${CONTRIBDIR}leapseconds
 .else
@@ -53,12 +48,9 @@ LEAPFILE=
 
 TZFILES=   africa antarctica asia australasia etcetera europe \
factory northamerica southamerica
+TZFILES+=  backward systemv
 POSIXRULES=America/New_York
 
-.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
-TZFILES+=  backward systemv
-.endif
-
 TZFILES:=  ${TZFILES:S/^/${CONTRIBDIR}/}
 
 TZBUILDDIR=${.OBJDIR}/builddir
@@ -78,10 +70,7 @@ TZBUILDSUBDIRS=  \
Indian \
Pacific \
SystemV
-
-.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
 TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil
-.endif
 
 .if !defined(_SKIP_BUILD)
 all: zoneinfo

Modified: stable/11/share/zoneinfo/tests/Makefile
==
--- stable/11/share/zoneinfo/tests/Makefile Sat Apr 25 02:18:59 2020
(r360289)
+++ stable/11/share/zoneinfo/tests/Makefile Sat Apr 25 05:51:58 2020
(r360290)
@@ -8,10 +8,8 @@ PACKAGE=   tests
 
 FILESGROUPS+=  TESTFILES
 
-.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
 ATF_TESTS_SH+= backward_test
 TESTFILES+=backward
-.endif
 
 TESTFILES+=zoneinfo_common.sh
 TESTFILESPACKAGE= ${PACKAGE}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360215 - stable/12/lib/libc/nls

2020-04-22 Thread Xin LI
Author: delphij
Date: Thu Apr 23 04:51:32 2020
New Revision: 360215
URL: https://svnweb.freebsd.org/changeset/base/360215

Log:
  MFC r359118: Fix race condition in catopen(3).

Modified:
  stable/12/lib/libc/nls/msgcat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/nls/msgcat.c
==
--- stable/12/lib/libc/nls/msgcat.c Thu Apr 23 04:27:55 2020
(r360214)
+++ stable/12/lib/libc/nls/msgcat.c Thu Apr 23 04:51:32 2020
(r360215)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include  /* for ntohl() */
+#include 
 
 #include 
 #include 
@@ -76,19 +77,25 @@ __FBSDID("$FreeBSD$");
 
 #defineNLERR   ((nl_catd) -1)
 #define NLRETERR(errc)  { errno = errc; return (NLERR); }
-#define SAVEFAIL(n, l, e)  { WLOCK(NLERR); 
\
- np = malloc(sizeof(struct catentry)); 
\
+#define SAVEFAIL(n, l, e)  { np = calloc(1, sizeof(struct catentry));  
\
  if (np != NULL) { 
\
np->name = strdup(n);   
\
-   np->path = NULL;
\
np->catd = NLERR;   
\
-   np->refcount = 0;   
\
np->lang = (l == NULL) ? NULL : 
\
strdup(l);  
\
np->caterrno = e;   
\
-   SLIST_INSERT_HEAD(&cache, np, list);
\
+   if (np->name == NULL || 
\
+   (l != NULL && np->lang == NULL)) {  
\
+   free(np->name); 
\
+   free(np->lang); 
\
+   free(np);   
\
+   } else {
\
+   WLOCK(NLERR);   
\
+   SLIST_INSERT_HEAD(&cache, np,   
\
+   list);  
\
+   UNLOCK; 
\
+   }   
\
  } 
\
- UNLOCK;   
\
  errno = e;
\
}
 
@@ -152,7 +159,7 @@ catopen(const char *name, int type)
NLRETERR(np->caterrno);
} else {
/* Found cached successful entry */
-   np->refcount++;
+   atomic_add_int(&np->refcount, 1);
UNLOCK;
return (np->catd);
}
@@ -355,8 +362,7 @@ catclose(nl_catd catd)
WLOCK(-1);
SLIST_FOREACH(np, &cache, list) {
if (catd == np->catd) {
-   np->refcount--;
-   if (np->refcount == 0)
+   if (atomic_fetchadd_int(&np->refcount, -1) == 1)
catfree(np);
break;
}
@@ -376,6 +382,7 @@ load_msgcat(const char *path, const char *name, const 
nl_catd catd;
struct catentry *np;
void *data;
+   char *copy_path, *copy_name, *copy_lang;
int fd;
 
/* path/name will never be NULL here */
@@ -387,7 +394,7 @@ load_msgcat(const char *path, const char *name, const 
RLOCK(NLERR);
SLIST_FOREACH(np, &cache, list) {
if ((np->path != NULL) && (strcmp(np->path, path) == 0)) {
-   np->refcount++;
+   atomic_add_int(&np->refcount, 1);
UNLOCK;
return (np->catd);
}
@@ -432,7 +439,20 @@ load_msgcat(const char *path, const char *name, const 
NLRETERR(EFTYPE);
}
 
-   if ((catd = malloc(sizeof (*catd))) == NULL) {
+   copy_name = strdup(name);
+   copy_path = strdup(path);
+   copy_lang = (lang == NULL) ? NULL : strdup(lang);
+   catd = malloc(sizeof (*catd));
+   np = calloc(1, sizeof(struct catentry));
+
+   if (copy_name == NULL || copy_path == NULL ||
+ 

svn commit: r360214 - in stable/12: etc/mtree share/mk share/zoneinfo share/zoneinfo/tests

2020-04-22 Thread Xin LI
Author: delphij
Date: Thu Apr 23 04:27:55 2020
New Revision: 360214
URL: https://svnweb.freebsd.org/changeset/base/360214

Log:
  MFC r359736: Always install backward compatibility timezones, as they
  are installed on all major Linux distributions as well as NetBSD and
  OpenBSD.

Modified:
  stable/12/etc/mtree/BSD.usr.dist
  stable/12/share/mk/src.opts.mk
  stable/12/share/zoneinfo/Makefile
  stable/12/share/zoneinfo/tests/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/etc/mtree/BSD.usr.dist
==
--- stable/12/etc/mtree/BSD.usr.distThu Apr 23 03:46:41 2020
(r360213)
+++ stable/12/etc/mtree/BSD.usr.distThu Apr 23 04:27:55 2020
(r360214)
@@ -1253,15 +1253,25 @@
 ..
 Australia
 ..
+Brazil
+..
+Canada
+..
+Chile
+..
 Etc
 ..
 Europe
 ..
 Indian
 ..
+Mexico
+..
 Pacific
 ..
 SystemV
+..
+US
 ..
 ..
 ..

Modified: stable/12/share/mk/src.opts.mk
==
--- stable/12/share/mk/src.opts.mk  Thu Apr 23 03:46:41 2020
(r360213)
+++ stable/12/share/mk/src.opts.mk  Thu Apr 23 04:27:55 2020
(r360214)
@@ -214,7 +214,6 @@ __DEFAULT_NO_OPTIONS = \
 SORT_THREADS \
 SVN \
 ZONEINFO_LEAPSECONDS_SUPPORT \
-ZONEINFO_OLD_TIMEZONES_SUPPORT \
 
 # LEFT/RIGHT. Left options which default to "yes" unless their corresponding
 # RIGHT option is disabled.
@@ -535,7 +534,6 @@ MK_GOOGLETEST:= no
 
 .if ${MK_ZONEINFO} == "no"
 MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no
-MK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no
 .endif
 
 .if ${MK_CROSS_COMPILER} == "no"

Modified: stable/12/share/zoneinfo/Makefile
==
--- stable/12/share/zoneinfo/Makefile   Thu Apr 23 03:46:41 2020
(r360213)
+++ stable/12/share/zoneinfo/Makefile   Thu Apr 23 04:27:55 2020
(r360214)
@@ -40,11 +40,6 @@ CONTRIBDIR=  ${SRCTOP}/contrib/tzdata/
 MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes
 .endif
 
-.if defined(OLDTIMEZONES)
-.warning "Using backwards compatibility variable for OLDTIMEZONES; please use 
WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT instead"
-MK_ZONEINFO_OLD_TIMEZONES_SUPPORT= yes
-.endif
-
 .if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no"
 LEAPFILE=  -L ${CONTRIBDIR}leapseconds
 .else
@@ -53,12 +48,9 @@ LEAPFILE=
 
 TZFILES=   africa antarctica asia australasia etcetera europe \
factory northamerica southamerica
+TZFILES+=  backward systemv
 POSIXRULES=America/New_York
 
-.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
-TZFILES+=  backward systemv
-.endif
-
 TZFILES:=  ${TZFILES:S/^/${CONTRIBDIR}/}
 
 TZBUILDDIR=${.OBJDIR}/builddir
@@ -78,10 +70,7 @@ TZBUILDSUBDIRS=  \
Indian \
Pacific \
SystemV
-
-.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
 TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil
-.endif
 
 .if !defined(_SKIP_BUILD)
 all: zoneinfo

Modified: stable/12/share/zoneinfo/tests/Makefile
==
--- stable/12/share/zoneinfo/tests/Makefile Thu Apr 23 03:46:41 2020
(r360213)
+++ stable/12/share/zoneinfo/tests/Makefile Thu Apr 23 04:27:55 2020
(r360214)
@@ -8,10 +8,8 @@ PACKAGE=   tests
 
 FILESGROUPS+=  TESTFILES
 
-.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
 ATF_TESTS_SH+= backward_test
 TESTFILES+=backward
-.endif
 
 TESTFILES+=zoneinfo_common.sh
 TESTFILESPACKAGE= ${PACKAGE}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360213 - head/bin/rm

2020-04-22 Thread Xin LI
Author: delphij
Date: Thu Apr 23 03:46:41 2020
New Revision: 360213
URL: https://svnweb.freebsd.org/changeset/base/360213

Log:
  Remove include of stdint.h.  It was added in r241014 for uintmax_t,
  which is gone in r340330 and is therefore no longer necessary.
  
  MFC after:2 weeks

Modified:
  head/bin/rm/rm.c

Modified: head/bin/rm/rm.c
==
--- head/bin/rm/rm.cWed Apr 22 23:53:28 2020(r360212)
+++ head/bin/rm/rm.cThu Apr 23 03:46:41 2020(r360213)
@@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360186 - stable/12/usr.bin/gzip

2020-04-21 Thread Xin LI
Author: delphij
Date: Wed Apr 22 05:54:46 2020
New Revision: 360186
URL: https://svnweb.freebsd.org/changeset/base/360186

Log:
  MFC r358988: Remove unneeded checks for prelen.

Modified:
  stable/12/usr.bin/gzip/gzip.c
  stable/12/usr.bin/gzip/unlz.c
  stable/12/usr.bin/gzip/unpack.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/gzip/gzip.c
==
--- stable/12/usr.bin/gzip/gzip.c   Wed Apr 22 05:14:52 2020
(r360185)
+++ stable/12/usr.bin/gzip/gzip.c   Wed Apr 22 05:54:46 2020
(r360186)
@@ -1443,7 +1443,7 @@ file_uncompress(char *file, char *outfile, size_t outs
struct stat isb, osb;
off_t size;
ssize_t rbytes;
-   unsigned char header1[4];
+   unsigned char fourbytes[4];
enum filetype method;
int fd, ofd, zfd = -1;
int error;
@@ -1477,8 +1477,8 @@ file_uncompress(char *file, char *outfile, size_t outs
goto lose;
}
 
-   rbytes = read(fd, header1, sizeof header1);
-   if (rbytes != sizeof header1) {
+   rbytes = read(fd, fourbytes, sizeof fourbytes);
+   if (rbytes != sizeof fourbytes) {
/* we don't want to fail here. */
 #ifndef SMALL
if (fflag)
@@ -1492,7 +1492,7 @@ file_uncompress(char *file, char *outfile, size_t outs
}
infile_newdata(rbytes);
 
-   method = file_gettype(header1);
+   method = file_gettype(fourbytes);
 #ifndef SMALL
if (fflag == 0 && method == FT_UNKNOWN) {
maybe_warnx("%s: not in gzip format", file);
@@ -1516,7 +1516,7 @@ file_uncompress(char *file, char *outfile, size_t outs
infile_newdata(rv);
timestamp = le32dec(&ts[0]);
 
-   if (header1[3] & ORIG_NAME) {
+   if (fourbytes[3] & ORIG_NAME) {
rbytes = pread(fd, name, sizeof(name) - 1, 
GZIP_ORIGNAME);
if (rbytes < 0) {
maybe_warn("can't read %s", file);
@@ -1818,7 +1818,7 @@ static void
 handle_stdin(void)
 {
struct stat isb;
-   unsigned char header1[4];
+   unsigned char fourbytes[4];
size_t in_size;
off_t usize, gsize;
enum filetype method;
@@ -1849,16 +1849,16 @@ handle_stdin(void)
goto out;
}
 
-   bytes_read = read_retry(STDIN_FILENO, header1, sizeof header1);
+   bytes_read = read_retry(STDIN_FILENO, fourbytes, sizeof fourbytes);
if (bytes_read == -1) {
maybe_warn("can't read stdin");
goto out;
-   } else if (bytes_read != sizeof(header1)) {
+   } else if (bytes_read != sizeof(fourbytes)) {
maybe_warnx("(stdin): unexpected end of file");
goto out;
}
 
-   method = file_gettype(header1);
+   method = file_gettype(fourbytes);
switch (method) {
default:
 #ifndef SMALL
@@ -1866,17 +1866,17 @@ handle_stdin(void)
maybe_warnx("unknown compression format");
goto out;
}
-   usize = cat_fd(header1, sizeof header1, &gsize, STDIN_FILENO);
+   usize = cat_fd(fourbytes, sizeof fourbytes, &gsize, 
STDIN_FILENO);
break;
 #endif
case FT_GZIP:
usize = gz_uncompress(STDIN_FILENO, STDOUT_FILENO,
- (char *)header1, sizeof header1, &gsize, 
"(stdin)");
+ (char *)fourbytes, sizeof fourbytes, &gsize, 
"(stdin)");
break;
 #ifndef NO_BZIP2_SUPPORT
case FT_BZIP2:
usize = unbzip2(STDIN_FILENO, STDOUT_FILENO,
-   (char *)header1, sizeof header1, &gsize);
+   (char *)fourbytes, sizeof fourbytes, &gsize);
break;
 #endif
 #ifndef NO_COMPRESS_SUPPORT
@@ -1886,27 +1886,27 @@ handle_stdin(void)
goto out;
}
 
-   usize = zuncompress(in, stdout, (char *)header1,
-   sizeof header1, &gsize);
+   usize = zuncompress(in, stdout, (char *)fourbytes,
+   sizeof fourbytes, &gsize);
fclose(in);
break;
 #endif
 #ifndef NO_PACK_SUPPORT
case FT_PACK:
usize = unpack(STDIN_FILENO, STDOUT_FILENO,
-  (char *)header1, sizeof header1, &gsize);
+  (char *)fourbytes, sizeof fourbytes, &gsize);
break;
 #endif
 #ifndef NO_XZ_SUPPORT
case FT_XZ:
usize = unxz(STDIN_FILENO, STDOUT_FILENO,
-(char *)header1, sizeof header1, &gsize);
+(char *)fourbytes, sizeof fourbytes, &gsize);
break;
 #endif
 #ifndef NO_LZ_SUPPORT
case FT_LZ:
usize = unlz(S

svn commit: r360185 - stable/11/sys/dev/evdev

2020-04-21 Thread Xin LI
Author: delphij
Date: Wed Apr 22 05:14:52 2020
New Revision: 360185
URL: https://svnweb.freebsd.org/changeset/base/360185

Log:
  MFC r360104: Use LIST_FOREACH_SAFE instead of LIST_FOREACH as we are
  removing elements in the middle.
  
  This fixes a panic when detaching USB mouse.
  
  PR:   245732
  Reviewed by:  wulf

Modified:
  stable/11/sys/dev/evdev/evdev.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/evdev/evdev.c
==
--- stable/11/sys/dev/evdev/evdev.c Wed Apr 22 05:08:42 2020
(r360184)
+++ stable/11/sys/dev/evdev/evdev.c Wed Apr 22 05:14:52 2020
(r360185)
@@ -354,7 +354,7 @@ evdev_register_mtx(struct evdev_dev *evdev, struct mtx
 int
 evdev_unregister(struct evdev_dev *evdev)
 {
-   struct evdev_client *client;
+   struct evdev_client *client, *tmp;
int ret;
debugf(evdev, "%s: unregistered evdev provider: %s\n",
evdev->ev_shortname, evdev->ev_name);
@@ -364,7 +364,7 @@ evdev_unregister(struct evdev_dev *evdev)
EVDEV_LOCK(evdev);
evdev->ev_cdev->si_drv1 = NULL;
/* Wake up sleepers */
-   LIST_FOREACH(client, &evdev->ev_clients, ec_link) {
+   LIST_FOREACH_SAFE(client, &evdev->ev_clients, ec_link, tmp) {
evdev_revoke_client(client);
evdev_dispose_client(evdev, client);
EVDEV_CLIENT_LOCKQ(client);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360184 - stable/12/sys/dev/evdev

2020-04-21 Thread Xin LI
Author: delphij
Date: Wed Apr 22 05:08:42 2020
New Revision: 360184
URL: https://svnweb.freebsd.org/changeset/base/360184

Log:
  MFC r360104: Use LIST_FOREACH_SAFE instead of LIST_FOREACH as we are
  removing elements in the middle.
  
  This fixes a panic when detaching USB mouse.
  
  PR:   245732
  Reviewed by:  wulf

Modified:
  stable/12/sys/dev/evdev/evdev.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/evdev/evdev.c
==
--- stable/12/sys/dev/evdev/evdev.c Wed Apr 22 04:05:02 2020
(r360183)
+++ stable/12/sys/dev/evdev/evdev.c Wed Apr 22 05:08:42 2020
(r360184)
@@ -356,7 +356,7 @@ evdev_register_mtx(struct evdev_dev *evdev, struct mtx
 int
 evdev_unregister(struct evdev_dev *evdev)
 {
-   struct evdev_client *client;
+   struct evdev_client *client, *tmp;
int ret;
debugf(evdev, "%s: unregistered evdev provider: %s\n",
evdev->ev_shortname, evdev->ev_name);
@@ -366,7 +366,7 @@ evdev_unregister(struct evdev_dev *evdev)
EVDEV_LOCK(evdev);
evdev->ev_cdev->si_drv1 = NULL;
/* Wake up sleepers */
-   LIST_FOREACH(client, &evdev->ev_clients, ec_link) {
+   LIST_FOREACH_SAFE(client, &evdev->ev_clients, ec_link, tmp) {
evdev_revoke_client(client);
evdev_dispose_client(evdev, client);
EVDEV_CLIENT_LOCKQ(client);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360104 - head/sys/dev/evdev

2020-04-19 Thread Xin LI
Author: delphij
Date: Sun Apr 19 17:28:42 2020
New Revision: 360104
URL: https://svnweb.freebsd.org/changeset/base/360104

Log:
  Use LIST_FOREACH_SAFE instead of LIST_FOREACH as we are removing
  elements in the middle.
  
  This fixes a panic when detaching USB mouse.
  
  PR:   245732
  Reviewed by:  wulf
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D24500

Modified:
  head/sys/dev/evdev/evdev.c

Modified: head/sys/dev/evdev/evdev.c
==
--- head/sys/dev/evdev/evdev.c  Sun Apr 19 17:19:29 2020(r360103)
+++ head/sys/dev/evdev/evdev.c  Sun Apr 19 17:28:42 2020(r360104)
@@ -358,7 +358,7 @@ evdev_register_mtx(struct evdev_dev *evdev, struct mtx
 int
 evdev_unregister(struct evdev_dev *evdev)
 {
-   struct evdev_client *client;
+   struct evdev_client *client, *tmp;
int ret;
debugf(evdev, "%s: unregistered evdev provider: %s\n",
evdev->ev_shortname, evdev->ev_name);
@@ -368,7 +368,7 @@ evdev_unregister(struct evdev_dev *evdev)
EVDEV_LOCK(evdev);
evdev->ev_cdev->si_drv1 = NULL;
/* Wake up sleepers */
-   LIST_FOREACH(client, &evdev->ev_clients, ec_link) {
+   LIST_FOREACH_SAFE(client, &evdev->ev_clients, ec_link, tmp) {
evdev_revoke_client(client);
evdev_dispose_client(evdev, client);
EVDEV_CLIENT_LOCKQ(client);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r360000 - head/usr.sbin/mailwrapper

2020-04-15 Thread Xin LI
Author: delphij
Date: Thu Apr 16 03:23:19 2020
New Revision: 36
URL: https://svnweb.freebsd.org/changeset/base/36

Log:
  Sync with NetBSD/OpenBSD.

Modified:
  head/usr.sbin/mailwrapper/mailwrapper.8

Modified: head/usr.sbin/mailwrapper/mailwrapper.8
==
--- head/usr.sbin/mailwrapper/mailwrapper.8 Thu Apr 16 00:54:06 2020
(r35)
+++ head/usr.sbin/mailwrapper/mailwrapper.8 Thu Apr 16 03:23:19 2020
(r36)
@@ -1,5 +1,5 @@
-.\"$OpenBSD: mailwrapper.8,v 1.10 2009/02/07 16:58:23 martynas Exp $
-.\"$NetBSD: mailwrapper.8,v 1.11 2002/02/08 01:38:50 ross Exp $
+.\"$OpenBSD: mailwrapper.8,v 1.12 2014/03/27 22:34:42 jmc Exp $
+.\"$NetBSD: mailwrapper.8,v 1.16 2014/09/19 16:05:55 wiz Exp $
 .\" $FreeBSD$
 .\"
 .\" Copyright (c) 1998
@@ -31,42 +31,58 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 27, 2014
+.Dd October 29, 2014
 .Dt MAILWRAPPER 8
 .Os
 .Sh NAME
 .Nm mailwrapper
-.Nd invoke appropriate MTA software based on configuration file
+.Nd invoke appropriate
+.Tn MTA
+software based on configuration file
 .Sh SYNOPSIS
 Special.
 See below.
 .Sh DESCRIPTION
-At one time, the only Mail Transfer Agent (MTA) software easily available
-was
-.Xr sendmail 8 .
-As a result of this, most Mail User Agents (MUAs) such as
-.Xr mail 1
-had the path and calling conventions expected by
-.Xr sendmail 8
-compiled in.
+Once upon time, the only Mail Transfer Agent
+.Pq Tn MTA
+software easily available was
+.Dq sendmail .
+This famous
+.Tn MTA
+was written by
+.An Eric Allman
+and first appeared in
+.Bx 4.1 .
+The legacy of this
+.Tn MTA
+affected most Mail User Agents
+.Pq Tn MUAs
+such as
+.Xr mail 1 ;
+the path and calling conventions expected by
+.Dq sendmail
+were compiled in.
 .Pp
-Times have changed, however.
+But times changed.
 On a modern
-.Ux
-system, the administrator may wish to use one of several
-available MTAs.
+.Fx
+system, the administrator may wish to use one of several available
+.Tn MTAs .
 .Pp
-It would be difficult to modify all MUA software typically available
-on a system, so most of the authors of alternative MTAs have written
-their front end message submission programs so that they use the same
-calling conventions as
-.Xr sendmail 8
-and may be put into place instead of
-.Xr sendmail 8
-in
-.Pa /usr/sbin/sendmail .
+It would be difficult to modify all
+.Tn MUA
+software typically available on a system,
+so most of the authors of alternative
+.Tn MTAs
+have written their front end message submission programs
+that may appear in the place of
+.Pa /usr/sbin/sendmail ,
+but still follow the same calling conventions as
+.Dq sendmail .
 .Pp
-.Xr sendmail 8
+The
+.Dq sendmail
+.Tn MTA
 also typically has aliases named
 .Xr mailq 1
 and
@@ -79,45 +95,52 @@ is
 or
 .Dq newaliases
 and behaves appropriately.
-Typically, replacement MTAs provide similar
-functionality, either through a program that also switches behavior
-based on calling name, or through a set of programs that provide
-similar functionality.
+Typically, replacement
+.Tn MTAs
+provide similar functionality, either through a program that also
+switches behavior based on calling name, or through a set of programs
+that provide similar functionality.
 .Pp
-Although having drop-in replacements for
-.Xr sendmail 8
-helps in installing alternative MTAs, it essentially makes the
-configuration of the system depend on hand installing new programs in
+Although having replacement programs that plug replace
+.Dq sendmail
+helps in installing alternative
+.Tn MTAs ,
+it essentially makes the configuration of the system depend
+on hand installing new programs in
 .Pa /usr .
 This leads to configuration problems for many administrators, since
-they may wish to install a new MTA without altering the system
-provided
+they may wish to install a new
+.Tn MTA
+without altering the system provided
 .Pa /usr .
 (This may be, for example, to avoid having upgrade problems when a new
 version of the system is installed over the old.)
 They may also have a shared
 .Pa /usr
-among several
-machines, and may wish to avoid placing implicit configuration
-information in a read-only
+among several machines, and may wish to avoid placing
+implicit configuration information in a read-only
 .Pa /usr .
 .Pp
 The
 .Nm
-utility is designed to replace
+program is designed to replace
 .Pa /usr/sbin/sendmail
-and to invoke an appropriate MTA instead of
-.Xr sendmail 8
+and to invoke an appropriate
+.Tn MTA
 based on configuration information placed in
 .Pa ${LOCALBASE}/etc/mail/mailer.conf
 falling back on
 .Pa /etc/mail/mailer.conf .
-This permits the administrator to configure which MTA is to be invoked on
+This permits the administrator to configure which
+.Tn MTA
+is to be invoked on
 the system at run time.
 .Pp
 Other configuration

Re: svn commit: r359945 - in head: lib/geom/eli sys/geom/eli

2020-04-14 Thread Xin Li via svn-src-all
On 4/14/20 17:22, Alan Somers wrote:
> On Tue, Apr 14, 2020 at 6:15 PM John Baldwin  > wrote:
> 
> Author: jhb
> Date: Wed Apr 15 00:14:50 2020
> New Revision: 359945
> URL: https://svnweb.freebsd.org/changeset/base/359945
> 
> Log:
>   Remove support for geli(4) algorithms deprecated in r348206.
[snip]
> Why remove read-only support?  That will make it much harder to convert
> old volumes.

Because they uses 64-bit block size and is vulnerable to birthday
attacks.  We have officially communicated that these algorithms would be
gone in 13 last year, with gone_in messages in place, so I think it's
fine to remove them as we are not going to keep the code forever.

Cheers,

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359849 - head/lib/libc/gen

2020-04-13 Thread Xin LI
Author: delphij
Date: Mon Apr 13 08:42:13 2020
New Revision: 359849
URL: https://svnweb.freebsd.org/changeset/base/359849

Log:
  Sync with OpenBSD:
  
  arc4random.c: In the incredibly unbelievable circumstance where
  _rs_init() fails to allocate pages, don't call abort() because of
  corefile data leakage concerns, but simply _exit().  The reasoning
  is _rs_init() will only fail if someone finds a way to apply
  specific pressure against this failure point, for the purpose of
  leaking information into a core which they can read.  We don't
  need a corefile in this instance to debug that.  So take this
  "lever" away from whoever in the future wants to do that.
  
  arc4random.3: reference random(4)
  
  arc4random_uniform.c: include stdint.h over sys/types.h

Modified:
  head/lib/libc/gen/arc4random.3
  head/lib/libc/gen/arc4random.c
  head/lib/libc/gen/arc4random_uniform.c

Modified: head/lib/libc/gen/arc4random.3
==
--- head/lib/libc/gen/arc4random.3  Mon Apr 13 08:41:24 2020
(r359848)
+++ head/lib/libc/gen/arc4random.3  Mon Apr 13 08:42:13 2020
(r359849)
@@ -1,4 +1,4 @@
-.\" $OpenBSD: arc4random.3,v 1.35 2014/11/25 16:45:24 millert Exp $
+.\" $OpenBSD: arc4random.3,v 1.37 2019/09/29 16:30:35 jmc Exp $
 .\"
 .\" Copyright 1997 Niels Provos 
 .\" All rights reserved.
@@ -31,7 +31,7 @@
 .\" Manual page, using -mandoc macros
 .\" $FreeBSD$
 .\"
-.Dd April 10, 2020
+.Dd April 13, 2020
 .Dt ARC4RANDOM 3
 .Os
 .Sh NAME
@@ -71,7 +71,9 @@ On each call, a cryptographic pseudo-random number gen
 to generate a new result.
 One data pool is used for all consumers in a process, so that consumption
 under program flow can act as additional stirring.
-The subsystem is re-seeded from the kernel random number subsystem using
+The subsystem is re-seeded from the kernel
+.Xr random 4
+subsystem using
 .Xr getentropy 2
 on a regular basis, and also upon
 .Xr fork 2 .

Modified: head/lib/libc/gen/arc4random.c
==
--- head/lib/libc/gen/arc4random.c  Mon Apr 13 08:41:24 2020
(r359848)
+++ head/lib/libc/gen/arc4random.c  Mon Apr 13 08:42:13 2020
(r359849)
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc4random.c,v 1.54 2015/09/13 08:31:47 guenther Exp $
*/
+/* $OpenBSD: arc4random.c,v 1.55 2019/03/24 17:56:54 deraadt Exp $ */
 
 /*
  * Copyright (c) 1996, David Mazieres 
@@ -84,7 +84,7 @@ _rs_init(u_char *buf, size_t n)
 
if (rs == NULL) {
if (_rs_allocate(&rs, &rsx) == -1)
-   abort();
+   _exit(1);
}
 
chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8);

Modified: head/lib/libc/gen/arc4random_uniform.c
==
--- head/lib/libc/gen/arc4random_uniform.c  Mon Apr 13 08:41:24 2020
(r359848)
+++ head/lib/libc/gen/arc4random_uniform.c  Mon Apr 13 08:42:13 2020
(r359849)
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc4random_uniform.c,v 1.2 2015/09/13 08:31:47 guenther Exp $ 
*/
+/* $OpenBSD: arc4random_uniform.c,v 1.3 2019/01/20 02:59:07 bcook Exp $
*/
 
 /*
  * Copyright (c) 2008, Damien Miller 
@@ -18,7 +18,7 @@
  * $FreeBSD$
  */
 
-#include 
+#include 
 #include 
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r359374 - in head: . share/man/man4 share/man/man7 share/man/man9 sys/crypto/aesni sys/crypto/armv8 sys/crypto/blake2 sys/crypto/ccp sys/crypto/via sys/dev/cesa sys/dev/cxgbe sys/dev/c

2020-04-12 Thread Xin Li via svn-src-all



On 3/27/20 11:25 AM, John Baldwin wrote:
[...]>   - Drivers no longer register a list of supported algorithms.  This
> doesn't quite work when you factor in modes (e.g. a driver might
> support both AES-CBC and SHA2-256-HMAC separately but not combined
> for ETA).  Instead, a new 'crypto_probesession' method has been
> added to the kobj interface for symmteric crypto drivers.  This
> method returns a negative value on success (similar to how
> device_probe works) and the crypto framework uses this value to pick
> the "best" driver.  There are three constants for hardware
> (e.g. ccr), accelerated software (e.g. aesni), and plain software
> (cryptosoft) that give preference in that order.  One effect of this
> is that if you request only hardware when creating a new session,
> you will no longer get a session using accelerated software.
> Another effect is that the default setting to disallow software
> crypto via /dev/crypto now disables accelerated software.

For user-visible interface, it seems like we are essentially treating
"accelerated software" like AES-NI the same way of plain software.  For
example, geom_eli would now say:

GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI: Crypto: software

Instead of:

GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI: Crypto: hardware

When AES-NI is used (which is because we only have two bits to represent
hardware and software, and have gave neither bits clear with its own
meaning (use specific driver)).

If we are not going to add a new bit to represent accelerated software,
why are they categorized as software providers?  Technically, all these
still requires hardware that implements the cryptographic primitives to
work, and it's much easier for system administrators if we expose the
fact that they are using some kind of acceleration than asking them to
run DTrace etc. to find out.  Personally, I think it's probably better
to change the notion to either "accelerated" (by either hardware or
software) and "software"...

Cheers,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r359795 - head/sys/dev/acpi_support

2020-04-11 Thread Xin LI
Author: delphij
Date: Sat Apr 11 07:24:57 2020
New Revision: 359795
URL: https://svnweb.freebsd.org/changeset/base/359795

Log:
  Avoid using a variable solely for sizes that are never meant to be
  modified runtime.
  
  No functional change.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/acpi_support/acpi_hp.c

Modified: head/sys/dev/acpi_support/acpi_hp.c
==
--- head/sys/dev/acpi_support/acpi_hp.c Sat Apr 11 05:12:38 2020
(r359794)
+++ head/sys/dev/acpi_support/acpi_hp.c Sat Apr 11 07:24:57 2020
(r359795)
@@ -962,10 +962,9 @@ acpi_hp_get_cmi_block(device_t wmi_dev, const char* gu
ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL };
int i;
int outlen;
-   int size = 255;
int has_enums = 0;
int valuebase = 0;
-   charstring_buffer[size];
+   charstring_buffer[255];
int enumbase;
 
outlen = 0;
@@ -1019,18 +1018,21 @@ acpi_hp_get_cmi_block(device_t wmi_dev, const char* gu
 
if (detail & ACPI_HP_CMI_DETAIL_PATHS) {
strlcat(outbuf, acpi_hp_get_string_from_object(
-   &obj->Package.Elements[2], string_buffer, size), outsize);
+   &obj->Package.Elements[2],
+   string_buffer, sizeof(string_buffer)), outsize);
outlen += 48;
while (strlen(outbuf) < outlen)
strlcat(outbuf, " ", outsize);
}
strlcat(outbuf, acpi_hp_get_string_from_object(
-   &obj->Package.Elements[0], string_buffer, size), outsize);
+   &obj->Package.Elements[0],
+   string_buffer, sizeof(string_buffer)), outsize);
outlen += 43;
while (strlen(outbuf) < outlen)
strlcat(outbuf, " ", outsize);
strlcat(outbuf, acpi_hp_get_string_from_object(
-   &obj->Package.Elements[valuebase], string_buffer, size), outsize);
+   &obj->Package.Elements[valuebase],
+   string_buffer, sizeof(string_buffer)), outsize);
outlen += 21;
while (strlen(outbuf) < outlen)
strlcat(outbuf, " ", outsize);
@@ -1041,7 +1043,8 @@ acpi_hp_get_cmi_block(device_t wmi_dev, const char* gu
for (i = enumbase + 1; i < enumbase + 1 +
obj->Package.Elements[enumbase].Integer.Value; ++i) {
acpi_hp_get_string_from_object(
-   &obj->Package.Elements[i], string_buffer, size);
+   &obj->Package.Elements[i],
+   string_buffer, sizeof(string_buffer));
if (strlen(string_buffer) > 1 ||
(strlen(string_buffer) == 1 &&
string_buffer[0] != ' ')) {
@@ -1211,8 +1214,7 @@ acpi_hp_hpcmi_read(struct cdev *dev, struct uio *buf, 
UINT8   instance;
UINT8   maxInstance;
UINT32  sequence;
-   int linesize = 1025;
-   charline[linesize];
+   charline[1025];
 
if (dev == NULL || dev->si_drv1 == NULL)
return (EBADF);
@@ -1237,7 +1239,7 @@ acpi_hp_hpcmi_read(struct cdev *dev, struct uio *buf, 
++instance) {
if (acpi_hp_get_cmi_block(sc->wmi_dev,
ACPI_HP_WMI_CMI_GUID, instance,
-   line, linesize, &sequence,
+   line, sizeof(line), &sequence,
sc->cmi_detail)) {
instance = maxInstance;
}
@@ -1270,7 +1272,7 @@ acpi_hp_hpcmi_read(struct cdev *dev, struct uio *buf, 
for (i=0; icmi_order_size; ++i) {
if (!acpi_hp_get_cmi_block(sc->wmi_dev,
ACPI_HP_WMI_CMI_GUID,
-   sc->cmi_order[i].instance, line, linesize,
+   sc->cmi_order[i].instance, line, 
sizeof(line),
&sequence, sc->cmi_detail)) {
sbuf_printf(&sc->hpcmi_sbuf, "%s\n", 
line);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


  1   2   3   4   5   6   7   8   9   10   >