svn commit: r368778 - head/usr.bin/login

2020-12-18 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Dec 19 03:07:38 2020
New Revision: 368778
URL: https://svnweb.freebsd.org/changeset/base/368778

Log:
  login(1): when exporting variables check the result of setenv(3)
  
  When exporting a variable we correctly check all the preconditions that
  could make setenv(3) fail. Checking the setenv(3) return value seems
  redundant, but given that login(1) is critical, it doesn't hurt to have
  a post-check.
  
  This change is based on the "Principles of Secure Coding" course by
  Matthew Bishop, PhD., which specifically discusses this code in FreeBSD.
  
  (This change redoes r368776 due to a silly mistake)

Modified:
  head/usr.bin/login/login.c

Modified: head/usr.bin/login/login.c
==
--- head/usr.bin/login/login.c  Sat Dec 19 02:42:14 2020(r368777)
+++ head/usr.bin/login/login.c  Sat Dec 19 03:07:38 2020(r368778)
@@ -793,6 +793,7 @@ export(const char *s)
char *p;
const char **pp;
size_t n;
+   int rv;
 
if (strlen(s) > 1024 || (p = strchr(s, '=')) == NULL)
return (0);
@@ -804,8 +805,10 @@ export(const char *s)
return (0);
}
*p = '\0';
-   (void)setenv(s, p + 1, 1);
+   rv = setenv(s, p + 1, 1);
*p = '=';
+   if (rv == -1)
+   return (0);
return (1);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r368777 - head/usr.bin/login

2020-12-18 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Dec 19 02:42:14 2020
New Revision: 368777
URL: https://svnweb.freebsd.org/changeset/base/368777

Log:
  Revert r368776:
  login(1): when exporting variables check the result of setenv(3)
  
  mismatch: the return value upon error is -1, so the code was not
  doing nothing.

Modified:
  head/usr.bin/login/login.c

Modified: head/usr.bin/login/login.c
==
--- head/usr.bin/login/login.c  Sat Dec 19 02:23:53 2020(r368776)
+++ head/usr.bin/login/login.c  Sat Dec 19 02:42:14 2020(r368777)
@@ -793,7 +793,6 @@ export(const char *s)
char *p;
const char **pp;
size_t n;
-   int rv;
 
if (strlen(s) > 1024 || (p = strchr(s, '=')) == NULL)
return (0);
@@ -805,10 +804,8 @@ export(const char *s)
return (0);
}
*p = '\0';
-   rv = setenv(s, p + 1, 1);
+   (void)setenv(s, p + 1, 1);
*p = '=';
-   if (rv == 1)
-   return (0);
return (1);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r368776 - head/usr.bin/login

2020-12-18 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Dec 19 02:23:53 2020
New Revision: 368776
URL: https://svnweb.freebsd.org/changeset/base/368776

Log:
  login(1): when exporting variables check the result of setenv(3)
  
  When exporting a variable we correctly check all the preconditions that
  could make setenv(3) fail. Checking the setenv(3) return value seems
  redundant, but given that login(1) is critical, it doesn't hurt to have
  a post-check.
  
  This change is based on the "Principles of Secure Coding" course by
  Matthew Bishop, PhD., which specifically discusses this code in FreeBSD.
  
  Differential Revision:https://reviews.freebsd.org/D26966

Modified:
  head/usr.bin/login/login.c

Modified: head/usr.bin/login/login.c
==
--- head/usr.bin/login/login.c  Sat Dec 19 01:46:47 2020(r368775)
+++ head/usr.bin/login/login.c  Sat Dec 19 02:23:53 2020(r368776)
@@ -793,6 +793,7 @@ export(const char *s)
char *p;
const char **pp;
size_t n;
+   int rv;
 
if (strlen(s) > 1024 || (p = strchr(s, '=')) == NULL)
return (0);
@@ -804,8 +805,10 @@ export(const char *s)
return (0);
}
*p = '\0';
-   (void)setenv(s, p + 1, 1);
+   rv = setenv(s, p + 1, 1);
*p = '=';
+   if (rv == 1)
+   return (0);
return (1);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r368712 - in head: . usr.sbin/services_mkdb

2020-12-16 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Dec 17 02:54:32 2020
New Revision: 368712
URL: https://svnweb.freebsd.org/changeset/base/368712

Log:
  /etc/services: attempt to bring the database to this century 2/2.
  
  This is the final half of splitting r358153 in two, in order to avoid a build
  system bugs and being able to merge an earlier change to previous releases.
  
  Add a note to UPDATING to avoid people building from very old systems from
  having issues with mergemaster
  
  MFC after:3 days (only 12-stable)
  
  Differential Revision:https://reviews.freebsd.org/D23621

Modified:
  head/UPDATING
  head/usr.sbin/services_mkdb/services

Modified: head/UPDATING
==
--- head/UPDATING   Thu Dec 17 02:33:52 2020(r368711)
+++ head/UPDATING   Thu Dec 17 02:54:32 2020(r368712)
@@ -26,6 +26,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20201216:
+   The services database has been updated to cover more of the basic
+   services expected in a modern system. The database is big enough
+   that it will cause issues in mergemaster in Releases previous to
+   12.2 and 11.3, or in very old current systems from before r358154.
+
 20201215:
Obsolete in-tree GDB 6.1.1 has been removed.  GDB (including kgdb)
may be installed from ports or packages.

Modified: head/usr.sbin/services_mkdb/services
==
--- head/usr.sbin/services_mkdb/servicesThu Dec 17 02:33:52 2020
(r368711)
+++ head/usr.sbin/services_mkdb/servicesThu Dec 17 02:54:32 2020
(r368712)
@@ -1613,8 +1613,8 @@ tr-rsrb-p21988/udp   #cisco RSRB Priority 2 port
 tr-rsrb-p3 1989/tcp   #cisco RSRB Priority 3 port
 tr-rsrb-p3 1989/udp   #cisco RSRB Priority 3 port
 #PROBLEMS!===
-mshnet 1989/tcp   #MHSnet system
-mshnet 1989/udp   #MHSnet system
+#mshnet1989/tcp   #MHSnet system
+#mshnet1989/udp   #MHSnet system
 #PROBLEMS!===
 stun-p11990/tcp   #cisco STUN Priority 1 port
 stun-p11990/udp   #cisco STUN Priority 1 port
@@ -1640,129 +1640,86 @@ x25-svc-port   1998/tcp   #cisco X.25 service (XOT)
 x25-svc-port   1998/udp   #cisco X.25 service (XOT)
 tcp-id-port1999/tcp   #cisco identification port
 tcp-id-port1999/udp   #cisco identification port
-callbook   2000/tcp
-callbook   2000/udp
-dc 2001/tcp
-wizard 2001/udp   #curry
-globe  2002/tcp
-globe  2002/udp
 cfingerd   2003/tcp   #GNU finger
 mailbox2004/tcp
-emce   2004/udp   #CCWS mm conf
-berknet2005/tcp
 oracle 2005/udp
-invokator  2006/tcp
 raid-cc2006/udp   #raid
-dectalk2007/tcp
 raid-am2007/udp
-conf   2008/tcp
-terminaldb 2008/udp
-news   2009/tcp
-whosockami 2009/udp
-search 2010/tcp
-pipe_server2010/udp
 raid-cc2011/tcp   #raid
-servserv   2011/udp
-ttyinfo2012/tcp
-raid-ac2012/udp
-raid-am2013/tcp
-raid-cd2013/udp
-troff  2014/tcp
-raid-sf2014/udp
-cypress2015/tcp
-raid-cs2015/udp
-bootserver 2016/tcp
-bootserver 2016/udp
-cypress-stat   2017/tcp
-bootclient 2017/udp
-terminaldb 2018/tcp
-rellpack   2018/udp
-whosockami 2019/tcp
-about  2019/udp
-xinupageserver 2020/tcp
-xinupageserver 2020/udp
-servexec   2021/tcp
-xinuexpansion1 2021/udp
-down   2022/tcp
-xinuexpansion2 2022/udp
-xinuexpansion3 2023/tcp
-xinuexpansion3 2023/udp
-xinuexpansion4 2024/tcp
-xinuexpansion4 2024/udp
-ellpack2025/tcp
-xribs  2025/udp
-scrabble   2026/tcp
-scrabble   2026/udp
-shadowserver   2027/tcp
-shadowserver   2027/udp
-submitserver   2028/tcp
-submitserver   2028/udp
-device22030/tcp
-device22030/udp
-blackboard 2032/tcp
-blackboard 2032/udp
-glogger2033/tcp
-glogger2033/udp
-scoremgr   2034/tcp
-scoremgr   2034/udp
-imsldoc2035/tcp
-imsldoc2035/udp
-objectmanager  2038/tcp
-objectmanager  2038/udp
 lam2040/tcp
 lam2040/udp
 interbase  2041/tcp
 interbase  2041/udp
-isis   2042/tcp
-isis   2042/udp
-isis-bcast 2043/tcp
-isis-bcast 2043/udp
-rimsl  2044/tcp
-rimsl  2044/udp
-cdfunc 2045/tcp
-cdfunc 2045/udp
-sdfunc 2046/tcp
-sdfunc   

svn commit: r366501 - head/sys/fs/ext2fs

2020-10-06 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Oct  6 21:31:04 2020
New Revision: 366501
URL: https://svnweb.freebsd.org/changeset/base/366501

Log:
  ext2fs: minor typo.
  
  Obtained from:Dragonfly
  MFC after:3 days

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Tue Oct  6 19:19:56 2020
(r366500)
+++ head/sys/fs/ext2fs/ext2_alloc.c Tue Oct  6 21:31:04 2020
(r366501)
@@ -193,7 +193,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW 
 static int doasyncfree = 1;
 
 SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doasyncfree, CTLFLAG_RW, , 0,
-"Use asychronous writes to update block pointers when freeing blocks");
+"Use asynchronous writes to update block pointers when freeing blocks");
 
 static int doreallocblks = 0;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r364417 - head/usr.sbin/fstyp

2020-08-19 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Aug 20 05:18:08 2020
New Revision: 364417
URL: https://svnweb.freebsd.org/changeset/base/364417

Log:
  usr.sbin/fstyp: Fix incorrect pfs_type test in ondisk inode
  
  "ipdata.meta.pfs_type & HAMMER2_PFSTYPE_SUPROOT" happened to have
  the same result (except HAMMER2_PFSTYPE_DUMMY could also match).
  
  Obtained from: Dragonfly (git 29e6489bbd4f8e237c9c17b300ac8b711f36770)

Modified:
  head/usr.sbin/fstyp/hammer2.c

Modified: head/usr.sbin/fstyp/hammer2.c
==
--- head/usr.sbin/fstyp/hammer2.c   Thu Aug 20 05:08:49 2020
(r364416)
+++ head/usr.sbin/fstyp/hammer2.c   Thu Aug 20 05:18:08 2020
(r364417)
@@ -127,7 +127,7 @@ find_pfs(FILE *fp, const hammer2_blockref_t *bref, con
switch (bref->type) {
case HAMMER2_BREF_TYPE_INODE:
ipdata = media->ipdata;
-   if (ipdata.meta.pfs_type & HAMMER2_PFSTYPE_SUPROOT) {
+   if (ipdata.meta.pfs_type == HAMMER2_PFSTYPE_SUPROOT) {
bscan = [0];
bcount = HAMMER2_SET_COUNT;
} else {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r364416 - head/sys/fs/ext2fs

2020-08-19 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Aug 20 05:08:49 2020
New Revision: 364416
URL: https://svnweb.freebsd.org/changeset/base/364416

Log:
  extfs: remove redundant little endian conversion.
  
  The XTIME_TO_NSEC macro already calls the htole32(), so there is no need
  to call it twice. This code does nothing on LE platforms and affects only
  nanosecond and birthtime fields so it's difficult to notice on regular use.
  
  Hinted by:DragonFlyBSD (git ae503f8f6f4b9a413932ffd68be029f20c38cab4)
  
  X-MFC with:   r361136

Modified:
  head/sys/fs/ext2fs/ext2_inode_cnv.c

Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c
==
--- head/sys/fs/ext2fs/ext2_inode_cnv.c Thu Aug 20 03:53:18 2020
(r364415)
+++ head/sys/fs/ext2fs/ext2_inode_cnv.c Thu Aug 20 05:08:49 2020
(r364416)
@@ -146,11 +146,11 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip)
ip->i_mtime = le32toh(ei->e2di_mtime);
ip->i_ctime = le32toh(ei->e2di_ctime);
if (E2DI_HAS_XTIME(ip)) {
-   ip->i_atimensec = XTIME_TO_NSEC(le32toh(ei->e2di_atime_extra));
-   ip->i_mtimensec = XTIME_TO_NSEC(le32toh(ei->e2di_mtime_extra));
-   ip->i_ctimensec = XTIME_TO_NSEC(le32toh(ei->e2di_ctime_extra));
+   ip->i_atimensec = XTIME_TO_NSEC(ei->e2di_atime_extra);
+   ip->i_mtimensec = XTIME_TO_NSEC(ei->e2di_mtime_extra);
+   ip->i_ctimensec = XTIME_TO_NSEC(ei->e2di_ctime_extra);
ip->i_birthtime = le32toh(ei->e2di_crtime);
-   ip->i_birthnsec = XTIME_TO_NSEC(le32toh(ei->e2di_crtime_extra));
+   ip->i_birthnsec = XTIME_TO_NSEC(ei->e2di_crtime_extra);
}
ip->i_flags = 0;
ei_flags_host = le32toh(ei->e2di_flags);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r364308 - head/sys/fs/ext2fs

2020-08-17 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Aug 17 15:05:41 2020
New Revision: 364308
URL: https://svnweb.freebsd.org/changeset/base/364308

Log:
  extfs: remove redundant little endian conversion.
  
  The NSEC_TO_XTIME macro already calls the htole32(), so there is no need
  to call it twice. This code does nothing on LE platforms and affects only
  nanosecond and birthtime fields so it's difficult to notice on regular use.
  
  X-MFC with:   r361136

Modified:
  head/sys/fs/ext2fs/ext2_inode_cnv.c

Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c
==
--- head/sys/fs/ext2fs/ext2_inode_cnv.c Mon Aug 17 14:07:29 2020
(r364307)
+++ head/sys/fs/ext2fs/ext2_inode_cnv.c Mon Aug 17 15:05:41 2020
(r364308)
@@ -213,11 +213,11 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei)
ei->e2di_dtime = htole32(le16toh(ei->e2di_nlink) ? 0 :
le32toh(ei->e2di_mtime));
if (E2DI_HAS_XTIME(ip)) {
-   ei->e2di_ctime_extra = htole32(NSEC_TO_XTIME(ip->i_ctimensec));
-   ei->e2di_mtime_extra = htole32(NSEC_TO_XTIME(ip->i_mtimensec));
-   ei->e2di_atime_extra = htole32(NSEC_TO_XTIME(ip->i_atimensec));
+   ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec);
+   ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec);
+   ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec);
ei->e2di_crtime = htole32(ip->i_birthtime);
-   ei->e2di_crtime_extra = htole32(NSEC_TO_XTIME(ip->i_birthnsec));
+   ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec);
}
/* Keep these in host endian for a while since they change a lot */
ei->e2di_flags = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361898 - head/usr.sbin/services_mkdb

2020-06-07 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Jun  7 19:56:17 2020
New Revision: 361898
URL: https://svnweb.freebsd.org/changeset/base/361898

Log:
  services: Add SSDP to service database
  
  This is used for UPnP and is registered in the IANA database.
  
  MFC after:2 weeks
  PR:   241573

Modified:
  head/usr.sbin/services_mkdb/services

Modified: head/usr.sbin/services_mkdb/services
==
--- head/usr.sbin/services_mkdb/servicesSun Jun  7 17:40:29 2020
(r361897)
+++ head/usr.sbin/services_mkdb/servicesSun Jun  7 19:56:17 2020
(r361898)
@@ -1602,6 +1602,8 @@ pptp  1723/tcp   #Point-to-point tunnelling 
protocol
 # IMPORTANT NOTE: See comments for ports 1645/1646 when using older equipment
 radius 1812/udp   #RADIUS authentication protocol (IANA sanctioned)
 radacct1813/udp   #RADIUS accounting protocol (IANA sanctioned)
+ssdp   1900/tcp   #Selective Service Discovery Protocol (UPnP)
+ssdp   1900/udp   #Selective Service Discovery Protocol (UPnP)
 licensedaemon  1986/tcp   #cisco license management
 licensedaemon  1986/udp   #cisco license management
 tr-rsrb-p1 1987/tcp   #cisco RSRB Priority 1 port
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r359005 - head/usr.bin/calendar/calendars

2020-03-14 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Mar 15 00:49:06 2020
New Revision: 359005
URL: https://svnweb.freebsd.org/changeset/base/359005

Log:
  calendar(1): Updates and corrections for some calendar files.
  
  These have an educational value and are, no doubt, an integral part of the fun
  behind running the BSDs.
  
  PR:   242909, 242918
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D23581

Modified:
  head/usr.bin/calendar/calendars/calendar.birthday
  head/usr.bin/calendar/calendars/calendar.history
  head/usr.bin/calendar/calendars/calendar.music

Modified: head/usr.bin/calendar/calendars/calendar.birthday
==
--- head/usr.bin/calendar/calendars/calendar.birthday   Sat Mar 14 22:07:11 
2020(r359004)
+++ head/usr.bin/calendar/calendars/calendar.birthday   Sun Mar 15 00:49:06 
2020(r359005)
@@ -5,7 +5,7 @@
  */
 
 #ifndef _calendar_birthday_
-#define _calendar_birthday_
+#define_calendar_birthday_
 #undef unix
 
 01/01  J.D. Salinger born, 1919
@@ -15,22 +15,26 @@
 01/04  Jakob Grimm born, 1785
 01/04  Wilhelm Beer born, 1797, first astronomer to map Mars
 01/05  DeWitt B. Brace born, 1859, inventor of spectrophotometer
+01/06  Millard Fillmore's birthday (let's party!)
+01/07  Nikola Tesla died in the Hotel New Yorker room 3327, 1943
 01/10  Ethan Allen born, 1738
 01/11  Alexander Hamilton born in Nevis, British West Indies, 1757?
 01/12  "Long" John Baldry is born in London, 1941
-01/13  Horatio Alger born, 1834
+01/13  Horatio Alger born, 1832
 01/13  Sophie Tucker born, 1884
 01/13  Wilhelm Wien born, 1864, Nobel prize for blackbody radiation laws
 01/14  Albert Schweitzer born, 1875
-01/15  Martin Luther King, Jr. born
+01/15  Martin Luther King, Jr. born, 1929
 01/17  Benjamin Franklin born in Boston, 1706
 01/19  Edgar Allan Poe born in Boston, 1809
 01/19  Robert Edward Lee born in Stratford Estate, Virginia, 1807
-01/20  George Burns born, 1898
+01/20  George Burns born, 1896
+01/20  Dr. Mendeleev died with a pen in his hand, 1907
 01/21  Lenin died, 1924
 01/21  Thomas Jonathan "Stonewall" Jackson born in Clarksburg, VA, 1824
 01/22  Sir Francis Bacon born, 1561
 01/23  Ernst Abbe born, 1840, formulated diffraction theory
+01/23  Grigori Yefimovich Rasputin born, 1869
 01/23  Humphrey Bogart born in New York City, 1899
 01/23  John Hancock born, 1737
 01/23  Joseph Hewes born, 1730
@@ -48,26 +52,28 @@
 02/06  King George VI of UK dies;  his daughter becomes Elizabeth II, 1952
 02/07  Sinclair Lewis born, 1885
 02/08  Friedleib F. Runge born, 1795, father of paper chromatography
+02/08  John von Neumann died, 1957
 02/08  Jules Verne born in Nantes, France, 1828
 02/09  George Hartmann born, 1489, designed astrolabes, timepieces, etc.
 02/10  Charles Lamb born, 1775
 02/10  William Allen White born, 1868
-02/11  Thos. Edison born, 1847
+02/11  Thomas Edison born, 1847
 02/11  William Henry Fox Talbot (photographic pioneer) born, 1800
 02/12  Abraham Lincoln born, 1809
 02/12  Charles Darwin born in Shrewsbury, England, 1809
 02/15  Galileo Galilei born in Pisa, Italy, 1564
 02/15  Susan B. Anthony born, 1820
 02/16  Pierre Bouguer born, 1698, founder of photometry
-02/17  Federick Eugene Ives born, 1856, pioneer of halftone
+02/17  Frederic Eugene Ives born, 1856, pioneer of halftone
 02/17  Marion Anderson born, 1902
 02/17  T. J. Watson, Sr. born, 1874
 02/18  Ernst Mach born, 1838, philosopher & optics pioneer
+02/18  Michelangelo Buonarroti dies in Rome, Italy, 1564
 02/19  Nicolas Copernicus born in Thorn, Poland, 1473
-02/20  Ludwig Boltzmann born, 1838, atomic physics pioneer
+02/20  Ludwig Boltzmann born, 1844, atomic physics pioneer
 02/21  Alexis De Rochon born, 1838, developed the spyglass
 02/22  George Washington born, 1732
-02/22  Pierre Jules Cesar Janssen born, 1838, found hydrogen in the sun
+02/22  Pierre Jules Cesar Janssen born, 1824, found hydrogen in the sun
 02/23  W.E.B. DuBois born, 1868
 02/24  Winslow Homer born, 1836
 02/24  Steve Jobs born, 1955
@@ -81,30 +87,41 @@
 03/02  Dr. Seuss born, 1904
 03/04  Casimir Pulaski born, 1747
 03/05  John Belushi dies in Los Angeles, 1982
+03/05  Joseph Stalin died in Moscow, 1953
+03/06  Michelangelo Buonarroti born in Caprese, Italy, 1475
+03/07  Aristotle died, 322BC
 03/07  Sir John Frederick William Herschel born, 1792, astronomer
 03/08  Alvan Clark born, 1804, astronomer & lens manufacturer
 03/08  Howard Aiken born, 1900
 03/11  Robert Treat Paine born, 1737
 03/11  Vannevar Bush born, 1890
+03/11  Douglas Adams born in Cambridge, England, 1952
 03/12  Gustav Robert Kirchhoff born, 1824, physicist
+03/12  Terry Pratchett (Sir) dies, 2015, author
 03/14  Albert Einstein born, 1879
 03/14  Casey Jones born, 1864
 03/14  Giovanni Virginia Schiaparelli born, 1835, astronomer;
named Mars "canals"
 03/14  Jean Baptiste Joseph Fourier born, 1768, mathematician & physicist
+03/14  Karl 

svn commit: r358904 - head/usr.sbin/services_mkdb

2020-03-11 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Mar 12 03:56:54 2020
New Revision: 358904
URL: https://svnweb.freebsd.org/changeset/base/358904

Log:
  style(9): Fix space after #define.
  
  No functional change.

Modified:
  head/usr.sbin/services_mkdb/services_mkdb.c

Modified: head/usr.sbin/services_mkdb/services_mkdb.c
==
--- head/usr.sbin/services_mkdb/services_mkdb.c Thu Mar 12 03:03:38 2020
(r358903)
+++ head/usr.sbin/services_mkdb/services_mkdb.c Thu Mar 12 03:56:54 2020
(r358904)
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
 static char tname[MAXPATHLEN];
 
 #definePMASK   0x
-#define PROTOMAX   6
+#definePROTOMAX6
 
 static voidadd(DB *, StringList *, size_t, const char *, size_t *, int);
 static StringList ***parseservices(const char *, StringList *);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r358448 - head/usr.sbin/services_mkdb

2020-02-28 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb 28 20:43:35 2020
New Revision: 358448
URL: https://svnweb.freebsd.org/changeset/base/358448

Log:
  /etc/services: attempt to bring the database to this century 1/2.
  
  This is the result of splitting r358153 in two, in order to avoid a build
  system bug and being able to merge the change to previous releases..
  
  Document better this file, updating the URL to the IANA registry and closely
  match the official services.
  
  For system ports (0 to 1023) we now try to follow the registry closely, noting
  some historical differences where applicable.
  
  As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
  on Oct 2006[1]. While it is conceivable some people may still use it in some
  very old FreeBSD machines that can't be replaced easily, the use of it is
  considered a security risk. Also drop the unofficial netatalk, which we
  supported long ago in the kernel but was dropped long ago.
  
  Leave for now smtps, even though it conflicts with IANA's submissions.
  The change should have very little visibility, if any, but should be a
  step closer to the current IANA database.
  
  [1] https://web.mit.edu/kerberos/krb4-end-of-life.html
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/services_mkdb/services

Modified: head/usr.sbin/services_mkdb/services
==
--- head/usr.sbin/services_mkdb/servicesFri Feb 28 20:34:30 2020
(r358447)
+++ head/usr.sbin/services_mkdb/servicesFri Feb 28 20:43:35 2020
(r358448)
@@ -1,65 +1,62 @@
 #
 # Network services, Internet style
 #
-# Note that it is presently the policy of IANA to assign a single well-known
-# port number for both TCP and UDP; hence, most entries here have two entries
-# even if the protocol doesn't support UDP operations.
+# Service names and port numbers are used to distinguish between different
+# services that run over transport protocols such as TCP, UDP, DCCP, and
+# SCTP.
 #
 # The latest IANA port assignments can be gotten from
 #
-#  http://www.iana.org/assignments/port-numbers
+#  https://www.iana.org/assignments/service-names-port-numbers/
 #
-# The Well Known Ports are those from 0 through 1023.
-# The Registered Ports are those from 1024 through 49151
-# The Dynamic and/or Private Ports are those from 49152 through 65535
+# System Ports are those from 0 through 1023.
+# User Ports are those from 1024 through 49151.
+# Dynamic and/or Private Ports are those from 49152 through 65535.
 #
-# Kerberos services are for Kerberos v4, and are unofficial.  Sites running
-# v5 should uncomment v5 entries and comment v4 entries.
+# Note that it is presently the policy of IANA to assign a single well-known
+# port number for both TCP and UDP; hence, most entries here have two entries
+# even if the protocol doesn't support UDP operations.
 #
 # $FreeBSD$
 #  From: @(#)services  5.8 (Berkeley) 5/9/91
 #
 # WELL KNOWN PORT NUMBERS
 #
-rtmp 1/ddp#Routing Table Maintenance Protocol
 tcpmux   1/tcp#TCP Port Service Multiplexer
 tcpmux   1/udp#TCP Port Service Multiplexer
-nbp  2/ddp#Name Binding Protocol
 compressnet  2/tcp#Management Utility
 compressnet  2/udp#Management Utility
 compressnet  3/tcp#Compression Process
 compressnet  3/udp#Compression Process
-echo 4/ddp#AppleTalk Echo Protocol
 rje  5/tcp#Remote Job Entry
 rje  5/udp#Remote Job Entry
-zip  6/ddp#Zone Information Protocol
-echo 7/sctp
 echo 7/tcp
 echo 7/udp
-discard  9/sctp   sink null
+echo 7/sctp
 discard  9/tcpsink null
 discard  9/udpsink null
+discard  9/sctp   sink null
 systat  11/tcpusers#Active Users
 systat  11/udpusers#Active Users
-daytime 13/sctp
 daytime 13/tcp
 daytime 13/udp
+daytime 13/sctp
 qotd17/tcpquote#Quote of the Day
 qotd17/udpquote#Quote of the Day
 msp 18/tcp#Message Send Protocol
 msp 18/udp#Message Send Protocol
-chargen 19/sctp   ttytst source#Character Generator
 chargen 19/tcpttytst source#Character Generator
 chargen 19/udpttytst source#Character Generator
-ftp-data20/sctp   #File Transfer [Default Data]
+chargen 19/sctp   ttytst source#Character Generator
 ftp-data20/tcp#File Transfer [Default Data]
 ftp-data20/udp#File Transfer [Default Data]
-ftp 21/sctp   #File Transfer [Control]
+ftp-data20/sctp   #File Transfer [Default Data]
 ftp 21/tcp#File Transfer 

svn commit: r358170 - head/usr.sbin/services_mkdb

2020-02-20 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 20 15:52:36 2020
New Revision: 358170
URL: https://svnweb.freebsd.org/changeset/base/358170

Log:
  Revert r358153: it is causing unexpected issues with the build system.

Modified:
  head/usr.sbin/services_mkdb/services

Modified: head/usr.sbin/services_mkdb/services
==
--- head/usr.sbin/services_mkdb/servicesThu Feb 20 15:37:44 2020
(r358169)
+++ head/usr.sbin/services_mkdb/servicesThu Feb 20 15:52:36 2020
(r358170)
@@ -1,62 +1,65 @@
 #
 # Network services, Internet style
 #
-# Service names and port numbers are used to distinguish between different
-# services that run over transport protocols such as TCP, UDP, DCCP, and
-# SCTP.
+# Note that it is presently the policy of IANA to assign a single well-known
+# port number for both TCP and UDP; hence, most entries here have two entries
+# even if the protocol doesn't support UDP operations.
 #
 # The latest IANA port assignments can be gotten from
 #
-#  https://www.iana.org/assignments/service-names-port-numbers/
+#  http://www.iana.org/assignments/port-numbers
 #
-# System Ports are those from 0 through 1023.
-# User Ports are those from 1024 through 49151.
-# Dynamic and/or Private Ports are those from 49152 through 65535.
+# The Well Known Ports are those from 0 through 1023.
+# The Registered Ports are those from 1024 through 49151
+# The Dynamic and/or Private Ports are those from 49152 through 65535
 #
-# Note that it is presently the policy of IANA to assign a single well-known
-# port number for both TCP and UDP; hence, most entries here have two entries
-# even if the protocol doesn't support UDP operations.
+# Kerberos services are for Kerberos v4, and are unofficial.  Sites running
+# v5 should uncomment v5 entries and comment v4 entries.
 #
 # $FreeBSD$
 #  From: @(#)services  5.8 (Berkeley) 5/9/91
 #
 # WELL KNOWN PORT NUMBERS
 #
+rtmp 1/ddp#Routing Table Maintenance Protocol
 tcpmux   1/tcp#TCP Port Service Multiplexer
 tcpmux   1/udp#TCP Port Service Multiplexer
+nbp  2/ddp#Name Binding Protocol
 compressnet  2/tcp#Management Utility
 compressnet  2/udp#Management Utility
 compressnet  3/tcp#Compression Process
 compressnet  3/udp#Compression Process
+echo 4/ddp#AppleTalk Echo Protocol
 rje  5/tcp#Remote Job Entry
 rje  5/udp#Remote Job Entry
+zip  6/ddp#Zone Information Protocol
+echo 7/sctp
 echo 7/tcp
 echo 7/udp
-echo 7/sctp
+discard  9/sctp   sink null
 discard  9/tcpsink null
 discard  9/udpsink null
-discard  9/sctp   sink null
 systat  11/tcpusers#Active Users
 systat  11/udpusers#Active Users
+daytime 13/sctp
 daytime 13/tcp
 daytime 13/udp
-daytime 13/sctp
 qotd17/tcpquote#Quote of the Day
 qotd17/udpquote#Quote of the Day
 msp 18/tcp#Message Send Protocol
 msp 18/udp#Message Send Protocol
+chargen 19/sctp   ttytst source#Character Generator
 chargen 19/tcpttytst source#Character Generator
 chargen 19/udpttytst source#Character Generator
-chargen 19/sctp   ttytst source#Character Generator
+ftp-data20/sctp   #File Transfer [Default Data]
 ftp-data20/tcp#File Transfer [Default Data]
 ftp-data20/udp#File Transfer [Default Data]
-ftp-data20/sctp   #File Transfer [Default Data]
+ftp 21/sctp   #File Transfer [Control]
 ftp 21/tcp#File Transfer [Control]
 ftp 21/udp#File Transfer [Control]
-ftp 21/sctp   #File Transfer [Control]
+ssh 22/sctp   #Secure Shell Login
 ssh 22/tcp#Secure Shell Login
 ssh 22/udp#Secure Shell Login
-ssh 22/sctp   #Secure Shell Login
 telnet  23/tcp
 telnet  23/udp
 #   24/tcpany private mail system
@@ -111,22 +114,24 @@ isi-gl 55/tcp#ISI Graphics Language
 isi-gl  55/udp#ISI Graphics Language
 xns-auth56/tcp#XNS Authentication
 xns-auth56/udp#XNS Authentication
-#   57/tcpany private terminal access
-#   57/udpany private terminal access
+#   57/tcpany private terminal access
+#   57/udpany private terminal access
 xns-mail58/tcp#XNS Mail
 xns-mail58/udp#XNS Mail
 #   59/tcpany private file service
 #   59/udpany private file service
+ni-mail 

svn commit: r358153 - head/usr.sbin/services_mkdb

2020-02-19 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 20 03:54:07 2020
New Revision: 358153
URL: https://svnweb.freebsd.org/changeset/base/358153

Log:
  /etc/services: attempt bring the database to this century.
  
  Document better this file, updating the URL to the IANA registry and closely
  match the official services.
  
  For system ports (0 to 1023) we now try to follow the registry closely, noting
  some historical differences where applicable.
  For the User ports (1024 - 49151) we try to keep some sensible balance only
  of services that are likely to be found on FreeBSD/UNIX systems. This attempts
  to strike a balance between complexity and usefulness.
  
  As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
  on Oct 2006[1]. While it is conceivable some people may still use it in some
  very old FreeBSD machines that can't be replaced easily, the use of it is
  considered a security risk. Also drop the unofficial netatalk, which we
  supported long ago in the kernel but was dropped long ago.
  
  [1] https://web.mit.edu/kerberos/krb4-end-of-life.html
  
  MFC after:3 weeks (likely to 12-stable only)
  Differential Revision:https://reviews.freebsd.org/D23621

Modified:
  head/usr.sbin/services_mkdb/services

Modified: head/usr.sbin/services_mkdb/services
==
--- head/usr.sbin/services_mkdb/servicesThu Feb 20 03:01:27 2020
(r358152)
+++ head/usr.sbin/services_mkdb/servicesThu Feb 20 03:54:07 2020
(r358153)
@@ -1,65 +1,62 @@
 #
 # Network services, Internet style
 #
-# Note that it is presently the policy of IANA to assign a single well-known
-# port number for both TCP and UDP; hence, most entries here have two entries
-# even if the protocol doesn't support UDP operations.
+# Service names and port numbers are used to distinguish between different
+# services that run over transport protocols such as TCP, UDP, DCCP, and
+# SCTP.
 #
 # The latest IANA port assignments can be gotten from
 #
-#  http://www.iana.org/assignments/port-numbers
+#  https://www.iana.org/assignments/service-names-port-numbers/
 #
-# The Well Known Ports are those from 0 through 1023.
-# The Registered Ports are those from 1024 through 49151
-# The Dynamic and/or Private Ports are those from 49152 through 65535
+# System Ports are those from 0 through 1023.
+# User Ports are those from 1024 through 49151.
+# Dynamic and/or Private Ports are those from 49152 through 65535.
 #
-# Kerberos services are for Kerberos v4, and are unofficial.  Sites running
-# v5 should uncomment v5 entries and comment v4 entries.
+# Note that it is presently the policy of IANA to assign a single well-known
+# port number for both TCP and UDP; hence, most entries here have two entries
+# even if the protocol doesn't support UDP operations.
 #
 # $FreeBSD$
 #  From: @(#)services  5.8 (Berkeley) 5/9/91
 #
 # WELL KNOWN PORT NUMBERS
 #
-rtmp 1/ddp#Routing Table Maintenance Protocol
 tcpmux   1/tcp#TCP Port Service Multiplexer
 tcpmux   1/udp#TCP Port Service Multiplexer
-nbp  2/ddp#Name Binding Protocol
 compressnet  2/tcp#Management Utility
 compressnet  2/udp#Management Utility
 compressnet  3/tcp#Compression Process
 compressnet  3/udp#Compression Process
-echo 4/ddp#AppleTalk Echo Protocol
 rje  5/tcp#Remote Job Entry
 rje  5/udp#Remote Job Entry
-zip  6/ddp#Zone Information Protocol
-echo 7/sctp
 echo 7/tcp
 echo 7/udp
-discard  9/sctp   sink null
+echo 7/sctp
 discard  9/tcpsink null
 discard  9/udpsink null
+discard  9/sctp   sink null
 systat  11/tcpusers#Active Users
 systat  11/udpusers#Active Users
-daytime 13/sctp
 daytime 13/tcp
 daytime 13/udp
+daytime 13/sctp
 qotd17/tcpquote#Quote of the Day
 qotd17/udpquote#Quote of the Day
 msp 18/tcp#Message Send Protocol
 msp 18/udp#Message Send Protocol
-chargen 19/sctp   ttytst source#Character Generator
 chargen 19/tcpttytst source#Character Generator
 chargen 19/udpttytst source#Character Generator
-ftp-data20/sctp   #File Transfer [Default Data]
+chargen 19/sctp   ttytst source#Character Generator
 ftp-data20/tcp#File Transfer [Default Data]
 ftp-data20/udp#File Transfer [Default Data]
-ftp 21/sctp   #File Transfer [Control]
+ftp-data20/sctp   #File Transfer [Default Data]
 ftp 21/tcp#File Transfer [Control]
 ftp 21/udp#File 

svn commit: r357860 - head/usr.sbin/services_mkdb

2020-02-13 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb 13 15:42:14 2020
New Revision: 357860
URL: https://svnweb.freebsd.org/changeset/base/357860

Log:
  Revert r357343:
  services: Add PROFInet and EtherCAT.
  
  Both are admitedly very niche features and no known users exist currently.
  I am doing a further review/update of the services file (see D23621) and
  both of these are not likely to be considered.

Modified:
  head/usr.sbin/services_mkdb/services

Modified: head/usr.sbin/services_mkdb/services
==
--- head/usr.sbin/services_mkdb/servicesThu Feb 13 15:28:56 2020
(r357859)
+++ head/usr.sbin/services_mkdb/servicesThu Feb 13 15:42:14 2020
(r357860)
@@ -2494,14 +2494,6 @@ wnn6_DS  26208/tcp  #Wnn6 (Dserver)
 sgsap  29118/sctp #SGsAP in 3GPP
 sbcap  29168/sctp #SBcAP in 3GPP
 iuhsctpassoc   29169/sctp #HNBAP and RUA Common Association
-profinet-rt34962/tcp  #PROFInet RT Unicast
-profinet-rt34962/udp  #PROFInet RT Unicast
-profinet-rtm   34963/tcp  #PROFInet RT Multicast
-profinet-rtm   34963/udp  #PROFInet RT Multicast
-profinet-cm34964/tcp  #PROFInet Context Manager
-profinet-cm34964/udp  #PROFInet Context Manager
-ethercat   34980/tcp  #EtherCAT Port
-ethercat   34980/udp  #EhterCAT Port
 s1-control 36412/sctp #S1-Control Plane (3GPP)
 x2-control 36422/sctp #X2-Control Plane (3GPP)
 dbbrowse   47557/tcp  #Databeam Corporation
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357655 - head/sys/net

2020-02-07 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb  7 15:16:04 2020
New Revision: 357655
URL: https://svnweb.freebsd.org/changeset/base/357655

Log:
  typo: stray spaces.
  
  No functional change

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Fri Feb  7 15:14:29 2020(r357654)
+++ head/sys/net/ethernet.h Fri Feb  7 15:16:04 2020(r357655)
@@ -344,7 +344,7 @@ struct ether_vlan_header {
 #defineETHERTYPE_SLOW  0x8809  /* 802.3ad link aggregation 
(LACP) */
 #defineETHERTYPE_PPP   0x880B  /* PPP (obsolete by PPPoE) */
 #defineETHERTYPE_HITACHI   0x8820  /* Hitachi Cable 
(Optoelectronic Systems Laboratory) */
-#defineETHERTYPE_TEST  0x8822  /* Network Conformance Testing 
*/
+#defineETHERTYPE_TEST  0x8822  /* Network Conformance Testing 
*/
 #defineETHERTYPE_MPLS  0x8847  /* MPLS Unicast */
 #defineETHERTYPE_MPLS_MCAST0x8848  /* MPLS Multicast */
 #defineETHERTYPE_AXIS  0x8856  /* Axis Communications AB 
proprietary bootstrap/config */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357654 - in head: lib/libc/xdr sys/xdr

2020-02-07 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb  7 15:14:29 2020
New Revision: 357654
URL: https://svnweb.freebsd.org/changeset/base/357654

Log:
  typo: s/impelmentation/implementation/.
  
  No functional change

Modified:
  head/lib/libc/xdr/xdr_array.c
  head/lib/libc/xdr/xdr_reference.c
  head/sys/xdr/xdr_array.c
  head/sys/xdr/xdr_reference.c

Modified: head/lib/libc/xdr/xdr_array.c
==
--- head/lib/libc/xdr/xdr_array.c   Fri Feb  7 14:36:28 2020
(r357653)
+++ head/lib/libc/xdr/xdr_array.c   Fri Feb  7 15:14:29 2020
(r357654)
@@ -41,7 +41,7 @@ static char *sccsid = "@(#)xdr_array.c2.1 88/07/29 4.
 __FBSDID("$FreeBSD$");
 
 /*
- * xdr_array.c, Generic XDR routines impelmentation.
+ * xdr_array.c, Generic XDR routines implementation.
  *
  * These are the "non-trivial" xdr primitives used to serialize and 
de-serialize
  * arrays.  See xdr.h for more info on the interface to xdr.

Modified: head/lib/libc/xdr/xdr_reference.c
==
--- head/lib/libc/xdr/xdr_reference.c   Fri Feb  7 14:36:28 2020
(r357653)
+++ head/lib/libc/xdr/xdr_reference.c   Fri Feb  7 15:14:29 2020
(r357654)
@@ -41,7 +41,7 @@ static char *sccsid = "@(#)xdr_reference.c2.1 88/07/2
 __FBSDID("$FreeBSD$");
 
 /*
- * xdr_reference.c, Generic XDR routines impelmentation.
+ * xdr_reference.c, Generic XDR routines implementation.
  *
  * These are the "non-trivial" xdr primitives used to serialize and 
de-serialize
  * "pointers".  See xdr.h for more info on the interface to xdr.

Modified: head/sys/xdr/xdr_array.c
==
--- head/sys/xdr/xdr_array.cFri Feb  7 14:36:28 2020(r357653)
+++ head/sys/xdr/xdr_array.cFri Feb  7 15:14:29 2020(r357654)
@@ -37,7 +37,7 @@ static char *sccsid = "@(#)xdr_array.c2.1 88/07/29 4.
 __FBSDID("$FreeBSD$");
 
 /*
- * xdr_array.c, Generic XDR routines impelmentation.
+ * xdr_array.c, Generic XDR routines implementation.
  *
  * Copyright (C) 1984, Sun Microsystems, Inc.
  *

Modified: head/sys/xdr/xdr_reference.c
==
--- head/sys/xdr/xdr_reference.cFri Feb  7 14:36:28 2020
(r357653)
+++ head/sys/xdr/xdr_reference.cFri Feb  7 15:14:29 2020
(r357654)
@@ -37,7 +37,7 @@ static char *sccsid = "@(#)xdr_reference.c2.1 88/07/2
 __FBSDID("$FreeBSD$");
 
 /*
- * xdr_reference.c, Generic XDR routines impelmentation.
+ * xdr_reference.c, Generic XDR routines implementation.
  *
  * Copyright (C) 1987, Sun Microsystems, Inc.
  *
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357631 - head/usr.sbin/fstyp

2020-02-06 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb  6 18:04:15 2020
New Revision: 357631
URL: https://svnweb.freebsd.org/changeset/base/357631

Log:
  fstyp: sync HAMMER1/2 detection support with DragonFly BSD.
  
  Submitted by: Tomohiro Kusumi
  PR:   243929

Modified:
  head/usr.sbin/fstyp/hammer.c
  head/usr.sbin/fstyp/hammer2.c

Modified: head/usr.sbin/fstyp/hammer.c
==
--- head/usr.sbin/fstyp/hammer.cThu Feb  6 18:02:38 2020
(r357630)
+++ head/usr.sbin/fstyp/hammer.cThu Feb  6 18:04:15 2020
(r357631)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2016 The DragonFly Project
+ * Copyright (c) 2016-2019 The DragonFly Project
+ * Copyright (c) 2016-2019 Tomohiro Kusumi 
  * All rights reserved.
  *
  * This software was developed by Edward Tomasz Napierala under sponsorship
@@ -43,7 +44,7 @@ __FBSDID("$FreeBSD$");
 #include "fstyp.h"
 
 static hammer_volume_ondisk_t
-__read_ondisk(FILE *fp)
+read_ondisk(FILE *fp)
 {
hammer_volume_ondisk_t ondisk;
 
@@ -55,7 +56,7 @@ __read_ondisk(FILE *fp)
 }
 
 static int
-__test_ondisk(const hammer_volume_ondisk_t ondisk)
+test_ondisk(const hammer_volume_ondisk_t ondisk)
 {
static int count = 0;
static hammer_uuid_t fsid, fstype;
@@ -97,23 +98,23 @@ fstyp_hammer(FILE *fp, char *label, size_t size)
hammer_volume_ondisk_t ondisk;
int error = 1;
 
-   ondisk = __read_ondisk(fp);
+   ondisk = read_ondisk(fp);
if (ondisk->vol_no != HAMMER_ROOT_VOLNO)
-   goto done;
+   goto fail;
if (ondisk->vol_count != 1)
-   goto done;
-   if (__test_ondisk(ondisk))
-   goto done;
+   goto fail;
+   if (test_ondisk(ondisk))
+   goto fail;
 
strlcpy(label, ondisk->vol_label, size);
error = 0;
-done:
+fail:
free(ondisk);
return (error);
 }
 
 static int
-__test_volume(const char *volpath)
+test_volume(const char *volpath)
 {
hammer_volume_ondisk_t ondisk;
FILE *fp;
@@ -122,13 +123,13 @@ __test_volume(const char *volpath)
if ((fp = fopen(volpath, "r")) == NULL)
err(1, "failed to open %s", volpath);
 
-   ondisk = __read_ondisk(fp);
+   ondisk = read_ondisk(fp);
fclose(fp);
-   if (__test_ondisk(ondisk))
-   goto done;
+   if (test_ondisk(ondisk))
+   goto fail;
 
volno = ondisk->vol_no;
-done:
+fail:
free(ondisk);
return (volno);
 }
@@ -136,51 +137,60 @@ done:
 static int
 __fsvtyp_hammer(const char *blkdevs, char *label, size_t size, int partial)
 {
-   hammer_volume_ondisk_t ondisk;
+   hammer_volume_ondisk_t ondisk = NULL;
FILE *fp;
char *dup, *p, *volpath, x[HAMMER_MAX_VOLUMES];
int i, volno, error = 1;
 
+   if (!blkdevs)
+   goto fail;
+
memset(x, 0, sizeof(x));
dup = strdup(blkdevs);
p = dup;
 
+   volpath = NULL;
+   volno = -1;
while (p) {
volpath = p;
if ((p = strchr(p, ':')) != NULL)
*p++ = '\0';
-   if ((volno = __test_volume(volpath)) == -1)
+   if ((volno = test_volume(volpath)) == -1)
break;
+   assert(volno >= 0);
+   assert(volno < HAMMER_MAX_VOLUMES);
x[volno]++;
}
 
+   if (!volpath)
+   err(1, "invalid path %s", blkdevs);
if ((fp = fopen(volpath, "r")) == NULL)
err(1, "failed to open %s", volpath);
-   ondisk = __read_ondisk(fp);
+   ondisk = read_ondisk(fp);
fclose(fp);
 
free(dup);
 
if (volno == -1)
-   goto done;
+   goto fail;
if (partial)
goto success;
 
for (i = 0; i < HAMMER_MAX_VOLUMES; i++)
if (x[i] > 1)
-   goto done;
+   goto fail;
for (i = 0; i < HAMMER_MAX_VOLUMES; i++)
if (x[i] == 0)
break;
if (ondisk->vol_count != i)
-   goto done;
+   goto fail;
for (; i < HAMMER_MAX_VOLUMES; i++)
if (x[i] != 0)
-   goto done;
+   goto fail;
 success:
strlcpy(label, ondisk->vol_label, size);
error = 0;
-done:
+fail:
free(ondisk);
return (error);
 }

Modified: head/usr.sbin/fstyp/hammer2.c
==
--- head/usr.sbin/fstyp/hammer2.c   Thu Feb  6 18:02:38 2020
(r357630)
+++ head/usr.sbin/fstyp/hammer2.c   Thu Feb  6 18:04:15 2020
(r357631)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2017-2019 The DragonFly Project
+ * Copyright (c) 2017-2019 Tomohiro Kusumi 
  * All rights reserved.
  *
  * This software was developed by Edward 

svn commit: r357587 - head/sys/net

2020-02-05 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Feb  5 19:11:07 2020
New Revision: 357587
URL: https://svnweb.freebsd.org/changeset/base/357587

Log:
  ethernet: Add a couple more Ethertypes.
  
  Powerlink and Sercos III are used in automation. Both have been standardized
  and In the case of Ethernet Powerlink there is a BSD-licensed stack.

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Wed Feb  5 19:08:45 2020(r357586)
+++ head/sys/net/ethernet.h Wed Feb  5 19:11:07 2020(r357587)
@@ -356,7 +356,9 @@ struct ether_vlan_header {
 #defineETHERTYPE_AOE   0x88A2  /* ATA Protocol */
 #defineETHERTYPE_ETHERCAT  0x88A4  /* EtherCat Protocol */
 #defineETHERTYPE_QINQ  0x88A8  /* 802.1ad VLAN stacking */
+#defineETHERTYPE_POWERLINK 0x88AB  /* Ethernet Powerlink (EPL) */
 #defineETHERTYPE_LLDP  0x88CC  /* Link Layer Discovery 
Protocol */
+#defineETHERTYPE_SERCOS0x88CD  /* SERCOS III Protocol */
 #defineETHERTYPE_MACSEC0x88E5  /* 802.1AE MAC Security */
 #defineETHERTYPE_PBB   0x88E7  /* 802.1Q Provider Backbone 
Bridges */
 #defineETHERTYPE_FCOE  0x8906  /* Fibre Channel over Ethernet 
*/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357424 - head/sys/net

2020-02-02 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Feb  3 02:02:13 2020
New Revision: 357424
URL: https://svnweb.freebsd.org/changeset/base/357424

Log:
  typo: Registration.
  
  Pointed by:   Dikshie Fauzie

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Mon Feb  3 01:08:15 2020(r357423)
+++ head/sys/net/ethernet.h Mon Feb  3 02:02:13 2020(r357424)
@@ -100,7 +100,7 @@ struct ether_vlan_header {
 /*
  * Ethernet protocol types.
  *
- * A public list is available from the IEEE Ragistration Authority:
+ * A public list is available from the IEEE Registration Authority:
  * https://standards.ieee.org/products-services/regauth/
  *
  *  NOTE: 0x-0x05DC (0..1500) are generally IEEE 802.3 length fields.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357423 - head/sys/net

2020-02-02 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Feb  3 01:08:15 2020
New Revision: 357423
URL: https://svnweb.freebsd.org/changeset/base/357423

Log:
  ethernet: Minor cleanup.
  Consistently use uppercase for ethertype hex numbers.

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Sun Feb  2 20:56:18 2020(r357422)
+++ head/sys/net/ethernet.h Mon Feb  3 01:08:15 2020(r357423)
@@ -351,14 +351,14 @@ struct ether_vlan_header {
 #defineETHERTYPE_PPPOEDISC 0x8863  /* PPP Over Ethernet Discovery 
Stage */
 #defineETHERTYPE_PPPOE 0x8864  /* PPP Over Ethernet Session 
Stage */
 #defineETHERTYPE_LANPROBE  0x  /* HP LanProbe test? */
-#defineETHERTYPE_PAE   0x888e  /* EAPOL PAE/802.1x */
+#defineETHERTYPE_PAE   0x888E  /* EAPOL PAE/802.1x */
 #defineETHERTYPE_PROFINET  0x8892  /* PROFINET RT Protocol */
-#defineETHERTYPE_AOE   0x88a2  /* ATA Protocol */
-#defineETHERTYPE_ETHERCAT  0x88a4  /* EtherCat Protocol */
+#defineETHERTYPE_AOE   0x88A2  /* ATA Protocol */
+#defineETHERTYPE_ETHERCAT  0x88A4  /* EtherCat Protocol */
 #defineETHERTYPE_QINQ  0x88A8  /* 802.1ad VLAN stacking */
 #defineETHERTYPE_LLDP  0x88CC  /* Link Layer Discovery 
Protocol */
-#defineETHERTYPE_MACSEC0x88e5  /* 802.1AE MAC Security */
-#defineETHERTYPE_PBB   0x88e7  /* 802.1Q Provider Backbone 
Bridges */
+#defineETHERTYPE_MACSEC0x88E5  /* 802.1AE MAC Security */
+#defineETHERTYPE_PBB   0x88E7  /* 802.1Q Provider Backbone 
Bridges */
 #defineETHERTYPE_FCOE  0x8906  /* Fibre Channel over Ethernet 
*/
 #defineETHERTYPE_LOOPBACK  0x9000  /* Loopback: used to test 
interfaces */
 #defineETHERTYPE_8021Q9100 0x9100  /* IEEE 802.1Q stacking 
(proprietary) */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357417 - head/sys/net

2020-02-02 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Feb  2 19:02:07 2020
New Revision: 357417
URL: https://svnweb.freebsd.org/changeset/base/357417

Log:
  style(9): Fix spaces after #define.
  
  No functional change.

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Sun Feb  2 19:01:16 2020(r357416)
+++ head/sys/net/ethernet.h Sun Feb  2 19:02:07 2020(r357417)
@@ -6,7 +6,7 @@
  */
 
 #ifndef _NET_ETHERNET_H_
-#define _NET_ETHERNET_H_
+#define_NET_ETHERNET_H_
 
 /*
  * Some basic Ethernet constants.
@@ -271,7 +271,7 @@ struct ether_vlan_header {
 #defineETHERTYPE_AARP  0x80F3  /* AppleTalk AARP */
/* 0x80F4 - 0x80F5 Kinetics */
 #defineETHERTYPE_APOLLO0x80F7  /* Apollo Computer */
-#define ETHERTYPE_VLAN 0x8100  /* IEEE 802.1Q VLAN tagging (XXX 
conflicts) */
+#defineETHERTYPE_VLAN  0x8100  /* IEEE 802.1Q VLAN tagging 
(XXX conflicts) */
/* 0x80FF - 0x8101 Wellfleet Communications (XXX 
conflicts) */
 #defineETHERTYPE_BOFL  0x8102  /* Wellfleet; BOFL (Breath OF 
Life) pkts [every 5-10 secs.] */
 #defineETHERTYPE_WELLFLEET 0x8103  /* Wellfleet Communications */
@@ -344,7 +344,7 @@ struct ether_vlan_header {
 #defineETHERTYPE_SLOW  0x8809  /* 802.3ad link aggregation 
(LACP) */
 #defineETHERTYPE_PPP   0x880B  /* PPP (obsolete by PPPoE) */
 #defineETHERTYPE_HITACHI   0x8820  /* Hitachi Cable 
(Optoelectronic Systems Laboratory) */
-#define ETHERTYPE_TEST 0x8822  /* Network Conformance Testing */
+#defineETHERTYPE_TEST  0x8822  /* Network Conformance Testing 
*/
 #defineETHERTYPE_MPLS  0x8847  /* MPLS Unicast */
 #defineETHERTYPE_MPLS_MCAST0x8848  /* MPLS Multicast */
 #defineETHERTYPE_AXIS  0x8856  /* Axis Communications AB 
proprietary bootstrap/config */
@@ -393,7 +393,7 @@ struct ether_vlan_header {
  * ether_vlan_mtap.  This function will re-insert VLAN tags for the duration
  * of the tap, so they show up properly for network analyzers.
  */
-#define ETHER_BPF_MTAP(_ifp, _m) do {  \
+#defineETHER_BPF_MTAP(_ifp, _m) do {   
\
if (bpf_peers_present((_ifp)->if_bpf)) {\
M_ASSERTVALID(_m);  \
if (((_m)->m_flags & M_VLANTAG) != 0)   \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357415 - head/sys/net

2020-02-02 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Feb  2 18:33:20 2020
New Revision: 357415
URL: https://svnweb.freebsd.org/changeset/base/357415

Log:
  ethernet: add some more Ethertypes.
  
  Sort ETHERTYPE_FCOE, from r357414.

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Sun Feb  2 18:27:37 2020(r357414)
+++ head/sys/net/ethernet.h Sun Feb  2 18:33:20 2020(r357415)
@@ -355,11 +355,11 @@ struct ether_vlan_header {
 #defineETHERTYPE_PROFINET  0x8892  /* PROFINET RT Protocol */
 #defineETHERTYPE_AOE   0x88a2  /* ATA Protocol */
 #defineETHERTYPE_ETHERCAT  0x88a4  /* EtherCat Protocol */
-#defineETHERTYPE_FCOE  0x8906  /* Fibre Channel over Ethernet 
*/
 #defineETHERTYPE_QINQ  0x88A8  /* 802.1ad VLAN stacking */
 #defineETHERTYPE_LLDP  0x88CC  /* Link Layer Discovery 
Protocol */
 #defineETHERTYPE_MACSEC0x88e5  /* 802.1AE MAC Security */
 #defineETHERTYPE_PBB   0x88e7  /* 802.1Q Provider Backbone 
Bridges */
+#defineETHERTYPE_FCOE  0x8906  /* Fibre Channel over Ethernet 
*/
 #defineETHERTYPE_LOOPBACK  0x9000  /* Loopback: used to test 
interfaces */
 #defineETHERTYPE_8021Q9100 0x9100  /* IEEE 802.1Q stacking 
(proprietary) */
 #defineETHERTYPE_LBACK ETHERTYPE_LOOPBACK  /* DEC MOP 
loopback */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357414 - head/sys/net

2020-02-02 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Feb  2 18:27:37 2020
New Revision: 357414
URL: https://svnweb.freebsd.org/changeset/base/357414

Log:
  ethernet: add some more Ethertypes.
  
  Add some types based on other BSDs and also add EtherCat and PROFINET, which
  are IEC standards.
  
  There is a public list (CSV format) at:
https://standards.ieee.org/products-services/regauth/
  
  MFC after:2 weeks

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Sun Feb  2 18:07:47 2020(r357413)
+++ head/sys/net/ethernet.h Sun Feb  2 18:27:37 2020(r357414)
@@ -98,6 +98,11 @@ struct ether_vlan_header {
((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
 
 /*
+ * Ethernet protocol types.
+ *
+ * A public list is available from the IEEE Ragistration Authority:
+ * https://standards.ieee.org/products-services/regauth/
+ *
  *  NOTE: 0x-0x05DC (0..1500) are generally IEEE 802.3 length fields.
  *  However, there are some conflicts.
  */
@@ -347,7 +352,14 @@ struct ether_vlan_header {
 #defineETHERTYPE_PPPOE 0x8864  /* PPP Over Ethernet Session 
Stage */
 #defineETHERTYPE_LANPROBE  0x  /* HP LanProbe test? */
 #defineETHERTYPE_PAE   0x888e  /* EAPOL PAE/802.1x */
+#defineETHERTYPE_PROFINET  0x8892  /* PROFINET RT Protocol */
+#defineETHERTYPE_AOE   0x88a2  /* ATA Protocol */
+#defineETHERTYPE_ETHERCAT  0x88a4  /* EtherCat Protocol */
+#defineETHERTYPE_FCOE  0x8906  /* Fibre Channel over Ethernet 
*/
 #defineETHERTYPE_QINQ  0x88A8  /* 802.1ad VLAN stacking */
+#defineETHERTYPE_LLDP  0x88CC  /* Link Layer Discovery 
Protocol */
+#defineETHERTYPE_MACSEC0x88e5  /* 802.1AE MAC Security */
+#defineETHERTYPE_PBB   0x88e7  /* 802.1Q Provider Backbone 
Bridges */
 #defineETHERTYPE_LOOPBACK  0x9000  /* Loopback: used to test 
interfaces */
 #defineETHERTYPE_8021Q9100 0x9100  /* IEEE 802.1Q stacking 
(proprietary) */
 #defineETHERTYPE_LBACK ETHERTYPE_LOOPBACK  /* DEC MOP 
loopback */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r357343 - head/usr.sbin/services_mkdb

2020-01-31 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Jan 31 18:55:21 2020
New Revision: 357343
URL: https://svnweb.freebsd.org/changeset/base/357343

Log:
  services: Add PROFInet and EtherCAT.
  
  Both are used in industrial networks.
  
  MFC after:1 week

Modified:
  head/usr.sbin/services_mkdb/services

Modified: head/usr.sbin/services_mkdb/services
==
--- head/usr.sbin/services_mkdb/servicesFri Jan 31 18:26:23 2020
(r357342)
+++ head/usr.sbin/services_mkdb/servicesFri Jan 31 18:55:21 2020
(r357343)
@@ -2494,6 +2494,14 @@ wnn6_DS  26208/tcp  #Wnn6 (Dserver)
 sgsap  29118/sctp #SGsAP in 3GPP
 sbcap  29168/sctp #SBcAP in 3GPP
 iuhsctpassoc   29169/sctp #HNBAP and RUA Common Association
+profinet-rt34962/tcp  #PROFInet RT Unicast
+profinet-rt34962/udp  #PROFInet RT Unicast
+profinet-rtm   34963/tcp  #PROFInet RT Multicast
+profinet-rtm   34963/udp  #PROFInet RT Multicast
+profinet-cm34964/tcp  #PROFInet Context Manager
+profinet-cm34964/udp  #PROFInet Context Manager
+ethercat   34980/tcp  #EtherCAT Port
+ethercat   34980/udp  #EhterCAT Port
 s1-control 36412/sctp #S1-Control Plane (3GPP)
 x2-control 36422/sctp #X2-Control Plane (3GPP)
 dbbrowse   47557/tcp  #Databeam Corporation
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r356624 - head/sys/sys

2020-01-10 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jan 11 01:44:55 2020
New Revision: 356624
URL: https://svnweb.freebsd.org/changeset/base/356624

Log:
  Update ELFOSABI_* constants with OpenVOS.
  
  Reference:
https://www.sco.com/developers/gabi/latest/ch4.eheader.html

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Sat Jan 11 01:15:38 2020(r356623)
+++ head/sys/sys/elf_common.h   Sat Jan 11 01:44:55 2020(r356624)
@@ -175,6 +175,7 @@ typedef struct {
 #defineELFOSABI_AROS   15  /* Amiga Research OS */
 #defineELFOSABI_FENIXOS16  /* FenixOS */
 #defineELFOSABI_CLOUDABI   17  /* Nuxi CloudABI */
+#defineELFOSABI_OPENVOS18  /* Stratus Technologies OpenVOS 
*/
 #defineELFOSABI_ARM_AEABI  64  /* ARM EABI */
 #defineELFOSABI_ARM97  /* ARM */
 #defineELFOSABI_STANDALONE 255 /* Standalone (embedded) 
application */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r356142 - in head/sys: dev/ofw sys

2019-12-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Dec 28 02:58:30 2019
New Revision: 356142
URL: https://svnweb.freebsd.org/changeset/base/356142

Log:
  SPDX: update some tags with two licenses.

Modified:
  head/sys/dev/ofw/openfirm.h
  head/sys/sys/sched.h

Modified: head/sys/dev/ofw/openfirm.h
==
--- head/sys/dev/ofw/openfirm.h Sat Dec 28 02:11:41 2019(r356141)
+++ head/sys/dev/ofw/openfirm.h Sat Dec 28 02:58:30 2019(r356142)
@@ -1,7 +1,7 @@
 /* $NetBSD: openfirm.h,v 1.1 1998/05/15 10:16:00 tsubai Exp $  */
 
 /*-
- * SPDX-License-Identifier: BSD-4-Clause
+ * SPDX-License-Identifier: (BSD-4-Clause AND BSD-2-Clause-FreeBSD)
  *
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
  * Copyright (C) 1995, 1996 TooLs GmbH.

Modified: head/sys/sys/sched.h
==
--- head/sys/sys/sched.hSat Dec 28 02:11:41 2019(r356141)
+++ head/sys/sys/sched.hSat Dec 28 02:58:30 2019(r356142)
@@ -1,5 +1,5 @@
 /*-
- * SPDX-License-Identifier: BSD-4-Clause
+ * SPDX-License-Identifier: (BSD-4-Clause AND BSD-2-Clause-FreeBSD)
  *
  * Copyright (c) 1996, 1997
  *  HD Associates, Inc.  All rights reserved.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r356141 - head/lib/libc/arm/string

2019-12-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Dec 28 02:11:41 2019
New Revision: 356141
URL: https://svnweb.freebsd.org/changeset/base/356141

Log:
  arm/ffs.S: remove stale comment.
  
  We already use the CLZ instruction.
  
  Discussed with: andrew

Modified:
  head/lib/libc/arm/string/ffs.S

Modified: head/lib/libc/arm/string/ffs.S
==
--- head/lib/libc/arm/string/ffs.S  Sat Dec 28 01:35:32 2019
(r356140)
+++ head/lib/libc/arm/string/ffs.S  Sat Dec 28 02:11:41 2019
(r356141)
@@ -40,9 +40,6 @@ __FBSDID("$FreeBSD$");
  * 6 bits as an index into the table.  This algorithm should be a win
  * over the checking each bit in turn as per the C compiled version.
  *
- * under ARMv5 there's an instruction called CLZ (count leading Zero's) that
- * could be used
- *
  * This is the ffs algorithm devised by d.seal and posted to comp.sys.arm on
  * 16 Feb 1994.
  */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r356106 - head/lib/msun/bsdsrc

2019-12-26 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 27 01:11:26 2019
New Revision: 356106
URL: https://svnweb.freebsd.org/changeset/base/356106

Log:
  msun: drop clause 3 from the Berkeley license.
  
  Per the University California Regents letter, drop the so-called
  "advertisement" clause.
  
  Discussed with:   bde, kargl (2017)
  Differential Revision:https://reviews.freebsd.org/D22928

Modified:
  head/lib/msun/bsdsrc/b_exp.c
  head/lib/msun/bsdsrc/b_log.c
  head/lib/msun/bsdsrc/b_tgamma.c

Modified: head/lib/msun/bsdsrc/b_exp.c
==
--- head/lib/msun/bsdsrc/b_exp.cFri Dec 27 00:49:49 2019
(r356105)
+++ head/lib/msun/bsdsrc/b_exp.cFri Dec 27 01:11:26 2019
(r356106)
@@ -1,5 +1,5 @@
 /*-
- * SPDX-License-Identifier: BSD-4-Clause
+ * SPDX-License-Identifier: BSD-3-Clause
  *
  * Copyright (c) 1985, 1993
  * The Regents of the University of California.  All rights reserved.
@@ -12,11 +12,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/lib/msun/bsdsrc/b_log.c
==
--- head/lib/msun/bsdsrc/b_log.cFri Dec 27 00:49:49 2019
(r356105)
+++ head/lib/msun/bsdsrc/b_log.cFri Dec 27 01:11:26 2019
(r356106)
@@ -1,5 +1,5 @@
 /*-
- * SPDX-License-Identifier: BSD-4-Clause
+ * SPDX-License-Identifier: BSD-3-Clause
  *
  * Copyright (c) 1992, 1993
  * The Regents of the University of California.  All rights reserved.
@@ -12,11 +12,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *

Modified: head/lib/msun/bsdsrc/b_tgamma.c
==
--- head/lib/msun/bsdsrc/b_tgamma.c Fri Dec 27 00:49:49 2019
(r356105)
+++ head/lib/msun/bsdsrc/b_tgamma.c Fri Dec 27 01:11:26 2019
(r356106)
@@ -1,5 +1,5 @@
 /*-
- * SPDX-License-Identifier: BSD-4-Clause
+ * SPDX-License-Identifier: BSD-3-Clause
  *
  * Copyright (c) 1992, 1993
  * The Regents of the University of California.  All rights reserved.
@@ -12,11 +12,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r356060 - head/usr.sbin/fstyp

2019-12-24 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 24 19:00:20 2019
New Revision: 356060
URL: https://svnweb.freebsd.org/changeset/base/356060

Log:
  sbin/fstyp: recgonize Dragonfly's hammer and hammer2.
  
  This is based on DragonFly's implementation from about 2019-09-13. It
  only contains the basic code and header information to identify the
  disks.
  
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D13369

Added:
  head/usr.sbin/fstyp/hammer.c   (contents, props changed)
  head/usr.sbin/fstyp/hammer2.c   (contents, props changed)
  head/usr.sbin/fstyp/hammer2_disk.h   (contents, props changed)
  head/usr.sbin/fstyp/hammer_disk.h   (contents, props changed)
Modified:
  head/usr.sbin/fstyp/Makefile
  head/usr.sbin/fstyp/fstyp.8
  head/usr.sbin/fstyp/fstyp.c
  head/usr.sbin/fstyp/fstyp.h

Modified: head/usr.sbin/fstyp/Makefile
==
--- head/usr.sbin/fstyp/MakefileTue Dec 24 18:38:06 2019
(r356059)
+++ head/usr.sbin/fstyp/MakefileTue Dec 24 19:00:20 2019
(r356060)
@@ -3,7 +3,8 @@
 .include 
 
 PROG=  fstyp
-SRCS=  apfs.c cd9660.c exfat.c ext2fs.c fstyp.c geli.c hfsplus.c msdosfs.c 
ntfs.c ufs.c
+SRCS=  apfs.c cd9660.c exfat.c ext2fs.c fstyp.c geli.c hammer.c\
+   hammer2.c hfsplus.c msdosfs.c ntfs.c ufs.c
 
 .if ${MK_ZFS} != "no"
 SRCS +=zfs.c

Modified: head/usr.sbin/fstyp/fstyp.8
==
--- head/usr.sbin/fstyp/fstyp.8 Tue Dec 24 18:38:06 2019(r356059)
+++ head/usr.sbin/fstyp/fstyp.8 Tue Dec 24 19:00:20 2019(r356060)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 26, 2017
+.Dd December 24, 2019
 .Dt FSTYP 8
 .Os
 .Sh NAME
@@ -67,6 +67,10 @@ exfat
 ext2fs
 .It
 geli
+.It
+hammer
+.It
+hammer2
 .It
 msdosfs
 .It

Modified: head/usr.sbin/fstyp/fstyp.c
==
--- head/usr.sbin/fstyp/fstyp.c Tue Dec 24 18:38:06 2019(r356059)
+++ head/usr.sbin/fstyp/fstyp.c Tue Dec 24 19:00:20 2019(r356060)
@@ -69,6 +69,8 @@ static struct {
{ "exfat", _exfat, false, EXFAT_ENC },
{ "ext2fs", _ext2fs, false, NULL },
{ "geli", _geli, true, NULL },
+   { "hammer", _hammer, true, NULL },
+   { "hammer2", _hammer2, true, NULL },
{ "hfs+", _hfsp, false, NULL },
{ "msdosfs", _msdosfs, false, NULL },
{ "ntfs", _ntfs, false, NTFS_ENC },

Modified: head/usr.sbin/fstyp/fstyp.h
==
--- head/usr.sbin/fstyp/fstyp.h Tue Dec 24 18:38:06 2019(r356059)
+++ head/usr.sbin/fstyp/fstyp.h Tue Dec 24 19:00:20 2019(r356060)
@@ -55,6 +55,8 @@ int   fstyp_cd9660(FILE *fp, char *label, size_t size);
 intfstyp_exfat(FILE *fp, char *label, size_t size);
 intfstyp_ext2fs(FILE *fp, char *label, size_t size);
 intfstyp_geli(FILE *fp, char *label, size_t size);
+intfstyp_hammer(FILE *fp, char *label, size_t size);
+intfstyp_hammer2(FILE *fp, char *label, size_t size);
 intfstyp_hfsp(FILE *fp, char *label, size_t size);
 intfstyp_msdosfs(FILE *fp, char *label, size_t size);
 intfstyp_ntfs(FILE *fp, char *label, size_t size);

Added: head/usr.sbin/fstyp/hammer.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/fstyp/hammer.cTue Dec 24 19:00:20 2019
(r356060)
@@ -0,0 +1,198 @@
+/*-
+ * Copyright (c) 2016 The DragonFly Project
+ * All rights reserved.
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 

svn commit: r355828 - head/sys/sys

2019-12-16 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Dec 16 23:55:30 2019
New Revision: 355828
URL: https://svnweb.freebsd.org/changeset/base/355828

Log:
  Double the size of ARG_MAX on LP64 platforms.
  
  As modern software keeps growing in size, we get requests to update the
  value of ARG_MAX in order to link the resulting object files. Other OSs
  have much higher values but Increasiong ARG_MAX has a multiplied effect on
  KVA, so just bumping this value is dangerous in some archs like ARM32 that
  can exhaust KVA rather easily.
  
  While it would be better to have a unique value for all archs, other OSs
  (Illumos in partidular) can have different ARG_MAX limits depending on the
  platform,  For now we want to be really conservative so we are avoidng
  the change on ILP32 and in the alternative case we only double it since that
  seems to work well enough for recent Code Aster.
  
  I was planning to bump the _FreeBSD_version but it was bumped recently
  (r355798) so we can reuse the 1300068 value for this change.
  
  PR:   241710
  MFC after:5 days

Modified:
  head/sys/sys/syslimits.h

Modified: head/sys/sys/syslimits.h
==
--- head/sys/sys/syslimits.hMon Dec 16 23:08:09 2019(r355827)
+++ head/sys/sys/syslimits.hMon Dec 16 23:55:30 2019(r355828)
@@ -48,7 +48,11 @@
  * Do not add any new variables here.  (See the comment at the end of
  * the file for why.)
  */
-#defineARG_MAX 262144  /* max bytes for an exec 
function */
+#ifndef __ILP32__
+#defineARG_MAX   (2 * 256 * 1024)  /* max bytes for an exec 
function */
+#else
+#defineARG_MAX   (256 * 1024)  /* max bytes for KVA-starved 
archs */
+#endif
 #ifndef CHILD_MAX
 #defineCHILD_MAX  40   /* max simultaneous processes */
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r355762 - head/sys/sys

2019-12-14 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Dec 15 01:56:56 2019
New Revision: 355762
URL: https://svnweb.freebsd.org/changeset/base/355762

Log:
  cdefs: use more accurate GCC version for the deprecated attribute.
  
  The message argument in the "deprecated" attribute was introduced in GCC 4.5 
*.
  Use the accurate version number for consistency, as done already with other
  attributes.
  
  * https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hSun Dec 15 01:26:57 2019(r355761)
+++ head/sys/sys/cdefs.hSun Dec 15 01:56:56 2019(r355762)
@@ -468,7 +468,7 @@
 #define__hidden
 #endif
 
-#if __GNUC__ > 4 || defined(__clang__)
+#if __GNUC_PREREQ__(4, 5) || defined(__clang__)
 #define__deprecated(m) __attribute__((__deprecated__(m)))
 #elif defined(__GNUC__)
 #define__deprecated(m) __attribute__((__deprecated__))
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r354924 - head/contrib/openresolv

2019-11-20 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Nov 20 23:56:20 2019
New Revision: 354924
URL: https://svnweb.freebsd.org/changeset/base/354924

Log:
  MFV 354917, 354918, 354919
  openresolv: update to version 3.9.2
  
  MFC after:3 weeks

Added:
  head/contrib/openresolv/LICENSE
 - copied unchanged from r354917, vendor/openresolv/dist/LICENSE
  head/contrib/openresolv/README.md
 - copied unchanged from r354917, vendor/openresolv/dist/README.md
Deleted:
  head/contrib/openresolv/README
Modified:
  head/contrib/openresolv/Makefile
  head/contrib/openresolv/configure
  head/contrib/openresolv/dnsmasq.in
  head/contrib/openresolv/libc.in
  head/contrib/openresolv/named.in
  head/contrib/openresolv/pdns_recursor.in
  head/contrib/openresolv/pdnsd.in
  head/contrib/openresolv/resolvconf.conf
  head/contrib/openresolv/resolvconf.conf.5.in
  head/contrib/openresolv/resolvconf.in
  head/contrib/openresolv/unbound.in
Directory Properties:
  head/contrib/openresolv/   (props changed)

Copied: head/contrib/openresolv/LICENSE (from r354917, 
vendor/openresolv/dist/LICENSE)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/openresolv/LICENSE Wed Nov 20 23:56:20 2019
(r354924, copy of r354917, vendor/openresolv/dist/LICENSE)
@@ -0,0 +1,23 @@
+Copyright (c) 2007-2019 Roy Marples 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

Modified: head/contrib/openresolv/Makefile
==
--- head/contrib/openresolv/MakefileWed Nov 20 23:49:47 2019
(r354923)
+++ head/contrib/openresolv/MakefileWed Nov 20 23:56:20 2019
(r354924)
@@ -10,6 +10,7 @@ SYSCONFDIR?=  /etc
 LIBEXECDIR?=   /libexec/resolvconf
 VARDIR?=   /var/run/resolvconf
 
+ECHO?= echo
 INSTALL?=  install
 SED?=  sed
 
@@ -20,7 +21,7 @@ DOCMODE?= 0644
 MANMODE?=  0444
 
 RESOLVCONF=resolvconf resolvconf.8 resolvconf.conf.5
-SUBSCRIBERS=   libc dnsmasq named pdnsd unbound
+SUBSCRIBERS=   libc dnsmasq named pdnsd pdns_recursor unbound
 TARGET=${RESOLVCONF} ${SUBSCRIBERS}
 SRCS=  ${TARGET:C,$,.in,} # pmake
 SRCS:= ${TARGET:=.in} # gmake
@@ -42,7 +43,7 @@ DISTINFOSIGN= ${DISTINFO}.asc
 CKSUM?=cksum -a SHA256
 PGP?=  netpgp
 
-FOSSILID?= current
+GITREF?=   HEAD
 
 .SUFFIXES: .in
 
@@ -79,15 +80,17 @@ maninstall:
 
 install: proginstall maninstall
 
-import:
+dist-git:
+   git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
+
+dist-inst:
+   mkdir /tmp/${DISTPREFIX}
+   cp -RPp * /tmp/${DISTPREFIX}
+   (cd /tmp/${DISTPREFIX}; make clean)
+   tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
rm -rf /tmp/${DISTPREFIX}
-   ${INSTALL} -d /tmp/${DISTPREFIX}
-   cp README ${SRCS} /tmp/${DISTPREFIX}
 
-dist:
-   fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
-   gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
-   rm ${DISTFILEGZ}
+dist: dist-git
 
 distinfo: dist
rm -f ${DISTINFO} ${DISTINFOSIGN}
@@ -96,3 +99,20 @@ distinfo: dist
${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
chmod 644 ${DISTINFOSIGN}
ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
+
+import: dist
+   rm -rf /tmp/${DISTPREFIX}
+   ${INSTALL} -d /tmp/${DISTPREFIX}
+   tar xvJpf ${DISTFILE} -C /tmp
+
+_import-src:
+   rm -rf ${DESTDIR}/*
+   ${INSTALL} -d ${DESTDIR}
+   cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR};
+   cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR};
+   @${ECHO}
+   @${ECHO} "="
+   

svn commit: r352054 - head/sys/dev/ral

2019-09-08 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Sep  9 03:31:46 2019
New Revision: 352054
URL: https://svnweb.freebsd.org/changeset/base/352054

Log:
  ral(4): Use unsigned to avoid undefined behavior.
  
  Found by NetBSD's kUBSan
  
  Obtained from:NetBSD (github 5b153f1)

Modified:
  head/sys/dev/ral/rt2860.c

Modified: head/sys/dev/ral/rt2860.c
==
--- head/sys/dev/ral/rt2860.c   Mon Sep  9 01:33:45 2019(r352053)
+++ head/sys/dev/ral/rt2860.c   Mon Sep  9 03:31:46 2019(r352054)
@@ -2220,7 +2220,7 @@ static void
 rt2860_enable_mrr(struct rt2860_softc *sc)
 {
 #define CCK(mcs)   (mcs)
-#define OFDM(mcs)  (1 << 3 | (mcs))
+#defineOFDM(mcs)   (1U << 3 | (mcs))
RAL_WRITE(sc, RT2860_LG_FBK_CFG0,
OFDM(6) << 28 | /* 54->48 */
OFDM(5) << 24 | /* 48->36 */
@@ -3325,7 +3325,7 @@ b4inc(uint32_t b32, int8_t delta)
b4 = 0;
else if (b4 > 0xf)
b4 = 0xf;
-   b32 = b32 >> 4 | b4 << 28;
+   b32 = b32 >> 4 | (uint32_t)b4 << 28;
}
return b32;
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r346310 - head/share/misc

2019-09-03 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 17 14:12:11 2019
New Revision: 346310
URL: https://svnweb.freebsd.org/changeset/base/346310

Log:
  Add myself to ports committers.
  
  Approved by: pfg (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotWed Apr 17 12:34:37 2019
(r346309)
+++ head/share/misc/committers-ports.dotWed Apr 17 14:12:11 2019
(r346310)
@@ -213,6 +213,7 @@ pat [label="Patrick Li\n...@freebsd.org\n2001/11/14"]
 pav [label="Pav Lucistnik\n...@freebsd.org\n2003/11/12"]
 pawel [label="Pawel Pekala\npa...@freebsd.org\n2011/03/11"]
 pclin [label="Po-Chien Lin\npc...@freebsd.org\n2013/02/11"]
+pfg [label="Pedro Giffuni\n...@freebsd.org\n2019/04/14"]
 pgj [label="Gabor Pali\n...@freebsd.org\n2009/04/12"]
 pgollucci [label="Philip M. Gollucci\npgollu...@freebsd.org\n2008/07/21"]
 philip [label="Philip Paeps\nphi...@freebsd.org\n2005/10/19"]
@@ -727,6 +728,7 @@ tcberner -> pkubaj
 
 thierry -> jadawin
 thierry -> riggs
+thierry -> pfg
 
 timur -> kbowling
 


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


svn commit: r346311 - head/share/misc

2019-09-03 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 17 14:20:55 2019
New Revision: 346311
URL: https://svnweb.freebsd.org/changeset/base/346311

Log:
  Add orphan mentee.

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Wed Apr 17 14:12:11 2019
(r346310)
+++ head/share/misc/committers-src.dot  Wed Apr 17 14:20:55 2019
(r346311)
@@ -743,6 +743,7 @@ obrien -> gshapiro
 obrien -> kan
 obrien -> sam
 
+pfg -> pstef
 pfg -> fsu
 
 peter -> asmodai


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


svn commit: r350969 - head/share/man/man4

2019-08-12 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug 13 01:24:43 2019
New Revision: 350969
URL: https://svnweb.freebsd.org/changeset/base/350969

Log:
  Add deprecation notice to snd_ds1(4).
  
  As suggested in:
  https://wiki.freebsd.org/WhatsGoing/FreeBSD13
  
  We will be dropping the snd_ds1 driver. The driver is known to be buggy
  and no one has been working on it for years now.
  Users of old Yamaha cards may have luck with the OSS drivers instead.
  
  MFC after:3 days
  Diferential Revision: https://reviews.freebsd.org/D21138

Modified:
  head/share/man/man4/snd_ds1.4

Modified: head/share/man/man4/snd_ds1.4
==
--- head/share/man/man4/snd_ds1.4   Mon Aug 12 23:44:03 2019
(r350968)
+++ head/share/man/man4/snd_ds1.4   Tue Aug 13 01:24:43 2019
(r350969)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 15, 2005
+.Dd August 12, 2019
 .Dt SND_DS1 4
 .Os
 .Sh NAME
@@ -68,5 +68,9 @@ The
 .Nm
 device driver first appeared in
 .Fx 4.1 .
+.Pp
+This driver will be removed in a future version of the
+.Fx base system.
+Users who require it may have better luck with the audio/oss port or package.
 .Sh AUTHORS
 .An Cameron Grant Aq Mt c...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r350970 - head/share/man/man4

2019-08-12 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug 13 01:25:07 2019
New Revision: 350970
URL: https://svnweb.freebsd.org/changeset/base/350970

Log:
  Add deprecation notice to snd_maestro(4).
  
  As suggested in:
  https://wiki.freebsd.org/WhatsGoing/FreeBSD13
  
  this old driver is buggy and no one is working on it so we should deprecate
  it for the next release.
  
  MFC after:3 days
  Diferential Revision: https://reviews.freebsd.org/D21139

Modified:
  head/share/man/man4/snd_maestro.4

Modified: head/share/man/man4/snd_maestro.4
==
--- head/share/man/man4/snd_maestro.4   Tue Aug 13 01:24:43 2019
(r350969)
+++ head/share/man/man4/snd_maestro.4   Tue Aug 13 01:25:07 2019
(r350970)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 15, 2005
+.Dd August 12, 2019
 .Dt SND_MAESTRO 4
 .Os
 .Sh NAME
@@ -73,6 +73,9 @@ The
 .Nm
 device driver first appeared in
 .Fx 4.2 .
+.Pp
+This driver will be removed in a future version of the
+.Fx base system.
 .Sh AUTHORS
 This manual page was written by
 .An Jorge Mario G. Mazo Aq Mt jguti...@eafit.edu.co .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348349 - in head: lib/libc/net sys/i386/i386

2019-05-28 Thread Pedro F. Giffuni
Author: pfg
Date: Wed May 29 02:08:23 2019
New Revision: 348349
URL: https://svnweb.freebsd.org/changeset/base/348349

Log:
  typo: suppported.

Modified:
  head/lib/libc/net/rthdr.c
  head/sys/i386/i386/initcpu.c

Modified: head/lib/libc/net/rthdr.c
==
--- head/lib/libc/net/rthdr.c   Wed May 29 02:03:08 2019(r348348)
+++ head/lib/libc/net/rthdr.c   Wed May 29 02:08:23 2019(r348349)
@@ -282,7 +282,7 @@ inet6_rth_space(int type, int segments)
return (((segments * 2) + 1) << 3);
/* FALLTHROUGH */
default:
-   return (0); /* type not suppported */
+   return (0); /* type not supported */
}
 }
 

Modified: head/sys/i386/i386/initcpu.c
==
--- head/sys/i386/i386/initcpu.cWed May 29 02:03:08 2019
(r348348)
+++ head/sys/i386/i386/initcpu.cWed May 29 02:08:23 2019
(r348349)
@@ -848,7 +848,7 @@ enable_K6_wt_alloc(void)
 */
/*
 * The AMD-K6 processer provides the 64-bit Test Register 12(TR12),
-* but only the Cache Inhibit(CI) (bit 3 of TR12) is suppported.
+* but only the Cache Inhibit(CI) (bit 3 of TR12) is supported.
 * All other bits in TR12 have no effect on the processer's operation.
 * The I/O Trap Restart function (bit 9 of TR12) is always enabled
 * on the AMD-K6.
@@ -898,7 +898,7 @@ enable_K6_2_wt_alloc(void)
 */
/*
 * The AMD-K6 processer provides the 64-bit Test Register 12(TR12),
-* but only the Cache Inhibit(CI) (bit 3 of TR12) is suppported.
+* but only the Cache Inhibit(CI) (bit 3 of TR12) is supported.
 * All other bits in TR12 have no effect on the processer's operation.
 * The I/O Trap Restart function (bit 9 of TR12) is always enabled
 * on the AMD-K6.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r346311 - head/share/misc

2019-04-17 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 17 14:20:55 2019
New Revision: 346311
URL: https://svnweb.freebsd.org/changeset/base/346311

Log:
  Add orphan mentee.

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Wed Apr 17 14:12:11 2019
(r346310)
+++ head/share/misc/committers-src.dot  Wed Apr 17 14:20:55 2019
(r346311)
@@ -743,6 +743,7 @@ obrien -> gshapiro
 obrien -> kan
 obrien -> sam
 
+pfg -> pstef
 pfg -> fsu
 
 peter -> asmodai
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r346310 - head/share/misc

2019-04-17 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 17 14:12:11 2019
New Revision: 346310
URL: https://svnweb.freebsd.org/changeset/base/346310

Log:
  Add myself to ports committers.
  
  Approved by: pfg (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotWed Apr 17 12:34:37 2019
(r346309)
+++ head/share/misc/committers-ports.dotWed Apr 17 14:12:11 2019
(r346310)
@@ -213,6 +213,7 @@ pat [label="Patrick Li\n...@freebsd.org\n2001/11/14"]
 pav [label="Pav Lucistnik\n...@freebsd.org\n2003/11/12"]
 pawel [label="Pawel Pekala\npa...@freebsd.org\n2011/03/11"]
 pclin [label="Po-Chien Lin\npc...@freebsd.org\n2013/02/11"]
+pfg [label="Pedro Giffuni\n...@freebsd.org\n2019/04/14"]
 pgj [label="Gabor Pali\n...@freebsd.org\n2009/04/12"]
 pgollucci [label="Philip M. Gollucci\npgollu...@freebsd.org\n2008/07/21"]
 philip [label="Philip Paeps\nphi...@freebsd.org\n2005/10/19"]
@@ -727,6 +728,7 @@ tcberner -> pkubaj
 
 thierry -> jadawin
 thierry -> riggs
+thierry -> pfg
 
 timur -> kbowling
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344042 - head/sys/vm

2019-02-11 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Feb 12 04:33:05 2019
New Revision: 344042
URL: https://svnweb.freebsd.org/changeset/base/344042

Log:
  UMA: unsign some variables related to allocation in hash_alloc().
  
  As a followup to r343673, unsign some variables related to allocation
  since the hashsize cannot be negative. This gives a bit more space to
  handle bigger allocations and avoid some implicit casting.
  
  While here also unsign uh_hashmask, it makes little sense to keep that
  signed.
  
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D19148

Modified:
  head/sys/vm/uma_core.c
  head/sys/vm/uma_int.h

Modified: head/sys/vm/uma_core.c
==
--- head/sys/vm/uma_core.c  Tue Feb 12 03:32:40 2019(r344041)
+++ head/sys/vm/uma_core.c  Tue Feb 12 04:33:05 2019(r344042)
@@ -622,7 +622,7 @@ zone_timeout(uma_zone_t zone)
 static int
 hash_alloc(struct uma_hash *hash)
 {
-   int oldsize;
+   u_int oldsize;
size_t alloc;
 
oldsize = hash->uh_hashsize;
@@ -666,8 +666,8 @@ static int
 hash_expand(struct uma_hash *oldhash, struct uma_hash *newhash)
 {
uma_slab_t slab;
-   int hval;
-   int i;
+   u_int hval;
+   u_int idx;
 
if (!newhash->uh_slab_hash)
return (0);
@@ -680,10 +680,10 @@ hash_expand(struct uma_hash *oldhash, struct uma_hash 
 * full rehash.
 */
 
-   for (i = 0; i < oldhash->uh_hashsize; i++)
-   while (!SLIST_EMPTY(>uh_slab_hash[i])) {
-   slab = SLIST_FIRST(>uh_slab_hash[i]);
-   SLIST_REMOVE_HEAD(>uh_slab_hash[i], us_hlink);
+   for (idx = 0; idx < oldhash->uh_hashsize; idx++)
+   while (!SLIST_EMPTY(>uh_slab_hash[idx])) {
+   slab = SLIST_FIRST(>uh_slab_hash[idx]);
+   SLIST_REMOVE_HEAD(>uh_slab_hash[idx], 
us_hlink);
hval = UMA_HASH(newhash, slab->us_data);
SLIST_INSERT_HEAD(>uh_slab_hash[hval],
slab, us_hlink);

Modified: head/sys/vm/uma_int.h
==
--- head/sys/vm/uma_int.h   Tue Feb 12 03:32:40 2019(r344041)
+++ head/sys/vm/uma_int.h   Tue Feb 12 04:33:05 2019(r344042)
@@ -179,8 +179,8 @@ SLIST_HEAD(slabhead, uma_slab);
 
 struct uma_hash {
struct slabhead *uh_slab_hash;  /* Hash table for slabs */
-   int uh_hashsize;/* Current size of the hash table */
-   int uh_hashmask;/* Mask used during hashing */
+   u_int   uh_hashsize;/* Current size of the hash table */
+   u_int   uh_hashmask;/* Mask used during hashing */
 };
 
 /*
@@ -453,7 +453,7 @@ static __inline uma_slab_t
 hash_sfind(struct uma_hash *hash, uint8_t *data)
 {
 uma_slab_t slab;
-int hval;
+u_int hval;
 
 hval = UMA_HASH(hash, data);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343459 - head/sys/fs/ext2fs

2019-01-25 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Jan 25 22:22:29 2019
New Revision: 343459
URL: https://svnweb.freebsd.org/changeset/base/343459

Log:
  ext2fs: Add some extra consistency checks for the superblock.
  
  Maliciously formed, or badly corrupted, filesystems can cause kernel
  panics.  In general, such acts of foot-shooting can only be accomplished
  by root, but in a world with VM images that is  moving towards automated
  mounts it is important to have some form of prevention.
  
  Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert
  of Fraunhofer FKIE.
  Incidentaly this should also fix a memory corruption issue reported by
  Dr Silvio Cesare of InfoSect.
  
  Huge thanks to all reseachers for making us aware of the issue.
  
  admbug:   872, 891
  Reviewed by:  fsu
  Obtained from:NetBSD (with minor changes)
  MFC after:3 days

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==
--- head/sys/fs/ext2fs/ext2_vfsops.cFri Jan 25 21:38:28 2019
(r343458)
+++ head/sys/fs/ext2fs/ext2_vfsops.cFri Jan 25 22:22:29 2019
(r343459)
@@ -416,7 +416,16 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es
es->e3fs_desc_size);
return (EINVAL);
}
+   /* Check for block size = 1K|2K|4K */
+   if (es->e2fs_log_bsize > 2) {
+   printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize);
+   return (EINVAL);
+   }
/* Check for group size */
+   if (fs->e2fs_bpg == 0) {
+   printf("ext2fs: zero blocks per group\n");
+   return (EINVAL);
+   }
if (fs->e2fs_bpg != fs->e2fs_bsize * 8) {
printf("ext2fs: non-standard group size unsupported %d\n",
fs->e2fs_bpg);
@@ -424,7 +433,21 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es
}
 
fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs);
+   if (fs->e2fs_ipg == 0) {
+   printf("ext2fs: zero inodes per group\n");
+   return (EINVAL);
+   }
fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb;
+   /* Check for block consistency */
+   if (es->e2fs_first_dblock >= fs->e2fs_bcount) {
+   printf("ext2fs: invalid first data block\n");
+   return (EINVAL);
+   }
+   if (fs->e2fs_rbcount > fs->e2fs_bcount ||
+   fs->e2fs_fbcount > fs->e2fs_bcount) {
+   printf("ext2fs: invalid block count\n");
+   return (EINVAL);
+   }
/* s_resuid / s_resgid ? */
fs->e2fs_gcount = howmany(fs->e2fs_bcount - es->e2fs_first_dblock,
EXT2_BLOCKS_PER_GROUP(fs));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r343023 - head/lib/msun/src

2019-01-14 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 14 15:48:35 2019
New Revision: 343023
URL: https://svnweb.freebsd.org/changeset/base/343023

Log:
  msun: reduce diff between src/e_j0.c and src/e_j0f.c
  
  PR:   229501
  MFC after:1 week

Modified:
  head/lib/msun/src/e_j0.c
  head/lib/msun/src/e_j0f.c

Modified: head/lib/msun/src/e_j0.c
==
--- head/lib/msun/src/e_j0.cMon Jan 14 09:57:36 2019(r343022)
+++ head/lib/msun/src/e_j0.cMon Jan 14 15:48:35 2019(r343023)
@@ -80,7 +80,7 @@ S02  =  1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xD
 S03  =  5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */
 S04  =  1.166140079205e-09; /* 0x3E1408BC, 0xF4745D8F */
 
-static const double zero = 0.0;
+static const double zero = 0, qrtr = 0.25;
 
 double
 __ieee754_j0(double x)
@@ -97,7 +97,7 @@ __ieee754_j0(double x)
c = cos(x);
ss = s-c;
cc = s+c;
-   if(ix<0x7fe0) {  /* make sure x+x not overflow */
+   if(ix<0x7fe0) {  /* Make sure x+x does not overflow. */
z = -cos(x+x);
if ((s*c)https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342910 - head/gnu/usr.bin/grep

2019-01-09 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Jan 10 02:59:19 2019
New Revision: 342910
URL: https://svnweb.freebsd.org/changeset/base/342910

Log:
  grep(1) outputs NOT-matched lines with multi-byte characters
  
  PR113343
  MFC after:2 months

Modified:
  head/gnu/usr.bin/grep/search.c

Modified: head/gnu/usr.bin/grep/search.c
==
--- head/gnu/usr.bin/grep/search.c  Thu Jan 10 02:01:20 2019
(r342909)
+++ head/gnu/usr.bin/grep/search.c  Thu Jan 10 02:59:19 2019
(r342910)
@@ -401,9 +401,12 @@ EGexecute (char const *buf, size_t size, size_t *match
}
 
  if (mlen == (size_t) -2)
-   /* Offset points inside multibyte character:
-* no good. */
-   break;
+   {
+ /* Offset points inside multibyte character:
+  * no good. */
+ memset (, '\0', sizeof (mbstate_t));
+ break;
+   }
 
  beg += mlen;
  bytes_left -= mlen;
@@ -463,9 +466,12 @@ EGexecute (char const *buf, size_t size, size_t *match
}
 
  if (mlen == (size_t) -2)
-   /* Offset points inside multibyte character:
-* no good. */
-   break;
+   {
+ /* Offset points inside multibyte character:
+  * no good. */
+ memset (, '\0', sizeof (mbstate_t));
+ break;
+   }
 
  beg += mlen;
  bytes_left -= mlen;
@@ -926,15 +932,21 @@ Fexecute (char const *buf, size_t size, size_t *match_
}
 
  if (mlen == (size_t) -2)
-   /* Offset points inside multibyte character: no good. */
-   break;
+   {
+ /* Offset points inside multibyte character: no good. */
+ memset (, '\0', sizeof (mbstate_t));
+ break;
+   }
 
  beg += mlen;
  bytes_left -= mlen;
}
 
  if (bytes_left)
-   continue;
+   {
+ beg += bytes_left;
+ continue;
+   }
}
   else
 #endif /* MBS_SUPPORT */
@@ -1052,6 +1064,7 @@ Fexecute (char const *buf, size_t size, size_t *match_
{
  /* Offset points inside multibyte character:
   * no good. */
+ memset (, '\0', sizeof (mbstate_t));
  break;
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342851 - head/lib/msun/src

2019-01-07 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan  7 17:35:09 2019
New Revision: 342851
URL: https://svnweb.freebsd.org/changeset/base/342851

Log:
  pow(3): Workaround possible signed shift Undefined Behavior.
  
  j is int32_t and thus j<<31 is undefined if j==1.
  
  Hinted by:muusl-lib (git 688d3da0f1730daddbc954bbc2d27cc96ceee04c)
  Discussed with:   freebsd-numerics (kargl)

Modified:
  head/lib/msun/src/e_pow.c

Modified: head/lib/msun/src/e_pow.c
==
--- head/lib/msun/src/e_pow.c   Mon Jan  7 16:36:45 2019(r342850)
+++ head/lib/msun/src/e_pow.c   Mon Jan  7 17:35:09 2019(r342851)
@@ -133,7 +133,7 @@ __ieee754_pow(double x, double y)
k = (iy>>20)-0x3ff;/* exponent */
if(k>20) {
j = ly>>(52-k);
-   if((j<<(52-k))==ly) yisint = 2-(j&1);
+   if(((u_int32_t)j<<(52-k))==ly) yisint = 2-(j&1);
} else if(ly==0) {
j = iy>>(20-k);
if((j<<(20-k))==iy) yisint = 2-(j&1);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342651 - in head/lib/msun: ld128 src

2018-12-31 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Dec 31 15:43:06 2018
New Revision: 342651
URL: https://svnweb.freebsd.org/changeset/base/342651

Log:
  msun: Fix some old typos.
  
  Seen in a posting from July 27 by "CM Graff" in musl-libc.

Modified:
  head/lib/msun/ld128/e_powl.c
  head/lib/msun/src/k_rem_pio2.c

Modified: head/lib/msun/ld128/e_powl.c
==
--- head/lib/msun/ld128/e_powl.cMon Dec 31 12:07:17 2018
(r342650)
+++ head/lib/msun/ld128/e_powl.cMon Dec 31 15:43:06 2018
(r342651)
@@ -32,7 +32,7 @@
  * 1. Compute and return log2(x) in two pieces:
  * log2(x) = w1 + w2,
  *where w1 has 113-53 = 60 bit trailing zeros.
- * 2. Perform y*log2(x) = n+y' by simulating muti-precision
+ * 2. Perform y*log2(x) = n+y' by simulating multi-precision
  *arithmetic, where |y'|<=0.5.
  * 3. Return x**y = 2**n*exp(y'*log2)
  *

Modified: head/lib/msun/src/k_rem_pio2.c
==
--- head/lib/msun/src/k_rem_pio2.c  Mon Dec 31 12:07:17 2018
(r342650)
+++ head/lib/msun/src/k_rem_pio2.c  Mon Dec 31 15:43:06 2018
(r342651)
@@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
  * 64-bit  precision   2
  * 113-bit precision   3
  * The actual value is the sum of them. Thus for 113-bit
- * precison, one may have to do something like:
+ * precision, one may have to do something like:
  *
  * long double t,w,r_head, r_tail;
  * t = (long double)y[2] + (long double)y[1];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342632 - head/share/man/man5

2018-12-30 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Dec 30 19:44:50 2018
New Revision: 342632
URL: https://svnweb.freebsd.org/changeset/base/342632

Log:
  ext2fs.5: Update the manpage.
  
  General update of the driver description and mention some important credits.
  Add a symlink for ext4fs as it is of special interest nowadays.
  
  Fic some `mandoc -Tlint` issues while here.
  
  MFC after:15 days
  Differential Revision:https://reviews.freebsd.org/D18445

Modified:
  head/share/man/man5/Makefile
  head/share/man/man5/ext2fs.5

Modified: head/share/man/man5/Makefile
==
--- head/share/man/man5/MakefileSun Dec 30 16:39:26 2018
(r342631)
+++ head/share/man/man5/MakefileSun Dec 30 19:44:50 2018
(r342632)
@@ -71,6 +71,7 @@ MAN=  acct.5 \
tmpfs.5
 
 MLINKS=dir.5 dirent.5
+MLINKS+=ext2fs.5 ext4fs.5
 MLINKS+=fs.5 inode.5
 MLINKS+=hosts.equiv.5 rhosts.5
 MLINKS+=msdosfs.5 msdos.5

Modified: head/share/man/man5/ext2fs.5
==
--- head/share/man/man5/ext2fs.5Sun Dec 30 16:39:26 2018
(r342631)
+++ head/share/man/man5/ext2fs.5Sun Dec 30 19:44:50 2018
(r342632)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 4, 2018
+.Dd December 30, 2018
 .Dt EXT2FS 5
 .Os
 .Sh NAME
@@ -47,13 +47,15 @@ The
 driver will permit the
 .Fx
 kernel to access
-.Tn ext2 ,
-.Tn ext3 ,
+ext2
+file systems and its derivatives.
+It currently implements most of the features required by
+.Em ext3
 and
-.Tn ext4
+.Em ext4
 file systems.
 Support for Extended Attributes in
-.Tn ext4
+.Em ext4
 is experimental.
 Journalling and encryption are currently not supported.
 .Sh EXAMPLES
@@ -77,14 +79,28 @@ driver first appeared in
 .An -nosplit
 The
 .Nm
-kernel implementation was written by
+kernel implementation is derived from code written,
+or modified,
+by
 .An Godmar Back
-or modified by him using the CSRG sources.
+using the UFS CSRG sources for CMU Mach.
 .Pp
 .An John Dyson
-and others in the
+did the initial port to
+.Fx .
+.An Aditya Sarawgi
+merged important parts of the allocation code from a clean-room
+.Nx
+implementation.
+.An Zheng Liu
+and
+.An Fedor Upurov
+implemented the read and write support respectively for
+.Em ext4
+filesystems.
+The
 .Fx
-Project made modifications.
+community has contributed a huge amount of modifications.
 .Pp
-This manual page was written by
+The initial version of this manual page was written by
 .An Craig Rodrigues Aq Mt rodr...@freebsd.org .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342383 - head/include

2018-12-23 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Dec 23 20:51:13 2018
New Revision: 342383
URL: https://svnweb.freebsd.org/changeset/base/342383

Log:
  Fix mismatch from r342379.

Modified:
  head/include/netdb.h

Modified: head/include/netdb.h
==
--- head/include/netdb.hSun Dec 23 19:14:31 2018(r342382)
+++ head/include/netdb.hSun Dec 23 20:51:13 2018(r342383)
@@ -168,7 +168,7 @@ struct addrinfo {
 #defineEAI_AGAIN2  /* name could not be resolved at this 
time */
 #defineEAI_BADFLAGS 3  /* flags parameter had an invalid value 
*/
 #defineEAI_FAIL 4  /* non-recoverable failure in name 
resolution */
-#defineEAI_FAMILY   5  /* address family was recognized */
+#defineEAI_FAMILY   5  /* address family not recognized */
 #defineEAI_MEMORY   6  /* memory allocation failure */
 #if 0
 /* Obsoleted on RFC 2553bis-02 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r342379 - in head: include lib/libc/net

2018-12-23 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Dec 23 18:15:48 2018
New Revision: 342379
URL: https://svnweb.freebsd.org/changeset/base/342379

Log:
  gai_strerror() - Update string error messages according to RFC 3493.
  
  Error messages in gai_strerror(3) vary largely among OSs.
  
  For new software we largely replaced the obsoleted EAI_NONAME and
  with EAI_NODATA but we never updated the corresponding message to better
  match the intended use. We also have references to ai_flags and ai_family
  which are not very descriptive for non-developer end users.
  
  Bring new new error messages based on informational RFC 3493, which has
  obsoleted RFC 2553, and make them consistent among the header adn
  manpage.
  
  MFC after:1 month
  Differentical Revision:   D18630

Modified:
  head/include/netdb.h
  head/lib/libc/net/gai_strerror.3
  head/lib/libc/net/gai_strerror.c

Modified: head/include/netdb.h
==
--- head/include/netdb.hSun Dec 23 09:48:36 2018(r342378)
+++ head/include/netdb.hSun Dec 23 18:15:48 2018(r342379)
@@ -159,24 +159,24 @@ struct addrinfo {
 #defineNO_ADDRESS  NO_DATA /* no address, look for MX 
record */
 
 /*
- * Error return codes from getaddrinfo()
+ * Error return codes from gai_strerror(3), see RFC 3493.
  */
 #if 0
-/* obsoleted */
+/* Obsoleted on RFC 2553bis-02 */
 #defineEAI_ADDRFAMILY   1  /* address family for hostname not 
supported */
 #endif
-#defineEAI_AGAIN2  /* temporary failure in name resolution 
*/
-#defineEAI_BADFLAGS 3  /* invalid value for ai_flags */
+#defineEAI_AGAIN2  /* name could not be resolved at this 
time */
+#defineEAI_BADFLAGS 3  /* flags parameter had an invalid value 
*/
 #defineEAI_FAIL 4  /* non-recoverable failure in name 
resolution */
-#defineEAI_FAMILY   5  /* ai_family not supported */
+#defineEAI_FAMILY   5  /* address family was recognized */
 #defineEAI_MEMORY   6  /* memory allocation failure */
 #if 0
-/* obsoleted */
+/* Obsoleted on RFC 2553bis-02 */
 #defineEAI_NODATA   7  /* no address associated with hostname 
*/
 #endif
-#defineEAI_NONAME   8  /* hostname nor servname provided, or 
not known */
-#defineEAI_SERVICE  9  /* servname not supported for 
ai_socktype */
-#defineEAI_SOCKTYPE10  /* ai_socktype not supported */
+#defineEAI_NONAME   8  /* name does not resolve */
+#defineEAI_SERVICE  9  /* service not recognized for socket 
type */
+#defineEAI_SOCKTYPE10  /* intended socket type was not 
recognized */
 #defineEAI_SYSTEM  11  /* system error returned in errno */
 #defineEAI_BADHINTS12  /* invalid value for hints */
 #defineEAI_PROTOCOL13  /* resolved protocol is unknown */

Modified: head/lib/libc/net/gai_strerror.3
==
--- head/lib/libc/net/gai_strerror.3Sun Dec 23 09:48:36 2018
(r342378)
+++ head/lib/libc/net/gai_strerror.3Sun Dec 23 18:15:48 2018
(r342379)
@@ -18,7 +18,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 21, 2006
+.Dd December 23, 2018
 .Dt GAI_STRERROR 3
 .Os
 .Sh NAME
@@ -44,38 +44,30 @@ The following error codes and their meaning are define
 .Pp
 .Bl -tag -width ".Dv EAI_BADFLAGS" -offset indent -compact
 .It Dv EAI_AGAIN
-temporary failure in name resolution
+Name could not be resolved at this time
 .It Dv EAI_BADFLAGS
-invalid value for
-.Fa ai_flags
+flags parameter had an invalid value
 .It Dv EAI_BADHINTS
 invalid value for
 .Fa hints
 .It Dv EAI_FAIL
-non-recoverable failure in name resolution
+Non-recoverable failure in name resolution
 .It Dv EAI_FAMILY
-.Fa ai_family
-not supported
+Address family was not recognized
 .It Dv EAI_MEMORY
-memory allocation failure
+Memory allocation failure
 .It Dv EAI_NONAME
-.Fa hostname
-or
-.Fa servname
-not provided, or not known
+Name does not resolve
 .It Dv EAI_OVERFLOW
 argument buffer overflow
 .It Dv EAI_PROTOCOL
-resolved protocol is unknown
+Resolved protocol is unknown
 .It Dv EAI_SERVICE
-.Fa servname
-not supported for
-.Fa ai_socktype
+Service was not recognized for socket type
 .It Dv EAI_SOCKTYPE
-.Fa ai_socktype
-not supported
+Intended socket type was not recognized
 .It Dv EAI_SYSTEM
-system error returned in
+System error returned in
 .Va errno
 .El
 .Sh RETURN VALUES
@@ -90,3 +82,8 @@ is out of range, an implementation-specific error mess
 .Sh SEE ALSO
 .Xr getaddrinfo 3 ,
 .Xr getnameinfo 3
+.Sh STANDARDS
+.Bl -tag -width ".It RFC 2743"
+.It RFC 3493
+Basic Socket Interface Extensions for IPv6
+.El

Modified: head/lib/libc/net/gai_strerror.c
==
--- 

svn commit: r341505 - head/share/man/man5

2018-12-04 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec  4 22:51:13 2018
New Revision: 341505
URL: https://svnweb.freebsd.org/changeset/base/341505

Log:
  ext2fs.4: basic updates.
  
  Starting with FreeBSD 12 we fully support writing ext4 filesystems.
  Mention some features that we don't support while here.
  
  MFC after:3 days

Modified:
  head/share/man/man5/ext2fs.5

Modified: head/share/man/man5/ext2fs.5
==
--- head/share/man/man5/ext2fs.5Tue Dec  4 22:46:58 2018
(r341504)
+++ head/share/man/man5/ext2fs.5Tue Dec  4 22:51:13 2018
(r341505)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2016
+.Dd December 4, 2018
 .Dt EXT2FS 5
 .Os
 .Sh NAME
@@ -52,9 +52,10 @@ kernel to access
 and
 .Tn ext4
 file systems.
-The
+Support for Extended Attributes in
 .Tn ext4
-support is read-only.
+is experimental.
+Journalling and encryption are currently not supported.
 .Sh EXAMPLES
 To mount a
 .Nm
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r338125 - head/lib/libthr/thread

2018-08-20 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug 21 01:33:25 2018
New Revision: 338125
URL: https://svnweb.freebsd.org/changeset/base/338125

Log:
  libthr: minor spacing cleanup.
  
  No functional change.
  
  X-MFC with:   r337992

Modified:
  head/lib/libthr/thread/thr_attr.c

Modified: head/lib/libthr/thread/thr_attr.c
==
--- head/lib/libthr/thread/thr_attr.c   Tue Aug 21 01:17:28 2018
(r338124)
+++ head/lib/libthr/thread/thr_attr.c   Tue Aug 21 01:33:25 2018
(r338125)
@@ -199,8 +199,8 @@ _pthread_attr_getdetachstate(const pthread_attr_t *att
 __weak_reference(_pthread_attr_getguardsize, pthread_attr_getguardsize);
 
 int
-_pthread_attr_getguardsize(const pthread_attr_t *__restrict attr,
-size_t *__restrict guardsize)
+_pthread_attr_getguardsize(const pthread_attr_t * __restrict attr,
+size_t * __restrict guardsize)
 {
int ret;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r337992 - in head: include lib/libthr/thread share/man/man3

2018-08-17 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Aug 18 01:05:38 2018
New Revision: 337992
URL: https://svnweb.freebsd.org/changeset/base/337992

Log:
  POSIX compliance improvements in the pthread(3) functions.
  
  This basically adds makes use of the C99 restrict keyword, and also
  adds some 'const's to four threading functions: pthread_mutexattr_gettype(),
  pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and
  pthread_mutex_getprioceiling. The changes are in accordance to 
POSIX/SUSv4-2018.
  
  Hinted by:DragonFlyBSD
  
  Relnotes: yes
  MFC after:1 month
  Differential Revision:D16722

Modified:
  head/include/pthread.h
  head/lib/libthr/thread/thr_attr.c
  head/lib/libthr/thread/thr_barrier.c
  head/lib/libthr/thread/thr_barrierattr.c
  head/lib/libthr/thread/thr_cond.c
  head/lib/libthr/thread/thr_condattr.c
  head/lib/libthr/thread/thr_create.c
  head/lib/libthr/thread/thr_getschedparam.c
  head/lib/libthr/thread/thr_mutex.c
  head/lib/libthr/thread/thr_mutexattr.c
  head/lib/libthr/thread/thr_rwlock.c
  head/lib/libthr/thread/thr_rwlockattr.c
  head/share/man/man3/pthread.3
  head/share/man/man3/pthread_attr.3
  head/share/man/man3/pthread_barrier_destroy.3
  head/share/man/man3/pthread_barrierattr.3
  head/share/man/man3/pthread_cond_init.3
  head/share/man/man3/pthread_cond_wait.3
  head/share/man/man3/pthread_create.3
  head/share/man/man3/pthread_mutex_init.3
  head/share/man/man3/pthread_mutex_timedlock.3
  head/share/man/man3/pthread_mutexattr.3
  head/share/man/man3/pthread_rwlock_init.3
  head/share/man/man3/pthread_rwlock_timedrdlock.3
  head/share/man/man3/pthread_rwlock_timedwrlock.3
  head/share/man/man3/pthread_rwlockattr_getpshared.3
  head/share/man/man3/pthread_schedparam.3

Modified: head/include/pthread.h
==
--- head/include/pthread.h  Fri Aug 17 21:19:18 2018(r337991)
+++ head/include/pthread.h  Sat Aug 18 01:05:38 2018(r337992)
@@ -153,10 +153,10 @@ int   pthread_attr_destroy(pthread_attr_t *);
 intpthread_attr_getstack(
const pthread_attr_t * __restrict, void ** __restrict,
size_t * __restrict);
-intpthread_attr_getstacksize(const pthread_attr_t *,
-   size_t *);
-intpthread_attr_getguardsize(const pthread_attr_t *,
-   size_t *);
+intpthread_attr_getstacksize(const pthread_attr_t * __restrict,
+   size_t * __restrict);
+intpthread_attr_getguardsize(const pthread_attr_t * __restrict,
+   size_t * __restrict);
 intpthread_attr_getstackaddr(const pthread_attr_t *, void **);
 intpthread_attr_getdetachstate(const pthread_attr_t *,
int *);
@@ -168,12 +168,12 @@ int   pthread_attr_setstack(pthread_attr_t *, 
void *,
 intpthread_attr_setstackaddr(pthread_attr_t *, void *);
 intpthread_attr_setdetachstate(pthread_attr_t *, int);
 intpthread_barrier_destroy(pthread_barrier_t *);
-intpthread_barrier_init(pthread_barrier_t *,
-   const pthread_barrierattr_t *, unsigned);
+intpthread_barrier_init(pthread_barrier_t * __restrict,
+   const pthread_barrierattr_t * __restrict, unsigned);
 intpthread_barrier_wait(pthread_barrier_t *);
 intpthread_barrierattr_destroy(pthread_barrierattr_t *);
 intpthread_barrierattr_getpshared(
-   const pthread_barrierattr_t *, int *);
+   const pthread_barrierattr_t * __restrict, int * __restrict);
 intpthread_barrierattr_init(pthread_barrierattr_t *);
 intpthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
 
@@ -191,24 +191,27 @@ int   
pthread_barrierattr_setpshared(pthread_barrieratt
}
 
 intpthread_condattr_destroy(pthread_condattr_t *);
-intpthread_condattr_getclock(const pthread_condattr_t *,
-   clockid_t *);
+intpthread_condattr_getclock(const pthread_condattr_t * __restrict,
+   clockid_t * __restrict);
 intpthread_condattr_getpshared(const pthread_condattr_t *, int *);
 intpthread_condattr_init(pthread_condattr_t *);
 intpthread_condattr_setclock(pthread_condattr_t *, clockid_t);
 intpthread_condattr_setpshared(pthread_condattr_t *, int);
 intpthread_cond_broadcast(pthread_cond_t *);
 intpthread_cond_destroy(pthread_cond_t *);
-intpthread_cond_init(pthread_cond_t *, const pthread_condattr_t *);
+intpthread_cond_init(pthread_cond_t * __restrict,
+   const pthread_condattr_t * __restrict);
 intpthread_cond_signal(pthread_cond_t *);
 intpthread_cond_timedwait(pthread_cond_t *,
   

svn commit: r337920 - head/usr.bin/sed

2018-08-16 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Aug 16 18:35:39 2018
New Revision: 337920
URL: https://svnweb.freebsd.org/changeset/base/337920

Log:
  Revert r337419.
  
  The fix is only partial and causes an asymmetry which breaks a test in
  multi_test.sh.
  
  We should consider both parts of the issue found in OpenBSD[1], but for now
  just revert the change.
  
  [1] http://undeadly.org/cgi?action=article;sid=20180728110010
  
  Reported by: asomers

Modified:
  head/usr.bin/sed/compile.c

Modified: head/usr.bin/sed/compile.c
==
--- head/usr.bin/sed/compile.c  Thu Aug 16 18:30:49 2018(r337919)
+++ head/usr.bin/sed/compile.c  Thu Aug 16 18:35:39 2018(r337920)
@@ -393,11 +393,11 @@ compile_delimited(char *p, char *d, int is_tr)
if ((d = compile_ccl(, d)) == NULL)
errx(1, "%lu: %s: unbalanced brackets ([])", 
linenum, fname);
continue;
-   } else if (*p == '\\' && p[1] == c) {
-   p++;
} else if (*p == '\\' && p[1] == '[') {
*d++ = *p++;
-   } else if (*p == '\\' && p[1] == 'n') {
+   } else if (*p == '\\' && p[1] == c)
+   p++;
+   else if (*p == '\\' && p[1] == 'n') {
*d++ = '\n';
p += 2;
continue;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r337458 - head/usr.bin/printf

2018-08-08 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Aug  8 15:25:01 2018
New Revision: 337458
URL: https://svnweb.freebsd.org/changeset/base/337458

Log:
  Fix printf(1) ignores width and precision in %b format.
  
  The precision with the conversion specifier b is specified by POSIX: see
  point 7 in the reference documentation.
  
  This corrects previous wrong log in r337440.
  
  Reference: 
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html
  
  PR:   229641
  Reported by:  Rudolf Cejka
  Submitted by: Garrett D'Amore (illumos)
  MFC after:1 week

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cWed Aug  8 15:12:32 2018
(r337457)
+++ head/usr.bin/printf/printf.cWed Aug  8 15:25:01 2018
(r337458)
@@ -1,6 +1,7 @@
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
  *
+ * Copyright 2018 Staysail Systems, Inc. 
  * Copyright 2014 Garrett D'Amore 
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 1989, 1993
@@ -375,16 +376,19 @@ printf_doformat(char *fmt, int *rval)
char *p;
int getout;
 
-   p = strdup(getstr());
-   if (p == NULL) {
+   /* Convert "b" to "s" for output. */
+   start[strlen(start) - 1] = 's';
+   if ((p = strdup(getstr())) == NULL) {
warnx("%s", strerror(ENOMEM));
return (NULL);
}
getout = escape(p, 0, );
-   fputs(p, stdout);
+   PF(start, p);
+   /* Restore format for next loop. */
+
free(p);
if (getout)
-   return (end_fmt);
+   exit(*rval);
break;
}
case 'c': {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r337457 - head/usr.bin/printf

2018-08-08 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Aug  8 15:12:32 2018
New Revision: 337457
URL: https://svnweb.freebsd.org/changeset/base/337457

Log:
  Revert r337440: the log message is wrong.

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cWed Aug  8 15:08:22 2018
(r337456)
+++ head/usr.bin/printf/printf.cWed Aug  8 15:12:32 2018
(r337457)
@@ -1,7 +1,6 @@
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
  *
- * Copyright 2018 Staysail Systems, Inc. 
  * Copyright 2014 Garrett D'Amore 
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 1989, 1993
@@ -376,19 +375,16 @@ printf_doformat(char *fmt, int *rval)
char *p;
int getout;
 
-   /* Convert "b" to "s" for output. */
-   start[strlen(start) - 1] = 's';
-   if ((p = strdup(getstr())) == NULL) {
+   p = strdup(getstr());
+   if (p == NULL) {
warnx("%s", strerror(ENOMEM));
return (NULL);
}
getout = escape(p, 0, );
-   PF(start, p);
-   /* Restore format for next loop. */
-
+   fputs(p, stdout);
free(p);
if (getout)
-   exit(*rval);
+   return (end_fmt);
break;
}
case 'c': {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r337456 - head/sys/fs/msdosfs

2018-08-08 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Aug  8 15:08:22 2018
New Revision: 337456
URL: https://svnweb.freebsd.org/changeset/base/337456

Log:
  msdosfs: fixes for Undefined Behavior.
  
  These were found by the Undefined Behaviour GsoC project at NetBSD:
  
  Do not change signedness bit with left shift.
  While there avoid signed integer overflow.
  Address both issues with using unsigned type.
  
  msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be
  represented in type 'int [20]'
  msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented
  in type 'int'
  msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be
  represented in type 'int [20]'
  
  Detected with micro-UBSan in the user mode.
  
  Hinted from:  NetBSD (CVS 1.33)
  MFC after:2 weeks
  Differenctial Revision:   https://reviews.freebsd.org/D16615

Modified:
  head/sys/fs/msdosfs/msdosfs_fat.c

Modified: head/sys/fs/msdosfs/msdosfs_fat.c
==
--- head/sys/fs/msdosfs/msdosfs_fat.c   Wed Aug  8 13:36:49 2018
(r337455)
+++ head/sys/fs/msdosfs/msdosfs_fat.c   Wed Aug  8 15:08:22 2018
(r337456)
@@ -391,7 +391,7 @@ usemap_alloc(struct msdosfsmount *pmp, u_long cn)
KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS)))
== 0, ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS,
(unsigned)pmp->pm_inusemap[cn / N_INUSEBITS]));
-   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS);
+   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS);
KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little"));
pmp->pm_freeclustercount--;
pmp->pm_flags |= MSDOSFS_FSIMOD;
@@ -412,7 +412,7 @@ usemap_free(struct msdosfsmount *pmp, u_long cn)
KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS)))
!= 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS,
(unsigned)pmp->pm_inusemap[cn / N_INUSEBITS]));
-   pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS));
+   pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS));
 }
 
 int
@@ -775,7 +775,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, 
for (cn = newst; cn <= pmp->pm_maxcluster;) {
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
-   map |= (1 << (cn % N_INUSEBITS)) - 1;
+   map |= (1U << (cn % N_INUSEBITS)) - 1;
if (map != FULL_RUN) {
cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
@@ -792,7 +792,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, 
for (cn = 0; cn < newst;) {
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
-   map |= (1 << (cn % N_INUSEBITS)) - 1;
+   map |= (1U << (cn % N_INUSEBITS)) - 1;
if (map != FULL_RUN) {
cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
@@ -950,7 +950,7 @@ fillinusemap(struct msdosfsmount *pmp)
 
for (cn = pmp->pm_maxcluster + 1; cn < (pmp->pm_maxcluster +
N_INUSEBITS) / N_INUSEBITS; cn++)
-   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS);
+   pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS);
 
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r337440 - head/usr.bin/printf

2018-08-07 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug  7 23:03:50 2018
New Revision: 337440
URL: https://svnweb.freebsd.org/changeset/base/337440

Log:
  Fix printf(1) ignores width and precision in %b format.
  
  The precision with behavior is "unspecified" by POSIX (as of 2018), but
  most implementations seem to have taken it to be treated the same as for
  "s"; applied after the unescaping.
  Adopt the same treatment on our printf.
  
  PR:   229641
  Submitted by: Garrett D'Amore (illumos)

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cTue Aug  7 22:13:03 2018
(r337439)
+++ head/usr.bin/printf/printf.cTue Aug  7 23:03:50 2018
(r337440)
@@ -1,6 +1,7 @@
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
  *
+ * Copyright 2018 Staysail Systems, Inc. 
  * Copyright 2014 Garrett D'Amore 
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 1989, 1993
@@ -375,16 +376,19 @@ printf_doformat(char *fmt, int *rval)
char *p;
int getout;
 
-   p = strdup(getstr());
-   if (p == NULL) {
+   /* Convert "b" to "s" for output. */
+   start[strlen(start) - 1] = 's';
+   if ((p = strdup(getstr())) == NULL) {
warnx("%s", strerror(ENOMEM));
return (NULL);
}
getout = escape(p, 0, );
-   fputs(p, stdout);
+   PF(start, p);
+   /* Restore format for next loop. */
+
free(p);
if (getout)
-   return (end_fmt);
+   exit(*rval);
break;
}
case 'c': {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r337422 - in head/lib/libc: gen inet

2018-08-07 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug  7 15:24:19 2018
New Revision: 337422
URL: https://svnweb.freebsd.org/changeset/base/337422

Log:
  libc: fix cases of undefined behavior.
  
  These were found by the Undefined Behavious  GsoC project at NetBSD:
  
  Avoid undefined behavior in ftok(3)
  
  Do not change the signedness bit with a left shift operation.
  Cast to unsigned integer to prevent this.
  
  ftok.c:56:10, left shift of 123456789 by 24 places cannot be represented
  in type 'int'
  ftok.c:56:10, left shift of 4160 by 24 places cannot be represented in
  type 'int'
  
  Avoid undefined behavior in an inet_addr.c
  
  Do not change the signedness bit with a left shift operation.
  Cast to unsigned integer to prevent this.
  
  inet_addr.c:218:20, left shift of 131 by 24 places cannot be represented
  in type 'int'
  
  Detected with micro-UBSan in the user mode.
  
  Obtained from:NetBSD
  MFC after:2 weeks

Modified:
  head/lib/libc/gen/ftok.c
  head/lib/libc/inet/inet_addr.c

Modified: head/lib/libc/gen/ftok.c
==
--- head/lib/libc/gen/ftok.cTue Aug  7 15:04:53 2018(r337421)
+++ head/lib/libc/gen/ftok.cTue Aug  7 15:24:19 2018(r337422)
@@ -42,5 +42,6 @@ ftok(const char *path, int id)
if (stat(path, ) < 0)
return (key_t)-1;
 
-   return (key_t) (id << 24 | (st.st_dev & 0xff) << 16 | (st.st_ino & 
0x));
+   return ((key_t)((unsigned int)id << 24 | (st.st_dev & 0xff) << 16 |
+   (st.st_ino & 0x)));
 }

Modified: head/lib/libc/inet/inet_addr.c
==
--- head/lib/libc/inet/inet_addr.c  Tue Aug  7 15:04:53 2018
(r337421)
+++ head/lib/libc/inet/inet_addr.c  Tue Aug  7 15:24:19 2018
(r337422)
@@ -184,19 +184,20 @@ inet_aton(const char *cp, struct in_addr *addr) {
case 2: /*%< a.b -- 8.24 bits */
if (val > 0xffU)
return (0);
-   val |= parts[0] << 24;
+   val |= (uint32_t)parts[0] << 24;
break;
 
case 3: /*%< a.b.c -- 8.8.16 bits */
if (val > 0xU)
return (0);
-   val |= (parts[0] << 24) | (parts[1] << 16);
+   val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16);
break;
 
case 4: /*%< a.b.c.d -- 8.8.8.8 bits */
if (val > 0xffU)
return (0);
-   val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
+   val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16) |
+   (parts[2] << 8);
break;
}
if (addr != NULL)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r337419 - head/usr.bin/sed

2018-08-07 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug  7 14:47:39 2018
New Revision: 337419
URL: https://svnweb.freebsd.org/changeset/base/337419

Log:
  sed(1): partial fix for the case of the regex delimited with '['.
  
  We don't generally support the weird case of regular expresions delimited
  by an opening square bracket ('[') but POSIX says that inside
  bracket expressions, escaping is not possible and both '[' and '\'
  represent themselves.
  
  PR:   230198 (exp-run)
  Obtained from:OpenBSD

Modified:
  head/usr.bin/sed/compile.c

Modified: head/usr.bin/sed/compile.c
==
--- head/usr.bin/sed/compile.c  Tue Aug  7 14:39:00 2018(r337418)
+++ head/usr.bin/sed/compile.c  Tue Aug  7 14:47:39 2018(r337419)
@@ -393,11 +393,11 @@ compile_delimited(char *p, char *d, int is_tr)
if ((d = compile_ccl(, d)) == NULL)
errx(1, "%lu: %s: unbalanced brackets ([])", 
linenum, fname);
continue;
+   } else if (*p == '\\' && p[1] == c) {
+   p++;
} else if (*p == '\\' && p[1] == '[') {
*d++ = *p++;
-   } else if (*p == '\\' && p[1] == c)
-   p++;
-   else if (*p == '\\' && p[1] == 'n') {
+   } else if (*p == '\\' && p[1] == 'n') {
*d++ = '\n';
p += 2;
continue;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r336929 - head/usr.bin/sed

2018-07-30 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jul 30 19:41:54 2018
New Revision: 336929
URL: https://svnweb.freebsd.org/changeset/base/336929

Log:
  sed: compile with the default WARNS level.

Modified:
  head/usr.bin/sed/Makefile

Modified: head/usr.bin/sed/Makefile
==
--- head/usr.bin/sed/Makefile   Mon Jul 30 19:29:31 2018(r336928)
+++ head/usr.bin/sed/Makefile   Mon Jul 30 19:41:54 2018(r336929)
@@ -6,8 +6,6 @@
 PROG=  sed
 SRCS=  compile.c main.c misc.c process.c
 
-WARNS?=2
-
 HAS_TESTS=
 SUBDIR.${MK_TESTS}+= tests
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r336926 - head/usr.bin/sed

2018-07-30 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jul 30 18:29:46 2018
New Revision: 336926
URL: https://svnweb.freebsd.org/changeset/base/336926

Log:
  sed: unsign some indexes to fix sign-compare warnings.
  
  Hinted by:OpenBSD (CVS 1.32)
  
  MFC after: 1 week

Modified:
  head/usr.bin/sed/extern.h
  head/usr.bin/sed/process.c

Modified: head/usr.bin/sed/extern.h
==
--- head/usr.bin/sed/extern.h   Mon Jul 30 18:29:20 2018(r336925)
+++ head/usr.bin/sed/extern.h   Mon Jul 30 18:29:46 2018(r336926)
@@ -41,7 +41,7 @@ extern struct s_appends *appends;
 extern regmatch_t *match;
 extern size_t maxnsub;
 extern u_long linenum;
-extern int appendnum;
+extern unsigned int appendnum;
 extern int aflag, eflag, nflag;
 extern const char *fname, *outfname;
 extern FILE *infile, *outfile;

Modified: head/usr.bin/sed/process.c
==
--- head/usr.bin/sed/process.c  Mon Jul 30 18:29:20 2018(r336925)
+++ head/usr.bin/sed/process.c  Mon Jul 30 18:29:46 2018(r336926)
@@ -79,8 +79,8 @@ static voidregsub(SPACE *, char *, char *);
 static int  substitute(struct s_command *);
 
 struct s_appends *appends; /* Array of pointers to strings to append. */
-static int appendx;/* Index into appends array. */
-int appendnum; /* Size of appends array. */
+static unsigned int appendx;   /* Index into appends array. */
+unsigned int appendnum;/* Size of appends array. */
 
 static int lastaddr;   /* Set by applies if last address of a range. */
 static int sdone;  /* If any substitutes since last line input. */
@@ -385,7 +385,7 @@ substitute(struct s_command *cp)
regex_t *re;
regoff_t slen;
int lastempty, n;
-   size_t le = 0;
+   regoff_t le = 0;
char *s;
 
s = ps;
@@ -550,13 +550,13 @@ static void
 flush_appends(void)
 {
FILE *f;
-   int count, i;
+   unsigned int count, idx;
char buf[8 * 1024];
 
-   for (i = 0; i < appendx; i++)
-   switch (appends[i].type) {
+   for (idx = 0; idx < appendx; idx++)
+   switch (appends[idx].type) {
case AP_STRING:
-   fwrite(appends[i].s, sizeof(char), appends[i].len,
+   fwrite(appends[idx].s, sizeof(char), appends[idx].len,
outfile);
break;
case AP_FILE:
@@ -568,7 +568,7 @@ flush_appends(void)
 * would be truly bizarre, but possible.  It's probably
 * not that big a performance win, anyhow.
 */
-   if ((f = fopen(appends[i].s, "r")) == NULL)
+   if ((f = fopen(appends[idx].s, "r")) == NULL)
break;
while ((count = fread(buf, sizeof(char), sizeof(buf), 
f)))
(void)fwrite(buf, sizeof(char), count, outfile);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r336360 - head/sys/sys

2018-07-16 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Jul 17 02:20:51 2018
New Revision: 336360
URL: https://svnweb.freebsd.org/changeset/base/336360

Log:
  FreeBSD_version bump as per r336351,
  
  Updating the libstdc++ is likely to have consequences for archs that are
  still using the older GCC based toolchain.
  
  Requested by: mcl

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hMon Jul 16 23:32:24 2018(r336359)
+++ head/sys/sys/param.hTue Jul 17 02:20:51 2018(r336360)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200073  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200074  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r336351 - head/gnu/lib/libstdc++

2018-07-16 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jul 16 18:53:28 2018
New Revision: 336351
URL: https://svnweb.freebsd.org/changeset/base/336351

Log:
  Update libstdc++ configuration.
  
  Its been quite a while since the last time we updated this and since then
  we have grown iconv and a bunch of complex math functions.
  
  This only applies to the platforms which still use GCC 4.2.1 in the
  toolchain.
  
  Differential Revision:https://reviews.freebsd.org/D16289

Modified:
  head/gnu/lib/libstdc++/config.h

Modified: head/gnu/lib/libstdc++/config.h
==
--- head/gnu/lib/libstdc++/config.h Mon Jul 16 18:53:17 2018
(r336350)
+++ head/gnu/lib/libstdc++/config.h Mon Jul 16 18:53:28 2018
(r336351)
@@ -28,7 +28,7 @@
 #define HAVE_ATANF 1
 
 /* Define to 1 if you have the `atanl' function. */
-/* #undef HAVE_ATANL */
+#define HAVE_ATANL 1
 
 /* Define to 1 if you have the `ceilf' function. */
 #define HAVE_CEILF 1
@@ -55,10 +55,10 @@
 #define HAVE_COSHF 1
 
 /* Define to 1 if you have the `coshl' function. */
-/* #undef HAVE_COSHL */
+#define HAVE_COSHL 1
 
 /* Define to 1 if you have the `cosl' function. */
-/* #undef HAVE_COSL */
+#define HAVE_COSL 1
 
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_ENDIAN_H */
@@ -137,13 +137,13 @@
 #define HAVE_HYPOTL 1
 
 /* Define to 1 if you have the `iconv' function. */
-/* #undef HAVE_ICONV */
+#define HAVE_ICONV 1
 
 /* Define to 1 if you have the `iconv_close' function. */
-/* #undef HAVE_ICONV_CLOSE */
+#define HAVE_ICONV_CLOSE 1
 
 /* Define to 1 if you have the `iconv_open' function. */
-/* #undef HAVE_ICONV_OPEN */
+#define HAVE_ICONV_OPEN 1
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_IEEEFP_H 1
@@ -257,7 +257,7 @@
 #define HAVE_POWF 1
 
 /* Define to 1 if you have the `powl' function. */
-/* #undef HAVE_POWL */
+#define HAVE_POWL 1
 
 /* Define to 1 if you have the `qfpclass' function. */
 /* #undef HAVE_QFPCLASS */
@@ -269,13 +269,13 @@
 #define HAVE_SIGSETJMP 1
 
 /* Define to 1 if you have the `sincos' function. */
-/* #undef HAVE_SINCOS */
+#define HAVE_SINCOS 1
 
 /* Define to 1 if you have the `sincosf' function. */
-/* #undef HAVE_SINCOSF */
+#define HAVE_SINCOSF 1
 
 /* Define to 1 if you have the `sincosl' function. */
-/* #undef HAVE_SINCOSL */
+#define HAVE_SINCOSL 1
 
 /* Define to 1 if you have the `sinf' function. */
 #define HAVE_SINF 1
@@ -284,10 +284,10 @@
 #define HAVE_SINHF 1
 
 /* Define to 1 if you have the `sinhl' function. */
-/* #undef HAVE_SINHL */
+#define HAVE_SINHL 1
 
 /* Define to 1 if you have the `sinl' function. */
-/* #undef HAVE_SINL */
+#define HAVE_SINL 1
 
 /* Define to 1 if you have the `sqrtf' function. */
 #define HAVE_SQRTF 1
@@ -323,7 +323,7 @@
 #define HAVE_STRTOLD 1
 
 /* Define if strxfrm_l is available in . */
-/* #undef HAVE_STRXFRM_L */
+#define HAVE_STRXFRM_L 1
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_FILIO_H 1
@@ -341,7 +341,7 @@
 /* #undef HAVE_SYS_MACHINE_H */
 
 /* Define to 1 if you have the  header file. */
-/* #undef HAVE_SYS_PARAM_H */
+#define HAVE_SYS_PARAM_H 1
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_RESOURCE_H 1
@@ -362,9 +362,6 @@
 #define HAVE_SYS_UIO_H 1
 
 /* Define if S_IFREG is available in . */
-/* #undef HAVE_S_IFREG */
-
-/* Define if S_IFREG is available in . */
 #define HAVE_S_ISREG 1
 
 /* Define to 1 if you have the `tanf' function. */
@@ -374,10 +371,10 @@
 #define HAVE_TANHF 1
 
 /* Define to 1 if you have the `tanhl' function. */
-/* #undef HAVE_TANHL */
+#define HAVE_TANHL 1
 
 /* Define to 1 if you have the `tanl' function. */
-/* #undef HAVE_TANL */
+#define HAVE_TANL 1
 
 /* Define to 1 if the target supports thread-local storage. */
 #if !defined(__mips__)
@@ -731,7 +728,7 @@
 /* Define if C99 functions in  should be used in . Using
compiler builtins for these functions requires corresponding C99 library
functions to be present. */
-/* #undef _GLIBCXX_USE_C99_COMPLEX */
+#define _GLIBCXX_USE_C99_COMPLEX 1
 
 /* Define if C99 functions in  should be used in .
Using compiler builtins for these functions requires corresponding C99
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r336145 - head/usr.bin/localedef

2018-07-09 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jul  9 20:38:47 2018
New Revision: 336145
URL: https://svnweb.freebsd.org/changeset/base/336145

Log:
  localedef(1): remove duplicated includes.
  
  Hinted by:DragonFlyBSD

Modified:
  head/usr.bin/localedef/charmap.c
  head/usr.bin/localedef/localedef.c

Modified: head/usr.bin/localedef/charmap.c
==
--- head/usr.bin/localedef/charmap.cMon Jul  9 20:33:48 2018
(r336144)
+++ head/usr.bin/localedef/charmap.cMon Jul  9 20:38:47 2018
(r336145)
@@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include "localedef.h"

Modified: head/usr.bin/localedef/localedef.c
==
--- head/usr.bin/localedef/localedef.c  Mon Jul  9 20:33:48 2018
(r336144)
+++ head/usr.bin/localedef/localedef.c  Mon Jul  9 20:38:47 2018
(r336145)
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r336143 - head/usr.bin/sed

2018-07-09 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jul  9 20:27:31 2018
New Revision: 336143
URL: https://svnweb.freebsd.org/changeset/base/336143

Log:
  sed(1): Suppress implicit-fallthrough.
  
  Apparently some tools are not able to determine if all the cases of a
  switch are covered. Make use of the attribute for cases like this.
  
  Hinted by:DragonFlyBSD GGC8 (but fixed differently)
  
  CID:  976552

Modified:
  head/usr.bin/sed/main.c

Modified: head/usr.bin/sed/main.c
==
--- head/usr.bin/sed/main.c Mon Jul  9 20:00:45 2018(r336142)
+++ head/usr.bin/sed/main.c Mon Jul  9 20:27:31 2018(r336143)
@@ -250,6 +250,8 @@ again:
s = script->s;
state = ST_STRING;
goto again;
+   default:
+   __unreachable();
}
case ST_FILE:
if ((p = fgets(buf, n, f)) != NULL) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r336115 - head/lib/libiconv_modules/mapper_std

2018-07-08 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Jul  8 23:22:04 2018
New Revision: 336115
URL: https://svnweb.freebsd.org/changeset/base/336115

Log:
  libiconv: correct undefined behavior.
  
  Detected on NetBSD:
  # nm /usr/lib/libc.so|grep sanit
  /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8:
  runtime error: left shift of 1 by 31 places cannot be represented in type 
'int'
  
  Obtained from:NetBSD (CVS Rev. 1.11)
  MFC after:1 week

Modified:
  head/lib/libiconv_modules/mapper_std/citrus_mapper_std.c

Modified: head/lib/libiconv_modules/mapper_std/citrus_mapper_std.c
==
--- head/lib/libiconv_modules/mapper_std/citrus_mapper_std.cSun Jul  8 
23:12:27 2018(r336114)
+++ head/lib/libiconv_modules/mapper_std/citrus_mapper_std.cSun Jul  8 
23:22:04 2018(r336115)
@@ -1,5 +1,5 @@
 /* $FreeBSD$ */
-/* $NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $   
*/
+/* $NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -161,7 +161,7 @@ rowcol_parse_variable_compat(struct _citrus_mapper_std
rc->rc_dst_invalid = be32toh(rcx->rcx_dst_invalid);
rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits);
m = be32toh(rcx->rcx_src_col_bits);
-   n = 1 << (m - 1);
+   n = 1U << (m - 1);
n |= n - 1;
rc->rc_src_rowcol_bits = m;
rc->rc_src_rowcol_mask = n;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r336113 - head/usr.bin/gzip

2018-07-08 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Jul  8 22:39:33 2018
New Revision: 336113
URL: https://svnweb.freebsd.org/changeset/base/336113

Log:
  gzip: fix for undefined behavior.
  
  Unportable left shift reported with MKSANITIZER=yes
  USE_SANITIZER=undefined:
  
  # progress -zf ./games.tgz  tar -xp -C "./" -f -
  /public/src.git/usr.bin/gzip/gzip.c:2126:33: runtime error: left shift of
  251 by 24 places cannot be represented in type 'int'
  100%
  
||
  44500 KiB  119.69 MiB/s00:00 ETA
  
  Refactor the following code into something that is more clear
  and fix signed integer shift, by casting all buf[] elements to
  (unsigned int):
  
  unsigned char buf[8];
  uint32_t usize;
  [...]
  else {
  usize = buf[4] | buf[5] << 8 |
  buf[6] << 16 | buf[7] << 24;
  [...]
  
  New version:
  
  usize = buf[4];
  usize |= (unsigned int)buf[5] << 8;
  usize |= (unsigned int)buf[6] << 16;
  usize |= (unsigned int)buf[7] << 24;
  
  Only the "<< 24" part needs explicit cast, but for consistency make the
  integer promotion explicit and clear to a code reader.
  
  Sponsored by 
  
  Obtained from:NetBSD (CVS rev. 1.113)
  MFC after:1 week

Modified:
  head/usr.bin/gzip/gzip.c

Modified: head/usr.bin/gzip/gzip.c
==
--- head/usr.bin/gzip/gzip.cSun Jul  8 21:14:43 2018(r336112)
+++ head/usr.bin/gzip/gzip.cSun Jul  8 22:39:33 2018(r336113)
@@ -1,4 +1,4 @@
-/* $NetBSD: gzip.c,v 1.112 2017/08/23 13:04:17 christos Exp $  */
+/* $NetBSD: gzip.c,v 1.113 2018/06/12 00:42:17 kamil Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-NetBSD
@@ -2169,12 +2169,16 @@ print_list(int fd, off_t out, const char *outfile, tim
maybe_warnx("read of uncompressed size");
 
else {
-   usize = buf[4] | buf[5] << 8 |
-   buf[6] << 16 | buf[7] << 24;
+   usize = buf[4];
+   usize |= (unsigned int)buf[5] << 8;
+   usize |= (unsigned int)buf[6] << 16;
+   usize |= (unsigned int)buf[7] << 24;
in = (off_t)usize;
 #ifndef SMALL
-   crc = buf[0] | buf[1] << 8 |
- buf[2] << 16 | buf[3] << 24;
+   crc = buf[0];
+   crc |= (unsigned int)buf[1] << 8;
+   crc |= (unsigned int)buf[2] << 16;
+   crc |= (unsigned int)buf[3] << 24;
 #endif
}
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r334950 - head/usr.sbin/bhyve

2018-06-11 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jun 11 14:45:34 2018
New Revision: 334950
URL: https://svnweb.freebsd.org/changeset/base/334950

Log:
  style(9): Fix tabs after #define.
  
  No functional change intended.

Modified:
  head/usr.sbin/bhyve/pci_virtio_scsi.c

Modified: head/usr.sbin/bhyve/pci_virtio_scsi.c
==
--- head/usr.sbin/bhyve/pci_virtio_scsi.c   Mon Jun 11 14:27:19 2018
(r334949)
+++ head/usr.sbin/bhyve/pci_virtio_scsi.c   Mon Jun 11 14:45:34 2018
(r334950)
@@ -77,17 +77,17 @@ __FBSDID("$FreeBSD$");
 #defineVTSCSI_OUT_HEADER_LEN(_sc)  \
(sizeof(struct pci_vtscsi_req_cmd_wr) + _sc->vss_config.sense_size)
 
-#define VIRTIO_SCSI_MAX_CHANNEL 0
-#define VIRTIO_SCSI_MAX_TARGET  0
-#define VIRTIO_SCSI_MAX_LUN 16383
+#defineVIRTIO_SCSI_MAX_CHANNEL 0
+#defineVIRTIO_SCSI_MAX_TARGET  0
+#defineVIRTIO_SCSI_MAX_LUN 16383
 
 #defineVIRTIO_SCSI_F_INOUT (1 << 0)
 #defineVIRTIO_SCSI_F_HOTPLUG   (1 << 1)
 #defineVIRTIO_SCSI_F_CHANGE(1 << 2)
 
 static int pci_vtscsi_debug = 0;
-#define DPRINTF(params) if (pci_vtscsi_debug) printf params
-#define WPRINTF(params) printf params
+#defineDPRINTF(params) if (pci_vtscsi_debug) printf params
+#defineWPRINTF(params) printf params
 
 struct pci_vtscsi_config {
uint32_t num_queues;
@@ -108,7 +108,7 @@ struct pci_vtscsi_queue {
int   vsq_ctl_fd;
pthread_mutex_t   vsq_mtx;
pthread_mutex_t   vsq_qmtx;
-pthread_cond_tvsq_cv;
+   pthread_cond_tvsq_cv;
STAILQ_HEAD(, pci_vtscsi_request) vsq_requests;
LIST_HEAD(, pci_vtscsi_worker)vsq_workers;
 };
@@ -117,7 +117,7 @@ struct pci_vtscsi_worker {
struct pci_vtscsi_queue * vsw_queue;
pthread_t vsw_thread;
bool  vsw_exiting;
-LIST_ENTRY(pci_vtscsi_worker) vsw_link;
+   LIST_ENTRY(pci_vtscsi_worker) vsw_link;
 };
 
 struct pci_vtscsi_request {
@@ -144,20 +144,20 @@ struct pci_vtscsi_softc {
struct pci_vtscsi_config vss_config;
 };
 
-#define VIRTIO_SCSI_T_TMF  0
-#define VIRTIO_SCSI_T_TMF_ABORT_TASK   0
-#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET   1
-#define VIRTIO_SCSI_T_TMF_CLEAR_ACA2
-#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET   3
-#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET  4
-#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET   5
-#define VIRTIO_SCSI_T_TMF_QUERY_TASK   6
-#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET   7
+#defineVIRTIO_SCSI_T_TMF   0
+#defineVIRTIO_SCSI_T_TMF_ABORT_TASK0
+#defineVIRTIO_SCSI_T_TMF_ABORT_TASK_SET1
+#defineVIRTIO_SCSI_T_TMF_CLEAR_ACA 2
+#defineVIRTIO_SCSI_T_TMF_CLEAR_TASK_SET3
+#defineVIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET   4
+#defineVIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET5
+#defineVIRTIO_SCSI_T_TMF_QUERY_TASK6
+#defineVIRTIO_SCSI_T_TMF_QUERY_TASK_SET7
 
 /* command-specific response values */
-#define VIRTIO_SCSI_S_FUNCTION_COMPLETE0
-#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED   10
-#define VIRTIO_SCSI_S_FUNCTION_REJECTED11
+#defineVIRTIO_SCSI_S_FUNCTION_COMPLETE 0
+#defineVIRTIO_SCSI_S_FUNCTION_SUCCEEDED10
+#defineVIRTIO_SCSI_S_FUNCTION_REJECTED 11
 
 struct pci_vtscsi_ctrl_tmf {
uint32_t type;
@@ -167,13 +167,13 @@ struct pci_vtscsi_ctrl_tmf {
uint8_t response;
 } __attribute__((packed));
 
-#define VIRTIO_SCSI_T_AN_QUERY 1
-#define VIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2
-#define VIRTIO_SCSI_EVT_ASYNC_POWER_MGMT   4
-#define VIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST 8
-#define VIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE 16
-#define VIRTIO_SCSI_EVT_ASYNC_MULTI_HOST   32
-#define VIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY  64
+#defineVIRTIO_SCSI_T_AN_QUERY  1
+#defineVIRTIO_SCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2
+#defineVIRTIO_SCSI_EVT_ASYNC_POWER_MGMT4
+#defineVIRTIO_SCSI_EVT_ASYNC_EXTERNAL_REQUEST  8
+#defineVIRTIO_SCSI_EVT_ASYNC_MEDIA_CHANGE  16
+#defineVIRTIO_SCSI_EVT_ASYNC_MULTI_HOST32
+#defineVIRTIO_SCSI_EVT_ASYNC_DEVICE_BUSY   64
 
 struct pci_vtscsi_ctrl_an {
uint32_t type;
@@ -184,23 +184,23 @@ struct pci_vtscsi_ctrl_an {
 } __attribute__((packed));
 
 /* command-specific response values */
-#define VIRTIO_SCSI_S_OK   0
-#define VIRTIO_SCSI_S_OVERRUN  1
-#define VIRTIO_SCSI_S_ABORTED  2
-#define VIRTIO_SCSI_S_BAD_TARGET   3
-#define VIRTIO_SCSI_S_RESET4
-#define 

svn commit: r333311 - head/sys/fs/msdosfs

2018-05-06 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  6 21:29:29 2018
New Revision: 11
URL: https://svnweb.freebsd.org/changeset/base/11

Log:
  msdosfs: use vfs_timestamp() to generate timestamps instead of getnanotime().
  
  Most filesystems, with the notable exceptions of msdosfs and autofs use
  only vfs_timestamp() to read the current time. This has the benefit of
  configurable granularity (using the vfs.timestamp_precision sysctl).
  
  For convenience, use it on msdosfs too.
  
  Submitted by: Damjan Jovanovic
  Differential Revision:https://reviews.freebsd.org/D15297

Modified:
  head/sys/fs/msdosfs/msdosfs_denode.c
  head/sys/fs/msdosfs/msdosfs_vnops.c

Modified: head/sys/fs/msdosfs/msdosfs_denode.c
==
--- head/sys/fs/msdosfs/msdosfs_denode.cSun May  6 21:22:46 2018
(r10)
+++ head/sys/fs/msdosfs/msdosfs_denode.cSun May  6 21:29:29 2018
(r11)
@@ -297,7 +297,7 @@ deupdat(struct denode *dep, int waitfor)
DE_MODIFIED);
return (0);
}
-   getnanotime();
+   vfs_timestamp();
DETIMES(dep, , , );
if ((dep->de_flag & DE_MODIFIED) == 0 && waitfor == 0)
return (0);

Modified: head/sys/fs/msdosfs/msdosfs_vnops.c
==
--- head/sys/fs/msdosfs/msdosfs_vnops.c Sun May  6 21:22:46 2018
(r10)
+++ head/sys/fs/msdosfs/msdosfs_vnops.c Sun May  6 21:29:29 2018
(r11)
@@ -178,7 +178,7 @@ msdosfs_create(struct vop_create_args *ap)
ndirent.de_FileSize = 0;
ndirent.de_pmp = pdep->de_pmp;
ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE;
-   getnanotime();
+   vfs_timestamp();
DETIMES(, , , );
error = createde(, pdep, , cnp);
if (error)
@@ -216,7 +216,7 @@ msdosfs_close(struct vop_close_args *ap)
 
VI_LOCK(vp);
if (vp->v_usecount > 1) {
-   getnanotime();
+   vfs_timestamp();
DETIMES(dep, , , );
}
VI_UNLOCK(vp);
@@ -266,7 +266,7 @@ msdosfs_getattr(struct vop_getattr_args *ap)
u_long dirsperblk = pmp->pm_BytesPerSec / sizeof(struct direntry);
uint64_t fileid;
 
-   getnanotime();
+   vfs_timestamp();
DETIMES(dep, , , );
vap->va_fsid = dev2udev(pmp->pm_dev);
/*
@@ -1330,7 +1330,7 @@ msdosfs_mkdir(struct vop_mkdir_args *ap)
memset(, 0, sizeof(ndirent));
ndirent.de_pmp = pmp;
ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE;
-   getnanotime();
+   vfs_timestamp();
DETIMES(, , , );
 
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r333239 - head/sys/fs/msdosfs

2018-05-03 Thread Pedro F. Giffuni
Author: pfg
Date: Fri May  4 03:44:12 2018
New Revision: 333239
URL: https://svnweb.freebsd.org/changeset/base/333239

Log:
  msdosfs: long names of files are created incorrectly.
  
  This fixes a regression that happened in r120492 (2003) where libkiconv
  was introduced and we went from checking unlen to checking for '\0'.
  
  PR:   111843
  Patch by: Damjan Jovanovic
  MFC after:1 week

Modified:
  head/sys/fs/msdosfs/msdosfs_conv.c

Modified: head/sys/fs/msdosfs/msdosfs_conv.c
==
--- head/sys/fs/msdosfs/msdosfs_conv.c  Fri May  4 03:23:45 2018
(r333238)
+++ head/sys/fs/msdosfs/msdosfs_conv.c  Fri May  4 03:44:12 2018
(r333239)
@@ -570,7 +570,7 @@ unix2winfn(const u_char *un, size_t unlen, struct wine
if (!code)
end = WIN_LAST;
}
-   if (*un == '\0')
+   if (!unlen)
end = WIN_LAST;
wep->weCnt |= end;
return !end;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r332986 - head/usr.sbin/makefs

2018-04-24 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 25 02:43:53 2018
New Revision: 332986
URL: https://svnweb.freebsd.org/changeset/base/332986

Log:
  makefs: Use ENODATA instead of ENOMSG as a translation for missing ENOATTR.
  
  This is consistent with what some linux filesystems do and has been
  adopted in our linuxulator.
  
  MFC after:3 days

Modified:
  head/usr.sbin/makefs/mtree.c

Modified: head/usr.sbin/makefs/mtree.c
==
--- head/usr.sbin/makefs/mtree.cWed Apr 25 02:42:57 2018
(r332985)
+++ head/usr.sbin/makefs/mtree.cWed Apr 25 02:43:53 2018
(r332986)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
 #include "makefs.h"
 
 #ifndef ENOATTR
-#defineENOATTR ENOMSG
+#defineENOATTR ENODATA
 #endif
 
 #defineIS_DOT(nm)  ((nm)[0] == '.' && (nm)[1] == '\0')
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r332035 - head/include

2018-04-04 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr  4 15:16:04 2018
New Revision: 332035
URL: https://svnweb.freebsd.org/changeset/base/332035

Log:
  pthread.h: minor indentation cleanups.
  
  No functional change.
  
  X-MFC with:   r331969

Modified:
  head/include/pthread.h

Modified: head/include/pthread.h
==
--- head/include/pthread.h  Wed Apr  4 14:41:48 2018(r332034)
+++ head/include/pthread.h  Wed Apr  4 15:16:04 2018(r332035)
@@ -175,8 +175,7 @@ int 
pthread_barrierattr_destroy(pthread_barrierattr_t
 intpthread_barrierattr_getpshared(
const pthread_barrierattr_t *, int *);
 intpthread_barrierattr_init(pthread_barrierattr_t *);
-intpthread_barrierattr_setpshared(pthread_barrierattr_t *,
-   int);
+intpthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
 
 #definepthread_cleanup_push(cleanup_routine, cleanup_arg)  
\
{   
\
@@ -194,16 +193,13 @@ int   
pthread_barrierattr_setpshared(pthread_barrieratt
 intpthread_condattr_destroy(pthread_condattr_t *);
 intpthread_condattr_getclock(const pthread_condattr_t *,
clockid_t *);
-intpthread_condattr_getpshared(const pthread_condattr_t *,
-   int *);
+intpthread_condattr_getpshared(const pthread_condattr_t *, int *);
 intpthread_condattr_init(pthread_condattr_t *);
-intpthread_condattr_setclock(pthread_condattr_t *,
-   clockid_t);
+intpthread_condattr_setclock(pthread_condattr_t *, clockid_t);
 intpthread_condattr_setpshared(pthread_condattr_t *, int);
 intpthread_cond_broadcast(pthread_cond_t *);
 intpthread_cond_destroy(pthread_cond_t *);
-intpthread_cond_init(pthread_cond_t *,
-   const pthread_condattr_t *);
+intpthread_cond_init(pthread_cond_t *, const pthread_condattr_t *);
 intpthread_cond_signal(pthread_cond_t *);
 intpthread_cond_timedwait(pthread_cond_t *,
pthread_mutex_t * __mutex,
@@ -219,18 +215,15 @@ void  pthread_exit(void *) __dead2;
 void   *pthread_getspecific(pthread_key_t);
 intpthread_getcpuclockid(pthread_t, clockid_t *);
 intpthread_join(pthread_t, void **);
-intpthread_key_create(pthread_key_t *,
-   void (*) (void *));
+intpthread_key_create(pthread_key_t *, void (*) (void *));
 intpthread_key_delete(pthread_key_t);
 intpthread_mutexattr_init(pthread_mutexattr_t *);
 intpthread_mutexattr_destroy(pthread_mutexattr_t *);
-intpthread_mutexattr_getpshared(
-   const pthread_mutexattr_t *, int *);
-intpthread_mutexattr_gettype(pthread_mutexattr_t *,
+intpthread_mutexattr_getpshared(const pthread_mutexattr_t *,
int *);
+intpthread_mutexattr_gettype(pthread_mutexattr_t *, int *);
 intpthread_mutexattr_settype(pthread_mutexattr_t *, int);
-intpthread_mutexattr_setpshared(pthread_mutexattr_t *,
-   int);
+intpthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
 intpthread_mutex_consistent(pthread_mutex_t * __mutex)
__requires_exclusive(*__mutex);
 intpthread_mutex_destroy(pthread_mutex_t * __mutex)
@@ -247,8 +240,7 @@ int pthread_mutex_timedlock(pthread_mutex_t * 
__mutex
__trylocks_exclusive(0, *__mutex);
 intpthread_mutex_unlock(pthread_mutex_t * __mutex)
__unlocks(*__mutex);
-intpthread_once(pthread_once_t *,
-   void (*) (void));
+intpthread_once(pthread_once_t *, void (*) (void));
 intpthread_rwlock_destroy(pthread_rwlock_t * __rwlock)
__requires_unlocked(*__rwlock);
 intpthread_rwlock_init(pthread_rwlock_t * __rwlock,
@@ -271,15 +263,14 @@ int   pthread_rwlock_unlock(pthread_rwlock_t 
* __rwlock
 intpthread_rwlock_wrlock(pthread_rwlock_t * __rwlock)
__locks_exclusive(*__rwlock);
 intpthread_rwlockattr_destroy(pthread_rwlockattr_t *);
-intpthread_rwlockattr_getkind_np(
-   const pthread_rwlockattr_t *, int *);
-intpthread_rwlockattr_getpshared(
-   const pthread_rwlockattr_t *, int *);
+intpthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *,
+   int *);
+intpthread_rwlockattr_getpshared(const pthread_rwlockattr_t *,
+   int *);
 int

svn commit: r331969 - head/include

2018-04-03 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr  4 02:00:10 2018
New Revision: 331969
URL: https://svnweb.freebsd.org/changeset/base/331969

Log:
  pthread.h: drop nullability attributes.
  
  These have been found to be practically useless. We were actually
  following the Android bionic library and had some interest in replicating
  the same warnings and behaviour but Android has since removed them.
  
  We are still keeping some uses of nullability attributes in other headers,
  somewhat in line with Apple's libc.
  
  MFC after:1 week
  Hinted by: bionic (git 3f66e74b903905e763e104396aff52a81718cfde)

Modified:
  head/include/pthread.h

Modified: head/include/pthread.h
==
--- head/include/pthread.h  Wed Apr  4 01:56:46 2018(r331968)
+++ head/include/pthread.h  Wed Apr  4 02:00:10 2018(r331969)
@@ -48,8 +48,6 @@
 #include 
 #include 
 
-__NULLABILITY_PRAGMA_PUSH
-
 /*
  * Run-time invariant values:
  */
@@ -151,34 +149,33 @@ struct _pthread_cleanup_info {
  */
 __BEGIN_DECLS
 intpthread_atfork(void (*)(void), void (*)(void), void (*)(void));
-intpthread_attr_destroy(pthread_attr_t * _Nonnull);
+intpthread_attr_destroy(pthread_attr_t *);
 intpthread_attr_getstack(
-   const pthread_attr_t * _Nonnull __restrict, 
-   void ** _Nonnull __restrict,
-   size_t * _Nonnull __restrict);
-intpthread_attr_getstacksize(const pthread_attr_t * _Nonnull,
-   size_t * _Nonnull);
-intpthread_attr_getguardsize(const pthread_attr_t * _Nonnull,
-   size_t * _Nonnull);
+   const pthread_attr_t * __restrict, void ** __restrict,
+   size_t * __restrict);
+intpthread_attr_getstacksize(const pthread_attr_t *,
+   size_t *);
+intpthread_attr_getguardsize(const pthread_attr_t *,
+   size_t *);
 intpthread_attr_getstackaddr(const pthread_attr_t *, void **);
-intpthread_attr_getdetachstate(const pthread_attr_t * _Nonnull,
-   int * _Nonnull);
-intpthread_attr_init(pthread_attr_t * _Nonnull);
-intpthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t);
-intpthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t);
-intpthread_attr_setstack(pthread_attr_t * _Nonnull, void *,
+intpthread_attr_getdetachstate(const pthread_attr_t *,
+   int *);
+intpthread_attr_init(pthread_attr_t *);
+intpthread_attr_setstacksize(pthread_attr_t *, size_t);
+intpthread_attr_setguardsize(pthread_attr_t *, size_t);
+intpthread_attr_setstack(pthread_attr_t *, void *,
size_t);
 intpthread_attr_setstackaddr(pthread_attr_t *, void *);
-intpthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int);
-intpthread_barrier_destroy(pthread_barrier_t * _Nonnull);
-intpthread_barrier_init(pthread_barrier_t * _Nonnull,
+intpthread_attr_setdetachstate(pthread_attr_t *, int);
+intpthread_barrier_destroy(pthread_barrier_t *);
+intpthread_barrier_init(pthread_barrier_t *,
const pthread_barrierattr_t *, unsigned);
-intpthread_barrier_wait(pthread_barrier_t * _Nonnull);
-intpthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull);
+intpthread_barrier_wait(pthread_barrier_t *);
+intpthread_barrierattr_destroy(pthread_barrierattr_t *);
 intpthread_barrierattr_getpshared(
-   const pthread_barrierattr_t * _Nonnull, int * _Nonnull);
-intpthread_barrierattr_init(pthread_barrierattr_t * _Nonnull);
-intpthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull,
+   const pthread_barrierattr_t *, int *);
+intpthread_barrierattr_init(pthread_barrierattr_t *);
+intpthread_barrierattr_setpshared(pthread_barrierattr_t *,
int);
 
 #definepthread_cleanup_push(cleanup_routine, cleanup_arg)  
\
@@ -194,108 +191,107 @@ int 
pthread_barrierattr_setpshared(pthread_barrieratt
__pthread_cleanup_pop_imp(execute); 
\
}
 
-intpthread_condattr_destroy(pthread_condattr_t * _Nonnull);
-intpthread_condattr_getclock(const pthread_condattr_t * _Nonnull,
-   clockid_t * _Nonnull);
-intpthread_condattr_getpshared(const pthread_condattr_t * _Nonnull,
-   int * _Nonnull);
-intpthread_condattr_init(pthread_condattr_t * _Nonnull);
-intpthread_condattr_setclock(pthread_condattr_t * _Nonnull,
+int

svn commit: r329848 - head/lib/libc/stdio

2018-02-22 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb 23 01:11:57 2018
New Revision: 329848
URL: https://svnweb.freebsd.org/changeset/base/329848

Log:
  __printf_render_int(): small type change to match use.
  
  Variable l is consistently used as an int rather than a char.
  Sort names while here.
  
  Obtained from:Apple's Libc-1244.30.3
  MFC after:5 days

Modified:
  head/lib/libc/stdio/xprintf_int.c

Modified: head/lib/libc/stdio/xprintf_int.c
==
--- head/lib/libc/stdio/xprintf_int.c   Fri Feb 23 00:38:42 2018
(r329847)
+++ head/lib/libc/stdio/xprintf_int.c   Fri Feb 23 01:11:57 2018
(r329848)
@@ -260,8 +260,8 @@ __printf_render_int(struct __printf_io *io, const stru
const union arg *argp;
char buf[BUF];
char *p, *pe;
-   char ns, l;
-   int rdx, sign, zext, ngrp;
+   char ns;
+   int l, ngrp, rdx, sign, zext;
const char *nalt, *digit;
char thousands_sep; /* locale specific thousands separator */
const char *grouping;   /* locale specific numeric grouping rules */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2018-02-22 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb 23 00:28:00 2018
New Revision: 329846
URL: https://svnweb.freebsd.org/changeset/base/329846

Log:
  getpeereid(3): Fix behavior on failure to match documentation.
  
  According to the getpeereid(3) documentation, on failure the value -1 is
  returned and the global variable errno is set to indicate the error. We
  were returning the error instead.
  
  Obtained from:Apple's Libc-1244.30.3
  MFC after:5 days

Modified:
  head/lib/libc/gen/getpeereid.c

Modified: head/lib/libc/gen/getpeereid.c
==
--- head/lib/libc/gen/getpeereid.c  Fri Feb 23 00:17:50 2018
(r329845)
+++ head/lib/libc/gen/getpeereid.c  Fri Feb 23 00:28:00 2018
(r329846)
@@ -50,8 +50,10 @@ getpeereid(int s, uid_t *euid, gid_t *egid)
error = _getsockopt(s, 0, LOCAL_PEERCRED, , );
if (error != 0)
return (error);
-   if (xuc.cr_version != XUCRED_VERSION)
-   return (EINVAL);
+   if (xuc.cr_version != XUCRED_VERSION) {
+   errno = EINVAL;
+   return (-1);
+   }
*euid = xuc.cr_uid;
*egid = xuc.cr_gid;
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r329102 - head/lib/libcompat/4.3

2018-02-10 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Feb 10 14:45:29 2018
New Revision: 329102
URL: https://svnweb.freebsd.org/changeset/base/329102

Log:
  libcompat: Use %hu for unsigned shorts.
  
  Obtained from:DragonFlyBSD (git  82e1476a)

Modified:
  head/lib/libcompat/4.3/rexec.c

Modified: head/lib/libcompat/4.3/rexec.c
==
--- head/lib/libcompat/4.3/rexec.c  Sat Feb 10 10:13:17 2018
(r329101)
+++ head/lib/libcompat/4.3/rexec.c  Sat Feb 10 14:45:29 2018
(r329102)
@@ -356,7 +356,7 @@ retry:
goto bad;
}
port = ntohs((u_short)sin2.sin_port);
-   (void) sprintf(num, "%u", port);
+   (void) sprintf(num, "%hu", port);
(void) write(s, num, strlen(num)+1);
{ int len = sizeof (from);
  s3 = accept(s2, (struct sockaddr *), );
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r329018 - in head: lib/libc/rpc usr.sbin/ypserv

2018-02-08 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Feb  8 14:53:34 2018
New Revision: 329018
URL: https://svnweb.freebsd.org/changeset/base/329018

Log:
  su_data: correct macro expansion.
  
  Protect su_data() users from strange macro expansion.
  
  Obtained from:linux libtirpc

Modified:
  head/lib/libc/rpc/svc_dg.c
  head/usr.sbin/ypserv/yp_svc_udp.c

Modified: head/lib/libc/rpc/svc_dg.c
==
--- head/lib/libc/rpc/svc_dg.c  Thu Feb  8 14:39:07 2018(r329017)
+++ head/lib/libc/rpc/svc_dg.c  Thu Feb  8 14:53:34 2018(r329018)
@@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
 #include "rpc_com.h"
 #include "mt_misc.h"
 
-#definesu_data(xprt)   ((struct svc_dg_data *)(xprt->xp_p2))
+#definesu_data(xprt)   ((struct svc_dg_data *)((xprt)->xp_p2))
 #definerpc_buffer(xprt) ((xprt)->xp_p1)
 
 #ifndef MAX

Modified: head/usr.sbin/ypserv/yp_svc_udp.c
==
--- head/usr.sbin/ypserv/yp_svc_udp.c   Thu Feb  8 14:39:07 2018
(r329017)
+++ head/usr.sbin/ypserv/yp_svc_udp.c   Thu Feb  8 14:53:34 2018
(r329018)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "yp_extern.h"
 
-#define su_data(xprt)  ((struct svc_dg_data *)(xprt->xp_p2))
+#definesu_data(xprt)   ((struct svc_dg_data *)((xprt)->xp_p2))
 
 /*
  * We need to be able to manually set the transaction ID in the
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328957 - in head/sys: fs/ext2fs ufs/ufs

2018-02-06 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Feb  6 22:38:19 2018
New Revision: 328957
URL: https://svnweb.freebsd.org/changeset/base/328957

Log:
  {ext2|ufs}_readdir: Avoid setting negative ncookies.
  
  ncookies cannot be negative or the allocator will fail. This should only
  happen if a caller is very broken but we can still try to survive the
  event.
  
  We should probably also verify for uio_resid > MAXPHYS but in that case
  it is not clear that just clipping the ncookies value is an adequate
  response.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cTue Feb  6 22:17:01 2018
(r328956)
+++ head/sys/fs/ext2fs/ext2_lookup.cTue Feb  6 22:38:19 2018
(r328957)
@@ -153,7 +153,10 @@ ext2_readdir(struct vop_readdir_args *ap)
return (EINVAL);
ip = VTOI(vp);
if (ap->a_ncookies != NULL) {
-   ncookies = uio->uio_resid;
+   if (uio->uio_resid < 0)
+   ncookies = 0;
+   else
+   ncookies = uio->uio_resid;
if (uio->uio_offset >= ip->i_size)
ncookies = 0;
else if (ip->i_size - uio->uio_offset < ncookies)

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cTue Feb  6 22:17:01 2018
(r328956)
+++ head/sys/ufs/ufs/ufs_vnops.cTue Feb  6 22:38:19 2018
(r328957)
@@ -2179,7 +2179,10 @@ ufs_readdir(ap)
if (ip->i_effnlink == 0)
return (0);
if (ap->a_ncookies != NULL) {
-   ncookies = uio->uio_resid;
+   if (uio->uio_resid < 0)
+   ncookies = 0;
+   else
+   ncookies = uio->uio_resid;
if (uio->uio_offset >= ip->i_size)
ncookies = 0;
else if (ip->i_size - uio->uio_offset < ncookies)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328885 - head/sys/fs/ext2fs

2018-02-05 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Feb  5 15:14:01 2018
New Revision: 328885
URL: https://svnweb.freebsd.org/changeset/base/328885

Log:
  ext2fs: remove EXT4F_RO_INCOMPAT_SUPP
  
  This was a hack to be able to mount ext4 filesystems read-only while not
  supporting all the features. We now support all those features so it
  doesn't make sense to keep the undocumented hack.
  
  Discussed with:   fsu

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/ext2fs/ext2fs.h

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==
--- head/sys/fs/ext2fs/ext2_vfsops.cMon Feb  5 15:02:35 2018
(r328884)
+++ head/sys/fs/ext2fs/ext2_vfsops.cMon Feb  5 15:14:01 2018
(r328885)
@@ -290,8 +290,7 @@ ext2_check_sb_compat(struct ext2fs *es, struct cdev *d
return (1);
}
if (es->e2fs_rev > E2FS_REV0) {
-   mask = es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP |
-   EXT4F_RO_INCOMPAT_SUPP);
+   mask = es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP);
if (mask) {
printf("WARNING: mount of %s denied due to "
"unsupported optional features:\n", devtoname(dev));

Modified: head/sys/fs/ext2fs/ext2fs.h
==
--- head/sys/fs/ext2fs/ext2fs.h Mon Feb  5 15:02:35 2018(r328884)
+++ head/sys/fs/ext2fs/ext2fs.h Mon Feb  5 15:14:01 2018(r328885)
@@ -319,11 +319,6 @@ static const struct ext2_feature incompat[] = {
  * - EXT2F_ROCOMPAT_HUGE_FILE
  * - EXT2F_INCOMPAT_EXTENTS
  *
- * We do not support these EXT4 features but they are irrelevant
- * for read-only support:
- * - EXT2F_INCOMPAT_RECOVER
- * - EXT2F_INCOMPAT_FLEX_BG
- * - EXT2F_INCOMPAT_META_BG
  */
 #defineEXT2F_COMPAT_SUPP   EXT2F_COMPAT_DIRHASHINDEX
 #defineEXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \
@@ -339,7 +334,6 @@ static const struct ext2_feature incompat[] = {
 EXT2F_INCOMPAT_64BIT | \
 EXT2F_INCOMPAT_FLEX_BG | \
 EXT2F_INCOMPAT_CSUM_SEED)
-#defineEXT4F_RO_INCOMPAT_SUPP  EXT2F_INCOMPAT_RECOVER
 
 /* Assume that user mode programs are passing in an ext2fs superblock, not
  * a kernel struct super_block.  This will allow us to call the feature-test
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328882 - head/sys/fs/ext2fs

2018-02-05 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Feb  5 14:30:27 2018
New Revision: 328882
URL: https://svnweb.freebsd.org/changeset/base/328882

Log:
  ext2fs: Cleanup variable assignments for extents.
  
  Delay the initialization of variables until the are needed.
  
  In the case of ext4_ext_rm_leaf(), make sure 'error' value is not
  undefined.
  
  Reported by:  Clang's static analyzer
  Differential Revision:https://reviews.freebsd.org/D14193

Modified:
  head/sys/fs/ext2fs/ext2_extents.c

Modified: head/sys/fs/ext2fs/ext2_extents.c
==
--- head/sys/fs/ext2fs/ext2_extents.c   Mon Feb  5 14:19:36 2018
(r328881)
+++ head/sys/fs/ext2fs/ext2_extents.c   Mon Feb  5 14:30:27 2018
(r328882)
@@ -1159,14 +1159,13 @@ ext4_new_blocks(struct inode *ip, daddr_t lbn, e4fs_da
struct m_ext2fs *fs;
e4fs_daddr_t newblk;
 
-   fs = ip->i_e2fs;
-
/*
 * We will allocate only single block for now.
 */
if (*count > 1)
return (0);
 
+   fs = ip->i_e2fs;
EXT2_LOCK(ip->i_ump);
*perror = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, );
if (*perror)
@@ -1193,13 +1192,12 @@ ext4_ext_get_blocks(struct inode *ip, e4fs_daddr_t ibl
unsigned long allocated = 0;
int error = 0, depth;
 
-   fs = ip->i_e2fs;
-   *pallocated = 0;
-   path = NULL;
if(bpp)
*bpp = NULL;
+   *pallocated = 0;
 
/* Check cache. */
+   path = NULL;
if ((bpref = ext4_ext_in_cache(ip, iblk, ))) {
if (bpref == EXT4_EXT_CACHE_IN) {
/* Block is already allocated. */
@@ -1271,6 +1269,7 @@ out:
 
if (bpp)
{
+   fs = ip->i_e2fs;
error = bread(ip->i_devvp, fsbtodb(fs, newblk),
fs->e2fs_bsize, cred, );
if (error) {
@@ -1304,7 +1303,7 @@ static inline struct ext4_extent_header *
 ext4_ext_header(struct inode *ip)
 {
 
-   return (struct ext4_extent_header *)ip->i_db;
+   return ((struct ext4_extent_header *)ip->i_db);
 }
 
 static int
@@ -1345,19 +1344,15 @@ static int
 ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_path *path,
 uint64_t start)
 {
-   struct m_ext2fs *fs;
-   int depth;
struct ext4_extent_header *eh;
+   struct ext4_extent *ex;
unsigned int a, b, block, num;
unsigned long ex_blk;
unsigned short ex_len;
-   struct ext4_extent *ex;
+   int depth;
int error, correct_index;
 
-   fs = ip->i_e2fs;
depth = ext4_ext_inode_depth(ip);
-   correct_index = 0;
-
if (!path[depth].ep_header) {
if (path[depth].ep_data == NULL)
return (EINVAL);
@@ -1367,7 +1362,8 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_
 
eh = path[depth].ep_header;
if (!eh) {
-   ext2_fserr(fs, ip->i_uid, "bad header => extent corrupted");
+   ext2_fserr(ip->i_e2fs, ip->i_uid,
+   "bad header => extent corrupted");
return (EIO);
}
 
@@ -1375,6 +1371,8 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_
ex_blk = ex->e_blk;
ex_len = ext4_ext_get_actual_len(ex);
 
+   error = 0;
+   correct_index = 0;
while (ex >= EXT_FIRST_EXTENT(eh) && ex_blk + ex_len > start) {
path[depth].ep_ext = ex;
a = ex_blk > start ? ex_blk : start;
@@ -1442,7 +1440,6 @@ ext4_read_extent_tree_block(struct inode *ip, e4fs_dad
int error;
 
fs = ip->i_e2fs;
-
error = bread(ip->i_devvp, fsbtodb(fs, pblk),
fs->e2fs_bsize, NOCRED, );
if (error) {
@@ -1506,10 +1503,10 @@ ext4_ext_remove_space(struct inode *ip, off_t length, 
if (!path)
return (ENOMEM);
 
-   i = 0;
path[0].ep_header = ehp;
path[0].ep_depth = depth;
-   while (i >= 0 && error == 0) {
+   i = 0;
+   while (error == 0 && i >= 0) {
if (i == depth) {
/* This is leaf. */
error = ext4_ext_rm_leaf(ip, path, length);
@@ -1568,7 +1565,6 @@ ext4_ext_remove_space(struct inode *ip, off_t length, 
 ext4_ext_header(ip)->eh_depth = 0;
 ext4_ext_header(ip)->eh_max = ext4_ext_space_root(ip);
 ext4_ext_dirty(ip, path);
-
}
 
ext4_ext_drop_refs(path);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328567 - head/lib/libedit

2018-01-29 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 29 22:38:23 2018
New Revision: 328567
URL: https://svnweb.freebsd.org/changeset/base/328567

Log:
  libedit: sort the Makefile in line with NetBSD's version.
  
  NetBSD's libedit has been been cleaned-up considerably so the
  non--widecharacter version is no longer an option. Re -sorting the
  Makefile should make it easier for some brave soul trying to update it.
  
  No functional change intended.
  
  MFC after:5 days

Modified:
  head/lib/libedit/Makefile

Modified: head/lib/libedit/Makefile
==
--- head/lib/libedit/Makefile   Mon Jan 29 22:15:46 2018(r328566)
+++ head/lib/libedit/Makefile   Mon Jan 29 22:38:23 2018(r328567)
@@ -3,18 +3,19 @@
 # $FreeBSD$
 
 PACKAGE=clibs
-LIB=   edit
+
 SHLIB_MAJOR=   7
 SHLIBDIR?= /lib
 
 WARNS?=3
+LIB=   edit
 
+LIBADD=ncursesw
+
 OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \
hist.c keymacro.c map.c chartype.c \
parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c
 
-LIBADD=ncursesw
-
 MAN=   editline.3 editrc.5
 
 MLINKS=editline.3 el_deletestr.3 editline.3 el_end.3 editline.3 
el_init.3 \
@@ -28,25 +29,26 @@ MLINKS= editline.3 el_deletestr.3 editline.3 el_end.3 
editline.3 tok_line.3 editline.3 tok_str.3
 
 # For speed and debugging
-#SRCS=   ${OSRCS}
+#SRCS=   ${OSRCS} readline.c tokenizer.c history.c
 # For protection
-SRCS=  editline.c
-SRCS+= tokenizer.c history.c readline.c
+SRCS=  editline.c readline.c tokenizer.c history.c 
 SRCS+= common.h emacs.h fcns.h help.h vi.h
-CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h
 
-INCS=  histedit.h
-
+# Widechar
 SRCS+= tokenizern.c historyn.c
 CLEANFILES+=   tokenizern.c historyn.c
+
+INCS=  histedit.h
+
+CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h
 CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR
 #CFLAGS+= -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
 #CFLAGS+= -DDEBUG_PASTE -DDEBUG_EDIT
 
-SUBDIR= edit/readline
-
 AHDR=  vi.h emacs.h common.h
 ASRC=  ${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c
+
+SUBDIR= edit/readline
 
 .for hdr in vi emacs common
 ${hdr}.h: ${hdr}.c makelist
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328551 - head/usr.sbin/pppctl

2018-01-29 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 29 14:23:44 2018
New Revision: 328551
URL: https://svnweb.freebsd.org/changeset/base/328551

Log:
  pppctl88) Avoid strcpy() copies on overlapping string.
  
  This may lead to unpredicatable behaviour on different platforms or C
  library implementations. Use an intermediate variable.
  
  Obtained from:DragonFlyBSD (git a861a526)

Modified:
  head/usr.sbin/pppctl/pppctl.c

Modified: head/usr.sbin/pppctl/pppctl.c
==
--- head/usr.sbin/pppctl/pppctl.c   Mon Jan 29 14:15:44 2018
(r328550)
+++ head/usr.sbin/pppctl/pppctl.c   Mon Jan 29 14:23:44 2018
(r328551)
@@ -121,6 +121,7 @@ static int
 Receive(int fd, int display)
 {
 static char Buffer[LINELEN];
+char temp[sizeof(Buffer)];
 struct timeval t;
 int Result;
 char *last;
@@ -185,7 +186,8 @@ Receive(int fd, int display)
 else
 flush = last - Buffer + 1;
 write(STDOUT_FILENO, Buffer, flush);
-strcpy(Buffer, Buffer + flush);
+   strcpy(temp, Buffer + flush);
+   strcpy(Buffer, temp);
 len -= flush;
 }
 if ((Result = select(fd + 1, , NULL, NULL, )) <= 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328525 - head/contrib/tnftp/src

2018-01-28 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 29 01:05:57 2018
New Revision: 328525
URL: https://svnweb.freebsd.org/changeset/base/328525

Log:
  ftp(1): Use closefrom() instead of individual close()s.
  
  Use closefrom(3) instead of manually closing all file descriptors
  between 3 and 19.
  
  Obtained from:OpenBSD (CVS 1.80)

Modified:
  head/contrib/tnftp/src/cmds.c

Modified: head/contrib/tnftp/src/cmds.c
==
--- head/contrib/tnftp/src/cmds.c   Mon Jan 29 00:22:30 2018
(r328524)
+++ head/contrib/tnftp/src/cmds.c   Mon Jan 29 01:05:57 2018
(r328525)
@@ -1438,8 +1438,7 @@ shell(int argc, char *argv[])
}
oldintr = xsignal(SIGINT, SIG_IGN);
if ((pid = fork()) == 0) {
-   for (pid = 3; pid < 20; pid++)
-   (void)close(pid);
+   (void)closefrom(3);
(void)xsignal(SIGINT, SIG_DFL);
shellp = getenv("SHELL");
if (shellp == NULL)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328517 - head/include

2018-01-28 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Jan 28 19:37:30 2018
New Revision: 328517
URL: https://svnweb.freebsd.org/changeset/base/328517

Log:
  Avoid implicit gcc nonnull attribute in vwarnx().
  
  We removed the nonnull attributes from our headers long ago, but still
  __printflike() includes it implicitly. This will cause the NULL check to
  be optimized away in higher -O levels and it will also trigger a
  -Wnonnull-compare warning.
  
  Avoid warning with it in vwarnx().
  
  Obtained from:DragonfLyBSD (git 
6329e2f68af73662a1960240675e796ab586bcb1)

Modified:
  head/include/err.h

Modified: head/include/err.h
==
--- head/include/err.h  Sun Jan 28 19:18:40 2018(r328516)
+++ head/include/err.h  Sun Jan 28 19:37:30 2018(r328517)
@@ -60,7 +60,7 @@ void  vwarn(const char *, __va_list) __printf0like(1, 0
 void   warnc(int, const char *, ...) __printf0like(2, 3);
 void   vwarnc(int, const char *, __va_list) __printf0like(2, 0);
 void   warnx(const char *, ...) __printflike(1, 2);
-void   vwarnx(const char *, __va_list) __printflike(1, 0);
+void   vwarnx(const char *, __va_list) __printf0like(1, 0);
 void   err_set_file(void *);
 void   err_set_exit(void (* _Nullable)(int));
 __END_DECLS
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328506 - head/contrib/opie/libopie

2018-01-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Jan 28 03:16:54 2018
New Revision: 328506
URL: https://svnweb.freebsd.org/changeset/base/328506

Log:
  Revert r328492:
  "Fix gcc80 -Wsizeof-pointer-memaccess warning."
  
  The warning is bogus: GCC8 only looks at the size of the destination.
  We shouldn't be fixing imaginary problems, so perhaps its better to deal
  with this later on by disabling such warnings.
  
  Pointed out by:   ed, bde

Modified:
  head/contrib/opie/libopie/insecure.c

Modified: head/contrib/opie/libopie/insecure.c
==
--- head/contrib/opie/libopie/insecure.cSun Jan 28 03:07:22 2018
(r328505)
+++ head/contrib/opie/libopie/insecure.cSun Jan 28 03:16:54 2018
(r328506)
@@ -135,7 +135,8 @@ int opieinsecure FUNCTION_NOARGS
char host[sizeof(utmp.ut_host) + 1];
insecure = 1;
 
-   strncpy(host, utmp.ut_host, sizeof(host));
+   strncpy(host, utmp.ut_host, sizeof(utmp.ut_host));
+   host[sizeof(utmp.ut_host)] = 0;
 
if (s = strchr(host, ':')) {
  int n = s - host;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328497 - head/sbin/pfctl

2018-01-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jan 27 22:57:01 2018
New Revision: 328497
URL: https://svnweb.freebsd.org/changeset/base/328497

Log:
  pfctl(8): Fix two wrong conditions.
  
  Caught by gcc80's -Wtautological-compare option.
  
  MFC after:5 days
  Approved by:  kp
  Obtained from:DragonFlyBSD (git e3cdbf6c)
  Differential Revision:https://reviews.freebsd.org/D14083

Modified:
  head/sbin/pfctl/pfctl_optimize.c

Modified: head/sbin/pfctl/pfctl_optimize.c
==
--- head/sbin/pfctl/pfctl_optimize.cSat Jan 27 22:53:29 2018
(r328496)
+++ head/sbin/pfctl/pfctl_optimize.cSat Jan 27 22:57:01 2018
(r328497)
@@ -1092,7 +1092,7 @@ skip_cmp_dst_addr(struct pf_rule *a, struct pf_rule *b
return (0);
case PF_ADDR_DYNIFTL:
if (strcmp(a->dst.addr.v.ifname, b->dst.addr.v.ifname) != 0 ||
-   a->dst.addr.iflags != a->dst.addr.iflags ||
+   a->dst.addr.iflags != b->dst.addr.iflags ||
memcmp(>dst.addr.v.a.mask, >dst.addr.v.a.mask,
sizeof(a->dst.addr.v.a.mask)))
return (1);
@@ -1164,7 +1164,7 @@ skip_cmp_src_addr(struct pf_rule *a, struct pf_rule *b
return (0);
case PF_ADDR_DYNIFTL:
if (strcmp(a->src.addr.v.ifname, b->src.addr.v.ifname) != 0 ||
-   a->src.addr.iflags != a->src.addr.iflags ||
+   a->src.addr.iflags != b->src.addr.iflags ||
memcmp(>src.addr.v.a.mask, >src.addr.v.a.mask,
sizeof(a->src.addr.v.a.mask)))
return (1);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328493 - head/lib/libthr/thread

2018-01-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jan 27 22:27:55 2018
New Revision: 328493
URL: https://svnweb.freebsd.org/changeset/base/328493

Log:
  libthr: Fix missing break in switch.
  
  This is also a warning in recent GCC with -Wimplicit-fallthrough.
  
  CID:  1356262
  Obtained from:DragonFly (git 0f037c78 - partial)

Modified:
  head/lib/libthr/thread/thr_printf.c

Modified: head/lib/libthr/thread/thr_printf.c
==
--- head/lib/libthr/thread/thr_printf.c Sat Jan 27 22:16:19 2018
(r328492)
+++ head/lib/libthr/thread/thr_printf.c Sat Jan 27 22:27:55 2018
(r328493)
@@ -95,6 +95,7 @@ next: c = *fmt++;
case 'p':
pstr(fd, "0x");
islong = 1;
+   /* FALLTHROUGH */
case 'd':
case 'u':
case 'x':
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328492 - head/contrib/opie/libopie

2018-01-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jan 27 22:16:19 2018
New Revision: 328492
URL: https://svnweb.freebsd.org/changeset/base/328492

Log:
  Fix gcc80 -Wsizeof-pointer-memaccess warning.
  
  Obtained from:DragonFlyBSD (git 
56267d362d5769c8df07bf26d5e322610e0d24b4)

Modified:
  head/contrib/opie/libopie/insecure.c

Modified: head/contrib/opie/libopie/insecure.c
==
--- head/contrib/opie/libopie/insecure.cSat Jan 27 21:25:45 2018
(r328491)
+++ head/contrib/opie/libopie/insecure.cSat Jan 27 22:16:19 2018
(r328492)
@@ -135,8 +135,7 @@ int opieinsecure FUNCTION_NOARGS
char host[sizeof(utmp.ut_host) + 1];
insecure = 1;
 
-   strncpy(host, utmp.ut_host, sizeof(utmp.ut_host));
-   host[sizeof(utmp.ut_host)] = 0;
+   strncpy(host, utmp.ut_host, sizeof(host));
 
if (s = strchr(host, ':')) {
  int n = s - host;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328487 - head/bin/pax

2018-01-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jan 27 18:24:13 2018
New Revision: 328487
URL: https://svnweb.freebsd.org/changeset/base/328487

Log:
  pax(1): Honour the restrict in sigaction().
  
  Use a setup_sig() helper and make it fail when either of sigaction fails.
  
  While there, do not leak fds for "." + minor cleanup.
  
  Obtained from:OpenBSD (through DragonFly git 
eca362d0f9bd086cc56d6b5bc4f03f09e040b9db)

Modified:
  head/bin/pax/pax.c

Modified: head/bin/pax/pax.c
==
--- head/bin/pax/pax.c  Sat Jan 27 17:43:09 2018(r328486)
+++ head/bin/pax/pax.c  Sat Jan 27 18:24:13 2018(r328487)
@@ -109,7 +109,7 @@ char*tempbase;  /* basename of tempfile 
to use for mk
 /*
  * PAX - Portable Archive Interchange
  *
- * A utility to read, write, and write lists of the members of archive
+ * A utility to read, write, and write lists of the members of archive
  * files and copy directory hierarchies. A variety of archive formats
  * are supported (some are described in POSIX 1003.1 10.1):
  *
@@ -237,7 +237,7 @@ main(int argc, char *argv[])
/*
 * Keep a reference to cwd, so we can always come back home.
 */
-   cwdfd = open(".", O_RDONLY);
+   cwdfd = open(".", O_RDONLY | O_CLOEXEC);
if (cwdfd < 0) {
syswarn(0, errno, "Can't open current working directory.");
return(exit_val);
@@ -249,7 +249,7 @@ main(int argc, char *argv[])
if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0')
tmpdir = _PATH_TMP;
tdlen = strlen(tmpdir);
-   while(tdlen > 0 && tmpdir[tdlen - 1] == '/')
+   while (tdlen > 0 && tmpdir[tdlen - 1] == '/')
tdlen--;
tempfile = malloc(tdlen + 1 + sizeof(_TFILE_BASE));
if (tempfile == NULL) {
@@ -271,7 +271,7 @@ main(int argc, char *argv[])
/*
 * select a primary operation mode
 */
-   switch(act) {
+   switch (act) {
case EXTRACT:
extract();
break;
@@ -325,6 +325,25 @@ sig_cleanup(int which_sig)
 }
 
 /*
+ * setup_sig()
+ * set a signal to be caught, but only if it isn't being ignored already
+ */
+
+static int
+setup_sig(int sig, const struct sigaction *n_hand)
+{
+   struct sigaction o_hand;
+
+   if (sigaction(sig, NULL, _hand) < 0)
+   return (-1);
+
+   if (o_hand.sa_handler == SIG_IGN)
+   return (0);
+
+   return (sigaction(sig, n_hand, NULL));
+}
+
+/*
  * gen_init()
  * general setup routines. Not all are required, but they really help
  * when dealing with a medium to large sized archives.
@@ -335,7 +354,6 @@ gen_init(void)
 {
struct rlimit reslimit;
struct sigaction n_hand;
-   struct sigaction o_hand;
 
/*
 * Really needed to handle large archives. We can run out of memory for
@@ -389,34 +407,16 @@ gen_init(void)
n_hand.sa_flags = 0;
n_hand.sa_handler = sig_cleanup;
 
-   if ((sigaction(SIGHUP, _hand, _hand) < 0) &&
-   (o_hand.sa_handler == SIG_IGN) &&
-   (sigaction(SIGHUP, _hand, _hand) < 0))
+   if (setup_sig(SIGHUP,  _hand) ||
+  setup_sig(SIGTERM, _hand) ||
+  setup_sig(SIGINT,  _hand) ||
+  setup_sig(SIGQUIT, _hand) ||
+  setup_sig(SIGXCPU, _hand))
goto out;
 
-   if ((sigaction(SIGTERM, _hand, _hand) < 0) &&
-   (o_hand.sa_handler == SIG_IGN) &&
-   (sigaction(SIGTERM, _hand, _hand) < 0))
-   goto out;
-
-   if ((sigaction(SIGINT, _hand, _hand) < 0) &&
-   (o_hand.sa_handler == SIG_IGN) &&
-   (sigaction(SIGINT, _hand, _hand) < 0))
-   goto out;
-
-   if ((sigaction(SIGQUIT, _hand, _hand) < 0) &&
-   (o_hand.sa_handler == SIG_IGN) &&
-   (sigaction(SIGQUIT, _hand, _hand) < 0))
-   goto out;
-
-   if ((sigaction(SIGXCPU, _hand, _hand) < 0) &&
-   (o_hand.sa_handler == SIG_IGN) &&
-   (sigaction(SIGXCPU, _hand, _hand) < 0))
-   goto out;
-
n_hand.sa_handler = SIG_IGN;
-   if ((sigaction(SIGPIPE, _hand, _hand) < 0) ||
-   (sigaction(SIGXFSZ, _hand, _hand) < 0))
+   if ((sigaction(SIGPIPE, _hand, NULL) < 0) ||
+   (sigaction(SIGXFSZ, _hand, NULL) < 0))
goto out;
return(0);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328486 - head/usr.bin/fortune/fortune

2018-01-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jan 27 17:43:09 2018
New Revision: 328486
URL: https://svnweb.freebsd.org/changeset/base/328486

Log:
  fortune(6): Fix gcc80 -Wbool-operation warnings.
  
  Hinted by:Dragonfly (git 4d1086765752f0569497d06460d95117c74f33ac)

Modified:
  head/usr.bin/fortune/fortune/fortune.c

Modified: head/usr.bin/fortune/fortune/fortune.c
==
--- head/usr.bin/fortune/fortune/fortune.c  Sat Jan 27 17:24:59 2018
(r328485)
+++ head/usr.bin/fortune/fortune/fortune.c  Sat Jan 27 17:43:09 2018
(r328486)
@@ -289,35 +289,35 @@ getargs(int argc, char *argv[])
 #endif /* DEBUG */
switch(ch) {
case 'a':   /* any fortune */
-   All_forts++;
+   All_forts = TRUE;
break;
 #ifdef DEBUG
case 'D':
Debug++;
break;
 #endif /* DEBUG */
-   case 'e':
-   Equal_probs++;  /* scatter un-allocted prob equally */
+   case 'e':   /* scatter un-allocted prob equally */
+   Equal_probs = TRUE;
break;
case 'f':   /* find fortune files */
-   Find_files++;
+   Find_files = TRUE;
break;
case 'l':   /* long ones only */
-   Long_only++;
+   Long_only = TRUE;
Short_only = FALSE;
break;
case 'o':   /* offensive ones only */
-   Offend++;
+   Offend = TRUE;
break;
case 's':   /* short ones only */
-   Short_only++;
+   Short_only = TRUE;
Long_only = FALSE;
break;
case 'w':   /* give time to read */
-   Wait++;
+   Wait = TRUE;
break;
case 'm':   /* dump out the fortunes */
-   Match++;
+   Match = TRUE;
pat = optarg;
break;
case 'i':   /* case-insensitive match */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328480 - in head/sys: fs/ext2fs ufs/ufs

2018-01-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jan 27 16:34:00 2018
New Revision: 328480
URL: https://svnweb.freebsd.org/changeset/base/328480

Log:
  Revert r328479:
  {ext2|ufs}_readdir: Set limit on valid ncookies values.
  
  We aren't allowed to set resid like this.
  
  Pointed out by:   kib, imp

Modified:
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cSat Jan 27 15:33:52 2018
(r328479)
+++ head/sys/fs/ext2fs/ext2_lookup.cSat Jan 27 16:34:00 2018
(r328480)
@@ -145,18 +145,14 @@ ext2_readdir(struct vop_readdir_args *ap)
off_t offset, startoffset;
size_t readcnt, skipcnt;
ssize_t startresid;
-   int ncookies;
+   u_int ncookies;
int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize;
int error;
 
if (uio->uio_offset < 0)
return (EINVAL);
ip = VTOI(vp);
-   if (uio->uio_resid < 0)
-   uio->uio_resid = 0;
if (ap->a_ncookies != NULL) {
-   if (uio->uio_resid > MAXPHYS)
-   uio->uio_resid = MAXPHYS;
ncookies = uio->uio_resid;
if (uio->uio_offset >= ip->i_size)
ncookies = 0;

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cSat Jan 27 15:33:52 2018
(r328479)
+++ head/sys/ufs/ufs/ufs_vnops.cSat Jan 27 16:34:00 2018
(r328480)
@@ -2170,7 +2170,7 @@ ufs_readdir(ap)
off_t offset, startoffset;
size_t readcnt, skipcnt;
ssize_t startresid;
-   int ncookies;
+   u_int ncookies;
int error;
 
if (uio->uio_offset < 0)
@@ -2178,11 +2178,7 @@ ufs_readdir(ap)
ip = VTOI(vp);
if (ip->i_effnlink == 0)
return (0);
-   if (uio->uio_resid < 0)
-   uio->uio_resid = 0;
if (ap->a_ncookies != NULL) {
-   if (uio->uio_resid > MAXPHYS)
-   uio->uio_resid = MAXPHYS;
ncookies = uio->uio_resid;
if (uio->uio_offset >= ip->i_size)
ncookies = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328479 - in head/sys: fs/ext2fs ufs/ufs

2018-01-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jan 27 15:33:52 2018
New Revision: 328479
URL: https://svnweb.freebsd.org/changeset/base/328479

Log:
  {ext2|ufs}_readdir: Set limit on valid ncookies values.
  
  Sanitize the values that will be assigned to ncookies so that we ensure
  they are sane and we can handle them.
  
  Let ncookies signed as it was before r328346. The valid range is such
  that unsigned values are not required and we are not able to avoid at
  least one cast anyways.
  
  Hinted by:bde

Modified:
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cSat Jan 27 13:46:55 2018
(r328478)
+++ head/sys/fs/ext2fs/ext2_lookup.cSat Jan 27 15:33:52 2018
(r328479)
@@ -145,14 +145,18 @@ ext2_readdir(struct vop_readdir_args *ap)
off_t offset, startoffset;
size_t readcnt, skipcnt;
ssize_t startresid;
-   u_int ncookies;
+   int ncookies;
int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize;
int error;
 
if (uio->uio_offset < 0)
return (EINVAL);
ip = VTOI(vp);
+   if (uio->uio_resid < 0)
+   uio->uio_resid = 0;
if (ap->a_ncookies != NULL) {
+   if (uio->uio_resid > MAXPHYS)
+   uio->uio_resid = MAXPHYS;
ncookies = uio->uio_resid;
if (uio->uio_offset >= ip->i_size)
ncookies = 0;

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cSat Jan 27 13:46:55 2018
(r328478)
+++ head/sys/ufs/ufs/ufs_vnops.cSat Jan 27 15:33:52 2018
(r328479)
@@ -2170,7 +2170,7 @@ ufs_readdir(ap)
off_t offset, startoffset;
size_t readcnt, skipcnt;
ssize_t startresid;
-   u_int ncookies;
+   int ncookies;
int error;
 
if (uio->uio_offset < 0)
@@ -2178,7 +2178,11 @@ ufs_readdir(ap)
ip = VTOI(vp);
if (ip->i_effnlink == 0)
return (0);
+   if (uio->uio_resid < 0)
+   uio->uio_resid = 0;
if (ap->a_ncookies != NULL) {
+   if (uio->uio_resid > MAXPHYS)
+   uio->uio_resid = MAXPHYS;
ncookies = uio->uio_resid;
if (uio->uio_offset >= ip->i_size)
ncookies = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328406 - head/sys/fs/ext2fs

2018-01-25 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Jan 25 18:01:46 2018
New Revision: 328406
URL: https://svnweb.freebsd.org/changeset/base/328406

Log:
  Minor style issue introduced in r328346.
  
  Pointed by:   bde

Modified:
  head/sys/fs/ext2fs/ext2_lookup.c

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cThu Jan 25 17:53:33 2018
(r328405)
+++ head/sys/fs/ext2fs/ext2_lookup.cThu Jan 25 18:01:46 2018
(r328406)
@@ -145,9 +145,9 @@ ext2_readdir(struct vop_readdir_args *ap)
off_t offset, startoffset;
size_t readcnt, skipcnt;
ssize_t startresid;
+   u_int ncookies;
int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize;
int error;
-   u_int ncookies;
 
if (uio->uio_offset < 0)
return (EINVAL);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328346 - in head/sys: fs/ext2fs ufs/ffs ufs/ufs

2018-01-24 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jan 24 17:58:48 2018
New Revision: 328346
URL: https://svnweb.freebsd.org/changeset/base/328346

Log:
  ext2fs|ufs:Unsign some values related to allocation.
  
  When allocating memory through malloc(9), we always expect the amount of
  memory requested to be unsigned as a negative value would either stand for
  an error or an overflow.
  Unsign some values, found when considering the use of mallocarray(9), to
  avoid unnecessary casting. Also consider that indexes should be of
  at least the same size/type as the upper limit they pretend to index.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ufs/ufs_dirhash.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cWed Jan 24 17:52:06 2018
(r328345)
+++ head/sys/fs/ext2fs/ext2_lookup.cWed Jan 24 17:58:48 2018
(r328346)
@@ -145,9 +145,9 @@ ext2_readdir(struct vop_readdir_args *ap)
off_t offset, startoffset;
size_t readcnt, skipcnt;
ssize_t startresid;
-   int ncookies;
int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize;
int error;
+   u_int ncookies;
 
if (uio->uio_offset < 0)
return (EINVAL);

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Wed Jan 24 17:52:06 2018
(r328345)
+++ head/sys/ufs/ffs/ffs_softdep.c  Wed Jan 24 17:58:48 2018
(r328346)
@@ -2466,7 +2466,8 @@ softdep_mount(devvp, mp, fs, cred)
struct ufsmount *ump;
struct cg *cgp;
struct buf *bp;
-   int i, error, cyl;
+   u_int cyl, i;
+   int error;
 
sdp = malloc(sizeof(struct mount_softdeps), M_MOUNTDATA,
M_WAITOK | M_ZERO);

Modified: head/sys/ufs/ufs/ufs_dirhash.c
==
--- head/sys/ufs/ufs/ufs_dirhash.c  Wed Jan 24 17:52:06 2018
(r328345)
+++ head/sys/ufs/ufs/ufs_dirhash.c  Wed Jan 24 17:58:48 2018
(r328346)
@@ -349,7 +349,8 @@ ufsdirhash_build(struct inode *ip)
struct direct *ep;
struct vnode *vp;
doff_t bmask, pos;
-   int dirblocks, i, j, memreqd, nblocks, narrays, nslots, slot;
+   u_int dirblocks, i, narrays, nblocks, nslots;
+   int j, memreqd, slot;
 
/* Take care of a decreased sysctl value. */
while (ufs_dirhashmem > ufs_dirhashmaxmem) {

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cWed Jan 24 17:52:06 2018
(r328345)
+++ head/sys/ufs/ufs/ufs_vnops.cWed Jan 24 17:58:48 2018
(r328346)
@@ -2170,7 +2170,7 @@ ufs_readdir(ap)
off_t offset, startoffset;
size_t readcnt, skipcnt;
ssize_t startresid;
-   int ncookies;
+   u_int ncookies;
int error;
 
if (uio->uio_offset < 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328340 - in head/sys: fs/ext2fs ufs/ffs ufs/ufs

2018-01-24 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jan 24 16:44:57 2018
New Revision: 328340
URL: https://svnweb.freebsd.org/changeset/base/328340

Log:
  Revert r327781,  r328093, r328056:
  ufs|ext2fs: Revert uses of mallocarray(9).
  
  These aren't really useful: drop them.
  Variable unsigning will be brought again later.

Modified:
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/ufs/ffs/ffs_snapshot.c
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ufs/ufs_dirhash.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cWed Jan 24 16:40:26 2018
(r328339)
+++ head/sys/fs/ext2fs/ext2_lookup.cWed Jan 24 16:44:57 2018
(r328340)
@@ -145,9 +145,9 @@ ext2_readdir(struct vop_readdir_args *ap)
off_t offset, startoffset;
size_t readcnt, skipcnt;
ssize_t startresid;
+   int ncookies;
int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize;
int error;
-   u_int ncookies;
 
if (uio->uio_offset < 0)
return (EINVAL);
@@ -160,8 +160,7 @@ ext2_readdir(struct vop_readdir_args *ap)
ncookies = ip->i_size - uio->uio_offset;
ncookies = ncookies / (offsetof(struct ext2fs_direct_2,
e2d_namlen) + 4) + 1;
-   cookies = mallocarray(ncookies, sizeof(*cookies), M_TEMP,
-   M_WAITOK);
+   cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK);
*ap->a_ncookies = ncookies;
*ap->a_cookies = cookies;
} else {

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==
--- head/sys/fs/ext2fs/ext2_vfsops.cWed Jan 24 16:40:26 2018
(r328339)
+++ head/sys/fs/ext2fs/ext2_vfsops.cWed Jan 24 16:44:57 2018
(r328340)
@@ -400,9 +400,9 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es
fs->e2fs_bsize / sizeof(struct ext2_gd));
}
fs->e2fs_gdbcount = howmany(fs->e2fs_gcount, e2fs_descpb);
-   fs->e2fs_gd = mallocarray(e2fs_gdbcount_alloc, fs->e2fs_bsize,
+   fs->e2fs_gd = malloc(e2fs_gdbcount_alloc * fs->e2fs_bsize,
M_EXT2MNT, M_WAITOK | M_ZERO);
-   fs->e2fs_contigdirs = mallocarray(fs->e2fs_gcount,
+   fs->e2fs_contigdirs = malloc(fs->e2fs_gcount *
sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK | M_ZERO);
 
/*
@@ -683,8 +683,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp)
for (i = 0; i < ump->um_e2fs->e2fs_gcount; i++, sump++) {
*lp++ = ump->um_e2fs->e2fs_contigsumsize;
sump->cs_init = 0;
-   sump->cs_sum = mallocarray(
-   ump->um_e2fs->e2fs_contigsumsize + 1,
+   sump->cs_sum = malloc((ump->um_e2fs->e2fs_contigsumsize 
+ 1) *
sizeof(int32_t), M_EXT2MNT, M_WAITOK | M_ZERO);
}
}

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==
--- head/sys/ufs/ffs/ffs_snapshot.c Wed Jan 24 16:40:26 2018
(r328339)
+++ head/sys/ufs/ffs/ffs_snapshot.c Wed Jan 24 16:44:57 2018
(r328340)
@@ -648,7 +648,7 @@ loop:
 * keep us out of deadlock until the full one is ready.
 */
if (xp == NULL) {
-   snapblklist = mallocarray(snaplistsize, sizeof(daddr_t),
+   snapblklist = malloc(snaplistsize * sizeof(daddr_t),
M_UFSMNT, M_WAITOK);
blkp = [1];
*blkp++ = lblkno(fs, fs->fs_sblockloc);
@@ -729,7 +729,7 @@ out1:
/*
 * Allocate space for the full list of preallocated snapshot blocks.
 */
-   snapblklist = mallocarray(snaplistsize, sizeof(daddr_t),
+   snapblklist = malloc(snaplistsize * sizeof(daddr_t),
M_UFSMNT, M_WAITOK);
ip->i_snapblklist = [1];
/*

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Wed Jan 24 16:40:26 2018
(r328339)
+++ head/sys/ufs/ffs/ffs_softdep.c  Wed Jan 24 16:44:57 2018
(r328340)
@@ -2466,8 +2466,7 @@ softdep_mount(devvp, mp, fs, cred)
struct ufsmount *ump;
struct cg *cgp;
struct buf *bp;
-   u_int cyl, i;
-   int error;
+   int i, error, cyl;
 
sdp = malloc(sizeof(struct mount_softdeps), M_MOUNTDATA,
M_WAITOK | M_ZERO);
@@ -2501,7 +2500,7 @@ softdep_mount(devvp, mp, fs, cred)
ump->bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP,
>bmsafemap_hash_size);
i = 1 << (ffs(desiredvnodes / 10) - 1);
-   ump->indir_hashtbl = mallocarray(i, sizeof(struct 

svn commit: r328280 - head/sys/fs/ext2fs

2018-01-23 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Jan 23 14:17:04 2018
New Revision: 328280
URL: https://svnweb.freebsd.org/changeset/base/328280

Log:
  extfs: Remove unused variables.
  
  Found by: scan-build
  Reviewed by:  fsu
  Differential Revision:https://reviews.freebsd.org/D14017

Modified:
  head/sys/fs/ext2fs/ext2_csum.c
  head/sys/fs/ext2fs/ext2_extents.c
  head/sys/fs/ext2fs/ext2_lookup.c

Modified: head/sys/fs/ext2fs/ext2_csum.c
==
--- head/sys/fs/ext2fs/ext2_csum.c  Tue Jan 23 13:03:47 2018
(r328279)
+++ head/sys/fs/ext2fs/ext2_csum.c  Tue Jan 23 14:17:04 2018
(r328280)
@@ -535,12 +535,11 @@ static uint32_t
 ext2_ei_csum(struct inode *ip, struct ext2fs_dinode *ei)
 {
struct m_ext2fs *fs;
-   uint16_t old_lo, old_hi;
+   uint16_t old_hi;
uint32_t inum, gen, crc;
 
fs = ip->i_e2fs;
 
-   old_lo = ei->e2di_chksum_lo;
ei->e2di_chksum_lo = 0;
if ((EXT2_INODE_SIZE(ip->i_e2fs) > E2FS_REV0_INODE_SIZE &&
ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) {

Modified: head/sys/fs/ext2fs/ext2_extents.c
==
--- head/sys/fs/ext2fs/ext2_extents.c   Tue Jan 23 13:03:47 2018
(r328279)
+++ head/sys/fs/ext2fs/ext2_extents.c   Tue Jan 23 14:17:04 2018
(r328280)
@@ -125,10 +125,8 @@ ext4_ext_print_path(struct inode *ip, struct ext4_exte
 void
 ext4_ext_print_extent_tree_status(struct inode * ip)
 {
-   struct m_ext2fs *fs;
struct ext4_extent_header *ehp;
 
-   fs = ip->i_e2fs;
ehp = (struct ext4_extent_header *)(char *)ip->i_db;
 
printf("Extent status:ip=%d\n", ip->i_number);
@@ -882,7 +880,6 @@ ext4_ext_grow_indepth(struct inode *ip, struct ext4_ex
struct m_ext2fs *fs;
struct ext4_extent_path *curpath;
struct ext4_extent_header *neh;
-   struct ext4_extent_index *fidx;
struct buf *bp;
e4fs_daddr_t newblk;
int error = 0;
@@ -925,7 +922,6 @@ ext4_ext_grow_indepth(struct inode *ip, struct ext4_ex
ext4_index_store_pblock(curpath->ep_index, newblk);
 
neh = ext4_ext_inode_header(ip);
-   fidx = EXT_FIRST_INDEX(neh);
neh->eh_depth = path->ep_depth + 1;
ext4_ext_dirty(ip, curpath);
 out:
@@ -938,12 +934,9 @@ static int
 ext4_ext_create_new_leaf(struct inode *ip, struct ext4_extent_path *path,
 struct ext4_extent *newext)
 {
-   struct m_ext2fs *fs;
struct ext4_extent_path *curpath;
int depth, i, error;
 
-   fs = ip->i_e2fs;
-
 repeat:
i = depth = ext4_ext_inode_depth(ip);
 
@@ -1033,13 +1026,11 @@ static int
 ext4_ext_insert_extent(struct inode *ip, struct ext4_extent_path *path,
 struct ext4_extent *newext)
 {
-   struct m_ext2fs *fs;
struct ext4_extent_header * eh;
struct ext4_extent *ex, *nex, *nearex;
struct ext4_extent_path *npath;
int depth, len, error, next;
 
-   fs = ip->i_e2fs;
depth = ext4_ext_inode_depth(ip);
ex = path[depth].ep_ext;
npath = NULL;
@@ -1166,11 +1157,9 @@ ext4_new_blocks(struct inode *ip, daddr_t lbn, e4fs_da
 struct ucred *cred, unsigned long *count, int *perror)
 {
struct m_ext2fs *fs;
-   struct ext2mount *ump;
e4fs_daddr_t newblk;
 
fs = ip->i_e2fs;
-   ump = ip->i_ump;
 
/*
 * We will allocate only single block for now.

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cTue Jan 23 13:03:47 2018
(r328279)
+++ head/sys/fs/ext2fs/ext2_lookup.cTue Jan 23 14:17:04 2018
(r328280)
@@ -869,8 +869,8 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, str
struct inode *dp;
struct ext2fs_direct_2 newdir;
struct buf *bp;
-   int error, newentrysize;
int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize;
+   int error;
 
 
 #ifdef INVARIANTS
@@ -886,7 +886,6 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, str
else
newdir.e2d_type = EXT2_FT_UNKNOWN;
bcopy(cnp->cn_nameptr, newdir.e2d_name, (unsigned)cnp->cn_namelen + 1);
-   newentrysize = EXT2_DIR_REC_LEN(newdir.e2d_namlen);
 
if (ext2_htree_has_idx(dp)) {
error = ext2_htree_add_entry(dvp, , cnp);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328261 - head/sys/dev/drm2

2018-01-22 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 22 15:55:51 2018
New Revision: 328261
URL: https://svnweb.freebsd.org/changeset/base/328261

Log:
  drm2: Basic use of mallocarray(9).
  
  These functions deal the same type of overflows we do with mallocarray(9).
  Using our mallocarray will panic, which different from the previous
  behavior (returning NULL), but neither behavior is more correct.
  
  As a sidenote, drm_calloc_large() is not currently used at all.
  
  Reviewed by:  dumbbell
  Differential Revision:https://reviews.freebsd.org/D13835

Modified:
  head/sys/dev/drm2/drm_mem_util.h

Modified: head/sys/dev/drm2/drm_mem_util.h
==
--- head/sys/dev/drm2/drm_mem_util.hMon Jan 22 08:33:59 2018
(r328260)
+++ head/sys/dev/drm2/drm_mem_util.hMon Jan 22 15:55:51 2018
(r328261)
@@ -36,19 +36,15 @@ __FBSDID("$FreeBSD$");
 
 static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
 {
-   if (size != 0 && nmemb > SIZE_MAX / size)
-   return NULL;
 
-   return malloc(nmemb * size, DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
+   return mallocarray(nmemb, size, DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
 }
 
 /* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. 
*/
 static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size)
 {
-   if (size != 0 && nmemb > SIZE_MAX / size)
-   return NULL;
 
-   return malloc(nmemb * size, DRM_MEM_DRIVER, M_NOWAIT);
+   return mallocarray(nmemb, size, DRM_MEM_DRIVER, M_NOWAIT);
 }
 
 static __inline void drm_free_large(void *ptr)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328239 - head/sys/kern

2018-01-21 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 22 02:26:10 2018
New Revision: 328239
URL: https://svnweb.freebsd.org/changeset/base/328239

Log:
  Forgot to sort here in r328238.

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==
--- head/sys/kern/uipc_usrreq.c Mon Jan 22 02:08:10 2018(r328238)
+++ head/sys/kern/uipc_usrreq.c Mon Jan 22 02:26:10 2018(r328239)
@@ -1560,7 +1560,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
struct unp_head *head;
struct xunpcb *xu;
u_int i;
-   int freeunp, error, n;
+   int error, freeunp, n;
 
switch ((intptr_t)arg1) {
case SOCK_STREAM:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r328238 - in head/sys: cam/scsi dev/mps fs/cd9660 fs/nandfs fs/nfsclient kern netpfil/ipfw netsmb x86/x86

2018-01-21 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jan 22 02:08:10 2018
New Revision: 328238
URL: https://svnweb.freebsd.org/changeset/base/328238

Log:
  Unsign some values related to allocation.
  
  When allocating memory through malloc(9), we always expect the amount of
  memory requested to be unsigned as a negative value would either stand for
  an error or an overflow.
  Unsign some values, found when considering the use of mallocarray(9), to
  avoid unnecessary casting. Also consider that indexes should be of
  at least the same size/type as the upper limit they pretend to index.
  
  MFC after:3 weeks

Modified:
  head/sys/cam/scsi/scsi_ch.c
  head/sys/dev/mps/mps.c
  head/sys/fs/cd9660/cd9660_vnops.c
  head/sys/fs/nandfs/nandfs_vfsops.c
  head/sys/fs/nfsclient/nfs_clvnops.c
  head/sys/kern/kern_exec.c
  head/sys/kern/link_elf_obj.c
  head/sys/kern/subr_hash.c
  head/sys/kern/uipc_usrreq.c
  head/sys/netpfil/ipfw/ip_fw_sockopt.c
  head/sys/netpfil/ipfw/ip_fw_table_algo.c
  head/sys/netsmb/smb_crypt.c
  head/sys/x86/x86/mca.c

Modified: head/sys/cam/scsi/scsi_ch.c
==
--- head/sys/cam/scsi/scsi_ch.c Mon Jan 22 01:50:10 2018(r328237)
+++ head/sys/cam/scsi/scsi_ch.c Mon Jan 22 02:08:10 2018(r328238)
@@ -1198,13 +1198,14 @@ chgetelemstatus(struct cam_periph *periph, int scsi_ve
struct read_element_status_descriptor *desc;
caddr_t data = NULL;
size_t size, desclen;
-   int avail, i, error = 0;
+   u_int avail, i;
int curdata, dvcid, sense_flags;
int try_no_dvcid = 0;
struct changer_element_status *user_data = NULL;
struct ch_softc *softc;
union ccb *ccb;
int chet = cesr->cesr_element_type;
+   int error = 0;
int want_voltags = (cesr->cesr_flags & CESR_VOLTAGS) ? 1 : 0;
 
softc = (struct ch_softc *)periph->softc;

Modified: head/sys/dev/mps/mps.c
==
--- head/sys/dev/mps/mps.c  Mon Jan 22 01:50:10 2018(r328237)
+++ head/sys/dev/mps/mps.c  Mon Jan 22 02:08:10 2018(r328238)
@@ -1164,7 +1164,7 @@ static int
 mps_alloc_queues(struct mps_softc *sc)
 {
struct mps_queue *q;
-   int nq, i;
+   u_int nq, i;
 
nq = sc->msi_msgs;
mps_dprint(sc, MPS_INIT|MPS_XINFO, "Allocating %d I/O queues\n", nq);

Modified: head/sys/fs/cd9660/cd9660_vnops.c
==
--- head/sys/fs/cd9660/cd9660_vnops.c   Mon Jan 22 01:50:10 2018
(r328237)
+++ head/sys/fs/cd9660/cd9660_vnops.c   Mon Jan 22 02:08:10 2018
(r328238)
@@ -481,7 +481,7 @@ cd9660_readdir(ap)
int error = 0;
int reclen;
u_short namelen;
-   int ncookies = 0;
+   u_int ncookies = 0;
u_long *cookies = NULL;
cd_ino_t ino;
 

Modified: head/sys/fs/nandfs/nandfs_vfsops.c
==
--- head/sys/fs/nandfs/nandfs_vfsops.c  Mon Jan 22 01:50:10 2018
(r328237)
+++ head/sys/fs/nandfs/nandfs_vfsops.c  Mon Jan 22 02:08:10 2018
(r328238)
@@ -561,7 +561,7 @@ nandfs_read_structures(struct nandfs_device *fsdev)
 {
struct nandfs_fsdata *fsdata, *fsdatat;
struct nandfs_super_block *sblocks, *ssblock;
-   int nsbs, nfsds, i;
+   u_int nsbs, nfsds, i;
int error = 0;
int nrsbs;
 

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==
--- head/sys/fs/nfsclient/nfs_clvnops.c Mon Jan 22 01:50:10 2018
(r328237)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Jan 22 02:08:10 2018
(r328238)
@@ -2666,7 +2666,7 @@ ncl_flush(struct vnode *vp, int waitfor, struct thread
 #defineNFS_COMMITBVECSIZ   20
 #endif
struct buf *bvec_on_stack[NFS_COMMITBVECSIZ];
-   int bvecsize = 0, bveccount;
+   u_int bvecsize = 0, bveccount;
 
if (called_from_renewthread != 0)
slptimeo = hz;

Modified: head/sys/kern/kern_exec.c
==
--- head/sys/kern/kern_exec.c   Mon Jan 22 01:50:10 2018(r328237)
+++ head/sys/kern/kern_exec.c   Mon Jan 22 02:08:10 2018(r328238)
@@ -1693,7 +1693,7 @@ int
 exec_register(const struct execsw *execsw_arg)
 {
const struct execsw **es, **xs, **newexecsw;
-   int count = 2;  /* New slot and trailing NULL */
+   u_int count = 2;/* New slot and trailing NULL */
 
if (execsw)
for (es = execsw; *es; es++)

Modified: head/sys/kern/link_elf_obj.c
==
--- head/sys/kern/link_elf_obj.cMon Jan 22 01:50:10 2018
(r328237)
+++ head/sys/kern/link_elf_obj.cMon Jan 22 02:08:10 2018
(r328238)
@@ 

  1   2   3   4   5   6   7   8   9   10   >