Re: svn commit: r355164 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/trm sys/i386/conf sys/modules sys/modules/trm
Am 28.11.19 um 05:29 schrieb Rodney W. Grimes: >> Author: scottl >> Date: Thu Nov 28 02:32:17 2019 >> New Revision: 355164 >> URL: https://svnweb.freebsd.org/changeset/base/355164 >> >> Log: >> Remove the trm(4) driver >> >> Differential Revision: https://reviews.freebsd.org/D22575 > > Deprecation notice to merge to stable/{12,11}? > Relnotes entry? All devices supported by the trm driver were also covered by sym, but the trm driver was provided by Tekram and it did support the configuration of the bus mode by means of a BIOS menu (but these BIOS values were also found and used by the sym driver). As long as the sym driver remains in the tree, Tekram controllers that work with trm will still be supported. A deprecation note and release notes entry to the effect that sym will attach to Tekram controllers (compiled into a custom kernel or as module) should be sufficient. I do still have some generic Symbios cards and also some Tekram cards, but lack other required components required to perform any tests with them ... Regards, STefan ___ 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: r362681 - in head: contrib/bc contrib/bc/gen contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/src contrib/bc/src/bc contrib/bc/src/dc contrib/bc/src/history contrib/b...
0 < -1` to +return `0`. This only happened with negative numbers and only if the value on +the left was more negative by a certain amount. That said, this bug *is* a bad +bug, and needs to be fixed. + +**ALL USERS SHOULD UPDATE `bc`**. + +## 2.3.0 + +This is a production release with changes to the build system. + +## 2.2.0 + +This release is a production release. It only has new features and performance +improvements. + +1. The performance of `sqrt(x)` was improved. +2. The new function `root(x, n)` was added to the extended math library to + calculate `n`th roots. +3. The new function `cbrt(x)` was added to the extended math library to + calculate cube roots. + +## 2.1.3 + +This is a non-critical release; it just changes the build system, and in +non-breaking ways: + +1. Linked locale files were changed to link to their sources with a relative + link. +2. A bug in `configure.sh` that caused long option parsing to fail under `bash` + was fixed. + +## 2.1.2 + +This release is not a critical release. + +1. A few codes were added to history. +2. Multiplication was optimized a bit more. +3. Addition and subtraction were both optimized a bit more. + +## 2.1.1 + +This release contains a fix for the test suite made for Linux from Scratch: now +the test suite prints `pass` when a test is passed. + +Other than that, there is no change in this release, so distros and other users +do not need to upgrade. + +## 2.1.0 + +This release is a production release. + +The following bugs were fixed: + +1. A `dc` bug that caused stack mishandling was fixed. +2. A warning on OpenBSD was fixed. +3. Bugs in `ctrl+arrow` operations in history were fixed. +4. The ability to paste multiple lines in history was added. +5. A `bc` bug, mishandling of array arguments to functions, was fixed. +6. A crash caused by freeing the wrong pointer was fixed. +7. A `dc` bug where strings, in a rare case, were mishandled in parsing was + fixed. + +In addition, the following changes were made: + +1. Division was slightly optimized. +2. An option was added to the build to disable printing of prompts. +3. The special case of empty arguments is now handled. This is to prevent + errors in scripts that end up passing empty arguments. +4. A harmless bug was fixed. This bug was that, with the pop instructions + (mostly) removed (see below), `bc` would leave extra values on its stack for + `void` functions and in a few other cases. These extra items would not + affect anything put on the stack and would not cause any sort of crash or + even buggy behavior, but they would cause `bc` to take more memory than it + needed. + +On top of the above changes, the following optimizations were added: + +1. The need for pop instructions in `bc` was removed. +2. Extra tests on every iteration of the interpreter loop were removed. +3. Updating function and code pointers on every iteration of the interpreter + loop was changed to only updating them when necessary. +4. Extra assignments to pointers were removed. + +Altogether, these changes sped up the interpreter by around 2x. + +***NOTE***: This is the last release with new features because this `bc` is now +considered complete. From now on, only bug fixes and new translations will be +added to this `bc`. + +## 2.0.3 + +This is a production, bug-fix release. + +Two bugs were fixed in this release: + +1. A rare and subtle signal handling bug was fixed. +2. A misbehavior on `0` to a negative power was fixed. + +The last bug bears some mentioning. + +When I originally wrote power, I did not thoroughly check its error cases; +instead, I had it check if the first number was `0` and then if so, just return +`0`. However, `0` to a negative power means that `1` will be divided by `0`, +which is an error. + +I caught this, but only after I stopped being cocky. You see, sometime later, I +had noticed that GNU `bc` returned an error, correctly, but I thought it was +wrong simply because that's not what my `bc` did. I saw it again later and had a +double take. I checked for real, finally, and found out that my `bc` was wrong +all along. + +That was bad on me. But the bug was easy to fix, so it is fixed now. + +There are two other things in this release: + +1. Subtraction was optimized by [Stefan Eßer][14]. +2. Division was also optimized, also by Stefan Eßer. + +## 2.0.2 + +This release contains a fix for a possible overflow in the signal handling. I +would be surprised if any users ran into it because it would only happen after 2 +billion (`2^31-1`) `SIGINT`'s, but I saw it and had to fix it. + +## 2.0.1 + +This release contains very few things that will apply to any users. + +1. A slight bug in `dc`'s interactive mode was fixed. +2. A bug in the test suite that was only triggered on NetBSD was fixed. +3. **The `-P
Re: svn commit: r362681 - in head: contrib/bc contrib/bc/gen contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/src contrib/bc/src/bc contrib/bc/src/dc contrib/bc/src/history contrib/
Am 27.06.20 um 23:52 schrieb Eric van Gyzen: > On 6/27/20 8:11 AM, John Baldwin wrote: >> On 6/27/20 5:02 AM, Stefan Eßer wrote: >>> Author: se >>> Date: Sat Jun 27 12:02:01 2020 >>> New Revision: 362681 >>> URL: https://svnweb.freebsd.org/changeset/base/362681 >>> >>> Log: >>> Import new 2-clause BSD licenced implementation of the bc and dc >>> commands >> >> Hmm, I didn't see a commit to add the vendor sources into ^/vendor >> first via our >> standard process for contrib sources, nor any discussion about that in >> the review. > > When you add this to the vendor area, please include the tests, to > remove a barrier to integration. Hi Eric, I have already imported the full sources into the vendor area, including the tests. These tests compare the output of this bc and dc with that of GNU bc/dc and are run as regression tests by the author before a release is tagged (and have been extended over time for each area where an issue has been found). Extensive fuzzing is also performed to verify that the low level math functions give correct results (again using another bc/dc as reference), but we do not want to include those particular tests. I'd like to make the tests available as regression tests in FreeBSD, but have not looked at the best way to integrate them, yet. (The tests are meant to be run within the source directory after building from sources in place, for example, which is not at all what we do in FreeBSD.) Independently of the issue of tests, I'm not sure about the best way to proceed from the current situation with regard to what's in contrib/bc now, and I have decided to leave the incomplete import untouched in contrib/bc until I understand the best way forward. I could delete what's currently in contrib/bc and use svn copy to make the whole contents of vendor/bc/dist available in contrib/bc. The tests require 1112 KB of space, while the rest of the sources takes up less than 900 KB. I could revert the full import to contrib/bc, but that would also revert changes to e.g. usr.bin/Makefile and I'd rather remove just what's now in contrib/bc and then use svn copy to make vendor/bc/dist available there. The sources from the dist directory can be used unmodified, the reason for cherry-picking was just that I did not want to import more than is used at this time ... I'd appreciate any advice given about what causes the least repo churn and extra effort for the Git conversion. Regards, STefan ___ 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"
Re: svn commit: r362681 - in head: contrib/bc contrib/bc/gen contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/src contrib/bc/src/bc contrib/bc/src/dc contrib/bc/src/history contrib/
Am 29.06.20 um 20:09 schrieb Ed Maste: > On Mon, 29 Jun 2020 at 11:27, John Baldwin wrote: >> >> I suspect just doing the 'merge --record-only' is the simplest method >> assuming Git handles it ok. I suspect since Git ignores mergeinfo this >> is fine, but it would be good for Ed to confirm. You can always restore >> the tests in the future in contrib/bc when you want to add them. > > I think a --record-only merge is the best approach; in any case we > have a number of these in the tree already and Git will have to deal > with them. Thank you for this advice. There is a new version, which differs only in the man-pages. These used to mention optional features (of which only NLS support is actually optional in the version built on FreeBSD, all other are always compiled in, and I had mentioned to the author that this might irritate FreeBSD users). I have suggested to the author to add SPDX BSD-2-Clause tags, which would change a large fraction of the currently committed files. Is it required to perform the --record-only merge, then? Or would it be OK to import the new release into the vendor branch and then svn copy that version completely (including the tests and other files that I had omitted in the initial import) to contrib? I expect the svn copy without prior svn merge --record-only to result in the same repository state after the conversion to Git, but I do not really know ... Regards, STefan ___ 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"
Re: svn commit: r362681 - in head: contrib/bc contrib/bc/gen contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/src contrib/bc/src/bc contrib/bc/src/dc contrib/bc/src/history contrib/
Am 29.06.20 um 20:09 schrieb Ed Maste: > On Mon, 29 Jun 2020 at 11:27, John Baldwin wrote: >> >> I suspect just doing the 'merge --record-only' is the simplest method >> assuming Git handles it ok. I suspect since Git ignores mergeinfo this >> is fine, but it would be good for Ed to confirm. You can always restore >> the tests in the future in contrib/bc when you want to add them. > > I think a --record-only merge is the best approach; in any case we > have a number of these in the tree already and Git will have to deal > with them. $ cd /usr/svn/base/head/contrib/bc $ svn merge --record-only ^/vendor/bc/dist svn: E195016: 'svn+ssh://repo.freebsd.org/base/vendor/bc/dist@362810' must be ancestrally related to 'svn+ssh://repo.freebsd.org/base/head/contrib/bc@362810' Adding the option --ignore-ancestry to the merge command does not help. I have performed a clean check-out of base/head and base/vendor, but the error message stays the same ... SVN info for the relevant directories involved in the merge attempt: $ svn info /usr/svn/base/head/contrib/bc /usr/svn/base/vendor/bc/dist Path: usr/svn/base/head/contrib/bc Working Copy Root Path: /usr/svn/base URL: svn+ssh://repo.freebsd.org/base/head/contrib/bc Relative URL: ^/head/contrib/bc Repository Root: svn+ssh://repo.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 362810 Node Kind: directory Schedule: normal Last Changed Author: se Last Changed Rev: 362681 Last Changed Date: 2020-06-27 14:02:01 +0200 (Sat, 27 Jun 2020) Path: usr/svn/base/vendor/bc/dist Working Copy Root Path: /usr/svn/base URL: svn+ssh://repo.freebsd.org/base/vendor/bc/dist Relative URL: ^/vendor/bc/dist Repository Root: svn+ssh://repo.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 362810 Node Kind: directory Schedule: normal Last Changed Author: se Last Changed Rev: 362697 Last Changed Date: 2020-06-27 17:03:19 +0200 (Sat, 27 Jun 2020) Any idea how to merge from the vendor area in this situation? Regards, STefan ___ 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"
Re: svn commit: r362681 - in head: contrib/bc contrib/bc/gen contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/src contrib/bc/src/bc contrib/bc/src/dc contrib/bc/src/history contrib/
Am 30.06.20 um 23:29 schrieb Dimitry Andric: > On 30 Jun 2020, at 22:01, Stefan Eßer wrote: >> >> Am 29.06.20 um 20:09 schrieb Ed Maste: >>> On Mon, 29 Jun 2020 at 11:27, John Baldwin wrote: >>>> >>>> I suspect just doing the 'merge --record-only' is the simplest method >>>> assuming Git handles it ok. I suspect since Git ignores mergeinfo this >>>> is fine, but it would be good for Ed to confirm. You can always restore >>>> the tests in the future in contrib/bc when you want to add them. >>> >>> I think a --record-only merge is the best approach; in any case we >>> have a number of these in the tree already and Git will have to deal >>> with them. >> >> $ cd /usr/svn/base/head/contrib/bc >> >> $ svn merge --record-only ^/vendor/bc/dist >> svn: E195016: 'svn+ssh://repo.freebsd.org/base/vendor/bc/dist@362810' >> must be ancestrally related to >> 'svn+ssh://repo.freebsd.org/base/head/contrib/bc@362810' > > This is because you are supposed to commit stuff to ^/base/vendor/xxx > first, then svn cp it to ^/head/contrib/xxx, at least from Subversion > 1.8 onwards. The 'cp' action establishes the ancestral relation. Yes, I thought so - the problem I want to fix is the premature import to /contrib and I had been hoping that it was possible to use the --record-only merge to edit the merge history (as suggested by John Baldwin and Ed Maste). > Some of our older contrib areas were imported using cvs2svn, and these > also suffer the same problem, i.e. Subversion complains that the vendor > and contrib areas are not ancestrally related. I see. >> Adding the option --ignore-ancestry to the merge command does not help. > ... >> Any idea how to merge from the vendor area in this situation? > > As far as I know, you have these alternatives: > > * Delete the contrib/bc tree, and do a fresh svn cp from the vendor > area. You will have to apply any customizations on top again. I did > something like this to fixup contrib/libc++ in > https://svnweb.freebsd.org/base?view=revision&revision=287679 Yes, I could delete the files in contrib/bc and then immediately svn copy over the contents of vendor/bc/dist - and I guess that is the only real "clean" way forward. > * Figure out the right value of the svn:mergeinfo property, and apply > that by hand, using svn propset. This will be tricky, and has to be > re-done manually every time you want to merge again. Not my preferred approach ... > * Merge with Subversion 1.7 or earlier. If this would result in a sane state of the repository I might give it a try. > * Ignore all this, merge patches by hand and wait for the Git > transition to be completed. I want to upgrade to the next release and I'm wondering whether it would be possible to just svn copy that new version over from the vendor directory to the contrib directory. The import to the vendor area and the contrib directory have very similar commit messages and thus there would be no loss of commit history. If this is possible and does not cause problems for the SVN repo or the Git conversion, this might be the simplest solution. Thank you for your reply and the clarification of the situation! Best regards, STefan ___ 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: r362945 - head
Author: se Date: Sun Jul 5 14:43:14 2020 New Revision: 362945 URL: https://svnweb.freebsd.org/changeset/base/362945 Log: Add a note regarding the introduction of the new bc and dc implementations that are built by default on -CURRENT after 2020-06-26. Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Sun Jul 5 14:38:22 2020(r362944) +++ head/UPDATING Sun Jul 5 14:43:14 2020(r362945) @@ -26,6 +26,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200627: + A new implementation of bc and dc has been imorted in r362681. This + implementation corrects non-conformant behavior of the previous bc + and adds GNU bc compatible options. It offers a number of extensions, + is much faster on large values, and has support for message catalogs + (a number of languages are already supported, contributions of further + languages welcome). The option WITHOUT_GH_BC can be used to build the + world with the previous versions of bc and dc. + 20200625: r362639 changed the internal API used between the NFS kernel modules. As such, they all need to be rebuilt from sources. ___ 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: r362987 - in head: contrib/bc usr.bin/gh-bc
Author: se Date: Tue Jul 7 07:51:09 2020 New Revision: 362987 URL: https://svnweb.freebsd.org/changeset/base/362987 Log: Update to version 3.1.1 This version fixes a regression with regard to tradtional behavior of the non-standard FreeBSD option "-e". In the previous version "-e quit" caused bc to exit before any computations had been performed, since all -e option parameters were concatenated and parsed as a whole, with quit causing the program to exit as soon as it was parsed. This version parses and executes commands passed with -e one by one and only exits after all prior commands have been executed. This commit is not a SVN merge, since the vendor import had been performed after the import to contrib. Instead the contents of contrib/bc has been removed and the new version is copied over unchanged from vendor/bc/dist. Replaced: head/contrib/bc/ - copied from r362986, vendor/bc/dist/ Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile == --- head/usr.bin/gh-bc/Makefile Tue Jul 7 07:32:15 2020(r362986) +++ head/usr.bin/gh-bc/Makefile Tue Jul 7 07:51:09 2020(r362987) @@ -19,6 +19,7 @@ LINKS=${BINDIR}/bc ${BINDIR}/dc CATALOGS= en_US.UTF-8 CATALOGS+= de_DE.UTF-8 de_DE.ISO8859-1 +CATALOGS+= es_ES.UTF-8 es_ES.ISO8859-1 CATALOGS+= fr_FR.UTF-8 fr_FR.ISO8859-1 CATALOGS+= ja_JP.UTF-8 ja_JP.eucJP CATALOGS+= nl_NL.UTF-8 nl_NL.ISO8859-1 @@ -37,8 +38,7 @@ CFLAGS+= -DBC_ENABLE_PROMPT CFLAGS+= -DBC_ENABLE_LONG_OPTIONS CFLAGS+= -DBC_ENABLE_EXTRA_MATH CFLAGS+= -DBC_ENABLE_HISTORY -CFLAGS+= -DBC_ENABLE_SIGNALS=0 -CFLAGS+= -DBC_NUM_KARATSUBA_LEN=64 +CFLAGS+= -DBC_ENABLE_RAND CFLAGS+= -DDC_ENABLED CFLAGS+= -DNDEBUG CFLAGS+= -DVERSION=${BCVERSION} @@ -46,8 +46,12 @@ CFLAGS+= -I${BCDIR}/include .if ${MK_NLS_CATALOGS} == "no" CFLAGS+= -DBC_ENABLE_NLS=0 +MAN_SRC_BC=bc/N.1 +MAN_SRC_DC=dc/N.1 .else CFLAGS+= -DBC_ENABLE_NLS=1 +MAN_SRC_BC=bc/A.1 +MAN_SRC_DC=dc/A.1 # prevent floating point incompatibilities caused by -flto on some architectures .if ${MACHINE_ARCH} != mips && ${MACHINE_ARCH} != mips64 && \ @@ -73,6 +77,8 @@ NLSLINKS_de_DE.UTF-8+=de_AT.UTF-8 de_CH.UTF-8 NLSLINKS_de_DE.ISO8859-1+= de_AT.ISO8859-1 de_CH.ISO8859-1 NLSLINKS_de_DE.ISO8859-1+= de_AT.ISO8859-15 de_CH.ISO8859-15 de_DE.ISO8859-15 +NLSLINKS_es_ES.ISO8859-1+= es_ES.ISO8859-15 + NLSLINKS_fr_FR.UTF-8+= fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8 NLSLINKS_fr_FR.ISO8859-1+= fr_BE.ISO8859-1 fr_CA.ISO8859-1 fr_CH.ISO8859-1 NLSLINKS_fr_FR.ISO8859-1+= fr_BE.ISO8859-15 fr_CA.ISO8859-15 fr_CH.ISO8859-15 \ @@ -97,5 +103,11 @@ bc_help.c: bc_help.txt dc_help.c: dc_help.txt cd ${BCDIR} && sh gen/strgen.sh gen/dc_help.txt ${.OBJDIR}/dc_help.c dc_help dc.h + +bc.1: + ${CP} ${BCDIR}/manuals/${MAN_SRC_BC} ${.OBJDIR}/bc.1 + +dc.1: + ${CP} ${BCDIR}/manuals/${MAN_SRC_DC} ${.OBJDIR}/dc.1 .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"
Introduce WITH(OUT)_LTO? (was: Re: svn commit: r362987 - in head: contrib/bc usr.bin/gh-bc)
Am 08.07.20 um 09:01 schrieb Mark Millard: > The following is more informational than anything as far > as I'm concerned. But there may be implications that I'm > unaware of. (I sometimes experiment with toolchain use > to see what the current status is for such use.) > > I attempted to build a system for 32-bit powerpc using clang > and binutils, building head -r363000 ( from -r363000 ). (This > was a cross build, amd64 -> powerpc.) It got a new type of > failure, compared to my past experience: Hi Mark, thank you for the report. I have tested with "make universe" (with default settings) that this version builds on all architectures, but Ed Maste has already disabled -flto for powerpc64, due to run time issues (floating point exception, IIRC). I know that you are actively working on PowerPC and I'd appreciate, if you could provide me with information on which parameters cause breakage and which work for you. The combination of CLANG with LTO and GNU binutils cannot work - CLANG and GCC use incompatible file formats to represent the intermediate object files. This version of bc uses advanced algorithms (compared to the one it replaced) for much reduced time complexity (a factor of more than 100 for large numbers has been observed). It uses layering for correctness, e.g. a set of "vector" management functions, that are built as a separate compile unit. Compiling with -flto lets the linker replace many function calls with constant parameters with much more efficient inline instructions, resulting in 30% higher performance. The code could be re-arranged to use inline functions instead of relying on -flto, but this would be a lot of effort and might make the code much harder to maintain. If there is a condition that could be added to the Makefile to not enable LTO if CLANG+binutils or GCC+LLD are mixed, then I'm willing to add it. If more programs were to be built with LTO for performance reasons, then it might be a good idea to have a global parameter that controls whether lTO may be used, though. TL;DR Perhaps we could add a WITH(OUT)_LTO option that only affects specific programs that get a significant performance boost from building with LTO. IMHO, using LTO is preferable to the introduction of inline functions in source files that fall into that category. WITHOUT_LTO could be implied on platforms that are known to not fully support -flto with default their compiler and linker. And it could be set by the user when non-default build tools are used. This would allow to use -flto for specific programs without the need to make this optimization conditional on compilers or architectures. Best regards, STefan > --- gh-bc.full --- > /usr/local/powerpc-unknown-freebsd13.0/bin/ld: /usr/bin/../lib/LLVMgold.so: > error loading plugin: Cannot open "/usr/bin/../lib/LLVMgold.so" > cc: error: linker command failed with exit code 1 (use -v to see invocation) > *** [gh-bc.full] Error code 1 > > Yep: /usr/lib/LLVMgold.so when -B/usr/local/powerpc-unknown-freebsd13.0/bin/ > was in use. > > I turns out that the link of gh-bc used -flto : > > make[4]: stopped in /usr/src/usr.bin/gh-bc > .ERROR_TARGET='gh-bc.full' > .ERROR_META_FILE='/usr/obj/powerpcvtsc_clang_altbinutils/powerpc.powerpc/usr/src/powerpc.powerpc/usr.bin/gh-bc/gh-bc.full.meta' > .MAKE.LEVEL='4' > MAKEFILE='' > .MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose' > _ERROR_CMD='cc -target powerpc-unknown-freebsd13.0 > --sysroot=/usr/obj/powerpcvtsc_clang_altbinutils/powerpc.powerpc/usr/src/powerpc.powerpc/tmp > -B/usr/local/powerpc-unknown-freebsd13.0/bin/ -O2 -pipe -fno-common > -B/usr/local/powerpc-unknown-freebsd13.0/bin/ -DMAINEXEC=bc > -DNLSPATH=/usr/share/nls/%L/%N.cat -DBC_ENABLED -DBC_ENABLE_PROMPT > -DBC_ENABLE_LONG_OPTIONS -DBC_ENABLE_EXTRA_MATH -DBC_ENABLE_HISTORY > -DBC_ENABLE_RAND -DDC_ENABLED -DNDEBUG -DVERSION=3.1.1 > -I/usr/src/contrib/bc/include -DBC_ENABLE_NLS=1 -flto -g -std=gnu99 > -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual > -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align > -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls > -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations > -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-cons t-variable -Qunused-arguments -Wl,--secure-plt -o gh-bc.full args.o data.o file.o lang.o lex.o main.o num.o parse.o program.o read.o vector.o vm.o bc/bc.o bc/lex.o bc/parse.o dc/dc.o dc/lex.o dc/parse.o history/history.o bc_help.o dc_help.o lib.o lib2.o opt.o rand/rand.o ;' > .CURDIR='/usr/src/usr.bin/gh-bc' > .MAKE='make' > .OBJDIR='/usr/obj/powerpcvtsc_clang_altbinutils/powerpc.powerpc/usr/src/powerpc.powerpc/usr.bin/gh-bc' > .TARGETS='all' > DESTDIR='/usr/obj/powerpcvtsc_clang_altbinutils/powerpc.powerpc/usr/src/powerpc.powerpc/tmp' > LD
svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc
Author: se Date: Sat Jul 11 07:33:18 2020 New Revision: 363091 URL: https://svnweb.freebsd.org/changeset/base/363091 Log: Update to version 3.1.3 This version fixes the following evaluation, which lead to a parse error: echo "if (1 < 3) 1" | bc Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/configure.sh head/contrib/bc/include/vm.h head/contrib/bc/locale_install.sh head/contrib/bc/locale_uninstall.sh head/contrib/bc/manuals/build.md head/contrib/bc/src/vm.c head/contrib/bc/tests/bc/stdin.txt head/contrib/bc/tests/bc/stdin_results.txt head/contrib/bc/tests/stdin.sh Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in == --- head/contrib/bc/Makefile.in Sat Jul 11 06:51:42 2020(r363090) +++ head/contrib/bc/Makefile.in Sat Jul 11 07:33:18 2020(r363091) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.1 +VERSION = 3.1.3 SRC = %%SRC%% OBJ = %%OBJ%% @@ -335,7 +335,7 @@ clean_tests: clean clean_config clean_coverage @$(RM) -f bc.old install_locales: - $(LOCALE_INSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) + %%INSTALL_LOCALES%% install_bc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME) Modified: head/contrib/bc/NEWS.md == --- head/contrib/bc/NEWS.md Sat Jul 11 06:51:42 2020(r363090) +++ head/contrib/bc/NEWS.md Sat Jul 11 07:33:18 2020(r363091) @@ -1,5 +1,25 @@ # News +## 3.1.3 + +This is a production release that fixes one minor bug: if `bc` was invoked like +the following, it would error: + +``` +echo "if (1 < 3) 1" | bc +``` + +Unless users run into this bug, they do not need to upgrade, but it is suggested +that they do. + +## 3.1.2 + +This is a production release that adds a way to install *all* locales. Users do +***NOT*** need to upgrade. + +For package maintainers wishing to make use of the change, just pass `-l` to +`configure.sh`. + ## 3.1.1 This is a production release that adds two Spanish locales. Users do ***NOT*** Modified: head/contrib/bc/configure.sh == --- head/contrib/bc/configure.shSat Jul 11 06:51:42 2020 (r363090) +++ head/contrib/bc/configure.shSat Jul 11 07:33:18 2020 (r363091) @@ -47,12 +47,12 @@ usage() { printf 'usage: %s -h\n' "$script" printf ' %s --help\n' "$script" - printf ' %s [-bD|-dB|-c] [-EfgGHMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s [-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" printf ' %s \\\n' "$script" printf ' [--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n' printf ' [--debug --disable-extra-math --disable-generated-tests]\\\n' printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' - printf ' [--disable-prompt --disable-strip] \\\n' + printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' @@ -98,6 +98,10 @@ usage() { printf '-k KARATSUBA_LEN, --karatsuba-len KARATSUBA_LEN\n' printf 'Set the karatsuba length to KARATSUBA_LEN (default is 64).\n' printf 'It is an error if KARATSUBA_LEN is not a number or is less than 16.\n' + printf '-l, --install-all-locales\n' + printf 'Installs all locales, regardless of how many are on the system. This\n' + printf 'option is useful for package maintainers who want to make sure that\n' + printf 'a package contains all of the locales that end users might need.\n' printf '-M, --disable-man-pages\n' printf 'Disable installing manpages.\n' printf '-N, --disable-nls\n' @@ -319,8 +323,9 @@ nls=1 prompt=1 force=0 strip_bin=1 +all_locales=0 -while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do +while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do case "$opt" in b) bc_only=1 ;; @@ -335,6 +340,7 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do h) usage ;; H) hist=0 ;; k) karatsuba_len="$OPTARG" ;; + l) all_locales=1 ;; M) install_manpages=0 ;; N) nls=0 ;; O) optimization="$OPTARG" ;;
Re: svn commit: r363172 - head/contrib/bc/src
Am 14.07.20 um 19:31 schrieb Brooks Davis: > On Tue, Jul 14, 2020 at 05:02:18AM +, Adrian Chadd wrote: >> Author: adrian >> Date: Tue Jul 14 05:02:18 2020 >> New Revision: 363172 >> URL: https://svnweb.freebsd.org/changeset/base/363172 >> >> Log: >> [bc] Fix a "maybe uninitialized" compiler warning under mips-gcc-6.3.0. >> >> I guess this didn't like the case statements.. ? But this does quieten >> the compiler error. > > IMO it would be better to disable this warning for this (old) compiler > on this file rather than making a change here (in general we should be > removing these sorts of changes). That being said, we need to write > down some guidance on this so we have a clear set of principles and we > can figure out how we decided which compilers are on which side of the > line. I fully agree and have notified the "upstream". He may want to apply the change, but I do not expect him to tag a new release for this minor change. Since this is contributed software, I'd really appreciate, if a solution was only applied to the local build tree of the person affected by this local problem - a generally applicable solution can then be discussed and applied, if found to be necessary. Regards, STefan signature.asc Description: OpenPGP digital signature
Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex
Am 30.07.20 um 01:21 schrieb Kyle Evans: [...] > This change bumps the symbol version of regcomp to FBSD_1.6 and provides the > old escape semantics for legacy applications, just in case one has an older > application that would immediately turn into a pumpkin because of an > extraneous escape that's embedded or otherwise critical to its operation. I get an error during make buildworld with option WITH_TESTS=yes: ===> usr.bin/bmake/tests (install) ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined symbol "regcomp@FBSD_1.6" Regards, STefan ___ 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"
Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex
Am 30.07.20 um 13:48 schrieb Gordon Bergling: > On Thu, Jul 30, 2020 at 01:26:46PM +0200, Stefan Eßer wrote: >> Am 30.07.20 um 01:21 schrieb Kyle Evans: >> [...] >>> This change bumps the symbol version of regcomp to FBSD_1.6 and provides >>> the >>> old escape semantics for legacy applications, just in case one has an >>> older >>> application that would immediately turn into a pumpkin because of an >>> extraneous escape that's embedded or otherwise critical to its operation. >> >> I get an error during make buildworld with option WITH_TESTS=yes: >> >> ===> usr.bin/bmake/tests (install) >> ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined >> symbol "regcomp@FBSD_1.6" >> >> Regards, STefan > > I got the same error this morning and was able to solve it by doing a full > buildworld without NO_CLEAN=yes. > > You may want to try this in case you are using NO_CLEAN=yes. Too late ... but thanks for the hint ... I have restarted make buildworld installworld on an unmodified source tree from when the error occurred and it just finished, without error this time. Maybe that it will work with WITH_TESTS too, now - I'll start another build/install cycle now and will report back. If it does not work, I'll try without NO_CLEAN (I'm building with META_MODE enabled, normally). Regards, STefan ___ 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"
Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex
Am 30.07.20 um 13:54 schrieb Kyle Evans: > On Thu, Jul 30, 2020 at 6:48 AM Gordon Bergling wrote: >> I got the same error this morning and was able to solve it by doing a full >> buildworld without NO_CLEAN=yes. >> >> You may want to try this in case you are using NO_CLEAN=yes. >> > > This is interesting; there shouldn't be any NO_CLEAN implications with > this change. There were no dependency changes, libc should definitely > get rebuilt because regcomp.c changed and thus, the libc in your > objdir should have the symbol. The binary referenced above is one that > we symlink into OBJDIR from the host system. > > I think it's also likely your problem was just fixed by the second > installworld. The first one will manage to get libc installed, but not > before you get errors from all the other stuff. This appears to be true: after once completing installworld with WITHOUT_TESTS=yes the build and installation does also succeed for subsequent runs with WITH_TESTS=yes. My guess is that "make install" in tests tries to link against the base system version of the library and the freshly built one with the correct symbol version has not been installed, yet. Regards, STefan ___ 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"
Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc
Am 30.07.20 um 18:31 schrieb Baptiste Daroussin: > On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >> On 30 Jul 2020, at 17:20, Baptiste Daroussin wrote: >>> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote: >>>> Author: se >>>> Date: Sat Jul 11 07:33:18 2020 >>>> New Revision: 363091 >>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>> >>>> Log: >>>> Update to version 3.1.3 >>>> >>> Jumping on that commit, since the switch from our previous bc. >>> >>> The output of the interactive bc has changed, the previous version had a >>> clean >>> UI, the new version "pollutes" the output with plenty of lines about the >>> copyright: >>> >>> >>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>> Report bugs at: https://git.yzena.com/gavin/bc >>> >>> This is free software with ABSOLUTELY NO WARRANTY. >>> >>> >>> Imagine if all programs where doing that, it would be painful, do you think >>> upstream can be convinced to remove those lines? >>> >>> I no the GNU version also has the same polluted output which was one of the >>> reason I was happy with out previous version of bc. >> >> By default both will print such a banner if and only if being called >> interactively. You can disable the banner explicitly with -q/--quiet >> for both GNU bc and this bc. I agree it's a bit noisy and would be >> nicer to not have that printed, but it's not without precedent for >> REPL-like things. > > Yes it is not without precedent for REPL-like things, still I dislike this and > would be happy to get bc interactive be as nice as the previous one we had :) > > If not I will deal with it and just yell internally each time I run it :D I'll forward this thread to the author - had already stated similar thought to him for consideration. Is very interested to prevent forks of his software - although not forbidden by the license - but he wants to keep his sources as the official and "clean" upstream for other projects. My guess is that he'll add a compile time switch to his version that will be added to our usr.bin Makefile and will suppress the start-up message in our base system version. (I'll keep the port version as is unless there is a strong preference to suppress it also in the port). I'd expect it to take a few days (since he only tags new versions after running a fuzzer for a few days if non-trivial changes have been performed and I know he improved something in the interpreter without publishing it, yet) ... Regards, STefan ___ 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"
Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc
Am 30.07.20 um 18:45 schrieb Jessica Clarke: > On 30 Jul 2020, at 17:40, Ravi Pokala wrote: >> >> -Original Message- >> From: on behalf of Jessica Clarke >> >> Date: 2020-07-30, Thursday at 09:35 >> To: Baptiste Daroussin >> Cc: Stefan Eßer , src-committers >> , , >> >> Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src >> tests tests/bc >> >>On 30 Jul 2020, at 17:31, Baptiste Daroussin wrote: >>> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >>>> On 30 Jul 2020, at 17:20, Baptiste Daroussin wrote: >>>>> On Sat, Jul 11, 2020 at 07:33:19AM +, Stefan Eßer wrote: >>>>>> Author: se >>>>>> Date: Sat Jul 11 07:33:18 2020 >>>>>> New Revision: 363091 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>>>> >>>>>> Log: >>>>>> Update to version 3.1.3 >>>>>> >>>>> Jumping on that commit, since the switch from our previous bc. >>>>> >>>>> The output of the interactive bc has changed, the previous version had a >>>>> clean >>>>> UI, the new version "pollutes" the output with plenty of lines about the >>>>> copyright: >>>>> >>>>> >>>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>>>> Report bugs at: https://git.yzena.com/gavin/bc >>>>> >>>>> This is free software with ABSOLUTELY NO WARRANTY. >>>>> >>>>> >>>>> Imagine if all programs where doing that, it would be painful, do you >>>>> think >>>>> upstream can be convinced to remove those lines? >>>>> >>>>> I no the GNU version also has the same polluted output which was one of >>>>> the >>>>> reason I was happy with out previous version of bc. >>>> >>>> By default both will print such a banner if and only if being called >>>> interactively. You can disable the banner explicitly with -q/--quiet >>>> for both GNU bc and this bc. I agree it's a bit noisy and would be >>>> nicer to not have that printed, but it's not without precedent for >>>> REPL-like things. >>> >>> Yes it is not without precedent for REPL-like things, still I dislike this >>> and >>> would be happy to get bc interactive be as nice as the previous one we had >>> :) >>> >>> If not I will deal with it and just yell internally each time I run it :D >> >>`alias bc='bc -q'` / `alias bc bc -q` and preserve your inner zen? :) >> >>Jess >> >> I was actually about to complain about the new `dc' not exiting after >> evaluating a '-e' expression, without an explicit 'q'. But then I noticed >> the "DC_EXPR_EXIT" envvar, which restores the desired behavior. That lead me >> to discover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last one >> would be helpful here. > > That does feel like the wrong default; even GNU dc doesn't do that, and > the principle of least surprise would suggest exiting is the right > thing to do. It's also unlikely you want to evaluate something and then > use it interactively. Interesting observation - I've got to admit that I hardly ever use dc (despite being the owner of a collection of HP UPN calculators ;-) ). I'll forward this to the author of this bc/dc and I'm sure he will offer a patched version (unless there are strong reasons for the current behavior, e.g. compatibility with another dc ...) Regards, STefan ___ 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: r363809 - head/usr.bin/gh-bc
Author: se Date: Mon Aug 3 19:18:38 2020 New Revision: 363809 URL: https://svnweb.freebsd.org/changeset/base/363809 Log: Upgrade to version 3.1.4 This version omits the printing of a copyright header in interactive mode and the dc command now exits after execution of the commands passed via -e or -f instead of switching to interactive mode. To pass further commands via STDIN when dc has been invoked with -e or -f, add "-f -" to the parameter list. Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile == --- head/usr.bin/gh-bc/Makefile Mon Aug 3 19:00:12 2020(r363808) +++ head/usr.bin/gh-bc/Makefile Mon Aug 3 19:18:38 2020(r363809) @@ -59,6 +59,10 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif +.if ${MK_TESTS} != "no" +#SUBDIR+= tests +.endif + .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} NLSSRCFILES_${catalog:C/.*://}= ${catalog:C/.*://}.msg ___ 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: r363810 - in head/contrib/bc: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc
Author: se Date: Mon Aug 3 19:20:26 2020 New Revision: 363810 URL: https://svnweb.freebsd.org/changeset/base/363810 Log: Upgrade to version 3.1.4 This version omits the printing of a copyright header in interactive mode and the dc command now exits afterexecution ofthe commands passed via -e or -f instead of switching to interactive mode. To pass further commands via STDIN when dc has been invoked with -e or -f, add "-f -" to the parameter list. Added: head/contrib/bc/tests/bc/misc6.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6.txt head/contrib/bc/tests/bc/misc6_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6_results.txt head/contrib/bc/tests/bc/misc7.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7.txt head/contrib/bc/tests/bc/misc7_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7_results.txt head/contrib/bc/tests/bc/stdin1.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1.txt head/contrib/bc/tests/bc/stdin1_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1_results.txt head/contrib/bc/tests/bc/stdin2.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2.txt head/contrib/bc/tests/bc/stdin2_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2_results.txt Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/README.md head/contrib/bc/include/bc.h head/contrib/bc/include/vm.h head/contrib/bc/manuals/bc.1.md.in head/contrib/bc/manuals/bc/A.1 head/contrib/bc/manuals/bc/A.1.md head/contrib/bc/manuals/bc/E.1 head/contrib/bc/manuals/bc/E.1.md head/contrib/bc/manuals/bc/EH.1 head/contrib/bc/manuals/bc/EH.1.md head/contrib/bc/manuals/bc/EHN.1 head/contrib/bc/manuals/bc/EHN.1.md head/contrib/bc/manuals/bc/EHNP.1 head/contrib/bc/manuals/bc/EHNP.1.md head/contrib/bc/manuals/bc/EHP.1 head/contrib/bc/manuals/bc/EHP.1.md head/contrib/bc/manuals/bc/EN.1 head/contrib/bc/manuals/bc/EN.1.md head/contrib/bc/manuals/bc/ENP.1 head/contrib/bc/manuals/bc/ENP.1.md head/contrib/bc/manuals/bc/EP.1 head/contrib/bc/manuals/bc/EP.1.md head/contrib/bc/manuals/bc/H.1 head/contrib/bc/manuals/bc/H.1.md head/contrib/bc/manuals/bc/HN.1 head/contrib/bc/manuals/bc/HN.1.md head/contrib/bc/manuals/bc/HNP.1 head/contrib/bc/manuals/bc/HNP.1.md head/contrib/bc/manuals/bc/HP.1 head/contrib/bc/manuals/bc/HP.1.md head/contrib/bc/manuals/bc/N.1 head/contrib/bc/manuals/bc/N.1.md head/contrib/bc/manuals/bc/NP.1 head/contrib/bc/manuals/bc/NP.1.md head/contrib/bc/manuals/bc/P.1 head/contrib/bc/manuals/bc/P.1.md head/contrib/bc/manuals/dc.1.md.in head/contrib/bc/manuals/dc/A.1 head/contrib/bc/manuals/dc/A.1.md head/contrib/bc/manuals/dc/E.1 head/contrib/bc/manuals/dc/E.1.md head/contrib/bc/manuals/dc/EH.1 head/contrib/bc/manuals/dc/EH.1.md head/contrib/bc/manuals/dc/EHN.1 head/contrib/bc/manuals/dc/EHN.1.md head/contrib/bc/manuals/dc/EHNP.1 head/contrib/bc/manuals/dc/EHNP.1.md head/contrib/bc/manuals/dc/EHP.1 head/contrib/bc/manuals/dc/EHP.1.md head/contrib/bc/manuals/dc/EN.1 head/contrib/bc/manuals/dc/EN.1.md head/contrib/bc/manuals/dc/ENP.1 head/contrib/bc/manuals/dc/ENP.1.md head/contrib/bc/manuals/dc/EP.1 head/contrib/bc/manuals/dc/EP.1.md head/contrib/bc/manuals/dc/H.1 head/contrib/bc/manuals/dc/H.1.md head/contrib/bc/manuals/dc/HN.1 head/contrib/bc/manuals/dc/HN.1.md head/contrib/bc/manuals/dc/HNP.1 head/contrib/bc/manuals/dc/HNP.1.md head/contrib/bc/manuals/dc/HP.1 head/contrib/bc/manuals/dc/HP.1.md head/contrib/bc/manuals/dc/N.1 head/contrib/bc/manuals/dc/N.1.md head/contrib/bc/manuals/dc/NP.1 head/contrib/bc/manuals/dc/NP.1.md head/contrib/bc/manuals/dc/P.1 head/contrib/bc/manuals/dc/P.1.md head/contrib/bc/src/args.c head/contrib/bc/src/bc/bc.c head/contrib/bc/src/bc/parse.c head/contrib/bc/src/dc/dc.c head/contrib/bc/src/vm.c head/contrib/bc/tests/bc/all.txt Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in == --- head/contrib/bc/Makefile.in Mon Aug 3 19:18:38 2020(r363809) +++ head/contrib/bc/Makefile.in Mon Aug 3 19:20:26 2020(r363810) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.3 +VERSION = 3.1.4 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md == --- head/contrib/bc/NEWS.md Mon Aug 3 19:18:38 2020(r363809) +++ head/contrib/bc/NEWS.md Mon Aug 3 19:20:26 2020(r363810) @@ -1,5 +1,24 @@ # News +## 3.1.4 + +This is a production release that fixes one bug, changes two behaviors, and +removes one environment variable. + +The bug is like t
svn commit: r363811 - in head: etc/mtree usr.bin/gh-bc usr.bin/gh-bc/tests
Author: se Date: Mon Aug 3 20:26:04 2020 New Revision: 363811 URL: https://svnweb.freebsd.org/changeset/base/363811 Log: Connect the tests provided with the new bc and dc The tests compare the command output (including of error cases) with the expected output and exit code. Not all tests are executed, since some expect to have a known good bc and dc binary installed and compare results of large amounts of generated data being processed by both versions to test for regressions. Added: head/usr.bin/gh-bc/tests/ head/usr.bin/gh-bc/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/gh-bc/Makefile Modified: head/etc/mtree/BSD.tests.dist == --- head/etc/mtree/BSD.tests.dist Mon Aug 3 19:20:26 2020 (r363810) +++ head/etc/mtree/BSD.tests.dist Mon Aug 3 20:26:04 2020 (r363811) @@ -1002,6 +1002,8 @@ .. getconf .. +gh-bc +.. grep .. gzip Modified: head/usr.bin/gh-bc/Makefile == --- head/usr.bin/gh-bc/Makefile Mon Aug 3 19:20:26 2020(r363810) +++ head/usr.bin/gh-bc/Makefile Mon Aug 3 20:26:04 2020(r363811) @@ -59,9 +59,8 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif -.if ${MK_TESTS} != "no" -#SUBDIR+= tests -.endif +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} Added: head/usr.bin/gh-bc/tests/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/gh-bc/tests/Makefile Mon Aug 3 20:26:04 2020 (r363811) @@ -0,0 +1,67 @@ +# $FreeBSD$ + +.include + +PACKAGE= tests + +TEST_DIR= ${SRCTOP}/contrib/bc + +TESTSDIR= ${TESTSBASE}/usr.bin/gh-bc + +.PATH: ${SRCTOP}/tests + +FILESGROUPS+= FILESf +FILESfPACKAGE= ${PACKAGE} +FILESfDIR= ${TESTSDIR} +FILESf=${TEST_DIR}/functions.sh +FILESfMODE=0755 + +FILESGROUPS+= FILEStests +FILEStestsPACKAGE= ${PACKAGE} +FILEStestsDIR= ${TESTSDIR}/tests +FILEStests!= echo ${TEST_DIR}/tests/*.py ${TEST_DIR}/tests/*.sh ${TEST_DIR}/tests/*.txt +FILEStestsMODE=0755 + +FILESGROUPS+= FILESbc +FILESbcPACKAGE=${PACKAGE} +FILESbcDIR=${TESTSDIR}/tests/bc +FILESbc!= echo ${TEST_DIR}/tests/bc/*.* + +FILESGROUPS+= FILESbc_errors +FILESbc_errorsPACKAGE= ${PACKAGE} +FILESbc_errorsDIR= ${TESTSDIR}/tests/bc/errors +FILESbc_errors!= echo ${TEST_DIR}/tests/bc/errors/*.* + +FILESGROUPS+= FILESbc_scripts +FILESbc_scriptsPACKAGE=${PACKAGE} +FILESbc_scriptsDIR=${TESTSDIR}/tests/bc/scripts +FILESbc_scripts!= echo ${TEST_DIR}/tests/bc/scripts/*.* +FILESbc_scriptsMODE= 0755 + +FILESGROUPS+= FILESdc +FILESdcPACKAGE=${PACKAGE} +FILESdcDIR=${TESTSDIR}/tests/dc +FILESdc!= echo ${TEST_DIR}/tests/dc/*.* + +FILESGROUPS+= FILESdc_errors +FILESdc_errorsPACKAGE= ${PACKAGE} +FILESdc_errorsDIR= ${TESTSDIR}/tests/dc/errors +FILESdc_errors!= echo ${TEST_DIR}/tests/dc/errors/*.* + +FILESGROUPS+= FILESdc_scripts +FILESdc_scriptsPACKAGE=${PACKAGE} +FILESdc_scriptsDIR=${TESTSDIR}/tests/dc/scripts +FILESdc_scripts!= echo ${TEST_DIR}/tests/dc/scripts/*.* +FILESdc_scriptsMODE= 0755 + +PLAIN_TESTS_SH=bc_tests dc_tests + +bc_tests.sh: + echo "#!/bin/sh" > ${.TARGET} + echo "env LANG=C ${TESTSDIR}/tests/all.sh bc 1 1 0 0 bc" >> ${.TARGET} + +dc_tests.sh: + echo "#!/bin/sh" > ${.TARGET} + echo "env LANG=C ${TESTSDIR}/tests/all.sh dc 1 1 0 0 dc" >> ${.TARGET} + +.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: r363915 - in head/contrib/bc: . locales src
Author: se Date: Wed Aug 5 15:20:07 2020 New Revision: 363915 URL: https://svnweb.freebsd.org/changeset/base/363915 Log: Upgrade to version 3.1.5 This version fixes some entries in the chinese message catalogs which could lead to program crashes when used. Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/locales/zh_CN.GB18030.msg head/contrib/bc/locales/zh_CN.GB2312.msg head/contrib/bc/locales/zh_CN.GBK.msg head/contrib/bc/locales/zh_CN.UTF-8.msg head/contrib/bc/locales/zh_CN.eucCN.msg head/contrib/bc/src/program.c head/contrib/bc/src/vm.c Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in == --- head/contrib/bc/Makefile.in Wed Aug 5 14:42:45 2020(r363914) +++ head/contrib/bc/Makefile.in Wed Aug 5 15:20:07 2020(r363915) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.4 +VERSION = 3.1.5 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md == --- head/contrib/bc/NEWS.md Wed Aug 5 14:42:45 2020(r363914) +++ head/contrib/bc/NEWS.md Wed Aug 5 15:20:07 2020(r363915) @@ -1,5 +1,13 @@ # News +## 3.1.5 + +This is a production release that fixes the Chinese locales (which caused `bc` +to crash) and a crash caused by `bc` executing code when it should not have been +able to. + +***ALL USERS SHOULD UPGRADE.*** + ## 3.1.4 This is a production release that fixes one bug, changes two behaviors, and Modified: head/contrib/bc/locales/zh_CN.GB18030.msg == Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.GB2312.msg == Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.GBK.msg == Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.UTF-8.msg == Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.eucCN.msg == Binary file (source and/or target). No diff available. Modified: head/contrib/bc/src/program.c == --- head/contrib/bc/src/program.c Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/src/program.c Wed Aug 5 15:20:07 2020 (r363915) @@ -1271,11 +1271,12 @@ static void bc_program_divmod(BcProgram *p) { BcNum *n1, *n2; size_t req; + bc_vec_expand(&p->results, p->results.len + 2); + + // We don't need to update the pointer because + // the capacity is enough due to the line above. res2 = bc_program_prepResult(p); res = bc_program_prepResult(p); - - // Update the pointer, just in case. - res2 = bc_vec_item_rev(&p->results, 1); bc_program_binOpPrep(p, &opd1, &n1, &opd2, &n2, 2); Modified: head/contrib/bc/src/vm.c == --- head/contrib/bc/src/vm.cWed Aug 5 14:42:45 2020(r363914) +++ head/contrib/bc/src/vm.cWed Aug 5 15:20:07 2020(r363915) @@ -464,7 +464,7 @@ static void bc_vm_process(const char *text) { while (BC_PARSE_CAN_PARSE(vm.prs)) vm.parse(&vm.prs); - bc_program_exec(&vm.prog); + if(BC_IS_DC || !BC_PARSE_NO_EXEC(&vm.prs)) bc_program_exec(&vm.prog); assert(BC_IS_DC || vm.prog.results.len == 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: r364055 - head
Author: se Date: Sat Aug 8 19:48:15 2020 New Revision: 364055 URL: https://svnweb.freebsd.org/changeset/base/364055 Log: Mention the new implementation of bc and dc which has become the default version in FreeBSD-CURRENT. Modified: head/RELNOTES Modified: head/RELNOTES == --- head/RELNOTES Sat Aug 8 19:39:38 2020(r364054) +++ head/RELNOTES Sat Aug 8 19:48:15 2020(r364055) @@ -27,6 +27,13 @@ r363180: r363084: nc(1) now implements SCTP mode, enabled by specifying the --sctp option. +r362681: + A new implementation of bc and dc has been imported. It offers + better standards compliance, performance, localization and comes + with extensive test cases that are optionally installed. + Use WITHOUT_GH_BC=yes to build and install the world with the + previous version instead of the new one, if required. + r362158, r362163: struct export_args has changed so that the "user" specified for the -maproot and -mapall exports(5) options may be in more than ___ 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: r366962 - in head: include usr.bin/calendar
Author: se Date: Fri Oct 23 09:22:23 2020 New Revision: 366962 URL: https://svnweb.freebsd.org/changeset/base/366962 Log: Add search of LOCALBASE/share/calendar for calendars supplied by a port. Calendar files in LOCALBASE override similarily named ones in the base system. This could easily be changed if the base system calendars should have precedence, but it could lead to a violation of POLA since then the port's files were ignored unless those in base have been deleted. There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease a consistent modification of this prefix. Reviewed by: imp, pfg Differential Revision:https://reviews.freebsd.org/D26882 Modified: head/include/paths.h head/usr.bin/calendar/io.c head/usr.bin/calendar/pathnames.h Modified: head/include/paths.h == --- head/include/paths.hFri Oct 23 08:44:53 2020(r366961) +++ head/include/paths.hFri Oct 23 09:22:23 2020(r366962) @@ -37,8 +37,11 @@ #include +#define_PATH_LOCALBASE "/usr/local" + /* Default search path. */ -#define_PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" +#define_PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" /* All standard utilities path. */ #define_PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" /* Locate system binaries. */ Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Fri Oct 23 08:44:53 2020(r366961) +++ head/usr.bin/calendar/io.c Fri Oct 23 09:22:23 2020(r366962) @@ -71,7 +71,7 @@ enum { }; const char *calendarFile = "calendar"; /* default calendar file */ -static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, _PATH_INCLUDE}; /* HOME */ static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ static char path[MAXPATHLEN]; Modified: head/usr.bin/calendar/pathnames.h == --- head/usr.bin/calendar/pathnames.h Fri Oct 23 08:44:53 2020 (r366961) +++ head/usr.bin/calendar/pathnames.h Fri Oct 23 09:22:23 2020 (r366962) @@ -35,3 +35,4 @@ #include #define_PATH_INCLUDE "/usr/share/calendar" +#define_PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar" ___ 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: r366963 - head/usr.bin/calendar
Author: se Date: Fri Oct 23 10:00:56 2020 New Revision: 366963 URL: https://svnweb.freebsd.org/changeset/base/366963 Log: Udpate calendar man-page to mention the search path added in r366962. Calendar files in /usr/lcoal/share/calendar take precedence over files in the base system. They can be provided by a port or package, but since such a port has not been committed, yet, no specific port name is suggested. In fact, multiple ports could exist (e.g. per locale) without conflicting with each other. Modified: head/usr.bin/calendar/calendar.1 Modified: head/usr.bin/calendar/calendar.1 == --- head/usr.bin/calendar/calendar.1Fri Oct 23 09:22:23 2020 (r366962) +++ head/usr.bin/calendar/calendar.1Fri Oct 23 10:00:56 2020 (r366963) @@ -28,7 +28,7 @@ .\" @(#)calendar.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd September 29, 2020 +.Dd Oktober 23, 2020 .Dt CALENDAR 1 .Os .Sh NAME @@ -245,7 +245,15 @@ A chdir is done into this directory if it exists. calendar file to use if no calendar file exists in the current directory. .It Pa ~/.calendar/nomail do not send mail if this file exists. +.It Pa /usr/share/calendar +system wide location of calendar files provided as part of the base system. +.It Pa /usr/local/share/calendar +system wide location for calendar files provided by a port or package. .El +.Pp +The order of precedence in searches for a calendar file is: +current directory, ~/.calendar, /usr/local/share/calendar, /usr/share/calendar. +Files of similar names are ignored in lower precedence locations. .Pp The following default calendar files are provided in .Pa /usr/share/calendar : ___ 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: r367075 - in head: crypto/openssh/regress/unittests/sshkey lib/libc/nls lib/libfetch sbin/nvmecontrol secure/lib/libssh secure/usr.bin/ssh-agent tools/tools/ath/athprom tools/tools/net8...
Author: se Date: Tue Oct 27 11:29:11 2020 New Revision: 367075 URL: https://svnweb.freebsd.org/changeset/base/367075 Log: Replace literal uses of /usr/local in C sources with _PATH_LOCALBASE Literal references to /usr/local exist in a large number of files in the FreeBSD base system. Many are in contributed software, in configuration files, or in the documentation, but 19 uses have been identified in C source files or headers outside the contrib and sys/contrib directories. This commit makes it possible to set _PATH_LOCALBASE in paths.h to use a different prefix for locally installed software. In order to avoid changes to openssh source files, LOCALBASE is passed to the build via Makefiles under src/secure. While _PATH_LOCALBASE could have been used here, there is precedent in the construction of the path used to a xauth program which depends on the LOCALBASE value passed on the compiler command line to select a non-default directory. This could be changed in a later commit to make the openssh build consistently use _PATH_LOCALBASE. It is considered out-of-scope for this commit. Reviewed by: imp MFC after:1 month Differential Revision:https://reviews.freebsd.org/D26942 Modified: head/crypto/openssh/regress/unittests/sshkey/test_sshkey.c head/lib/libc/nls/msgcat.c head/lib/libfetch/common.c head/sbin/nvmecontrol/nvmecontrol.c head/secure/lib/libssh/Makefile head/secure/usr.bin/ssh-agent/Makefile head/tools/tools/ath/athprom/athprom.c head/tools/tools/net80211/wesside/wesside/wesside.c head/usr.bin/fortune/fortune/pathnames.h head/usr.bin/mail/pathnames.h head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c head/usr.sbin/cpucontrol/cpucontrol.c head/usr.sbin/cron/cron/pathnames.h head/usr.sbin/mailwrapper/mailwrapper.c head/usr.sbin/pciconf/pathnames.h head/usr.sbin/pkg/config.c head/usr.sbin/pkg/config.h head/usr.sbin/pkg/pkg.c Modified: head/crypto/openssh/regress/unittests/sshkey/test_sshkey.c == --- head/crypto/openssh/regress/unittests/sshkey/test_sshkey.c Tue Oct 27 09:53:49 2020(r367074) +++ head/crypto/openssh/regress/unittests/sshkey/test_sshkey.c Tue Oct 27 11:29:11 2020(r367075) @@ -9,6 +9,7 @@ #include #include +#include #include #ifdef HAVE_STDINT_H #include @@ -79,7 +80,7 @@ build_cert(struct sshbuf *b, const struct sshkey *k, c critopts = sshbuf_new(); ASSERT_PTR_NE(critopts, NULL); - put_opt(critopts, "force-command", "/usr/local/bin/nethack"); + put_opt(critopts, "force-command", _PATH_LOCALBASE "/bin/nethack"); put_opt(critopts, "source-address", "192.168.0.0/24,127.0.0.1,::1"); exts = sshbuf_new(); Modified: head/lib/libc/nls/msgcat.c == --- head/lib/libc/nls/msgcat.c Tue Oct 27 09:53:49 2020(r367074) +++ head/lib/libc/nls/msgcat.c Tue Oct 27 11:29:11 2020(r367075) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,7 +59,9 @@ __FBSDID("$FreeBSD$"); #include "../locale/xlocale_private.h" -#define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L" +#define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:" \ + _PATH_LOCALBASE "/share/nls/%L/%N.cat:" \ + _PATH_LOCALBASE "/share/nls/%N/%L" #define RLOCK(fail){ int ret; \ if (__isthreaded && \ Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Tue Oct 27 09:53:49 2020(r367074) +++ head/lib/libfetch/common.c Tue Oct 27 11:29:11 2020(r367075) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1071,7 +1072,7 @@ fetch_ssl_setup_transport_layer(SSL_CTX *ctx, int verb /* * Configure peer verification based on environment. */ -#define LOCAL_CERT_FILE"/usr/local/etc/ssl/cert.pem" +#define LOCAL_CERT_FILE_PATH_LOCALBASE "/etc/ssl/cert.pem" #define BASE_CERT_FILE "/etc/ssl/cert.pem" static int fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) Modified: head/sbin/nvmecontrol/nvmecontrol.c == --- head/sbin/nvmecontrol/nvmecontrol.c Tue Oct 27 09:53:49 2020 (r367074) +++ head/sbin/nvmecontrol/nvmecontrol.c Tue Oct 27 11:29:11 2020 (r367075) @@ -179,7 +179,7 @@ main(int argc, char *argv[]) cmd_init(); cmd_load_dir("/lib/nvmecontrol",
svn commit: r367103 - head/usr.bin/calendar
Author: se Date: Wed Oct 28 13:06:39 2020 New Revision: 367103 URL: https://svnweb.freebsd.org/changeset/base/367103 Log: Fix parsing of #ifdef in calendar files There was code to process an #ifndef tokens, but none for #ifdef. The #ifdef token was mentioned as unsupported in the BUGS section, but no reason was given and I do not see why it should stay omitted. Misleading information in The BUGS section of the man-page regarding the maximum number of #define and #include statements supported has been removed. These limits might have applied to a prior version of this program, but do not seem to apply to the current implementation. I have not tried to test for the existence of the limits, but the include file processing just recursively calls the parser (without counting the recursion depth) and the stringlist functions do not impose a limit on the number of entries. Reported by: j...@berklix.com MFC after:3 days Modified: head/usr.bin/calendar/calendar.1 head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/calendar.1 == --- head/usr.bin/calendar/calendar.1Wed Oct 28 11:54:09 2020 (r367102) +++ head/usr.bin/calendar/calendar.1Wed Oct 28 13:06:39 2020 (r367103) @@ -346,11 +346,9 @@ double-check the start and end time of solar and lunar .Sh BUGS The .Nm -internal cpp does not correctly do #ifndef and will discard the rest -of the file if a #ifndef is triggered. -It also has a maximum of 50 include file and/or 100 #defines -and only recognises #include, #define and -#ifndef. +internal cpp does not support nested conditions and will continue +parsing of the input file on the next #endif even in nested contexts. +It does only recognise #include, #define, #ifdef and #ifndef. .Pp There is no possibility to properly specify the local position needed for solar and lunar calculations. Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Wed Oct 28 11:54:09 2020(r367102) +++ head/usr.bin/calendar/io.c Wed Oct 28 13:06:39 2020(r367103) @@ -212,6 +212,21 @@ token(char *line, FILE *out, bool *skip) return (T_OK); } + if (strncmp(line, "ifdef", 5) == 0) { + walk = line + 6; + trimlr(&walk); + + if (*walk == '\0') { + warnx("Expecting arguments after #ifdef"); + return (T_ERR); + } + + if (definitions == NULL || sl_find(definitions, walk) == NULL) + *skip = true; + + return (T_OK); + } + if (strncmp(line, "ifndef", 6) == 0) { walk = line + 6; trimlr(&walk); ___ 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: r367104 - head/usr.bin/calendar
Author: se Date: Wed Oct 28 13:30:24 2020 New Revision: 367104 URL: https://svnweb.freebsd.org/changeset/base/367104 Log: Fix off-by-one error in processing of #ifdef lines The convention in this program is to parse the line immediately starting after the token (e.g. #defineA and #ifdefA define respectively look-up "A"), and this commit restores this behavior instead of skipping an assumed white-space character following #ifdef. Reported by: kevans MFC after:3 days Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Wed Oct 28 13:06:39 2020(r367103) +++ head/usr.bin/calendar/io.c Wed Oct 28 13:30:24 2020(r367104) @@ -213,7 +213,7 @@ token(char *line, FILE *out, bool *skip) } if (strncmp(line, "ifdef", 5) == 0) { - walk = line + 6; + walk = line + 5; trimlr(&walk); if (*walk == '\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: r367108 - head/usr.bin/calendar
Author: se Date: Wed Oct 28 14:48:58 2020 New Revision: 367108 URL: https://svnweb.freebsd.org/changeset/base/367108 Log: Add support for nested conditionals The previous behavior was to support nested #ifdef and #ifndef, but to return to unconditional parsing after the next #endif, independently of the number of previously parsed conditions. E.g. after "#ifdef A / #ifdef B / #endif" the following lines were unconditially parsed again, independently of A and/or B being defined. The new behavior is to count the level of false conditions and to only restart parsing of calendar entries when the corresponding number of #endif tokens have been seen. In addition to the above, an #else directive has been added, to toggle between parsing and ignoring of the following lines. No validation of the correct use of the condition directives is made. #endif without prior #define or #ifndef is ignored and #else toggles between parsing and skipping of entries. The MFC period has been set to 1 month to allow for a review of the changes and for a discussion, whether these modifications should not be merged at all. No correct input file is parsed differently than before, but if calendar data files are published that use these new features, those data files will not parse correctly on prior versions of this program. MFC after:1 month Modified: head/usr.bin/calendar/calendar.1 head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/calendar.1 == --- head/usr.bin/calendar/calendar.1Wed Oct 28 14:43:38 2020 (r367107) +++ head/usr.bin/calendar/calendar.1Wed Oct 28 14:48:58 2020 (r367108) @@ -28,7 +28,7 @@ .\" @(#)calendar.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd October 25, 2020 +.Dd October 28, 2020 .Dt CALENDAR 1 .Os .Sh NAME @@ -198,7 +198,13 @@ file is preprocessed by a limited subset of .Xr cpp 1 internally, allowing the inclusion of shared files such as lists of company holidays or meetings. -This limited subset consists of \fB#include #ifndef #endif\fR and \fB#define\fR. +This limited subset consists of \fB#include #ifdef #ifndef #else +#endif\fR and \fB#define\fR. Conditions can be nested, but not check +for matching begin and end directives is performed. +Included files are parsed in their own scope. +They have no read or write access to condition variables defined in +an outer scope and open conditional blocks are implicitly closed. +.Pp If the shared file is not referenced by a full pathname, .Nm searches in the current (or home) directory first, and then in the @@ -346,9 +352,12 @@ double-check the start and end time of solar and lunar .Sh BUGS The .Nm -internal cpp does not support nested conditions and will continue -parsing of the input file on the next #endif even in nested contexts. -It does only recognise #include, #define, #ifdef and #ifndef. +does only recognise the cpp directives #include, #define, #ifdef, +#ifndef and #else. +It supports nested conditions, but does not perform any validation +on the correct use and nesting of conditions. +#endif without prior #ifdef or #define is ignored and #else outside +a conditional section skips input lines up to the next #endif. .Pp There is no possibility to properly specify the local position needed for solar and lunar calculations. Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Wed Oct 28 14:43:38 2020(r367107) +++ head/usr.bin/calendar/io.c Wed Oct 28 14:48:58 2020(r367108) @@ -140,18 +140,66 @@ cal_fopen(const char *file) } static int -token(char *line, FILE *out, bool *skip) +token(char *line, FILE *out, int *skip) { char *walk, c, a; if (strncmp(line, "endif", 5) == 0) { - *skip = false; + if (*skip > 0) + --*skip; return (T_OK); } - if (*skip) + if (strncmp(line, "ifdef", 5) == 0) { + walk = line + 5; + trimlr(&walk); + + if (*walk == '\0') { + warnx("Expecting arguments after #ifdef"); + return (T_ERR); + } + + if (*skip != 0 || definitions == NULL || sl_find(definitions, walk) == NULL) + ++*skip; + return (T_OK); + } + if (strncmp(line, "ifndef", 6) == 0) { + walk = line + 6; + trimlr(&walk); + + if (*walk == '\0') { + warnx("Expecting arguments after #ifndef"); + return (T_ERR); + } + + if (*skip != 0 || (definitions != NULL && sl_find(definitions, walk) != NULL)) + ++*skip; + + return (T_OK); + } + + if
svn commit: r367126 - head/usr.bin/calendar
Author: se Date: Thu Oct 29 08:26:38 2020 New Revision: 367126 URL: https://svnweb.freebsd.org/changeset/base/367126 Log: Fix calendar -a processing of files included in the user's home directory The existing code performed a chdir() into the home directory, but the parser fell back to using the invoking user's home directory as the base directory for the search for an include file. Since use of the -a option is limited to UID==0, the directory searched was typically ~root/.calendar, not the .calendar directory of the user whose file is being processed. PR: 205580 Reported by: greg.b...@gmail.com (Greg Balfour) MFC after:3 days Modified: head/usr.bin/calendar/calendar.c Modified: head/usr.bin/calendar/calendar.c == --- head/usr.bin/calendar/calendar.cThu Oct 29 02:02:30 2020 (r367125) +++ head/usr.bin/calendar/calendar.cThu Oct 29 08:26:38 2020 (r367126) @@ -228,6 +228,7 @@ main(int argc, char *argv[]) if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETALL) != 0) errx(1, "setusercontext"); + setenv("HOME", pw->pw_dir, 1); cal(); exit(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: r367127 - head/usr.bin/calendar
Author: se Date: Thu Oct 29 08:31:47 2020 New Revision: 367127 URL: https://svnweb.freebsd.org/changeset/base/367127 Log: Simplify test for closing delimiter of #include argument (no functional change). While here: Fix invalid parameters of a commented-out debug printf() found when testing with this code enabled. MFC after:3 days Modified: head/usr.bin/calendar/events.c head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Thu Oct 29 08:26:38 2020 (r367126) +++ head/usr.bin/calendar/events.c Thu Oct 29 08:31:47 2020 (r367127) @@ -207,8 +207,9 @@ event_print_all(FILE *fp) while (walkthrough_dates(&e) != 0) { #ifdef DEBUG - fprintf(stderr, "event_print_allmonth: %d, day: %d\n", - month, day); + if (e) + fprintf(stderr, "event_print_all month: %d, day: %d\n", + e->month, e->day); #endif /* Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Thu Oct 29 08:26:38 2020(r367126) +++ head/usr.bin/calendar/io.c Thu Oct 29 08:31:47 2020(r367127) @@ -215,26 +215,12 @@ token(char *line, FILE *out, int *skip) return (T_ERR); } - a = *walk; + a = *walk == '<' ? '>' : '\"'; walk++; c = walk[strlen(walk) - 1]; - switch(c) { - case '>': - if (a != '<') { - warnx("Unterminated include expecting '\"'"); - return (T_ERR); - } - break; - case '\"': - if (a != '\"') { - warnx("Unterminated include expecting '>'"); - return (T_ERR); - } - break; - default: - warnx("Unterminated include expecting '%c'", - a == '<' ? '>' : '\"' ); + if (a != c) { + warnx("Unterminated include expecting '%c'", a); return (T_ERR); } walk[strlen(walk) - 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: r367161 - head/usr.bin/calendar
Author: se Date: Fri Oct 30 10:44:46 2020 New Revision: 367161 URL: https://svnweb.freebsd.org/changeset/base/367161 Log: Re-implement comment parsing missing in the internal pre-processor The internal pre-processor ignored lines that did not parse a calendar entries, but did not support multi-line comments in the way the external cpp did. The calendar files distributed with the base system (now in a port) do use comments, though. Implement comment processing for single-line (//) and multi-line comments (/* */) with same semantics as in a standard C pre-processor. All tests pass with this version, but there are no tests that specifically verify comment processing. Reported by: j...@berklix.com (Julian H. Stacey) MFC after:3 days Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Fri Oct 30 09:48:41 2020(r367160) +++ head/usr.bin/calendar/io.c Fri Oct 30 10:44:46 2020(r367161) @@ -278,6 +278,8 @@ cal_parse(FILE *in, FILE *out) char *pp, p; struct tm tm; int flags; + char *c, *cc; + bool incomment = false; /* Unused */ tm.tm_sec = 0; @@ -289,8 +291,55 @@ cal_parse(FILE *in, FILE *out) return (1); while ((linelen = getline(&line, &linecap, in)) > 0) { - if (*line == '#') { - switch (token(line+1, out, &skip)) { + buf = line; + if (buf[linelen - 1] == '\n') + buf[--linelen] = '\0'; + + if (incomment) { + c = strstr(buf, "*/"); + if (c) { + c += 2; + linelen -= c - buf; + buf = c; + incomment = false; + } else { + continue; + } + } + if (!incomment) { + do { + c = strstr(buf, "//"); + cc = strstr(buf, "/*"); + if (c != NULL && (cc == NULL || c - cc < 0)) { + *c = '\0'; + linelen = c - buf; + break; + } else if (cc != NULL) { + c = strstr(cc + 2, "*/"); + if (c != NULL) { + c += 2; + memmove(cc, c, c - buf + linelen); + linelen -= c - cc; + } else { + *cc = '\0'; + linelen = cc - buf; + incomment = true; + break; + } + } + } while (c != NULL || cc != NULL); + } + + for (l = linelen; +l > 0 && isspace((unsigned char)buf[l - 1]); +l--) + ; + buf[l] = '\0'; + if (buf[0] == '\0') + continue; + + if (buf == line && *buf == '#') { + switch (token(buf+1, out, &skip)) { case T_ERR: free(line); return (1); @@ -304,15 +353,6 @@ cal_parse(FILE *in, FILE *out) } if (skip != 0) - continue; - - buf = line; - for (l = linelen; -l > 0 && isspace((unsigned char)buf[l - 1]); -l--) - ; - buf[l] = '\0'; - if (buf[0] == '\0') 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: r367166 - head/usr.bin/calendar
Author: se Date: Fri Oct 30 14:32:13 2020 New Revision: 367166 URL: https://svnweb.freebsd.org/changeset/base/367166 Log: Fix length calculation in memmove MFC after:3 days Modified: head/usr.bin/calendar/events.c head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Fri Oct 30 14:07:25 2020 (r367165) +++ head/usr.bin/calendar/events.c Fri Oct 30 14:32:13 2020 (r367166) @@ -55,6 +55,7 @@ set_new_encoding(void) const char *newenc; newenc = nl_langinfo(CODESET); + fprintf(stderr, "NEWENC=%s\n", newenc); // DEBUG if (currentEncoding == NULL) { currentEncoding = strdup(newenc); if (currentEncoding == NULL) @@ -98,13 +99,14 @@ convert(char *input) else err(1, "Initialization failure"); } + fprintf(stderr, "CONV=%p\n", conv); // DEBUG } inleft = strlen(input); inbuf = input; - outlen = inleft; - if ((output = malloc(outlen + 1)) == NULL) + outlen = inleft + 3; + if ((output = malloc(outlen)) == NULL) errx(1, "convert: cannot allocate memory"); for (;;) { @@ -112,7 +114,9 @@ convert(char *input) outbuf = output + converted; outleft = outlen - converted; + fprintf(stderr, "-< %s %p %ld %ld\n", inbuf, outbuf, inleft, outleft); // DEBUG converted = iconv(conv, (char **) &inbuf, &inleft, &outbuf, &outleft); + fprintf(stderr, "-> %ld %s %p %ld %ld\n", converted, inbuf, outbuf, inleft, outleft); // DEBUG if (converted != (size_t) -1 || errno == EINVAL) { /* finished or invalid multibyte, so truncate and ignore */ break; Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Fri Oct 30 14:07:25 2020(r367165) +++ head/usr.bin/calendar/io.c Fri Oct 30 14:32:13 2020(r367166) @@ -311,16 +311,19 @@ cal_parse(FILE *in, FILE *out) c = strstr(buf, "//"); cc = strstr(buf, "/*"); if (c != NULL && (cc == NULL || c - cc < 0)) { + /* single line comment */ *c = '\0'; linelen = c - buf; break; } else if (cc != NULL) { c = strstr(cc + 2, "*/"); if (c != NULL) { + /* multi-line comment ending on same line */ c += 2; - memmove(cc, c, c - buf + linelen); + memmove(cc, c, buf + linelen + 1 - c); linelen -= c - cc; } else { + /* multi-line comment */ *cc = '\0'; linelen = cc - buf; incomment = true; ___ 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: r367167 - head/usr.bin/calendar
Author: se Date: Fri Oct 30 14:34:51 2020 New Revision: 367167 URL: https://svnweb.freebsd.org/changeset/base/367167 Log: Revert debug output committed in r367166 by accident MFC after:3 days Modified: head/usr.bin/calendar/events.c Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Fri Oct 30 14:32:13 2020 (r367166) +++ head/usr.bin/calendar/events.c Fri Oct 30 14:34:51 2020 (r367167) @@ -55,7 +55,6 @@ set_new_encoding(void) const char *newenc; newenc = nl_langinfo(CODESET); - fprintf(stderr, "NEWENC=%s\n", newenc); // DEBUG if (currentEncoding == NULL) { currentEncoding = strdup(newenc); if (currentEncoding == NULL) @@ -99,14 +98,13 @@ convert(char *input) else err(1, "Initialization failure"); } - fprintf(stderr, "CONV=%p\n", conv); // DEBUG } inleft = strlen(input); inbuf = input; - outlen = inleft + 3; - if ((output = malloc(outlen)) == NULL) + outlen = inleft; + if ((output = malloc(outlen + 1)) == NULL) errx(1, "convert: cannot allocate memory"); for (;;) { @@ -114,9 +112,7 @@ convert(char *input) outbuf = output + converted; outleft = outlen - converted; - fprintf(stderr, "-< %s %p %ld %ld\n", inbuf, outbuf, inleft, outleft); // DEBUG converted = iconv(conv, (char **) &inbuf, &inleft, &outbuf, &outleft); - fprintf(stderr, "-> %ld %s %p %ld %ld\n", converted, inbuf, outbuf, inleft, outleft); // DEBUG if (converted != (size_t) -1 || errno == EINVAL) { /* finished or invalid multibyte, so truncate and ignore */ 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: r367173 - in head/usr.bin/calendar: . tests
Author: se Date: Fri Oct 30 15:43:52 2020 New Revision: 367173 URL: https://svnweb.freebsd.org/changeset/base/367173 Log: Print calendar entries in the order they occur The calendar program used to output entries in reverse order, due to the way an internal linked list was built up. A regression test with 2 entries for the same day has been adapted to the now non-reversed order. MFC after:3 days Modified: head/usr.bin/calendar/dates.c head/usr.bin/calendar/tests/regress.s5.out Modified: head/usr.bin/calendar/dates.c == --- head/usr.bin/calendar/dates.c Fri Oct 30 14:42:02 2020 (r367172) +++ head/usr.bin/calendar/dates.c Fri Oct 30 15:43:52 2020 (r367173) @@ -64,6 +64,7 @@ struct cal_day { struct cal_month *month;/* points back */ struct cal_year *year; /* points back */ struct event *events; + struct event *lastevent; }; int debug_remember = 0; @@ -446,8 +447,13 @@ void addtodate(struct event *e, int year, int month, int day) { struct cal_day *d; + struct event *ee; d = find_day(year, month, day); - e->next = d->events; - d->events = e; + ee = d->lastevent; + if (ee != NULL) + ee->next = e; + else + d->events = e; + d->lastevent = e; } Modified: head/usr.bin/calendar/tests/regress.s5.out == --- head/usr.bin/calendar/tests/regress.s5.out Fri Oct 30 14:42:02 2020 (r367172) +++ head/usr.bin/calendar/tests/regress.s5.out Fri Oct 30 15:43:52 2020 (r367173) @@ -1,3 +1,3 @@ -Jun 21*sunthird Jun 21 jun 21 +Jun 21*sunthird Jun 22 jun 22 ___ 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: r367179 - in head: lib/libc/gen sys/kern sys/sys
Author: se Date: Fri Oct 30 18:48:09 2020 New Revision: 367179 URL: https://svnweb.freebsd.org/changeset/base/367179 Log: Add read only sysctl variable user.localbase The value is provided by the C library as for other sysctl variables in the user tree. It is compiled in and returns the value of _PATH_LOCALBASE defined in paths.h. Reviewed by: imp, scottl Differential Revision:https://reviews.freebsd.org/D27009 Modified: head/lib/libc/gen/sysctl.c head/sys/kern/kern_mib.c head/sys/sys/sysctl.h Modified: head/lib/libc/gen/sysctl.c == --- head/lib/libc/gen/sysctl.c Fri Oct 30 18:22:46 2020(r367178) +++ head/lib/libc/gen/sysctl.c Fri Oct 30 18:48:09 2020(r367179) @@ -87,6 +87,15 @@ sysctl(const int *name, u_int namelen, void *oldp, siz if (oldp != NULL) memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); return (0); + case USER_LOCALBASE: + if (oldp && orig_oldlen < sizeof(_PATH_LOCALBASE)) { + errno = ENOMEM; + return -1; + } + *oldlenp = sizeof(_PATH_LOCALBASE); + if (oldp != NULL) + memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE)); + return(0); } if (oldp && *oldlenp < sizeof(int)) { Modified: head/sys/kern/kern_mib.c == --- head/sys/kern/kern_mib.cFri Oct 30 18:22:46 2020(r367178) +++ head/sys/kern/kern_mib.cFri Oct 30 18:48:09 2020(r367179) @@ -652,6 +652,8 @@ SYSCTL_INT(_user, USER_STREAM_MAX, stream_max, CTLFLAG SYSCTL_NULL_INT_PTR, 0, "Min Maximum number of streams a process may have open at one time"); SYSCTL_INT(_user, USER_TZNAME_MAX, tzname_max, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, 0, "Min Maximum number of types supported for timezone names"); +SYSCTL_STRING(_user, USER_LOCALBASE, localbase, CTLFLAG_RD, +"", 0, "Prefix used to install and locate add-on packages"); #include SYSCTL_INT(_debug_sizeof, OID_AUTO, vnode, CTLFLAG_RD, Modified: head/sys/sys/sysctl.h == --- head/sys/sys/sysctl.h Fri Oct 30 18:22:46 2020(r367178) +++ head/sys/sys/sysctl.h Fri Oct 30 18:48:09 2020(r367179) @@ -1070,6 +1070,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #defineUSER_POSIX2_UPE 18 /* int: POSIX2_UPE */ #defineUSER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */ #defineUSER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */ +#defineUSER_LOCALBASE 21 /* string: _PATH_LOCALBASE */ #defineCTL_P1003_1B_ASYNCHRONOUS_IO1 /* boolean */ #defineCTL_P1003_1B_MAPPED_FILES 2 /* boolean */ ___ 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: r367184 - in head: lib/libc/gen sbin/sysctl
Author: se Date: Fri Oct 30 19:37:53 2020 New Revision: 367184 URL: https://svnweb.freebsd.org/changeset/base/367184 Log: Update man-pages to describe the user.localbase variable added in r367179. MFC after:3 days Modified: head/lib/libc/gen/sysctl.3 head/sbin/sysctl/sysctl.8 Modified: head/lib/libc/gen/sysctl.3 == --- head/lib/libc/gen/sysctl.3 Fri Oct 30 19:37:34 2020(r367183) +++ head/lib/libc/gen/sysctl.3 Fri Oct 30 19:37:53 2020(r367184) @@ -28,7 +28,7 @@ .\"@(#)sysctl.38.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd March 22, 2019 +.Dd October 30, 2020 .Dt SYSCTL 3 .Os .Sh NAME @@ -654,6 +654,7 @@ privilege may change the value. .It Dv USER_CS_PATH Ta string Ta no .It Dv USER_EXPR_NEST_MAX Ta integer Ta no .It Dv USER_LINE_MAX Ta integer Ta no +.It Dv USER_LOCALBASE Ta string Ta no .It Dv USER_POSIX2_CHAR_TERM Ta integer Ta no .It Dv USER_POSIX2_C_BIND Ta integer Ta no .It Dv USER_POSIX2_C_DEV Ta integer Ta no @@ -699,6 +700,9 @@ utility. .It Li USER_LINE_MAX The maximum length in bytes of a text-processing utility's input line. +.It Li USER_LOCALBASE +Return the value of localbase that has been compiled into system utilities +that need to have access to resources provided by a port or package. .It Li USER_POSIX2_CHAR_TERM Return 1 if the system supports at least one terminal type capable of all operations described in Modified: head/sbin/sysctl/sysctl.8 == --- head/sbin/sysctl/sysctl.8 Fri Oct 30 19:37:34 2020(r367183) +++ head/sbin/sysctl/sysctl.8 Fri Oct 30 19:37:53 2020(r367184) @@ -28,7 +28,7 @@ .\"From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 22, 2020 +.Dd October 30, 2020 .Dt SYSCTL 8 .Os .Sh NAME @@ -256,6 +256,7 @@ String and integer values can be set using .It "user.posix2_upe integer no" .It "user.stream_max integer no" .It "user.tzname_max integer no" +.It "user.localbasestring no" .El .Sh FILES .Bl -tag -width ".In netinet/icmp_var.h" -compact ___ 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: r367196 - head/lib/libc/gen
Author: se Date: Sat Oct 31 11:44:10 2020 New Revision: 367196 URL: https://svnweb.freebsd.org/changeset/base/367196 Log: Fix style, no functional change Submitted by: kib MFC after:3 days Modified: head/lib/libc/gen/sysctl.c Modified: head/lib/libc/gen/sysctl.c == --- head/lib/libc/gen/sysctl.c Sat Oct 31 03:36:31 2020(r367195) +++ head/lib/libc/gen/sysctl.c Sat Oct 31 11:44:10 2020(r367196) @@ -79,23 +79,23 @@ sysctl(const int *name, u_int namelen, void *oldp, siz switch (name[1]) { case USER_CS_PATH: - if (oldp && orig_oldlen < sizeof(_PATH_STDPATH)) { + if (oldp == NULL && orig_oldlen < sizeof(_PATH_STDPATH)) { errno = ENOMEM; - return -1; + return (-1); } *oldlenp = sizeof(_PATH_STDPATH); if (oldp != NULL) memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); return (0); case USER_LOCALBASE: - if (oldp && orig_oldlen < sizeof(_PATH_LOCALBASE)) { + if (oldp == NULL && orig_oldlen < sizeof(_PATH_LOCALBASE)) { errno = ENOMEM; - return -1; + return (-1); } *oldlenp = sizeof(_PATH_LOCALBASE); if (oldp != NULL) memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE)); - return(0); + return (0); } if (oldp && *oldlenp < sizeof(int)) { ___ 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: r367199 - head/lib/libc/gen
Author: se Date: Sat Oct 31 12:10:43 2020 New Revision: 367199 URL: https://svnweb.freebsd.org/changeset/base/367199 Log: Fix reversed condition after attempted style fix in r367196 Reported by: xto...@hotmail.com MFC after:3 days Modified: head/lib/libc/gen/sysctl.c Modified: head/lib/libc/gen/sysctl.c == --- head/lib/libc/gen/sysctl.c Sat Oct 31 12:05:00 2020(r367198) +++ head/lib/libc/gen/sysctl.c Sat Oct 31 12:10:43 2020(r367199) @@ -79,7 +79,7 @@ sysctl(const int *name, u_int namelen, void *oldp, siz switch (name[1]) { case USER_CS_PATH: - if (oldp == NULL && orig_oldlen < sizeof(_PATH_STDPATH)) { + if (oldp != NULL && orig_oldlen < sizeof(_PATH_STDPATH)) { errno = ENOMEM; return (-1); } @@ -88,7 +88,7 @@ sysctl(const int *name, u_int namelen, void *oldp, siz memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); return (0); case USER_LOCALBASE: - if (oldp == NULL && orig_oldlen < sizeof(_PATH_LOCALBASE)) { + if (oldp != NULL && orig_oldlen < sizeof(_PATH_LOCALBASE)) { errno = ENOMEM; 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: r367203 - head/usr.bin/calendar
Author: se Date: Sat Oct 31 13:32:08 2020 New Revision: 367203 URL: https://svnweb.freebsd.org/changeset/base/367203 Log: Add file names and line numbers to calendar format error messages Without file name and line number it is very cumbersum to identify the locations of errors in calendar files. MFC after:3 days Modified: head/usr.bin/calendar/io.c head/usr.bin/calendar/parsedata.c Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Sat Oct 31 12:39:22 2020(r367202) +++ head/usr.bin/calendar/io.c Sat Oct 31 13:32:08 2020(r367203) @@ -75,6 +75,10 @@ static const char *calendarHomes[] = {".calendar", _PA static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ static char path[MAXPATHLEN]; +static const char *cal_home; +static const char *cal_dir; +static const char *cal_file; +static int cal_line; struct fixs neaster, npaskha, ncny, nfullmoon, nnewmoon; struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; @@ -118,7 +122,7 @@ cal_fopen(const char *file) } if (chdir(home) != 0) { - warnx("Cannot enter home directory"); + warnx("Cannot enter home directory \"%s\"", home); return (NULL); } @@ -126,8 +130,12 @@ cal_fopen(const char *file) if (chdir(calendarHomes[i]) != 0) continue; - if ((fp = fopen(file, "r")) != NULL) + if ((fp = fopen(file, "r")) != NULL) { + cal_home = home; + cal_dir = calendarHomes[i]; + cal_file = file; return (fp); + } } warnx("can't open calendar file \"%s\"", file); @@ -139,10 +147,19 @@ cal_fopen(const char *file) return (NULL); } +#defineWARN0(format) \ + warnx(format " in %s/%s/%s line %d", cal_home, cal_dir, cal_file, cal_line) +#defineWARN1(format, arg1)\ + warnx(format " in %s/%s/%s line %d", arg1, cal_home, cal_dir, cal_file, cal_line) + static int token(char *line, FILE *out, int *skip) { char *walk, c, a; + const char *this_cal_home; + const char *this_cal_dir; + const char *this_cal_file; + int this_cal_line; if (strncmp(line, "endif", 5) == 0) { if (*skip > 0) @@ -155,7 +172,7 @@ token(char *line, FILE *out, int *skip) trimlr(&walk); if (*walk == '\0') { - warnx("Expecting arguments after #ifdef"); + WARN0("Expecting arguments after #ifdef"); return (T_ERR); } @@ -170,7 +187,7 @@ token(char *line, FILE *out, int *skip) trimlr(&walk); if (*walk == '\0') { - warnx("Expecting arguments after #ifndef"); + WARN0("Expecting arguments after #ifndef"); return (T_ERR); } @@ -185,7 +202,7 @@ token(char *line, FILE *out, int *skip) trimlr(&walk); if (*walk != '\0') { - warnx("Expecting no arguments after #else"); + WARN0("Expecting no arguments after #else"); return (T_ERR); } @@ -206,12 +223,12 @@ token(char *line, FILE *out, int *skip) trimlr(&walk); if (*walk == '\0') { - warnx("Expecting arguments after #include"); + WARN0("Expecting arguments after #include"); return (T_ERR); } if (*walk != '<' && *walk != '\"') { - warnx("Excecting '<' or '\"' after #include"); + WARN0("Excecting '<' or '\"' after #include"); return (T_ERR); } @@ -220,13 +237,21 @@ token(char *line, FILE *out, int *skip) c = walk[strlen(walk) - 1]; if (a != c) { - warnx("Unterminated include expecting '%c'", a); + WARN1("Unterminated include expecting '%c'", a); return (T_ERR); } walk[strlen(walk) - 1] = '\0'; + this_cal_home = cal_home; + this_cal_dir = cal_dir; + this_cal_file = cal_file; + this_cal_line = cal_line; if (cal_parse(cal_fopen(walk), out)) return (T_ERR); + cal_home = this_cal_home; + cal_dir = this_cal_dir; + cal_file = this_cal_file; + cal_line = this_cal_line; return (T_OK); } @@ -238,7 +263,7 @@ token(char *line, FILE *out, int *skip)
svn commit: r367204 - head/usr.bin/calendar
Author: se Date: Sat Oct 31 13:55:10 2020 New Revision: 367204 URL: https://svnweb.freebsd.org/changeset/base/367204 Log: Add file names and line numbers to debug messages MFC after:3 days Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Sat Oct 31 13:32:08 2020(r367203) +++ head/usr.bin/calendar/io.c Sat Oct 31 13:55:10 2020(r367204) @@ -448,7 +448,8 @@ cal_parse(FILE *in, FILE *out) if (count < 0) { /* Show error status based on return value */ if (debug) - fprintf(stderr, "Ignored: %s\n", buf); + fprintf(stderr, "Ignored: \"%s\" in %s/%s/%s line %d\n", + buf, cal_home, cal_dir, cal_file, cal_line); if (count == -1) continue; count = -count + 1; @@ -468,7 +469,8 @@ cal_parse(FILE *in, FILE *out) (void)strftime(dbuf, sizeof(dbuf), d_first ? "%e %b" : "%b %e", &tm); if (debug) - fprintf(stderr, "got %s\n", pp); + fprintf(stderr, "got \"%s\" in %s/%s/%s line %d\n", + pp, cal_home, cal_dir, cal_file, cal_line); events[i] = event_add(year[i], month[i], day[i], dbuf, ((flags &= F_VARIABLE) != 0) ? 1 : 0, pp, extradata[i]); ___ 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: r367207 - head/usr.bin/calendar
Author: se Date: Sat Oct 31 15:11:24 2020 New Revision: 367207 URL: https://svnweb.freebsd.org/changeset/base/367207 Log: Improve calendar file parsing and consistency tests Add line number information to more warning and error messages. Detect #else and #endif without corresponing #ifdef/#ifndef as error. Detect missing #endif at end of file and print warning but continue. Support for #undef has been added to reverse the effect of a prior #define. It is no error if the argument value has not been defined before. These changes may cause error aborts on malformed input files (e.g. with spurious #else or #endif), but no such errors exist in the calendar files in the FreeBSD base system and the calendar-data port and all tests pass. More tests will be added in a follow-up commit to detect regressions that might affect the newly added features. This commit ends a series of updates that enhance the pre-processor and make it behave much more like prior versions of the calendar progarm that called cpp to pre-process the data files. MFC after:3 days Relnotes: yes Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Sat Oct 31 14:59:39 2020(r367206) +++ head/usr.bin/calendar/io.c Sat Oct 31 15:11:24 2020(r367207) @@ -153,7 +153,7 @@ cal_fopen(const char *file) warnx(format " in %s/%s/%s line %d", arg1, cal_home, cal_dir, cal_file, cal_line) static int -token(char *line, FILE *out, int *skip) +token(char *line, FILE *out, int *skip, int *unskip) { char *walk, c, a; const char *this_cal_home; @@ -164,6 +164,13 @@ token(char *line, FILE *out, int *skip) if (strncmp(line, "endif", 5) == 0) { if (*skip > 0) --*skip; + else if (*unskip > 0) + --*unskip; + else { + WARN0("#endif without prior #ifdef or #ifndef"); + return (T_ERR); + } + return (T_OK); } @@ -178,7 +185,9 @@ token(char *line, FILE *out, int *skip) if (*skip != 0 || definitions == NULL || sl_find(definitions, walk) == NULL) ++*skip; - + else + ++*unskip; + return (T_OK); } @@ -193,6 +202,8 @@ token(char *line, FILE *out, int *skip) if (*skip != 0 || (definitions != NULL && sl_find(definitions, walk) != NULL)) ++*skip; + else + ++*unskip; return (T_OK); } @@ -206,10 +217,18 @@ token(char *line, FILE *out, int *skip) return (T_ERR); } - if (*skip == 0) + if (*unskip == 0) { + if (*skip == 0) { + WARN0("#else without prior #ifdef or #ifndef"); + return (T_ERR); + } else if (*skip == 1) { + *skip = 0; + *unskip = 1; + } + } else if (*unskip == 1) { *skip = 1; - else if (*skip == 1) - *skip = 0; + *unskip = 0; + } return (T_OK); } @@ -267,10 +286,28 @@ token(char *line, FILE *out, int *skip) return (T_ERR); } - sl_add(definitions, strdup(walk)); + if (sl_find(definitions, walk) == NULL) + sl_add(definitions, strdup(walk)); return (T_OK); } + if (strncmp(line, "undef", 5) == 0) { + if (definitions != NULL) { + walk = line + 5; + trimlr(&walk); + + if (*walk == '\0') { + WARN0("Expecting arguments after #undef"); + return (T_ERR); + } + + walk = sl_find(definitions, walk); + if (walk != NULL) + walk[0] = '\0'; + } + return (T_OK); + } + return (T_PROCESS); } @@ -299,6 +336,7 @@ cal_parse(FILE *in, FILE *out) int day[MAXCOUNT]; int year[MAXCOUNT]; int skip = 0; + int unskip = 0; char dbuf[80]; char *pp, p; struct tm tm; @@ -369,7 +407,7 @@ cal_parse(FILE *in, FILE *out) continue; if (buf == line && *buf == '#') { - switch (token(buf+1, out, &skip)) { + switch (token(buf+1, out, &skip, &unskip)) {
svn commit: r367221 - head
Author: se Date: Sat Oct 31 16:39:27 2020 New Revision: 367221 URL: https://svnweb.freebsd.org/changeset/base/367221 Log: Mention the more strict consistency checks performed by calendar(), which can make the program abort with an error message on previously accepted but malformed input files. Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Sat Oct 31 16:24:11 2020(r367220) +++ head/UPDATING Sat Oct 31 16:39:27 2020(r367221) @@ -26,6 +26,13 @@ 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".) +20101030: + The internal pre-processor in the calendar(1) program has been + extended to support more C pre-processor commands (e.g. #ifdef, #else, + and #undef) and to detect unbalanced conditional statements. + Error messages have been extended to include the filename and line + number if processing stops to help fixing malformed data files. + 20101026: All the data files for the calendar(1) program, except calendar.freebsd, have been moved to the deskutils/calendar-data port, much like 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: r367243 - in head: lib/libc/gen sys/kern
Author: se Date: Sat Oct 31 23:48:41 2020 New Revision: 367243 URL: https://svnweb.freebsd.org/changeset/base/367243 Log: Make sysctl user.local a tunable that can be written at run-time This sysctl value had been provided as a read-only variable that is compiled into the C library based on the value of _PATH_LOCALBASE in paths.h. After this change, the value is compiled into the kernel as an empty string, which is translated to _PATH_LOCALBASE by the C library. This empty string can be overridden at boot time or by a privileged user at run time and will then be returned by sysctl. When set to an empty string, the value returned by sysctl reverts to _PATH_LOCALBASE. This update does not change the behavior on any system that does not modify the default value of user.localbase. I consider this change as experimental and would prefer if the run-time write permission was reconsidered and the sysctl variable defined with CLFLAG_RDTUN instead to restrict it to be set at boot time. MFC after:1 month Modified: head/lib/libc/gen/sysctl.c head/sys/kern/kern_mib.c Modified: head/lib/libc/gen/sysctl.c == --- head/lib/libc/gen/sysctl.c Sat Oct 31 23:19:59 2020(r367242) +++ head/lib/libc/gen/sysctl.c Sat Oct 31 23:48:41 2020(r367243) @@ -68,14 +68,14 @@ sysctl(const int *name, u_int namelen, void *oldp, siz if (retval || name[0] != CTL_USER) return (retval); - if (newp != NULL) { - errno = EPERM; - return (-1); - } if (namelen != 2) { errno = EINVAL; return (-1); } + if (newp != NULL && name[1] != USER_LOCALBASE) { + errno = EPERM; + return (-1); + } switch (name[1]) { case USER_CS_PATH: @@ -88,13 +88,21 @@ sysctl(const int *name, u_int namelen, void *oldp, siz memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); return (0); case USER_LOCALBASE: - if (oldp != NULL && orig_oldlen < sizeof(_PATH_LOCALBASE)) { - errno = ENOMEM; - return (-1); + if (oldlenp != NULL) { + if (oldp == NULL) { + if (*oldlenp == 1) + *oldlenp = sizeof(_PATH_LOCALBASE); + } else { + if (*oldlenp != 1) + return (retval); + if (orig_oldlen < sizeof(_PATH_LOCALBASE)) { + errno = ENOMEM; + return (-1); + } + *oldlenp = sizeof(_PATH_LOCALBASE); + memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE)); + } } - *oldlenp = sizeof(_PATH_LOCALBASE); - if (oldp != NULL) - memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE)); return (0); } Modified: head/sys/kern/kern_mib.c == --- head/sys/kern/kern_mib.cSat Oct 31 23:19:59 2020(r367242) +++ head/sys/kern/kern_mib.cSat Oct 31 23:48:41 2020(r367243) @@ -652,8 +652,11 @@ SYSCTL_INT(_user, USER_STREAM_MAX, stream_max, CTLFLAG SYSCTL_NULL_INT_PTR, 0, "Min Maximum number of streams a process may have open at one time"); SYSCTL_INT(_user, USER_TZNAME_MAX, tzname_max, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, 0, "Min Maximum number of types supported for timezone names"); -SYSCTL_STRING(_user, USER_LOCALBASE, localbase, CTLFLAG_RD, -"", 0, "Prefix used to install and locate add-on packages"); + +static char localbase[MAXPATHLEN] = ""; + +SYSCTL_STRING(_user, USER_LOCALBASE, localbase, CTLFLAG_RWTUN, +localbase, sizeof(localbase), "Prefix used to install and locate add-on packages"); #include SYSCTL_INT(_debug_sizeof, OID_AUTO, vnode, CTLFLAG_RD, ___ 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: r367254 - head
Author: se Date: Sun Nov 1 19:13:55 2020 New Revision: 367254 URL: https://svnweb.freebsd.org/changeset/base/367254 Log: Fix year in 2 most recent entries (2010 -> 2020) Reported by: m...@macktronics.com (Dan Mack) Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Sun Nov 1 17:27:48 2020(r367253) +++ head/UPDATING Sun Nov 1 19:13:55 2020(r367254) @@ -26,14 +26,14 @@ 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".) -20101030: +20201030: The internal pre-processor in the calendar(1) program has been extended to support more C pre-processor commands (e.g. #ifdef, #else, and #undef) and to detect unbalanced conditional statements. Error messages have been extended to include the filename and line number if processing stops to help fixing malformed data files. -20101026: +20201026: All the data files for the calendar(1) program, except calendar.freebsd, have been moved to the deskutils/calendar-data port, much like the jewish calendar entries were moved to deskutils/hebcal years ago. After ___ 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: r367255 - head/usr.bin/calendar
Author: se Date: Sun Nov 1 20:38:35 2020 New Revision: 367255 URL: https://svnweb.freebsd.org/changeset/base/367255 Log: Fix psoition reporting for calendar data file in system directory MFC after:3 days Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Sun Nov 1 19:13:55 2020(r367254) +++ head/usr.bin/calendar/io.c Sun Nov 1 20:38:35 2020(r367255) @@ -147,10 +147,22 @@ cal_fopen(const char *file) return (NULL); } +static char* +cal_path(void) +{ + static char buffer[MAXPATHLEN + 10]; + + if (cal_dir[0] == '/') + snprintf(buffer, sizeof(buffer), "%s/%s", cal_dir, cal_file); + else + snprintf(buffer, sizeof(buffer), "%s/%s/%s", cal_home, cal_dir, cal_file); + return (buffer); +} + #defineWARN0(format) \ - warnx(format " in %s/%s/%s line %d", cal_home, cal_dir, cal_file, cal_line) + warnx(format " in %s line %d", cal_path(), cal_line) #defineWARN1(format, arg1)\ - warnx(format " in %s/%s/%s line %d", arg1, cal_home, cal_dir, cal_file, cal_line) + warnx(format " in %s line %d", arg1, cal_path(), cal_line) static int token(char *line, FILE *out, int *skip, int *unskip) ___ 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: r367280 - head/lib/libc/gen
Author: se Date: Mon Nov 2 18:48:06 2020 New Revision: 367280 URL: https://svnweb.freebsd.org/changeset/base/367280 Log: Re-arrange some of the code to separate writable user tree variables from R/O variables. While here fix some nearby style. No functional change intended. MFC after:1 month Modified: head/lib/libc/gen/sysctl.c Modified: head/lib/libc/gen/sysctl.c == --- head/lib/libc/gen/sysctl.c Mon Nov 2 18:45:43 2020(r367279) +++ head/lib/libc/gen/sysctl.c Mon Nov 2 18:48:06 2020(r367280) @@ -53,26 +53,42 @@ sysctl(const int *name, u_int namelen, void *oldp, siz int retval; size_t orig_oldlen; - orig_oldlen = oldlenp ? *oldlenp : 0; + orig_oldlen = oldlenp != NULL ? *oldlenp : 0; retval = __sysctl(name, namelen, oldp, oldlenp, newp, newlen); /* -* All valid names under CTL_USER have a dummy entry in the sysctl -* tree (to support name lookups and enumerations) with an -* empty/zero value, and the true value is supplied by this routine. -* For all such names, __sysctl() is used solely to validate the -* name. +* Valid names under CTL_USER except USER_LOCALBASE have a dummy entry +* in the sysctl tree (to support name lookups and enumerations) with +* an empty/zero value, and the true value is supplied by this routine. +* For all such names, __sysctl() is used solely to validate the name. * -* Return here unless there was a successful lookup for a CTL_USER -* name. +* Return here unless there was a successful lookup for a CTL_USER name. */ - if (retval || name[0] != CTL_USER) + if (retval != 0 || name[0] != CTL_USER) return (retval); if (namelen != 2) { errno = EINVAL; return (-1); } - if (newp != NULL && name[1] != USER_LOCALBASE) { + + /* Variables under CLT_USER that may be overridden by kernel values */ + switch (name[1]) { + case USER_LOCALBASE: + if (oldlenp == NULL || *oldlenp != 1) + return (0); + if (oldp != NULL) { + if (orig_oldlen < sizeof(_PATH_LOCALBASE)) { + errno = ENOMEM; + return (-1); + } + memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE)); + } + *oldlenp = sizeof(_PATH_LOCALBASE); + return (0); + } + + /* Variables under CLT_USER whose values are immutably defined below */ + if (newp != NULL) { errno = EPERM; return (-1); } @@ -87,26 +103,9 @@ sysctl(const int *name, u_int namelen, void *oldp, siz if (oldp != NULL) memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); return (0); - case USER_LOCALBASE: - if (oldlenp != NULL) { - if (oldp == NULL) { - if (*oldlenp == 1) - *oldlenp = sizeof(_PATH_LOCALBASE); - } else { - if (*oldlenp != 1) - return (retval); - if (orig_oldlen < sizeof(_PATH_LOCALBASE)) { - errno = ENOMEM; - return (-1); - } - *oldlenp = sizeof(_PATH_LOCALBASE); - memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE)); - } - } - return (0); } - if (oldp && *oldlenp < sizeof(int)) { + if (oldp != NULL && *oldlenp < sizeof(int)) { errno = ENOMEM; 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: r367292 - head/usr.bin/calendar
Author: se Date: Tue Nov 3 11:37:19 2020 New Revision: 367292 URL: https://svnweb.freebsd.org/changeset/base/367292 Log: Check that #ifdef, #ifndef, and #undef are used with a single name This restores the parameter validation that has been peformed by cpp for defining and testing of names used in conditions. MFC after:3 days Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Tue Nov 3 10:02:52 2020(r367291) +++ head/usr.bin/calendar/io.c Tue Nov 3 11:37:19 2020(r367292) @@ -89,22 +89,29 @@ static StringList *definitions = NULL; static struct event *events[MAXCOUNT]; static char *extradata[MAXCOUNT]; -static void +static char * trimlr(char **buf) { char *walk = *buf; + char *sep; char *last; while (isspace(*walk)) walk++; - if (*walk != '\0') { - last = walk + strlen(walk) - 1; + *buf = walk; + + sep = walk; + while (*sep != '\0' && !isspace(*sep)) + sep++; + + if (*sep != '\0') { + last = sep + strlen(sep) - 1; while (last > walk && isspace(*last)) last--; *(last+1) = 0; } - *buf = walk; + return (sep); } static FILE * @@ -167,7 +174,7 @@ cal_path(void) static int token(char *line, FILE *out, int *skip, int *unskip) { - char *walk, c, a; + char *walk, *sep, a, c; const char *this_cal_home; const char *this_cal_dir; const char *this_cal_file; @@ -188,14 +195,20 @@ token(char *line, FILE *out, int *skip, int *unskip) if (strncmp(line, "ifdef", 5) == 0) { walk = line + 5; - trimlr(&walk); + sep = trimlr(&walk); if (*walk == '\0') { WARN0("Expecting arguments after #ifdef"); return (T_ERR); } + if (*sep != '\0') { + WARN1("Expecting a single word after #ifdef " + "but got \"%s\"", walk); + return (T_ERR); + } - if (*skip != 0 || definitions == NULL || sl_find(definitions, walk) == NULL) + if (*skip != 0 || + definitions == NULL || sl_find(definitions, walk) == NULL) ++*skip; else ++*unskip; @@ -205,14 +218,20 @@ token(char *line, FILE *out, int *skip, int *unskip) if (strncmp(line, "ifndef", 6) == 0) { walk = line + 6; - trimlr(&walk); + sep = trimlr(&walk); if (*walk == '\0') { WARN0("Expecting arguments after #ifndef"); return (T_ERR); } + if (*sep != '\0') { + WARN1("Expecting a single word after #ifndef " + "but got \"%s\"", walk); + return (T_ERR); + } - if (*skip != 0 || (definitions != NULL && sl_find(definitions, walk) != NULL)) + if (*skip != 0 || + (definitions != NULL && sl_find(definitions, walk) != NULL)) ++*skip; else ++*unskip; @@ -222,7 +241,7 @@ token(char *line, FILE *out, int *skip, int *unskip) if (strncmp(line, "else", 4) == 0) { walk = line + 4; - trimlr(&walk); + (void)trimlr(&walk); if (*walk != '\0') { WARN0("Expecting no arguments after #else"); @@ -251,7 +270,7 @@ token(char *line, FILE *out, int *skip, int *unskip) if (strncmp(line, "include", 7) == 0) { walk = line + 7; - trimlr(&walk); + (void)trimlr(&walk); if (*walk == '\0') { WARN0("Expecting arguments after #include"); @@ -291,7 +310,8 @@ token(char *line, FILE *out, int *skip, int *unskip) if (definitions == NULL) definitions = sl_init(); walk = line + 6; - trimlr(&walk); + sep = trimlr(&walk); + *sep = '\0'; if (*walk == '\0') { WARN0("Expecting arguments after #define"); @@ -306,10 +326,15 @@ token(char *line, FILE *out, int *skip, int *unskip) if (strncmp(line, "undef", 5) == 0) { if (definitions != NULL) { walk = line + 5; - trimlr(&walk); + sep = trimlr(&walk); if (*walk == '\0') { WARN0("Expecting arguments after #undef"); +
svn commit: r367293 - head/usr.bin/calendar
Author: se Date: Tue Nov 3 12:15:08 2020 New Revision: 367293 URL: https://svnweb.freebsd.org/changeset/base/367293 Log: Consistently print calendar dates in the locale of the user Calendar files that specify LANG=... to specify their character encoding did also set the date format defined for that locale, resulting in output like: Nov 4Gabriel Faure dies from pneumonia in Paris, France, 1924 4 nov. N'oubliez pas les Charles ! After this commit the output is always printed in a consistent format according to the user's current locale, e.g.: Nov 4Gabriel Faure dies from pneumonia in Paris, France, 1924 Nov 4N'oubliez pas les Charles ! I'll open a review asking for opinions whether this format change should be merged to -STABLE. Relnotes: yes Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Tue Nov 3 11:37:19 2020(r367292) +++ head/usr.bin/calendar/io.c Tue Nov 3 12:15:08 2020(r367293) @@ -468,8 +468,7 @@ cal_parse(FILE *in, FILE *out) * and does not run iconv(), this variable has little use. */ if (strncmp(buf, "LANG=", 5) == 0) { - (void)setlocale(LC_ALL, buf + 5); - d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); + (void)setlocale(LC_CTYPE, buf + 5); #ifdef WITH_ICONV if (!doall) set_new_encoding(); ___ 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: r367294 - head/libexec/rc
Author: se Date: Tue Nov 3 12:29:10 2020 New Revision: 367294 URL: https://svnweb.freebsd.org/changeset/base/367294 Log: Replace literal uses of /usr/local with a variable The variable defaults to "/usr/local", unless sysctl returns some other value for "user.localbase". The value of user.localbase defaults to _PATH_LOCALBASE as defined in paths.h and thus this commit has no immediate effect. The purpose of this change is to make /etc/defaults/rc.conf automatically use the value of _PATH_LOCALBASE when not set to the default value. Reviewed by: imp, scottl MFC after:1 month Differential Revision:https://reviews.freebsd.org/D27014 Modified: head/libexec/rc/rc head/libexec/rc/rc.conf Modified: head/libexec/rc/rc == --- head/libexec/rc/rc Tue Nov 3 12:15:08 2020(r367293) +++ head/libexec/rc/rc Tue Nov 3 12:29:10 2020(r367294) @@ -59,6 +59,8 @@ else _boot="quietstart" fi +_localbase=`/sbin/sysctl -n user.localbase 2> /dev/null` + dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` if [ ${dlv:=0} -ne 0 -o -f /etc/diskless ]; then sh /etc/rc.initdiskless Modified: head/libexec/rc/rc.conf == --- head/libexec/rc/rc.conf Tue Nov 3 12:15:08 2020(r367293) +++ head/libexec/rc/rc.conf Tue Nov 3 12:29:10 2020(r367294) @@ -21,6 +21,9 @@ ### Important initial Boot-time options ## +# Set default value of _localbase if not previously set +: ${_localbase:="/usr/local"} + # rc_debug can't be set here without interferring with rc.subr's setting it # when the kenv variable rc.debug is set. #rc_debug="NO" # Set to YES to enable debugging output from rc.d @@ -58,7 +61,7 @@ varmfs_flags="-S" # Extra mount options for the mfs /v mfs_type="auto"# "md", "tmpfs", "auto" to prefer tmpfs with md as fallback populate_var="AUTO"# Set to YES to always (re)populate /var, NO to never cleanvar_enable="YES" # Clean the /var directory -local_startup="/usr/local/etc/rc.d" # startup script dirs. +local_startup="${_localbase}/etc/rc.d" # startup script dirs. script_name_sep=" "# Change if your startup scripts' names contain spaces rc_conf_files="/etc/rc.conf /etc/rc.conf.local" @@ -188,7 +191,7 @@ ipfw_netflow_enable="NO"# Enable netflow logging via ip_portrange_first="NO"# Set first dynamically allocated port ip_portrange_last="NO" # Set last dynamically allocated port ike_enable="NO"# Enable IKE daemon (usually racoon or isakmpd) -ike_program="/usr/local/sbin/isakmpd" # Path to IKE daemon +ike_program="${_localbase}/sbin/isakmpd" # Path to IKE daemon ike_flags="" # Additional flags for IKE daemon ipsec_enable="NO" # Set to YES to run setkey on ipsec_file ipsec_file="/etc/ipsec.conf" # Name of config file for setkey @@ -647,19 +650,19 @@ linux_mounts_enable="YES" # If linux_enable is set to clear_tmp_enable="NO" # Clear /tmp at startup. clear_tmp_X="YES" # Clear and recreate X11-related directories in /tmp ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks -ldconfig_paths="/usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg" +ldconfig_paths="/usr/lib/compat ${_localbase}/lib ${_localbase}/lib/compat/pkg" # shared library search paths ldconfig32_paths="/usr/lib32 /usr/lib32/compat" # 32-bit compatibility shared library search paths -ldconfigsoft_paths="/usr/libsoft /usr/libsoft/compat /usr/local/libsoft" +ldconfigsoft_paths="/usr/libsoft /usr/libsoft/compat ${_localbase}/libsoft" # soft float compatibility shared library search paths # Note: temporarily with extra stuff for transition -ldconfig_local_dirs="/usr/local/libdata/ldconfig" +ldconfig_local_dirs="${_localbase}/libdata/ldconfig" # Local directories with ldconfig configuration files. -ldconfig_local32_dirs="/usr/local/libdata/ldconfig32" +ldconfig_local32_dirs="${_localbase}/libdata/ldconfig32" # Local directories with 32-bit compatibility ldconfig # configuration files. -ldconfig_localsoft_dirs="/usr/local/libdata/ldconfigsoft" +ldconfig_localsoft_dirs="${_localbase}/libdata/ldconfigsoft" # Local directories with soft float compatibility ldconfig # configuration files. kern_securelevel_enable="NO" # kernel security level (see security(7)) ___ 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
svn commit: r367308 - head/usr.bin/calendar
Author: se Date: Tue Nov 3 22:13:16 2020 New Revision: 367308 URL: https://svnweb.freebsd.org/changeset/base/367308 Log: Update man-page to document changes made to the calendar program. MFC after:3 days Modified: head/usr.bin/calendar/calendar.1 Modified: head/usr.bin/calendar/calendar.1 == --- head/usr.bin/calendar/calendar.1Tue Nov 3 22:04:32 2020 (r367307) +++ head/usr.bin/calendar/calendar.1Tue Nov 3 22:13:16 2020 (r367308) @@ -198,12 +198,20 @@ file is preprocessed by a limited subset of .Xr cpp 1 internally, allowing the inclusion of shared files such as lists of company holidays or meetings. -This limited subset consists of \fB#include #ifdef #ifndef #else -#endif\fR and \fB#define\fR. Conditions can be nested, but not check -for matching begin and end directives is performed. -Included files are parsed in their own scope. -They have no read or write access to condition variables defined in -an outer scope and open conditional blocks are implicitly closed. +This limited subset consists of \fB#include\fR, \fB#define\fR, +\fB#undef\fR, \fB#ifdef\fR, \fB#ifndef\fR, and \fB#else\fR. +.Pp +Conditions can be nested and the consistency of opening and closing +instructions is checked. +Only the first word after #define is used as the name of the +condition variable being defined. +More than word following #ifdef, #ifndef, or #undef is a ayntax +error, since names cannot include white-space. +Included files are parsed in a global scope with regard to the condition +variables being defined or tested therein. +All conditional blocks are implicitly closed at the end of a file, +and missing #endif instructions are assumed to be present on implied +succeeding lines. .Pp If the shared file is not referenced by a full pathname, .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: r367350 - in head/usr.bin/calendar: . tests
Author: se Date: Wed Nov 4 22:29:01 2020 New Revision: 367350 URL: https://svnweb.freebsd.org/changeset/base/367350 Log: Add regression tests for conditions and comments Fix one case where #else was not corerctly processed and simplify the conditions logic. Fix parsing of day and month names in the locale specified in the calendar file. The previous version would expect those names to match the locale of the user. Mention that comments are now correctly processed and that // is supported in addition to /* ... */. MFC after:3 days Added: head/usr.bin/calendar/tests/calendar.comment (contents, props changed) head/usr.bin/calendar/tests/calendar.cond (contents, props changed) head/usr.bin/calendar/tests/comment.sh (contents, props changed) head/usr.bin/calendar/tests/comment_test.sh (contents, props changed) head/usr.bin/calendar/tests/cond.sh (contents, props changed) head/usr.bin/calendar/tests/cond_test.sh (contents, props changed) head/usr.bin/calendar/tests/regress.comment.out (contents, props changed) head/usr.bin/calendar/tests/regress.cond.out (contents, props changed) Modified: head/usr.bin/calendar/calendar.1 head/usr.bin/calendar/calendar.h head/usr.bin/calendar/dates.c head/usr.bin/calendar/events.c head/usr.bin/calendar/io.c head/usr.bin/calendar/tests/Makefile Directory Properties: head/usr.bin/calendar/tests/regress.a1.out (props changed) head/usr.bin/calendar/tests/regress.a2.out (props changed) head/usr.bin/calendar/tests/regress.a3.out (props changed) head/usr.bin/calendar/tests/regress.a4.out (props changed) head/usr.bin/calendar/tests/regress.a5.out (props changed) head/usr.bin/calendar/tests/regress.b1.out (props changed) head/usr.bin/calendar/tests/regress.b2.out (props changed) head/usr.bin/calendar/tests/regress.b3.out (props changed) head/usr.bin/calendar/tests/regress.b4.out (props changed) head/usr.bin/calendar/tests/regress.b5.out (props changed) head/usr.bin/calendar/tests/regress.s1.out (props changed) head/usr.bin/calendar/tests/regress.s2.out (props changed) head/usr.bin/calendar/tests/regress.s3.out (props changed) head/usr.bin/calendar/tests/regress.s4.out (props changed) head/usr.bin/calendar/tests/regress.s5.out (props changed) head/usr.bin/calendar/tests/regress.w0-1.out (props changed) head/usr.bin/calendar/tests/regress.w0-2.out (props changed) head/usr.bin/calendar/tests/regress.w0-3.out (props changed) head/usr.bin/calendar/tests/regress.w0-4.out (props changed) head/usr.bin/calendar/tests/regress.w0-5.out (props changed) head/usr.bin/calendar/tests/regress.w0-6.out (props changed) head/usr.bin/calendar/tests/regress.w0-7.out (props changed) head/usr.bin/calendar/tests/regress.wn-1.out (props changed) head/usr.bin/calendar/tests/regress.wn-2.out (props changed) head/usr.bin/calendar/tests/regress.wn-3.out (props changed) head/usr.bin/calendar/tests/regress.wn-4.out (props changed) head/usr.bin/calendar/tests/regress.wn-5.out (props changed) head/usr.bin/calendar/tests/regress.wn-6.out (props changed) head/usr.bin/calendar/tests/regress.wn-7.out (props changed) Modified: head/usr.bin/calendar/calendar.1 == --- head/usr.bin/calendar/calendar.1Wed Nov 4 21:52:10 2020 (r367349) +++ head/usr.bin/calendar/calendar.1Wed Nov 4 22:29:01 2020 (r367350) @@ -28,7 +28,7 @@ .\" @(#)calendar.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd October 28, 2020 +.Dd November 4, 2020 .Dt CALENDAR 1 .Os .Sh NAME @@ -218,12 +218,14 @@ If the shared file is not referenced by a full pathnam searches in the current (or home) directory first, and then in the directory .Pa /usr/share/calendar . -Empty lines and lines protected by the C commenting syntax +Empty lines and text protected by the C commenting syntax .Pq Li /* ... */ +or +.Pq Li // are ignored. .Pp Some possible calendar entries ( characters highlighted by -\fB\et\fR sequence) +\fB\et\fR sequence): .Bd -unfilled -offset indent LANG=C Easter=Ostern Modified: head/usr.bin/calendar/calendar.h == --- head/usr.bin/calendar/calendar.hWed Nov 4 21:52:10 2020 (r367349) +++ head/usr.bin/calendar/calendar.hWed Nov 4 22:29:01 2020 (r367350) @@ -122,7 +122,7 @@ extern int year1, year2; * - Use event_continue() to add more text to the last added event * - Use event_print_all() to display them in time chronological order */ -struct event *event_add(int, int, int, char *, int, char *, char *); +struct event *event_add(int, int, int, int, char *, char *); void event_continue(struct event *events, char *txt); void event_print_all(FILE *fp); struct event { @@ -189,7 +189,7 @@ int remember_yd(int y, int d, int *rm, int *rd);
svn commit: r367364 - head/usr.bin/calendar
Author: se Date: Thu Nov 5 08:58:21 2020 New Revision: 367364 URL: https://svnweb.freebsd.org/changeset/base/367364 Log: Restrict locale settings to the file they occur in This prevents LANG= in an included file from affecting the interpretation of month and day names in the including file. Make the internal pre-processor accept white space between the "#" at the start of the line and the keyword for better compatibility with cpp. Add support for the cpp keywords #warning and #error. MFC after:3 days Modified: head/usr.bin/calendar/calendar.1 head/usr.bin/calendar/calendar.h head/usr.bin/calendar/events.c head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/calendar.1 == --- head/usr.bin/calendar/calendar.1Thu Nov 5 07:59:05 2020 (r367363) +++ head/usr.bin/calendar/calendar.1Thu Nov 5 08:58:21 2020 (r367364) @@ -28,7 +28,7 @@ .\" @(#)calendar.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd November 4, 2020 +.Dd November 5, 2020 .Dt CALENDAR 1 .Os .Sh NAME @@ -199,13 +199,14 @@ file is preprocessed by a limited subset of internally, allowing the inclusion of shared files such as lists of company holidays or meetings. This limited subset consists of \fB#include\fR, \fB#define\fR, -\fB#undef\fR, \fB#ifdef\fR, \fB#ifndef\fR, and \fB#else\fR. +\fB#undef\fR, \fB#ifdef\fR, \fB#ifndef\fR, \fB#else\fR, \fB#warning\fR, +and \fB#error\fR. .Pp Conditions can be nested and the consistency of opening and closing instructions is checked. Only the first word after #define is used as the name of the condition variable being defined. -More than word following #ifdef, #ifndef, or #undef is a ayntax +More than word following #ifdef, #ifndef, or #undef is considered a syntax error, since names cannot include white-space. Included files are parsed in a global scope with regard to the condition variables being defined or tested therein. Modified: head/usr.bin/calendar/calendar.h == --- head/usr.bin/calendar/calendar.hThu Nov 5 07:59:05 2020 (r367363) +++ head/usr.bin/calendar/calendar.hThu Nov 5 08:58:21 2020 (r367364) @@ -130,7 +130,6 @@ struct event { int month; int day; int var; - char*date; char*text; char*extra; struct event *next; Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Thu Nov 5 07:59:05 2020 (r367363) +++ head/usr.bin/calendar/events.c Thu Nov 5 08:58:21 2020 (r367364) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include static iconv_t conv = (iconv_t)-1; static char *currentEncoding = NULL; @@ -204,13 +203,7 @@ event_print_all(FILE *fp) struct tm tm; char dbuf[80]; static int d_first; - const char *lang; - lang = getenv("LANG"); - if (lang == NULL) - lang = "C"; - if (setlocale(LC_ALL, lang) == NULL) - (void)setlocale(LC_ALL, "C"); d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); while (walkthrough_dates(&e) != 0) { Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Thu Nov 5 07:59:05 2020(r367363) +++ head/usr.bin/calendar/io.c Thu Nov 5 08:58:21 2020(r367364) @@ -172,6 +172,16 @@ cal_path(void) #defineWARN1(format, arg1)\ warnx(format " in %s line %d", arg1, cal_path(), cal_line) +static char* +cmptoken(char *line, const char* token) +{ + char len = strlen(token); + + if (strncmp(line, token, len) != 0) + return NULL; + return (line + len); +} + static int token(char *line, FILE *out, int *skip, int *unskip) { @@ -181,7 +191,10 @@ token(char *line, FILE *out, int *skip, int *unskip) const char *this_cal_file; int this_cal_line; - if (strncmp(line, "endif", 5) == 0) { + while (isspace(*line)) + line++; + + if (cmptoken(line, "endif")) { if (*skip + *unskip == 0) { WARN0("#endif without prior #ifdef or #ifndef"); return (T_ERR); @@ -194,8 +207,8 @@ token(char *line, FILE *out, int *skip, int *unskip) return (T_OK); } - if (strncmp(line, "ifdef", 5) == 0) { - walk = line + 5; + walk = cmptoken(line, "ifdef"); + if (walk != NULL) { sep = trimlr(&walk); if (*walk == '\0') { @@ -217,8 +230,8 @@ token(char *line, FILE *out, int *skip, int *unskip) return (T_OK); } - if (strncmp(line, "ifndef", 6
svn commit: r367813 - head/lib/libutil
Author: se Date: Wed Nov 18 19:44:30 2020 New Revision: 367813 URL: https://svnweb.freebsd.org/changeset/base/367813 Log: Add function getlocalbase() to libutil. This function returns the path to the local software base directory, by default "/usr/local" (or the value of _PATH_LOCALBASE in include/paths.h when building the world). The value returned can be overridden by 2 methods: - the LOCALBASE environment variable (ignored by SUID programs) - else a non-default user.localbase sysctl value Reviewed by: hps (earlier version) Relnotes: yes Differential Revision:https://reviews.freebsd.org/D27236 Added: head/lib/libutil/getlocalbase.3 (contents, props changed) head/lib/libutil/getlocalbase.c (contents, props changed) Modified: head/lib/libutil/Makefile head/lib/libutil/libutil.h Modified: head/lib/libutil/Makefile == --- head/lib/libutil/Makefile Wed Nov 18 19:35:30 2020(r367812) +++ head/lib/libutil/Makefile Wed Nov 18 19:44:30 2020(r367813) @@ -12,7 +12,8 @@ PACKAGE= runtime LIB= util SHLIB_MAJOR= 9 -SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \ +SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c \ + getlocalbase.c gr_util.c \ hexdump.c humanize_number.c kinfo_getfile.c \ kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c \ kinfo_getvmobject.c kld.c \ @@ -30,7 +31,7 @@ CFLAGS+= -DINET6 CFLAGS+= -I${.CURDIR} -I${SRCTOP}/lib/libc/gen/ -MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \ +MAN+= expand_number.3 flopen.3 fparseln.3 getlocalbase.3 hexdump.3 \ humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ kinfo_getproc.3 kinfo_getvmmap.3 kinfo_getvmobject.3 kld.3 \ login_auth.3 login_cap.3 \ Added: head/lib/libutil/getlocalbase.3 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/getlocalbase.3 Wed Nov 18 19:44:30 2020 (r367813) @@ -0,0 +1,99 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright 2020 Scott Long +.\" Copyright 2020 Stefan Eßer +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 18, 2020 +.Dt GETLOCALBASE 3 +.Os +.Sh NAME +.Nm getlocalbase +.Nd "return the path to the local software directory" +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.In libutil.h +.Ft const char* +.Fn getlocalbase "void" +.Sh DESCRIPTION +The +.Fn getlocalbase +function returns the path to the local software base directory. +Normally this is the +.Pa /usr/local +directory. +First the +.Ev LOCALBASE +environment variable is checked. +If that does not exist then the +.Va user.localbase +sysctl is checked. +If that also does not exist then the value of the +.Dv _PATH_LOCALBASE +compile-time variable is used. +If that is undefined then the default of +.Pa /usr/local +is used. +.Pp +The value returned by the +.Fn getlocalbase +function shall not be modified. +.Sh IMPLEMENTATION NOTES +Calls to +.Fn getlocalbase +will perform a setugid check on the running binary before checking the +environment. +.Sh RETURN VALUES +The +.Fn getlocalbase +function always succeeds and returns a pointer to a string, whose length +may exceed MAXPATHLEN if it has been derived from the environment variable +LOCALBASE. +No length checks are performed
svn commit: r367816 - in head: sbin/nvmecontrol usr.sbin/mailwrapper usr.sbin/pkg
Author: se Date: Wed Nov 18 20:00:55 2020 New Revision: 367816 URL: https://svnweb.freebsd.org/changeset/base/367816 Log: Make use of the getlocalbase() function for run-time adjustment of the local software base directory, as committed in SVN rev. 367813. The pkg and mailwrapper programs used the LOCALBASE environment variable for this purpose and this functionality is preserved by getlocalbase(). After this change, the value of the user.localbase sysctl variable is used if present (and not overridden in the environment). The nvmecontrol program gains support of a dynamic path to its plugin directory with this update. Differential Revision:https://reviews.freebsd.org/D27237 Modified: head/sbin/nvmecontrol/comnd.c head/sbin/nvmecontrol/nvmecontrol.c head/usr.sbin/mailwrapper/mailwrapper.c head/usr.sbin/pkg/Makefile head/usr.sbin/pkg/config.c head/usr.sbin/pkg/pkg.c Modified: head/sbin/nvmecontrol/comnd.c == --- head/sbin/nvmecontrol/comnd.c Wed Nov 18 19:55:24 2020 (r367815) +++ head/sbin/nvmecontrol/comnd.c Wed Nov 18 20:00:55 2020 (r367816) @@ -287,7 +287,7 @@ bad_arg: * Loads all the .so's from the specified directory. */ void -cmd_load_dir(const char *dir __unused, cmd_load_cb_t cb __unused, void *argp __unused) +cmd_load_dir(const char *dir, cmd_load_cb_t cb, void *argp) { DIR *d; struct dirent *dent; Modified: head/sbin/nvmecontrol/nvmecontrol.c == --- head/sbin/nvmecontrol/nvmecontrol.c Wed Nov 18 19:55:24 2020 (r367815) +++ head/sbin/nvmecontrol/nvmecontrol.c Wed Nov 18 20:00:55 2020 (r367816) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -178,11 +179,13 @@ get_nsid(int fd, char **ctrlr_str, uint32_t *nsid) int main(int argc, char *argv[]) { + static char dir[MAXPATHLEN]; cmd_init(); cmd_load_dir("/lib/nvmecontrol", NULL, NULL); - cmd_load_dir(_PATH_LOCALBASE "/lib/nvmecontrol", NULL, NULL); + snprintf(dir, MAXPATHLEN, "%s/lib/nvmecontrol", getlocalbase()); + cmd_load_dir(dir, NULL, NULL); cmd_dispatch(argc, argv, NULL); Modified: head/usr.sbin/mailwrapper/mailwrapper.c == --- head/usr.sbin/mailwrapper/mailwrapper.c Wed Nov 18 19:55:24 2020 (r367815) +++ head/usr.sbin/mailwrapper/mailwrapper.c Wed Nov 18 20:00:55 2020 (r367816) @@ -106,7 +106,7 @@ main(int argc, char *argv[], char *envp[]) addarg(&al, argv[0]); snprintf(localmailerconf, MAXPATHLEN, "%s/etc/mail/mailer.conf", - getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE); + getlocalbase()); mailerconf = localmailerconf; if ((config = fopen(localmailerconf, "r")) == NULL) Modified: head/usr.sbin/pkg/Makefile == --- head/usr.sbin/pkg/Makefile Wed Nov 18 19:55:24 2020(r367815) +++ head/usr.sbin/pkg/Makefile Wed Nov 18 20:00:55 2020(r367816) @@ -25,6 +25,6 @@ MAN= pkg.7 CFLAGS+=-I${SRCTOP}/contrib/libucl/include .PATH: ${SRCTOP}/contrib/libucl/include -LIBADD=archive fetch ucl sbuf crypto ssl +LIBADD=archive fetch ucl sbuf crypto ssl util .include Modified: head/usr.sbin/pkg/config.c == --- head/usr.sbin/pkg/config.c Wed Nov 18 19:55:24 2020(r367815) +++ head/usr.sbin/pkg/config.c Wed Nov 18 20:00:55 2020(r367816) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -455,9 +456,8 @@ config_init(void) } /* Read LOCALBASE/etc/pkg.conf first. */ - localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE; - snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", - localbase); + localbase = getlocalbase(); + snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); if (access(confpath, F_OK) == 0 && read_conf_file(confpath, CONFFILE_PKG)) Modified: head/usr.sbin/pkg/pkg.c == --- head/usr.sbin/pkg/pkg.c Wed Nov 18 19:55:24 2020(r367815) +++ head/usr.sbin/pkg/pkg.c Wed Nov 18 20:00:55 2020(r367816) @@ -43,12 +43,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -1045,8 +1045,7 @@ main(int argc, char *argv[]) pkgarg = NULL; yes = false; - snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg
svn commit: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests
Author: se Date: Thu Nov 26 17:39:51 2020 New Revision: 368072 URL: https://svnweb.freebsd.org/changeset/base/368072 Log: Update to version 3.2.0 Added: head/contrib/bc/exec-install.sh - copied unchanged from r368069, vendor/bc/dist/exec-install.sh head/contrib/bc/include/bcl.h - copied unchanged from r368069, vendor/bc/dist/include/bcl.h head/contrib/bc/include/library.h - copied unchanged from r368069, vendor/bc/dist/include/library.h head/contrib/bc/manuals/bcl.3 - copied unchanged from r368069, vendor/bc/dist/manuals/bcl.3 head/contrib/bc/manuals/bcl.3.md - copied unchanged from r368069, vendor/bc/dist/manuals/bcl.3.md head/contrib/bc/manuals/header.txt - copied unchanged from r368069, vendor/bc/dist/manuals/header.txt head/contrib/bc/manuals/header_bc.txt - copied unchanged from r368069, vendor/bc/dist/manuals/header_bc.txt head/contrib/bc/manuals/header_bcl.txt - copied unchanged from r368069, vendor/bc/dist/manuals/header_bcl.txt head/contrib/bc/manuals/header_dc.txt - copied unchanged from r368069, vendor/bc/dist/manuals/header_dc.txt head/contrib/bc/src/bc.c - copied unchanged from r368069, vendor/bc/dist/src/bc.c head/contrib/bc/src/bc_lex.c - copied unchanged from r368069, vendor/bc/dist/src/bc_lex.c head/contrib/bc/src/bc_parse.c - copied unchanged from r368069, vendor/bc/dist/src/bc_parse.c head/contrib/bc/src/dc.c - copied unchanged from r368069, vendor/bc/dist/src/dc.c head/contrib/bc/src/dc_lex.c - copied unchanged from r368069, vendor/bc/dist/src/dc_lex.c head/contrib/bc/src/dc_parse.c - copied unchanged from r368069, vendor/bc/dist/src/dc_parse.c head/contrib/bc/src/history.c - copied unchanged from r368069, vendor/bc/dist/src/history.c head/contrib/bc/src/library.c - copied unchanged from r368069, vendor/bc/dist/src/library.c head/contrib/bc/src/rand.c - copied unchanged from r368069, vendor/bc/dist/src/rand.c head/contrib/bc/tests/bcl.c - copied unchanged from r368069, vendor/bc/dist/tests/bcl.c Deleted: head/contrib/bc/install.sh head/contrib/bc/src/bc/ head/contrib/bc/src/dc/ head/contrib/bc/src/history/ head/contrib/bc/src/rand/ Modified: head/contrib/bc/.gitignore head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/README.md head/contrib/bc/configure.sh head/contrib/bc/gen/lib.bc head/contrib/bc/gen/strgen.c head/contrib/bc/gen/strgen.sh head/contrib/bc/include/file.h head/contrib/bc/include/lex.h head/contrib/bc/include/num.h head/contrib/bc/include/parse.h head/contrib/bc/include/rand.h head/contrib/bc/include/status.h head/contrib/bc/include/vector.h head/contrib/bc/include/vm.h head/contrib/bc/manpage.sh head/contrib/bc/manuals/bc.1.md.in head/contrib/bc/manuals/bc/A.1 head/contrib/bc/manuals/bc/A.1.md head/contrib/bc/manuals/bc/E.1 head/contrib/bc/manuals/bc/E.1.md head/contrib/bc/manuals/bc/EH.1 head/contrib/bc/manuals/bc/EH.1.md head/contrib/bc/manuals/bc/EHN.1 head/contrib/bc/manuals/bc/EHN.1.md head/contrib/bc/manuals/bc/EHNP.1 head/contrib/bc/manuals/bc/EHNP.1.md head/contrib/bc/manuals/bc/EHP.1 head/contrib/bc/manuals/bc/EHP.1.md head/contrib/bc/manuals/bc/EN.1 head/contrib/bc/manuals/bc/EN.1.md head/contrib/bc/manuals/bc/ENP.1 head/contrib/bc/manuals/bc/ENP.1.md head/contrib/bc/manuals/bc/EP.1 head/contrib/bc/manuals/bc/EP.1.md head/contrib/bc/manuals/bc/H.1 head/contrib/bc/manuals/bc/H.1.md head/contrib/bc/manuals/bc/HN.1 head/contrib/bc/manuals/bc/HN.1.md head/contrib/bc/manuals/bc/HNP.1 head/contrib/bc/manuals/bc/HNP.1.md head/contrib/bc/manuals/bc/HP.1 head/contrib/bc/manuals/bc/HP.1.md head/contrib/bc/manuals/bc/N.1 head/contrib/bc/manuals/bc/N.1.md head/contrib/bc/manuals/bc/NP.1 head/contrib/bc/manuals/bc/NP.1.md head/contrib/bc/manuals/bc/P.1 head/contrib/bc/manuals/bc/P.1.md head/contrib/bc/manuals/build.md head/contrib/bc/manuals/dc.1.md.in head/contrib/bc/manuals/dc/A.1 head/contrib/bc/manuals/dc/A.1.md head/contrib/bc/manuals/dc/E.1 head/contrib/bc/manuals/dc/E.1.md head/contrib/bc/manuals/dc/EH.1 head/contrib/bc/manuals/dc/EH.1.md head/contrib/bc/manuals/dc/EHN.1 head/contrib/bc/manuals/dc/EHN.1.md head/contrib/bc/manuals/dc/EHNP.1 head/contrib/bc/manuals/dc/EHNP.1.md head/contrib/bc/manuals/dc/EHP.1 head/contrib/bc/manuals/dc/EHP.1.md head/contrib/bc/manuals/dc/EN.1 head/contrib/bc/manuals/dc/EN.1.md head/contrib/bc/manuals/dc/ENP.1 head/contrib/bc/manuals/dc/ENP.1.md head/contrib/bc/manuals/dc/EP.1 head/contrib/bc/manuals/dc/EP.1.md head/contrib/bc/manuals/dc/H.1 head/contrib/bc/manuals/dc/H.1.md head/contrib/bc/manuals/dc/HN.1 head/contrib/bc/manuals/dc/HN.1.md head/contrib/bc/manuals/dc/HNP.1 head/contrib/bc/manuals/dc/HNP.1.md head/contrib/bc/manuals/dc/HP.1 head/contrib/bc/manuals/dc/HP.1.md head/contrib/bc/manuals/dc/N.1 head/contrib/
svn commit: r368080 - head/usr.bin/gh-bc
Author: se Date: Thu Nov 26 19:38:02 2020 New Revision: 368080 URL: https://svnweb.freebsd.org/changeset/base/368080 Log: Update Makefile for new version 3.2.0 Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile == --- head/usr.bin/gh-bc/Makefile Thu Nov 26 18:47:23 2020(r368079) +++ head/usr.bin/gh-bc/Makefile Thu Nov 26 19:38:02 2020(r368080) @@ -9,8 +9,8 @@ BCDIR= ${SRCTOP}/contrib/${PROGNAME} BCVERSION!=sed -n -e '/.*VERSION *= *[0-9]/s/.*VERSION *= *//p' ${BCDIR}/Makefile.in SRCS= args.c data.c file.c lang.c lex.c main.c num.c parse.c program.c read.c vector.c vm.c -SRCS+= bc/bc.c bc/lex.c bc/parse.c dc/dc.c dc/lex.c dc/parse.c history/history.c -SRCS+= bc_help.c dc_help.c lib.c lib2.c opt.c rand/rand.c +SRCS+= bc.c bc_lex.c bc_parse.c dc.c dc_lex.c dc_parse.c history.c library.c +SRCS+= bc_help.c dc_help.c lib.c lib2.c opt.c rand.c MAN= bc.1 dc.1 LINKS= ${BINDIR}/bc ${BINDIR}/dc @@ -96,16 +96,16 @@ NLSLINKS_pt_PT.ISO8859-1+= pt_PT.ISO8859-15 .endif lib.c: lib.bc - cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c bc_lib bc.h bc_lib_name 1 1 + cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c bc_lib bc_lib_name 1 1 lib2.c:lib2.bc - cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c bc_lib2 bc.h bc_lib2_name 1 1 + cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c bc_lib2 bc_lib2_name 1 1 bc_help.c: bc_help.txt - cd ${BCDIR} && sh gen/strgen.sh gen/bc_help.txt ${.OBJDIR}/bc_help.c bc_help bc.h + cd ${BCDIR} && sh gen/strgen.sh gen/bc_help.txt ${.OBJDIR}/bc_help.c bc_help dc_help.c: dc_help.txt - cd ${BCDIR} && sh gen/strgen.sh gen/dc_help.txt ${.OBJDIR}/dc_help.c dc_help dc.h + cd ${BCDIR} && sh gen/strgen.sh gen/dc_help.txt ${.OBJDIR}/dc_help.c dc_help bc.1: ${CP} ${BCDIR}/manuals/${MAN_SRC_BC} ${.OBJDIR}/bc.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: r368097 - head/usr.bin/gh-bc
Author: se Date: Fri Nov 27 09:00:21 2020 New Revision: 368097 URL: https://svnweb.freebsd.org/changeset/base/368097 Log: Make generated C files depend on this Makefile The contents of lib.c, lib2.c, bc_help.c, and dc_help.c depends on the parameters passed to strgen.sh in this Makefile. A change to the number of parameters of strgen.sh has been applied to the invocation of this command, but this did not cause a rebuild of the generated files. Reported by: cy.schub...@cschubert.com Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile == --- head/usr.bin/gh-bc/Makefile Fri Nov 27 08:53:59 2020(r368096) +++ head/usr.bin/gh-bc/Makefile Fri Nov 27 09:00:21 2020(r368097) @@ -95,16 +95,16 @@ NLSLINKS_pt_PT.ISO8859-1+= pt_BR.ISO8859-1 NLSLINKS_pt_PT.ISO8859-1+= pt_PT.ISO8859-15 .endif -lib.c: lib.bc +lib.c: lib.bc Makefile cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c bc_lib bc_lib_name 1 1 -lib2.c:lib2.bc +lib2.c:lib2.bc Makefile cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c bc_lib2 bc_lib2_name 1 1 -bc_help.c: bc_help.txt +bc_help.c: bc_help.txt Makefile cd ${BCDIR} && sh gen/strgen.sh gen/bc_help.txt ${.OBJDIR}/bc_help.c bc_help -dc_help.c: dc_help.txt +dc_help.c: dc_help.txt Makefile cd ${BCDIR} && sh gen/strgen.sh gen/dc_help.txt ${.OBJDIR}/dc_help.c dc_help bc.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: r368387 - in head/contrib/bc: . gen include manuals src tests tests/bc
Author: se Date: Sun Dec 6 11:49:21 2020 New Revision: 368387 URL: https://svnweb.freebsd.org/changeset/base/368387 Log: Upgrade to version 3.2.3 Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/configure.sh head/contrib/bc/gen/strgen.sh Directory Properties: head/contrib/bc/ (props changed) head/contrib/bc/include/bcl.h (props changed) head/contrib/bc/include/library.h (props changed) head/contrib/bc/manuals/bcl.3 (props changed) head/contrib/bc/manuals/header.txt (props changed) head/contrib/bc/manuals/header_bc.txt (props changed) head/contrib/bc/manuals/header_bcl.txt (props changed) head/contrib/bc/manuals/header_dc.txt (props changed) head/contrib/bc/src/library.c (props changed) head/contrib/bc/tests/bc/stdin1.txt (props changed) head/contrib/bc/tests/bc/stdin1_results.txt (props changed) head/contrib/bc/tests/bc/stdin2.txt (props changed) head/contrib/bc/tests/bc/stdin2_results.txt (props changed) head/contrib/bc/tests/bcl.c (props changed) Modified: head/contrib/bc/Makefile.in == --- head/contrib/bc/Makefile.in Sun Dec 6 11:43:30 2020(r368386) +++ head/contrib/bc/Makefile.in Sun Dec 6 11:49:21 2020(r368387) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.2.0 +VERSION = 3.2.3 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md == --- head/contrib/bc/NEWS.md Sun Dec 6 11:43:30 2020(r368386) +++ head/contrib/bc/NEWS.md Sun Dec 6 11:49:21 2020(r368387) @@ -1,5 +1,24 @@ # News +## 3.2.3 + +This is a production release that fixes a bug in `gen/strgen.sh`. I recently +changed `gen/strgen.c`, but I did not change `gen/strgen.sh`. + +Users that do not use `gen/strgen.sh` do not need to upgrade. + +## 3.2.2 + +This is a production release that fixes a portability bug in `configure.sh`. The +bug was using the GNU `find` extension `-wholename`. + +## 3.2.1 + +This is a production release that has one fix for `bcl(3)`. It is technically +not a bug fix since the behavior is undefined, but the `BclNumber`s that +`bcl_divmod()` returns will be set to `BCL_ERROR_INVALID_NUM` if there is an +error. Previously, they were not set. + ## 3.2.0 This is a production release that has one bug fix and a major addition. Modified: head/contrib/bc/configure.sh == --- head/contrib/bc/configure.shSun Dec 6 11:43:30 2020 (r368386) +++ head/contrib/bc/configure.shSun Dec 6 11:49:21 2020 (r368387) @@ -295,7 +295,7 @@ gen_file_list() { while [ "$#" -ge 1 ]; do a="$1" shift - args="$args ! -wholename src/${a}" + args="$args ! -path src/${a}" done else Modified: head/contrib/bc/gen/strgen.sh == --- head/contrib/bc/gen/strgen.sh Sun Dec 6 11:43:30 2020 (r368386) +++ head/contrib/bc/gen/strgen.sh Sun Dec 6 11:49:21 2020 (r368387) @@ -33,7 +33,7 @@ export LC_CTYPE=C progname=${0##*/} if [ $# -lt 3 ]; then - echo "usage: $progname input output name header [label [define [remove_tabs]]]" + echo "usage: $progname input output name [label [define [remove_tabs]]]" exit 1 fi ___ 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: r368503 - head/usr.sbin/crunch/crunchgen
Author: se Date: Thu Dec 10 09:31:05 2020 New Revision: 368503 URL: https://svnweb.freebsd.org/changeset/base/368503 Log: Lift scope of buf[] to make it extend to a potential access via *basename It can be assumed that the contents of the buffer was still allocated and valid at the point of the out-of-scope access, so there was no security issue in practice. Reported by: Coverity Scan CID 1437697 MFC after:3 days Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c == --- head/usr.sbin/crunch/crunchgen/crunched_main.c Thu Dec 10 09:30:09 2020(r368502) +++ head/usr.sbin/crunch/crunchgen/crunched_main.c Thu Dec 10 09:31:05 2020(r368503) @@ -114,6 +114,7 @@ main(int argc, char **argv, char **envp) { struct stub *ep = NULL; const char *basename = NULL; + char buf[MAXPATHLEN]; /* * Look at __progname first (this will be set if the crunched binary is @@ -141,7 +142,6 @@ main(int argc, char **argv, char **envp) * try AT_EXECPATH to get the actual binary that was executed. */ if (ep == NULL) { - char buf[MAXPATHLEN]; int error = elf_aux_info(AT_EXECPATH, &buf, sizeof(buf)); if (error == 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: r368551 - head/usr.bin/calendar/tests
Author: se Date: Fri Dec 11 13:23:59 2020 New Revision: 368551 URL: https://svnweb.freebsd.org/changeset/base/368551 Log: Install 2 forgotten shell scripts required to run the tests Submitted by: arichardson (Alexander Richardson) Differential Revision:https://reviews.freebsd.org/D27568 Modified: head/usr.bin/calendar/tests/Makefile Modified: head/usr.bin/calendar/tests/Makefile == --- head/usr.bin/calendar/tests/MakefileFri Dec 11 08:04:54 2020 (r368550) +++ head/usr.bin/calendar/tests/MakefileFri Dec 11 13:23:59 2020 (r368551) @@ -10,9 +10,11 @@ TEST_METADATA.legacy_test+= timeout="600" ${PACKAGE}FILES+= calendar.comment ${PACKAGE}FILES+= regress.comment.out +${PACKAGE}FILES+= comment.sh ${PACKAGE}FILES+= calendar.cond ${PACKAGE}FILES+= regress.cond.out +${PACKAGE}FILES+= cond.sh ${PACKAGE}FILES+= calendar.calibrate ${PACKAGE}FILES+= regress.a1.out ___ 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: r368577 - head/lib/libutil
Author: se Date: Sat Dec 12 11:23:52 2020 New Revision: 368577 URL: https://svnweb.freebsd.org/changeset/base/368577 Log: Change getlocalbase() to not allocate any heap memory After the commit of the current version, Scott Long pointed out, that an attacker might be able to cause a use-after-free access if this function returned the value of the sysctl variable "user.localbase" by freeing the allocated memory without the cached address being cleared in the library function. To resolve this issue, I have proposed the originally suggested version with a statically allocated buffer in a review (D27370). There was no feedback on this review and after waiting for more than 2 weeks, the potential security issue is fixed by this commit. (There was no security risk in practice, since none of the programs converted to use this function attempted to free the buffer. The address could only have pointed into the heap if user.localbase was set to a non-default value, into r/o data or the environment, else.) This version uses a static buffer of size LOCALBASE_CTL_LEN, which defaults to MAXPATHLEN. This does not increase the memory footprint of the library at this time, since its data segment grows from less than 7 KB to less than 8 KB, i.e. it will get two 4 KB pages on typical architectures, anyway. Compiling with LOCALBASE_CTL_LEN defined as 0 will remove the code that accesses the sysctl variable, values between 1 and MAXPATHLEN-1 will limit the maximum size of the prefix. When built with such a value and if too large a value has been configured in user.localbase, the value defined as ILLEGAL_PREFIX will be returned to cause any file operations on that result to fail. (Default value is "/dev/null/", the review contained "/\177", but I assume that "/dev/null" exists and can not be accessed as a directory. Any other string that can be assumed not be a valid path prefix could be used.) I do suggest to use LOCALBASE_CTL_LEN to size the in-kernel buffer for the user.localbase variable, too. Doing this would guarantee that the result always fit into the buffer in this library function (unless run on a kernel built with a different buffer size.) The function always returns a valid string, and only in case it is built with a small static buffer and run on a system with too large a value in user.localbase, the ILLEGAL_PREFIX will be returned, effectively causing the created path to be non-existent. Differential Revision:https://reviews.freebsd.org/D27370 Modified: head/lib/libutil/getlocalbase.3 head/lib/libutil/getlocalbase.c Modified: head/lib/libutil/getlocalbase.3 == --- head/lib/libutil/getlocalbase.3 Sat Dec 12 07:22:38 2020 (r368576) +++ head/lib/libutil/getlocalbase.3 Sat Dec 12 11:23:52 2020 (r368577) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2020 +.Dd November 25, 2020 .Dt GETLOCALBASE 3 .Os .Sh NAME @@ -59,7 +59,7 @@ If that is undefined then the default of .Pa /usr/local is used. .Pp -The value returned by the +The contents of the string returned by the .Fn getlocalbase function shall not be modified. .Sh IMPLEMENTATION NOTES @@ -67,13 +67,34 @@ Calls to .Fn getlocalbase will perform a setugid check on the running binary before checking the environment. +.Pp +The address returned by +.Fn getlocalbase +will point into the executing processes environment if it is the result of +.Fn getenv "LOCALBASE" , +to a static buffer if it is the result of +.Fn sysctl "user.localbase" , +and to a constant string if the compiled in default value is returned. +.Pp +The same value will be returned on successive calls during the run-time +of the program, ignoring any changes to the environment variable or the +sysctl value that might have been made. +.Pp +The +.Fn getlocalbase +function can be compiled with a non-default value of LOCALBASE_CTL_LEN. +A value of 0 will disable fetching of the sysctl value, a value less than +MAXPATHLEN will put a limit on the maximum string length supported for +this sysctl value. +If built with a non-default value of LOCALBASE_CTL_LEN, a value of the +user.localbase sysctl variable longer than this value will make +.Fn getlocalbase +return a valid string that is not a valid path prefix in any filesystem. .Sh RETURN VALUES The .Fn getlocalbase -function always succeeds and returns a pointer to a string, whose length -may exceed MAXPATHLEN if it has been derived from the environment variable -LOCALBASE. -No length checks are performed on the result. +function returns a pointer to a string, whose length may exceed MAXPATHLEN, +if it has been obtained from the environment. .Sh ENVIRONMENT The .Fn getlocalbase @@ -83,7 +104,7 @@ environment variable. .Sh ERRORS The .Fn getlocalbase -function always succeeds. +function always succeeds and returns a valid point
svn commit: r368578 - head/usr.bin/calendar
Author: se Date: Sat Dec 12 11:51:29 2020 New Revision: 368578 URL: https://svnweb.freebsd.org/changeset/base/368578 Log: Use getlocalbase() instead of compiled in LOCALBASE to locate calendars Modified: head/usr.bin/calendar/io.c head/usr.bin/calendar/pathnames.h Modified: head/usr.bin/calendar/io.c == --- head/usr.bin/calendar/io.c Sat Dec 12 11:23:52 2020(r368577) +++ head/usr.bin/calendar/io.c Sat Dec 12 11:51:29 2020(r368578) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -121,6 +122,7 @@ cal_fopen(const char *file) unsigned int i; struct stat sb; static bool warned = false; + char calendarhome[MAXPATHLEN]; if (home == NULL || *home == '\0') { warnx("Cannot get home directory"); @@ -133,12 +135,16 @@ cal_fopen(const char *file) } for (i = 0; i < nitems(calendarHomes); i++) { - if (chdir(calendarHomes[i]) != 0) + if (snprintf(calendarhome, sizeof (calendarhome), calendarHomes[i], + getlocalbase()) >= (int)sizeof (calendarhome)) continue; + if (chdir(calendarhome) != 0) + continue; + if ((fp = fopen(file, "r")) != NULL) { cal_home = home; - cal_dir = calendarHomes[i]; + cal_dir = calendarhome; cal_file = file; return (fp); } Modified: head/usr.bin/calendar/pathnames.h == --- head/usr.bin/calendar/pathnames.h Sat Dec 12 11:23:52 2020 (r368577) +++ head/usr.bin/calendar/pathnames.h Sat Dec 12 11:51:29 2020 (r368578) @@ -35,4 +35,4 @@ #include #define_PATH_INCLUDE "/usr/share/calendar" -#define_PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar" +#define_PATH_INCLUDE_LOCAL "%s/share/calendar" ___ 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: r368606 - head/usr.bin/calendar
Author: se Date: Sun Dec 13 09:38:50 2020 New Revision: 368606 URL: https://svnweb.freebsd.org/changeset/base/368606 Log: Fix WITHOUT_ICONV build There was an unprotected use of nl_langinfo() to determine the order of day vs. month in the generated output. When building without ICONV support, the order will be: month, day. Modified: head/usr.bin/calendar/events.c Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Sun Dec 13 05:34:14 2020 (r368605) +++ head/usr.bin/calendar/events.c Sun Dec 13 09:38:50 2020 (r368606) @@ -202,9 +202,13 @@ event_print_all(FILE *fp) struct event *e; struct tm tm; char dbuf[80]; +#ifdef WITH_ICONV static int d_first; d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); +#else +#defined_first 0 +#endif while (walkthrough_dates(&e) != 0) { if (e) { ___ 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: r368610 - head/usr.bin/calendar
Author: se Date: Sun Dec 13 19:03:38 2020 New Revision: 368610 URL: https://svnweb.freebsd.org/changeset/base/368610 Log: Revert r368606 The issue will be fixed in a different way. Reported by: yuripv Modified: head/usr.bin/calendar/events.c Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Sun Dec 13 18:06:24 2020 (r368609) +++ head/usr.bin/calendar/events.c Sun Dec 13 19:03:38 2020 (r368610) @@ -202,13 +202,9 @@ event_print_all(FILE *fp) struct event *e; struct tm tm; char dbuf[80]; -#ifdef WITH_ICONV static int d_first; d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); -#else -#defined_first 0 -#endif while (walkthrough_dates(&e) != 0) { if (e) { ___ 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: r368611 - head/usr.bin/calendar
Author: se Date: Sun Dec 13 19:06:59 2020 New Revision: 368611 URL: https://svnweb.freebsd.org/changeset/base/368611 Log: Fix WITHOUT_ICONV build Move the include of langinfo.h out of the WITH_ICONV condition block, since it is not dependent on ICONV. This was correct when nl_langinfo() had only been called in the WITH_ICONV case, but that is no longer the case. Submitted by: yuripv Modified: head/usr.bin/calendar/events.c Modified: head/usr.bin/calendar/events.c == --- head/usr.bin/calendar/events.c Sun Dec 13 19:03:38 2020 (r368610) +++ head/usr.bin/calendar/events.c Sun Dec 13 19:06:59 2020 (r368611) @@ -32,13 +32,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #ifdef WITH_ICONV #include #include -#include static iconv_t conv = (iconv_t)-1; static char *currentEncoding = 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"
Re: svn commit: r355585 - head/share/vt/keymaps
Am 10.12.19 um 15:35 schrieb Ed Maste: > Author: emaste > Date: Tue Dec 10 14:35:38 2019 > New Revision: 355585 > URL: https://svnweb.freebsd.org/changeset/base/355585 > > Log: > remove nonexistent from-* entries from vt INDEX.keymaps > > A number of entries of the form "de.kbd.from-cp850" existed in vt's > INDEX.keymaps, added in r270114, but these files do not exist. Sorry, these were left-overs from my conversion process from 8 bit syscons charsets to UTF-8 for vt. The names were meant to simplify QA by encoding the orginal charset name in the file name. Seems that I remembered to clean up the file names before the final commit, but forgot to edit the INDEX.keymaps that contained both the final and these intermediate names for my pre-commit tests ... Nobody seems to have noticed this problem for more than 5 years, though. Regards, STefan ___ 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"
Re: svn commit: r355585 - head/share/vt/keymaps
Am 10.12.19 um 13:59 schrieb Ed Maste: > On Tue, 10 Dec 2019 at 10:22, Stefan Eßer wrote: >> >> Nobody seems to have noticed this problem for more than 5 years, >> though. > > Probably because there's no user-facing impact - nonexistent keymap > files are just omitted from the list. I'm glad someone eventually > looked and submitted a PR :) Yes, I assumed so, they had been noticed before, else ... > There are a couple of other keymap/font issue PRs that I'll try to look into. I have just committed two small fixes that had been on my system for quite long and I had forgotten about them (0x15 and 01xf used instead of "nak" and "us" as in all other files). At the time when I converted the syscons keymaps for vt, I had started to write a converter from Linux keymaps to our style. But since we had all major locales covered, I did not consider this conversion a priority, I got side-tracked and did not complete that script. I might restart that effort, if there is interest (important keymaps missing in FreeBSD, but available for Linux). Regards, STefan ___ 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: r361803 - head/sys/ufs/ffs
Author: se Date: Thu Jun 4 19:54:25 2020 New Revision: 361803 URL: https://svnweb.freebsd.org/changeset/base/361803 Log: Fix obvious typo: IN_BLKDATA should be IN_IBLKDATA Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c == --- head/sys/ufs/ffs/ffs_balloc.c Thu Jun 4 19:21:41 2020 (r361802) +++ head/sys/ufs/ffs/ffs_balloc.c Thu Jun 4 19:54:25 2020 (r361803) @@ -648,7 +648,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i dp->di_extsize = smalllblktosize(fs, nb + 1); dp->di_extb[nb] = dbtofsb(fs, bp->b_blkno); bp->b_xflags |= BX_ALTDATA; - UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_BLKDATA); + UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_IBLKDATA); if (flags & IO_SYNC) bwrite(bp); 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"
Re: svn commit: r361801 - head/sys/ufs/ffs
Am 04.06.20 um 21:48 schrieb Kyle Evans: > On Thu, Jun 4, 2020 at 1:35 PM Kirk McKusick wrote: [...] >> Modified: head/sys/ufs/ffs/ffs_balloc.c >> == >> --- head/sys/ufs/ffs/ffs_balloc.c Thu Jun 4 18:19:16 2020 >> (r361800) >> +++ head/sys/ufs/ffs/ffs_balloc.c Thu Jun 4 18:35:21 2020 >> (r361801) >> @@ -154,7 +154,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, i >> ip->i_size = smalllblktosize(fs, nb + 1); >> dp->di_size = ip->i_size; >> dp->di_db[nb] = dbtofsb(fs, bp->b_blkno); >> - UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_UPDATE); >> + UFS_INODE_SET_FLAG(ip, >> + IN_CHANGE | IN_UPDATE | IN_IBLKDATA); >> if (flags & IO_SYNC) >> bwrite(bp); >> else if (DOINGASYNC(vp)) >> @@ -647,7 +648,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, i >> dp->di_extsize = smalllblktosize(fs, nb + 1); >> dp->di_extb[nb] = dbtofsb(fs, bp->b_blkno); >> bp->b_xflags |= BX_ALTDATA; >> - UFS_INODE_SET_FLAG(ip, IN_CHANGE); >> + UFS_INODE_SET_FLAG(ip, IN_CHANGE | >> IN_BLKDATA); >> if (flags & IO_SYNC) >> bwrite(bp); >> else > > Hello! > > This second one seems to have been accidentally misspelled as "IN_BLKDATA" I had noticed this independently since my kernel builds failed and took liberty to commit a fix of this obvious typo. Regards, STefan ___ 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"
Re: svn commit: r359503 - in head
Am 02.04.20 um 09:10 schrieb Mark Linimon: > On Wed, Apr 01, 2020 at 05:53:14AM +, Glen Barber wrote: >> Update head to 14.0-CURRENT in order to prevent having >> a 13.0-RELEASE. > > You forgot to update the Porter's Handbook. You are aware that this commit message came from and only applied to some parallel universe ... ??? ;-) Regards, STefan ___ 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: r365030 - head/sbin/ipfw
Author: se Date: Tue Sep 1 09:02:43 2020 New Revision: 365030 URL: https://svnweb.freebsd.org/changeset/base/365030 Log: Change printf format string to include the extra blank This is a follow up change to r364321 after a discussion about the style. All near by places use extra blanks in format strings, and while use of the format string to provide the extra blank may need more cycles than adding 1 to twidth, it generates shorter code and is clearer in the opinion of some reviewers of the previous change. Not objected to by: emaste MFC after:3 days Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c == --- head/sbin/ipfw/ipfw2.c Tue Sep 1 08:14:46 2020(r365029) +++ head/sbin/ipfw/ipfw2.c Tue Sep 1 09:02:43 2020(r365030) @@ -2199,7 +2199,7 @@ show_static_rule(struct cmdline_opts *co, struct forma *strchr(timestr, '\n') = '\0'; bprintf(bp, "%s ", timestr); } else { - bprintf(bp, "%*s", twidth + 1, " "); + bprintf(bp, "%*s ", twidth, ""); } } ___ 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: r365753 - head/tools/build/options
Author: se Date: Tue Sep 15 16:22:05 2020 New Revision: 365753 URL: https://svnweb.freebsd.org/changeset/base/365753 Log: Add descriptions of the WITH_(OUT)_GH_BC options that exist in -CURRENT (default: WITH_GH_BC) and 12-STABLE (default: WITHOUT_GH_BC). Since the new implementation of bc and dc is optionally available in 12-STABLE, I intend to MFC these descriptions for inclusion in 12.2. MFC after:3 days Added: head/tools/build/options/WITHOUT_GH_BC (contents, props changed) head/tools/build/options/WITH_GH_BC (contents, props changed) Added: head/tools/build/options/WITHOUT_GH_BC == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_GH_BC Tue Sep 15 16:22:05 2020 (r365753) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Do not install the enhanced +.Xr bc +and +.Xr dc +programs instead of the traditional FreeBSD versions. Added: head/tools/build/options/WITH_GH_BC == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GH_BC Tue Sep 15 16:22:05 2020 (r365753) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Install the enhanced +.Xr bc +and +.Xr dc +programs instead of the traditional FreeBSD versions. ___ 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: r365754 - head/share/man/man5
Author: se Date: Tue Sep 15 16:38:44 2020 New Revision: 365754 URL: https://svnweb.freebsd.org/changeset/base/365754 Log: src.conf.5: regen after r365753 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Tue Sep 15 16:22:05 2020 (r365753) +++ head/share/man/man5/src.conf.5 Tue Sep 15 16:38:44 2020 (r365754) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 14, 2020 +.Dd September 15, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -668,6 +668,12 @@ Set to build .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mips, mips/mips64, powerpc/powerpc and powerpc/powerpc64. +.It Va WITHOUT_GH_BC +Do not install the enhanced +.Xr bc +and +.Xr dc +programs instead of the traditional FreeBSD versions. .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff3 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: r365921 - in head/lib/msun: ld128 ld80
Author: se Date: Sun Sep 20 05:28:31 2020 New Revision: 365921 URL: https://svnweb.freebsd.org/changeset/base/365921 Log: Apply fix for ld80 and ld128 submitted by Steve Kargl: - Micro-optimization: use sincosl(x) instead of a call to cosl(x) and a call to sinl(x). Argument reduction is done once not twice. - Use a long double constant instead of an invalid double constant. - Spell scale2 correctly He could not test ld128, so that patch is untested. Submitted by: sgk at troutmask.apl.washington.edu (Steve Kargl) Modified: head/lib/msun/ld128/k_expl.h head/lib/msun/ld80/k_expl.h Modified: head/lib/msun/ld128/k_expl.h == --- head/lib/msun/ld128/k_expl.hSun Sep 20 05:23:16 2020 (r365920) +++ head/lib/msun/ld128/k_expl.hSun Sep 20 05:28:31 2020 (r365921) @@ -300,7 +300,7 @@ hexpl(long double x) static inline long double complex __ldexp_cexpl(long double complex z, int expt) { - long double exp_x, hi, lo; + long double c, exp_x, hi, lo, s; long double x, y, scale1, scale2; int half_expt, k; @@ -308,16 +308,17 @@ __ldexp_cexpl(long double complex z, int expt) y = cimagl(z); __k_expl(x, &hi, &lo, &k); - exp_x = (lo + hi) * 0x1p16382; + exp_x = (lo + hi) * 0x1p16382L; expt += k - 16382; scale1 = 1; half_expt = expt / 2; SET_LDBL_EXPSIGN(scale1, BIAS + half_expt); scale2 = 1; - SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt); + SET_LDBL_EXPSIGN(scale2, BIAS + expt - half_expt); - return (CMPLXL(cos(y) * exp_x * scale1 * scale2, - sinl(y) * exp_x * scale1 * scale2)); + sincosl(y, &s, &c); + return (CMPLXL(c * exp_x * scale1 * scale2, + s * exp_x * scale1 * scale2)); } #endif /* _COMPLEX_H */ Modified: head/lib/msun/ld80/k_expl.h == --- head/lib/msun/ld80/k_expl.h Sun Sep 20 05:23:16 2020(r365920) +++ head/lib/msun/ld80/k_expl.h Sun Sep 20 05:28:31 2020(r365921) @@ -277,7 +277,7 @@ hexpl(long double x) static inline long double complex __ldexp_cexpl(long double complex z, int expt) { - long double exp_x, hi, lo; + long double c, exp_x, hi, lo, s; long double x, y, scale1, scale2; int half_expt, k; @@ -285,16 +285,17 @@ __ldexp_cexpl(long double complex z, int expt) y = cimagl(z); __k_expl(x, &hi, &lo, &k); - exp_x = (lo + hi) * 0x1p16382; + exp_x = (lo + hi) * 0x1p16382L; expt += k - 16382; scale1 = 1; half_expt = expt / 2; SET_LDBL_EXPSIGN(scale1, BIAS + half_expt); scale2 = 1; - SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt); + SET_LDBL_EXPSIGN(scale2, BIAS + expt - half_expt); - return (CMPLXL(cos(y) * exp_x * scale1 * scale2, - sinl(y) * exp_x * scale1 * scale2)); + sincosl(y, &s, &c); + return (CMPLXL(c * exp_x * scale1 * scale2, + s * exp_x * scale1 * scale2)); } #endif /* _COMPLEX_H */ ___ 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: r365922 - head/lib/msun/src
Author: se Date: Sun Sep 20 05:32:53 2020 New Revision: 365922 URL: https://svnweb.freebsd.org/changeset/base/365922 Log: Apply an opimization for the kernels used by cexp(x) and cexpf(x) submitted by Steve Kargl: - Use sincos[f] instead of a call to cos[f] and a call to sin[f]. - While here, alphabetize declaration. Submitted by: sgk at troutmask.apl.washington.edu (Steve Kargl) Modified: head/lib/msun/src/k_exp.c head/lib/msun/src/k_expf.c Modified: head/lib/msun/src/k_exp.c == --- head/lib/msun/src/k_exp.c Sun Sep 20 05:28:31 2020(r365921) +++ head/lib/msun/src/k_exp.c Sun Sep 20 05:32:53 2020(r365922) @@ -88,7 +88,7 @@ __ldexp_exp(double x, int expt) double complex __ldexp_cexp(double complex z, int expt) { - double x, y, exp_x, scale1, scale2; + double c, exp_x, s, scale1, scale2, x, y; int ex_expt, half_expt; x = creal(z); @@ -105,6 +105,7 @@ __ldexp_cexp(double complex z, int expt) half_expt = expt - half_expt; INSERT_WORDS(scale2, (0x3ff + half_expt) << 20, 0); - return (CMPLX(cos(y) * exp_x * scale1 * scale2, - sin(y) * exp_x * scale1 * scale2)); + sincos(y, &s, &c); + return (CMPLX(c * exp_x * scale1 * scale2, + s * exp_x * scale1 * scale2)); } Modified: head/lib/msun/src/k_expf.c == --- head/lib/msun/src/k_expf.c Sun Sep 20 05:28:31 2020(r365921) +++ head/lib/msun/src/k_expf.c Sun Sep 20 05:32:53 2020(r365922) @@ -71,7 +71,7 @@ __ldexp_expf(float x, int expt) float complex __ldexp_cexpf(float complex z, int expt) { - float x, y, exp_x, scale1, scale2; + float c, exp_x, s, scale1, scale2, x, y; int ex_expt, half_expt; x = crealf(z); @@ -84,6 +84,7 @@ __ldexp_cexpf(float complex z, int expt) half_expt = expt - half_expt; SET_FLOAT_WORD(scale2, (0x7f + half_expt) << 23); - return (CMPLXF(cosf(y) * exp_x * scale1 * scale2, - sinf(y) * exp_x * scale1 * scale2)); + sincosf(y, &s, &c); + return (CMPLXF(c * exp_x * scale1 * scale2, + s * exp_x * scale1 * scale2)); } ___ 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: r366100 - in head: share/man/man5 tools/build/options
Author: se Date: Thu Sep 24 06:12:57 2020 New Revision: 366100 URL: https://svnweb.freebsd.org/changeset/base/366100 Log: Slightly modify wording to better match nearby entries. MFC after:3 days Modified: head/share/man/man5/src.conf.5 head/tools/build/options/WITHOUT_GH_BC head/tools/build/options/WITH_GH_BC Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Thu Sep 24 03:38:32 2020 (r366099) +++ head/share/man/man5/src.conf.5 Thu Sep 24 06:12:57 2020 (r366100) @@ -669,10 +669,10 @@ Set to build This is a default setting on amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mips, mips/mips64, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_GH_BC -Do not install the enhanced -.Xr bc +Set to not build and install the enhanced +.Xr bc 1 and -.Xr dc +.Xr dc 1 programs instead of the traditional FreeBSD versions. .It Va WITHOUT_GNU_DIFF Set to not build GNU Modified: head/tools/build/options/WITHOUT_GH_BC == --- head/tools/build/options/WITHOUT_GH_BC Thu Sep 24 03:38:32 2020 (r366099) +++ head/tools/build/options/WITHOUT_GH_BC Thu Sep 24 06:12:57 2020 (r366100) @@ -1,6 +1,6 @@ .\" $FreeBSD$ -Do not install the enhanced -.Xr bc +Set to not build and install the enhanced +.Xr bc 1 and -.Xr dc +.Xr dc 1 programs instead of the traditional FreeBSD versions. Modified: head/tools/build/options/WITH_GH_BC == --- head/tools/build/options/WITH_GH_BC Thu Sep 24 03:38:32 2020 (r366099) +++ head/tools/build/options/WITH_GH_BC Thu Sep 24 06:12:57 2020 (r366100) @@ -1,6 +1,6 @@ .\" $FreeBSD$ -Install the enhanced -.Xr bc +Set this option to install the enhanced +.Xr bc 1 and -.Xr dc +.Xr dc 1 programs instead of the traditional FreeBSD versions. ___ 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: r366109 - in head/share/syscons: fonts keymaps
Author: se Date: Thu Sep 24 09:06:04 2020 New Revision: 366109 URL: https://svnweb.freebsd.org/changeset/base/366109 Log: Add danish translations provided by GitHub user scootergriesen These translations did already exist in the index files for "vt". Obtained from:https://github.com/scootergrisen/freebsd/ Modified: head/share/syscons/fonts/INDEX.fonts head/share/syscons/keymaps/INDEX.keymaps Modified: head/share/syscons/fonts/INDEX.fonts == --- head/share/syscons/fonts/INDEX.fontsThu Sep 24 08:51:23 2020 (r366108) +++ head/share/syscons/fonts/INDEX.fontsThu Sep 24 09:06:04 2020 (r366109) @@ -49,6 +49,7 @@ # Language support: MENU, FONT # MENU:en:Choose your keyboard font +MENU:da:V�lg din skrifttype for tastaturet MENU:de:W�hlen Sie Ihre Schrift MENU:fr:Choisissez votre fonte �cran MENU:pl:Wybierz czcionk� ekranow� @@ -71,109 +72,128 @@ FONT:hy:armscii8-8x16.fnt armscii8-8x16.fnt:hy:ARMSCII-8 �ṳ���ٳ� �۳�, 8x16 armscii8-8x16.fnt:ru:� ARMSCII-8, 8x16 armscii8-8x16.fnt:en:ARMSCII-8 Character set, 8x16 +armscii8-8x16.fnt:da:ARMSCII-8-tegns�t, 8x16 armscii8-8x16.fnt:de:ARMSCII-8 Zeichensatz, 8x16 armscii8-8x14.fnt:hy:ARMSCII-8 �ṳ���ٳ� �۳�, 8x14 armscii8-8x14.fnt:ru:� ARMSCII-8, 8x14 armscii8-8x14.fnt:en:ARMSCII-8 Character set, 8x14 +armscii8-8x14.fnt:da:ARMSCII-8-tegns�t, 8x14 armscii8-8x14.fnt:de:ARMSCII-8 Zeichensatz, 8x14 armscii8-8x8.fnt:hy:ARMSCII-8 �ṳ���ٳ� �۳�, 8x8 armscii8-8x8.fnt:ru:� ARMSCII-8, 8x8 armscii8-8x8.fnt:en:ARMSCII-8 Character set, 8x8 +armscii8-8x8.fnt:da:ARMSCII-8-tegns�t, 8x8 armscii8-8x8.fnt:de:ARMSCII-8 Zeichensatz, 8x8 cp437-8x14.fnt:en:Codepage 437 English, 8x14 +cp437-8x14.fnt:da:Codepage 437 engelsk, 8x14 cp437-8x14.fnt:de:Codeseite 437 Englisch, 8x14 cp437-8x14.fnt:fr:Code page 437 Anglais, 8x14 cp437-8x14.fnt:es:P�gina de c�digos 437 ingl�s, 8x14 cp437-8x14.fnt:uk:� 437 ���̦��, 8x14 cp437-8x16.fnt:en:Codepage 437 English, 8x16 +cp437-8x16.fnt:da:Codepage 437 engelsk, 8x16 cp437-8x16.fnt:de:Codeseite 437 Englisch, 8x16 cp437-8x16.fnt:fr:Code page 437 Anglais, 8x16 cp437-8x16.fnt:es:P�gina de c�digos 437 ingl�s, 8x16 cp437-8x16.fnt:uk:� 437 ���̦��, 8x16 cp437-thin-8x16.fnt:en:Codepage 437 English, 8x16 (thin) +cp437-thin-8x16.fnt:da:Codepage 437 engelsk, 8x16 (smal) cp437-thin-8x16.fnt:de:Codeseite 437 Englisch, 8x16 (d�nn) cp437-thin-8x16.fnt:fr:Code page 437 Anglais, 8x16 (d�nn) cp437-thin-8x16.fnt:es:P�gina de c�digos 437 ingl�s, 8x16 (fina) cp437-thin-8x16.fnt:uk:� 437 ���̦��, 8x16 (��) cp437-8x8.fnt:en:Codepage 437 English, 8x8 +cp437-8x8.fnt:da:Codepage 437 engelsk, 8x8 cp437-8x8.fnt:de:Codeseite 437 Englisch, 8x8 cp437-8x8.fnt:fr:Code page 437 Anglais, 8x8 cp437-8x8.fnt:es:P�gina de c�digos 437 ingl�s, 8x8 cp437-8x8.fnt:uk:� 437 ���̦��, 8x8 cp437-thin-8x8.fnt:en:Codepage 437 English, 8x8 (thin) +cp437-thin-8x8.fnt:da:Codepage 437 engelsk, 8x8 (smal) cp437-thin-8x8.fnt:de:Codeseite 437 Englisch, 8x8 (d�nn) cp437-thin-8x8.fnt:fr:Code page 437 Anglais, 8x8 (d�nn) cp437-thin-8x8.fnt:es:P�gina de c�digos 437 ingl�s, 8x8 (fina) cp437-thin-8x8.fnt:uk:� 437 ���̦��, 8x8 (��) cp850-8x14.fnt:en:Codepage 850 Multilingual Latin I, 8x14 +cp850-8x14.fnt:da:Codepage 850 flersproget latinsk I, 8x14 cp850-8x14.fnt:de:Codeseite 850 Mehrsprachig (Lateinisch I), 8x14 cp850-8x14.fnt:fr:Latin multilingual I, 8x14 cp850-8x14.fnt:es:P�gina de c�digos 850 multiling�e, 8x14 cp850-8x14.fnt:uk:� 850 I, 8x14 cp850-8x16.fnt:en:Codepage 850 Multilingual Latin I, 8x16 +cp850-8x16.fnt:da:Codepage 850 flersproget latinsk I, 8x16 cp850-8x16.fnt:de:Codeseite 850 Mehrsprachig (Lateinisch I), 8x16 cp850-8x16.fnt:fr:Latin multilingual I, 8x16 cp850-8x16.fnt:es:P�gina de c�digos 850 multiling�e, 8x16 cp850-8x16.fnt:uk:� 850 I, 8x16 cp850-thin-8x16.fnt:en:Codepage 850 Multilingual Latin I, 8x16 (thin) +cp850-thin-8x16.fnt:da:Codepage 850 flersproget latinsk I, 8x16 (smal) cp850-thin-8x16.fnt:de:Codeseite 850 Mehrsprachig (Lateinisch I), 8x16 (d�nn) cp850-thin-8x16.fnt:fr:Latin multilingual I, 8x16 (fine) cp850-thin-8x16.fnt:es:P�gina de c�digos 850 multiling�e, 8x16 (fina) cp850-thin-8x16.fnt:uk:� 850 I, 8x16 (��) cp850-8x8.fnt:en:Codepage 850 Multilingual Latin I, 8x8 +cp850-8x8.fnt:da:Codepage 850 flersproget latinsk I, 8x8 cp850-8x8.fnt:de:Codeseite 850 Mehrsprachig (Lateinisch I), 8x8 cp850-8x8.fnt:fr:Latin multilingual I, 8x8 cp850-8x8.fnt:es:P�gina de c�digos 850 multiling�e, 8x8 cp850-8x8.fnt:uk:� 850 I, 8x8 cp850-thin-8x8.fnt:en:Codepage 850 Multilingual Latin I, 8x8 (thin) +cp850-thin-8x8.fnt:da:Codepage 850 flersproget latinsk I, 8x8 (smal) cp850-thin-8x8.fnt:de:Codeseite 850 Mehrsprachig (Lateinisch I), 8x8 (d�nn) cp850-thin-8x8.fnt:fr:Latin multi
svn commit: r366318 - in head/contrib/bc: . include src
Author: se Date: Thu Oct 1 15:45:07 2020 New Revision: 366318 URL: https://svnweb.freebsd.org/changeset/base/366318 Log: Upgrade to version 3.1.6 This upgrade addresses one (benign) compiler warning when building with LLVM-12. Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/include/bc.h head/contrib/bc/release.sh head/contrib/bc/src/data.c head/contrib/bc/src/num.c head/contrib/bc/src/program.c Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in == --- head/contrib/bc/Makefile.in Thu Oct 1 15:41:32 2020(r366317) +++ head/contrib/bc/Makefile.in Thu Oct 1 15:45:07 2020(r366318) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.5 +VERSION = 3.1.6 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md == --- head/contrib/bc/NEWS.md Thu Oct 1 15:41:32 2020(r366317) +++ head/contrib/bc/NEWS.md Thu Oct 1 15:45:07 2020(r366318) @@ -1,5 +1,13 @@ # News +## 3.1.6 + +This is a production release that fixes a new warning from Clang 12 for FreeBSD +and also removes some possible undefined behavior found by UBSan that compilers +did not seem to take advantage of. + +Users do ***NOT*** need to upgrade, if they do not want to. + ## 3.1.5 This is a production release that fixes the Chinese locales (which caused `bc` Modified: head/contrib/bc/include/bc.h == --- head/contrib/bc/include/bc.hThu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/include/bc.hThu Oct 1 15:45:07 2020 (r366318) @@ -173,6 +173,10 @@ extern const BcParseNext bc_parse_next_elem; extern const BcParseNext bc_parse_next_for; extern const BcParseNext bc_parse_next_read; +#else // BC_ENABLED + +#define BC_PARSE_NO_EXEC(p) (0) + #endif // BC_ENABLED #endif // BC_BC_H Modified: head/contrib/bc/release.sh == --- head/contrib/bc/release.sh Thu Oct 1 15:41:32 2020(r366317) +++ head/contrib/bc/release.sh Thu Oct 1 15:45:07 2020(r366318) @@ -383,6 +383,7 @@ build_set() { clang_flags="-Weverything -Wno-padded -Wno-switch-enum -Wno-format-nonliteral" clang_flags="$clang_flags -Wno-cast-align -Wno-missing-noreturn -Wno-disabled-macro-expansion" clang_flags="$clang_flags -Wno-unreachable-code -Wno-unreachable-code-return" +clang_flags="$clang_flags -Wno-implicit-fallthrough" gcc_flags="-Wno-maybe-uninitialized -Wno-clobbered" cflags="-Wall -Wextra -Werror -pedantic -Wno-conditional-uninitialized" Modified: head/contrib/bc/src/data.c == --- head/contrib/bc/src/data.c Thu Oct 1 15:41:32 2020(r366317) +++ head/contrib/bc/src/data.c Thu Oct 1 15:45:07 2020(r366318) @@ -141,8 +141,8 @@ const char* const bc_err_msgs[] = { "empty expression", "bad print statement", "bad function definition", - "bad assignment: left side must be scale, ibase, " - "obase, seed, last, var, or array element", + ("bad assignment: left side must be scale, ibase, " + "obase, seed, last, var, or array element"), "no auto variable found", "function parameter or auto \"%s%s\" already exists", "block end cannot be found", Modified: head/contrib/bc/src/num.c == --- head/contrib/bc/src/num.c Thu Oct 1 15:41:32 2020(r366317) +++ head/contrib/bc/src/num.c Thu Oct 1 15:45:07 2020(r366318) @@ -1457,7 +1457,8 @@ static void bc_num_parseDecimal(BcNum *restrict n, con for (i = 0; i < len && (zero = (val[i] == '0' || val[i] == '.')); ++i); - n->scale = (size_t) (rdx * ((val + len) - (ptr + 1))); + n->scale = (size_t) (rdx * (((uintptr_t) (val + len)) - + (((uintptr_t) ptr) + 1))); n->rdx = BC_NUM_RDX(n->scale); i = len - (ptr == val ? 0 : i) - rdx; @@ -1656,7 +1657,7 @@ static void bc_num_printDecimal(const BcNum *restrict memset(buffer, 0, BC_BASE_DIGS * sizeof(size_t)); for (j = 0; n9 && j < BC_BASE_DIGS; ++j) { - buffer[j] = n9 % BC_BASE; + buffer[j] = ((size_t) n9) % BC_BASE; n9 /= BC_BASE; } Modified: head/contrib/bc/src/program.c == --- head/contrib/bc/src/program.c Thu Oct 1 15:41:32 2020 (r366317) +++ head/contrib/bc/src/program.c Thu Oct 1 15:45:07 2020 (r366318) @@ -180,7 +180,7 @@ static inline