Re: trunk on RAMDISK_CD

2014-07-15 Thread Theo Buehler
Hi Henning, On Tue, Jul 15, 2014 at 01:39:19PM +0200, Henning Brauer wrote: naddy's mpbios RAMDISK_CD mail reminded me that I have put trunk into RAMDISK_CD here for some time. Without, upgrading of machines with trunk is unecessarily hard, since, well, you won't get your trunk interface

PATCH: fix regress/sys/kern/extent

2014-08-05 Thread Theo Buehler
Hiding a lot of sys/pool.h from userland breaks the build of the extent test in regress/sys/kern/extent on amd64. Additionally, tedu's added size variable in free(9) breaks the userland macros in sys/kern/subr_extent.c. The following patch addresses these two issues. Index: sys/sys/pool.h

b64_pton(src, NULL, len) shouldn't accept invalid Base64 strings

2014-09-16 Thread Theo Buehler
The function int b64_pton(char const *src, u_char *target, size_t targsize); in src/lib/libc/net/base64.c has a small bug with no consequences in the rest of the tree. By design, b64_pton() can be called with a NULL pointer as `target', in which case it calculates the number of bytes encoded in

Re: call for testing: MSI for msk(4)

2014-10-02 Thread Theo Buehler
On Tue, Sep 23, 2014 at 01:58:59PM -0400, Brad Smith wrote: On 31/12/13 12:06 AM, Brad Smith wrote: On 16/05/13 5:55 PM, Jérémie Courrèges-Anglas wrote: Hi, I've been using msk(4) with MSI on my laptop since a few days, with no apparent problem. mskc0 at pci2 dev 0 function 0 Marvell

remove repeated #define in acpithinkpad.c

2014-10-07 Thread Theo Buehler
The latest commit caused a repeated line: Index: acpithinkpad.c === RCS file: /cvs/src/sys/dev/acpi/acpithinkpad.c,v retrieving revision 1.39 diff -u -p -r1.39 acpithinkpad.c --- acpithinkpad.c 5 Oct 2014 01:31:12 -

share/mk/bsd.README: bsd.prog.mk only has seven targets

2014-10-13 Thread Theo Buehler
This confused me quite a bit when I first read it. After lint was unhooked from the tree, there remain only seven targets in bsd.prog.mk: all, clean, cleandir, depend, includes, install, and tags. Same goes for bsd.subdir.mk and bsd.lib.mk. Index: bsd.README

mention lkm removal on current.html

2014-10-13 Thread Theo Buehler
Here's a shot at removing the binaries and manuals that are obsolete after the lkm removal. I hope I caught them all. There remains the user _lkm in /etc/groups. I am unsure how to remove that one properly. Index: faq/current.html

Remove lkm tendrils from bsd.own.mk

2014-10-13 Thread Theo Buehler
After lkm is gone, these should probably also be removed. Index: bsd.own.mk === RCS file: /cvs/src/share/mk/bsd.own.mk,v retrieving revision 1.150 diff -u -p -r1.150 bsd.own.mk --- bsd.own.mk 22 Apr 2014 14:42:53 - 1.150

tmux: handle C-w in copy mode search prompt

2014-11-03 Thread Theo Buehler
The editing facilities in the search prompt in tmux's copy mode are kept to a minimum. However, since deleting to the beginning of the prompt with `C-u' and deleting the previous letter with `C-h' work as usual, I would have expected that `C-w' would work as well and delete to the beginning of

tetris(6): fix select() - poll() conversion

2014-11-05 Thread Theo Buehler
Pausing a tetris game currently causes a segfault due to a a null pointer dereference. Fix this by checking that s is non-NULL before accessing its members. A number of comments and an error message still refer to select() instead of poll(). Correct this as well. Index: input.c

tmux.1: V is a vi key. Use alphabetical order

2014-11-07 Thread Theo Buehler
The new `select line' key 'V' in copy mode is a vi key, not an emacs key. Move the entry from the emacs column to the vi column in the manual. The table of copy mode keys is mostly sorted in alphabetical order with a few exceptions that make some sense and a few that don't. I seems most

tmux(1): remove -d option from optstring

2014-11-10 Thread Theo Buehler
The -d option in tmux was removed five years ago in revision 1.52 of tmux.c. Also remove it from the optstring argument to getopt(): Index: tmux.c === RCS file: /cvs/src/usr.bin/tmux/tmux.c,v retrieving revision 1.132 diff -u -p

tmux(1): make repeated jumps with [fFtT,;] behave as in vi

2014-11-10 Thread Theo Buehler
There currently are a number of differences between tmux's jump commands [fFtT,;] in copy mode and the behavior of the corresponding keys in vi: 1. The repeat count is not reset after a jump with [fFtT], but it is reset after the `repeat movement' keys [;,]. For example, in tmux `3fa;;'

Re: /usr/src/usr.bin/ssh/lib/../key.c:469: error: too few arguments to function 'sshkey_in_file'

2014-12-04 Thread Theo Buehler
On Fri, Dec 05, 2014 at 06:44:03AM +0100, Jiri Navratil wrote: [...] I got this error /usr/src/usr.bin/ssh/lib/../key.c: In function 'key_in_file': /usr/src/usr.bin/ssh/lib/../key.c:469: error: too few arguments to function 'sshkey_in_file' *** Error 1 in usr.bin/ssh/lib (bsd.lib.mk:40

Re: acpicpu _CST handling for mwait

2014-12-15 Thread Theo Buehler
On Sun, Dec 14, 2014 at 02:00:08PM -0800, Philip Guenther wrote: Some time ago, I had added support for using the MWAIT instruction in the idle loop. Various people found that made their boxes run hot, to the point that several developers diked it out of their own builds; I've committed

tmux.1: document missing command key bindings

2014-12-22 Thread Theo Buehler
A few default command key bindings are missing in the table of the tmux manual: Index: tmux.1 === RCS file: /cvs/src/usr.bin/tmux/tmux.1,v retrieving revision 1.411 diff -u -p -r1.411 tmux.1 --- tmux.1 9 Dec 2014 19:23:35 -

Unbreak adventure(6)

2014-12-31 Thread Theo Buehler
The adventure game is currently broken. When it's started without any arguments, it spits a pile of garbage to stdout before eventually dumping its core. The game data of adventure(6) is obfuscated at compile time with a scheme relying on deterministic random() and deobfuscated at runtime. This

Re: tetris(6): fix select() - poll() conversion

2014-12-31 Thread Theo Buehler
On Fri, Nov 07, 2014 at 11:57:50AM -0800, patrick keshishian wrote: [...] I propose getting rid of the s pointer all together as such: After replacing select() with poll(), not removing `struct timeval *s' seems an oversight; Its use was solely for select()'s benefit. Once more,

Document the special case pid=0 in kill(1)

2015-01-16 Thread Theo Buehler
POSIX says: If process number 0 is specified, all processes in the current process group shall be signaled. Add the corresponding line from kill.2 to document this case. Index: kill.1 === RCS file: /cvs/src/bin/kill/kill.1,v

apmd.8: add .Pa macros to files/devices/sockets

2015-02-12 Thread Theo Buehler
I was trying to convince apropos(1) to give me information on the scripts in /etc/apm and found myself unable to do so... The reason turned out to be missing semantic markup in the relevant man page. While there I was wondering about the weird ordering suspend, hibernate, resume, powerup,

vi.1: angle brackets vs. `...' in the UTF-8 locale

2015-03-17 Thread Theo Buehler
This is related to the thread `Aq macro' on tech@ from before the release lock (Feb 15): https://marc.info/?t=14239912901r=1w=2 In the UTF-8 locale `.Aq', `\(la' and `\(ra' are rendered as mathematical angle brackets, not as less-than and greater-than signs. This is kind of confusing in the

sysctl(3): HW_PERFPOLICY

2015-03-12 Thread Theo Buehler
I am confused by the new documentation of HW_PERFPOLICY. Is this bound to change? Looking at the function sysctl_hwperfpolicy() in sys/kern/sched_bsd.c, I think the following is more accurate, although I don't know what has to go wrong that the string is actually set to `unknown'. For

Re: sysctl(3): HW_PERFPOLICY

2015-03-12 Thread Theo Buehler
On Thu, Mar 12, 2015 at 08:20:30AM +, Jason McIntyre wrote: i think the unknown will be a catchall for errors, and we shouldn;t suggest to users that they can set it. This makes sense. They actually can't set it to unknown. so my suggestion is below. i'll commit later if no one has

csh.1: single and double quotes, backticks and tildas

2015-03-31 Thread Theo Buehler
Inspired by a recent commit of bentley@, I decided to clean up the quoting characters in the csh man-page a bit: Force ASCII versions of `, ', and ~ when appropriate, that is, escape them as \(ga, \(aq, and \(ti in code snippets, commands, etc. For the sake of consistency use \(dq instead of \

Re: ed(1): keep custom prompt string that was specified by -p

2015-06-18 Thread Theo Buehler
On Thu, Jun 18, 2015 at 02:16:08PM +0100, Jason McIntyre wrote: On Thu, Jun 18, 2015 at 12:33:58PM +0200, Theo Buehler wrote: Here's a silly ed(1) session: $ ed -p : : P P *q $ Notice how the prompt string changed from the custom prompt : to the default prompt

Should the patterns(7) manual use C-style indexing of strings?

2015-06-25 Thread Theo Buehler
From http://www.lua.org/manual/5.3/manual.html#6.4: When indexing a string in Lua, the first character is at position 1 (not at 0, as in C). The example of applying the pattern ()aa() to the string flaaap in the manpage shows that the empty captures () capture the positions between the 'l'

video(1): uninitialized variable

2015-06-19 Thread Theo Buehler
My laptop has the built-in camera $ dmesg | grep uvideo uvideo0 at uhub0 port 4 configuration 1 interface 0 Micron Built-in iSight rev 2.00/1.84 addr 2 video0 at uvideo0 $ and video(1) usually fails to grab frames in the default resolution of 640x480. No problems so far with 320x240 and

Re: video(1): uninitialized variable

2015-06-19 Thread Theo Buehler
On Fri, Jun 19, 2015 at 10:20:59AM +0100, Stuart Henderson wrote: On 2015/06/19 11:11, Theo Buehler wrote: In video(1)'s verbose mode, this results in a bogus `run time' being printed due to the use of the uninitialized variable `tp_start', which is only initialized after the first frame

patterns: unused header and doubled % sign

2015-06-26 Thread Theo Buehler
Three minor nits following up on differences between the versions in reyk@'s mails and the initial commit: - assert.h isn't used anymore, so it can be removed. - Sort the remaining headers alphabetically according to style(9). - There's one remaining '%%' in an error string that shouldn't be

openssl.1: two misspellings

2015-06-18 Thread Theo Buehler
Index: usr.bin/openssl/openssl.1 === RCS file: /cvs/src/usr.bin/openssl/openssl.1,v retrieving revision 1.13 diff -u -p -r1.13 openssl.1 --- usr.bin/openssl/openssl.1 28 Feb 2015 21:51:56 - 1.13 +++

ed(1): keep custom prompt string that was specified by -p

2015-06-18 Thread Theo Buehler
Here's a silly ed(1) session: $ ed -p : : P P *q $ Notice how the prompt string changed from the custom prompt : to the default prompt *. This behavior seems to contradict both the man page and POSIX: From ed(1): -p string Specifies a command prompt. This may be toggled on and off

Re: faq/current.html: Mention sudo removal

2015-07-04 Thread Theo Buehler
On Sat, Jul 04, 2015 at 03:36:58PM +0530, Hrishikesh Muruk wrote: Why is sudo being removed from base? Because millert@ and deraadt@ decided to do so. You can read some explanations in this thread: https://marc.info/?l=openbsd-portsm=143465998814989w=2 and tedu@'s blog post

Re: [patch 3/3] ksh: add overflow checking for memory allocations

2015-05-24 Thread Theo Buehler
On Sun, May 24, 2015 at 09:10:08PM +0200, Martin Natano wrote: I highly doubt any part of those three diffs is authored by yourself. (Merely renaming functions doesn't count as original work.) As pointed out before, the efficient overflow checking code is copied from Otto's code and the rest

Re: [patch 1/3] ksh: add overflow checking for memory allocations

2015-05-23 Thread Theo Buehler
Hi, Please don't forget to include Otto's license to the code, that you modified. Thanks for this reminder. Please accept my apologies, I'm not very familiar with the customs of licencing which doesn't exist in my profession. Would this be a satisfactory way of fulfilling your request?

[patch 1/3] ksh: add overflow checking for memory allocations

2015-05-23 Thread Theo Buehler
This set of three patches adds overflow checking to ksh in the spirit of the malloc(A*B) - reallocarray(NULL, A, B) conversions that were ongoing since last summer. I've been running these patches on my main laptop since January on amd64/CURRENT and didn't notice any issues. ksh has its own

[patch 2/3] ksh: add overflow checking for memory allocations

2015-05-23 Thread Theo Buehler
Conversion of explicit multiplications: alloc(A*B, ...) becomes allocarray(A, B, ...), and aresize(..., A*B, ...) becomes aresizearray(..., A, B, ...) I ordered the arguments in such a way that A is nmemb and B is size as in the prototypes of allocarray() and aresizearray(). Index: edit.c

[patch 3/3] ksh: add overflow checking for memory allocations

2015-05-23 Thread Theo Buehler
Expand the macro #define sizeofN(type, n) (sizeof(type) * n) whenever it occurs as an argument to `alloc' or `aresize' and replace `alloc' by `allocarray' and `aresize' by `aresizearray'. There remains one single call to sizeofN(a,b) (see the patch for exec.c) which could safely be

Re: [patch 1/3] ksh: add overflow checking for memory allocations

2015-05-23 Thread Theo Buehler
On Sat, May 23, 2015 at 03:01:03PM +0200, Theo Buehler wrote: Hi, Please don't forget to include Otto's license to the code, that you modified. Thanks for this reminder. Please accept my apologies, I'm not very familiar with the customs of licencing which doesn't exist in my

Re: [patch 1/3] ksh: add overflow checking for memory allocations

2015-05-23 Thread Theo Buehler
On Sat, May 23, 2015 at 03:01:03PM +0200, Theo Buehler wrote: Hi, Please don't forget to include Otto's license to the code, that you modified. Thanks for this reminder. Please accept my apologies, I'm not very familiar with the customs of licencing which doesn't exist in my

Don't allow rm -rf /

2015-08-23 Thread Theo Buehler
In episode 103 of BSD Now, Bryan Cantrill talks about the fact that on illumos rm -rf / is an error. It turns out that this behavior is mandated by POSIX 1003.1-2013: If either of the files dot or dot-dot are specified as the basename portion of an operand (that is, the final pathname component)

document clear(1) a bit more prominently

2015-08-23 Thread Theo Buehler
The clear(1) manpage is linked to the tput(1) manpage, but the clear utility is only mentioned in the history section. I suggest to make its appearance in the manual page a little more prominent. Index: tput.1 === RCS file:

Re: Don't allow rm -rf /

2015-08-23 Thread Theo Buehler
On Sun, Aug 23, 2015 at 07:38:15AM -0400, Ted Unangst wrote: Theo Buehler wrote: @@ -401,9 +401,10 @@ checkdot(char **argv) else p = *t; - if (ISDOT(p)) { + if (ISDOT(p) || *p == '\0') { if (!complained

rcctl ls: give an argument to needs_root()

2015-08-01 Thread Theo Buehler
If the `rcctl ls' command is given an argument that requires root, the error message has a awkward space in front of the colon since no argument is passed to the needs_root() function: $ rcctl ls started rcctl : need root privileges Since this is the only place where `needs_root()' is called

doas.conf.5: slight rewording of the example

2015-07-30 Thread Theo Buehler
This is a follow-up to a recent discussion on misc@: https://marc.info/?t=14380009452r=1w=2 I suggest two small changes to the example in doas.conf(5): a. make it explicit that the rule allows the users in group wheel to run commands as any user (not just root). b. modify the rule

Re: doas with a timeout

2015-07-27 Thread Theo Buehler
On Mon, Jul 27, 2015 at 10:54:02AM +0300, Gregory Edigarov wrote: Hi, sudo was having a nice feature of not overwhelming the user with password prompts (cookies :-) ). This diff is adding this back to doas(1). On Mon, Jul 27, 2015 at 10:54:02AM +0300, Gregory Edigarov wrote: Hi,

doas: add the -n flag to usage string

2015-07-27 Thread Theo Buehler
A small oversight. The man page is already up to date. Index: doas.c === RCS file: /cvs/src/usr.bin/doas/doas.c,v retrieving revision 1.27 diff -u -p -r1.27 doas.c --- doas.c 26 Jul 2015 22:44:33 - 1.27 +++ doas.c

Add doas.conf to /etc/mtree/special?

2015-07-23 Thread Theo Buehler
Since doas.conf is a `dangerous file', it seems to make sense to monitor it daily(8). I don't know the policy on permissions in the /etc/mtree/* files. Anything between 0400 and 0644 would seem to make sense. /etc/sudoers used to have 0440. I suggest 0640 so that root can edit the file (since

Re: pledge for tetris

2015-11-15 Thread Theo Buehler
Please disregard. This patch breaks multiple simultaneous games. Sorry for the noise.

pledge for tetris

2015-11-15 Thread Theo Buehler
pledge("stdio rpath wpath cpath flock getpw id tty") for setup then play the game with "stdio rpath wpath getpw tty". Most of the promises are needed for dealing with the score file. The function getscores() currently appears towards the end of the program's lifetime and it calls setegid() and

Re: pledge for tetris

2015-11-16 Thread Theo Buehler
In its current form, tetris is a setgid program and needs a whopping pledge("stdio rpath wpath cpath flock getpw id tty") throughout its lifetime because of the score file in /var/games. As discussed with Theo off-list, this is risk-only. Thus, drop the score file support, lose the setgid bit

Re: pledge for tetris

2015-11-16 Thread Theo Buehler
On Tue, Nov 17, 2015 at 12:15:59AM -0500, Ted Unangst wrote: > Theo Buehler wrote: > > In its current form, tetris is a setgid program and needs a whopping > > > > pledge("stdio rpath wpath cpath flock getpw id tty") > > > > throughout its lifet

Re: patch: fix top

2015-11-05 Thread Theo Buehler
On Thu, Nov 05, 2015 at 10:42:54AM +0100, Marc Espie wrote: > - if (pledge("stdio rpath getpw tty id ps vminfo", NULL) == -1) > + if (pledge("stdio rpath getpw tty proc id ps vminfo", NULL) == -1) > err(1, "pledge"); I think both "proc" and "id" are too much: "id" was added

Re: patch: fix top

2015-11-05 Thread Theo Buehler
On Thu, Nov 05, 2015 at 11:33:56AM +0100, Marc Espie wrote: > On Thu, Nov 05, 2015 at 10:54:32AM +0100, Theo Buehler wrote: > > On Thu, Nov 05, 2015 at 10:42:54AM +0100, Marc Espie wrote: > > > - if (pledge("stdio rpath getpw tty id ps vminfo", NULL) == -1) > >

Re: patch: fix top

2015-11-05 Thread Theo Buehler
On Thu, Nov 05, 2015 at 11:52:34AM -0500, Michael McConville wrote: > > It's not documented so it doesn't exist for me. :P > > > > (hint hint) > > Seconded. Here is an update for some missing syscalls for "stdio", "proc" and "id": Index: lib/libc/sys/pledge.2

Re: enhanced use-after-free detection for malloc v2

2015-11-02 Thread Theo Buehler
Sorry for this rather long mail: I have three small comments on the patch itself (starting 80 lines below). For those who want to try both new features, I attached a patch against -current that merges the three parts of Daniel's diff (plus the trivial two of the nits below) at the very end of

should pledge(2) allow raise(3) and abort(3)?

2015-11-02 Thread Theo Buehler
While playing with Daniel Micay's malloc patches, I ran into a lot of pledge aborts since pledge("stdio") disallows raise(3) and abort(3). That's because raise sends the to 'pid + THREAD_PID_OFFSET' instead of the pid itself. The first sentence of the comment and the logic is taken from

ksh.1: need preceding underscore for macro expansion

2015-10-17 Thread Theo Buehler
An alias must be called `_c' in order for it to be executed upon entering `@c' in ksh's vi command mode, not jsut `c'. The markup is taken from the corresponding line 900 in sh.1 Index: bin/ksh/ksh.1 === RCS file:

kdump perjury: syscall 5

2015-10-10 Thread Theo Buehler
While ktrace'ing firefox, I managed to produce a ktrace.out file that makes pledge(2) abort kdump: $ kdump >/dev/null Killed $ dmesg | tail -1 kdump(24965): syscall 5 The problem is that the "rpath" request is dropped in kdump's second pledge call. However, kdump's sockoptlevelname() formatter

Use proper .Xr syntax in yppush.8

2015-10-09 Thread Theo Buehler
Index: usr.sbin/ypserv/yppush/yppush.8 === RCS file: /var/cvs/src/usr.sbin/ypserv/yppush/yppush.8,v retrieving revision 1.16 diff -u -p -r1.16 yppush.8 --- usr.sbin/ypserv/yppush/yppush.8 16 Jul 2013 11:13:34 - 1.16 +++

fuser(1) needs pledge("proc") to send signals

2015-10-12 Thread Theo Buehler
I noticed a number of "fuser(PID): syscall 37" entries in my dmesg. If 'sflg' is set (i.e., the -k or -s options were specified), fuser might call kill(2) (see fuser.c: 176), otherwise "stdio rpath" is apparently sufficient for fuser. Index: usr.bin/fstat/fstat.c

Re: skey(1) cleanup

2015-10-09 Thread Theo Buehler
On Fri, Oct 09, 2015 at 03:10:38AM -0400, Michael Reed wrote: > The argument passed to usage() was always the same (argv[0]), so > this patch removes the parameter and uses __progname instead. > The usage message was misaligned, so I fixed that as well. > A few style(9) nits inline > Index:

doubled words in libcrypto manuals

2015-07-08 Thread Theo Buehler
While dabbling with J. Friedl's script for detecting doubled words in his Mastering Regular Expressions book, I found these four instances of doubled words. Three of these are completely straightforward: EC_GROUP_copy.pod: the the EC_KEY_new.pod: have have d2i_X509_NAME.pod: the the However,

Re: Unlock the reaper

2015-07-09 Thread Theo Buehler
A further success story on an amd64 Core2 laptop. I built an entire release with no complications. Suspend/Hibernate/Resume work fine as well. OpenBSD 5.8-beta (GENERIC.MP) #451: Wed Jul 8 16:33:38 CEST 2015 t...@miraculix.home:/sys/arch/amd64/compile/GENERIC.MP real mem = 2634596352

pledge("stdio") for arch(1)/machine(1)

2015-11-13 Thread Theo Buehler
This straightforward pledge("stdio") is one of the last uncommitted ones from Theo's big 'tame in userland' diff and seems to have been overlooked so far. Index: usr.bin/arch/arch.c === RCS file: /cvs/src/usr.bin/arch/arch.c,v

Tighter pledge(2) for nm(1)/size(1)

2015-11-13 Thread Theo Buehler
nm(1) was tamed shortly before the "exec" promise was introduced. The "proc exec" is necessary to cover `nm -C' which fork-exec's c++filt(1). Right after potential fork-exec, the original pledge "stdio rpath" is given (one could make that last pledge call in the file conditional on `issize' so

library-specs.7: Xr resolve-lib instead of resolve_lib

2015-09-27 Thread Theo Buehler
A typo: Index: share/man/man7/library-specs.7 === RCS file: /cvs/src/share/man/man7/library-specs.7,v retrieving revision 1.10 diff -u -p -r1.10 library-specs.7 --- share/man/man7/library-specs.7 15 Nov 2010 07:41:21 -

Xr radiusd with section number and remove outdated sentence

2015-09-27 Thread Theo Buehler
Now that there is radiusd(8) in base, I suggest the following changes: * add back the manual section number to 'Xr radiusd' in login_radius.8 and in login.conf.5 * remove a sentence from CAVEATS which is no longer true. I don't think that `.Xr packages 7' is necessary. * the grammar of one

packages.7: refer to check-problems instead of check-conflicts

2015-09-27 Thread Theo Buehler
check-conflicts(1) was replaced by check-problems(1), update packages.7 accordinginly. Index: share/man/man7/packages.7 === RCS file: /cvs/src/share/man/man7/packages.7,v retrieving revision 1.37 diff -u -p -r1.37 packages.7 ---

Re: __progname in base

2015-12-08 Thread Theo Buehler
On Sat, Nov 07, 2015 at 12:20:42PM +0100, Tobias Stoeckmann wrote: > Based on Todd's patch for at and cron, I did a grep through our base > tree to see if there are more occurrences of self-made __progname > handling. A few more of those: Index: caesar/caesar.c

Re: Move ancient ksh bug from README to man page

2015-12-06 Thread Theo Buehler
On Sun, Dec 06, 2015 at 12:00:36AM -0500, Michael McConville wrote: > Thoughts? ok? > It makes sense to me to document this in the manual, and not in a README file that no-one reads, so ok from me, but please wait for jmc@'s input. Note that this bug used to be documented in the manual, but it

nc -r: remove modulo bias and better shuffling

2015-12-06 Thread Theo Buehler
The current implementation of the selection of a random sequence of ports in nc -r suffers from modulo bias and a biased shuffling procedure. Use arc4random_uniform() and the Fisher-Yates shuffle instead. Index: usr.bin/nc/netcat.c

Re: malloc canaries and validation

2015-12-05 Thread Theo Buehler
On Wed, Dec 02, 2015 at 08:37:05AM -0500, Ted Unangst wrote: > This is a variant of the diffs sent by Daniel Micay, and then assembled by > Theo Buehler. I've looked it over and made a few tweaks. > > One: validate the junk in malloc hasn't been touched. I've tweaked this

Re: nc -r: remove modulo bias and better shuffling

2015-12-06 Thread Theo Buehler
On Sun, Dec 06, 2015 at 07:12:28PM -0700, Bob Beck wrote: > Theo (not deraadt) ignore our screams of pain, fix the thing to use > asprintf and then I'll go further with you on it ;) ok, there you go :) > On Sun, Dec 6, 2015 at 7:11 PM, Bob Beck wrote: > >> and then digging

Re: nc -r: remove modulo bias and better shuffling

2015-12-06 Thread Theo Buehler
On Mon, Dec 07, 2015 at 03:20:21AM +0100, Theo Buehler wrote: > On Sun, Dec 06, 2015 at 07:12:28PM -0700, Bob Beck wrote: > > Theo (not deraadt) ignore our screams of pain, fix the thing to use > > asprintf and then I'll go further with you on it ;) > > ok, there you go :)

Re: nc -r: remove modulo bias and better shuffling

2015-12-06 Thread Theo Buehler
On Sun, Dec 06, 2015 at 07:37:27PM +0100, Theo Buehler wrote: > The current implementation of the selection of a random sequence of > ports in nc -r suffers from modulo bias and a biased shuffling > procedure. Use arc4random_uniform() and the Fisher-Yates shuffle > instead. daniel@

Re: nc -r: remove modulo bias and better shuffling

2015-12-06 Thread Theo Buehler
On Sun, Dec 06, 2015 at 07:37:27PM +0100, Theo Buehler wrote: > The current implementation of the selection of a random sequence of > ports in nc -r suffers from modulo bias and a biased shuffling > procedure. Use arc4random_uniform() and the Fisher-Yates shuffle > instead. Sorry

Re: [patch] Convert modulus to arc4random_uniform

2015-12-07 Thread Theo Buehler
On Mon, Dec 07, 2015 at 12:49:17AM -0600, Matthew Martin wrote: > > Theo's diff inspired me to look for other cases of modulo bias. The > following diff converts most modulus operations on a random number to > use arc4random_uniform or & as appropriate. I excluded > >

Re: [patch] eliminate -Wsign-compare warning in imsg.c with clang on FreeBSD

2015-12-09 Thread Theo Buehler
Committed, thanks! Note: The patch didn't apply cleanly. There's been the following commit in the meantime, which probably is of interest for FreeBSD, too (there were corresponding changes in the imsg consumers on the same day). revision 1.12 date: 2015/12/05 13:06:52; author: claudio; state:

Re: Remove vi allocation casting

2015-12-07 Thread Theo Buehler
On Mon, Dec 07, 2015 at 02:59:52PM -0500, Michael McConville wrote: > It's definitely time for these to go. > > The allocation macros would probably be better as functions (e.g. > xmalloc) these days, too. I'll save that diff for another time, though. > > No binary change. confirmed and

Re: [patch] Convert modulus to arc4random_uniform

2015-12-07 Thread Theo Buehler
> I'll look into hack tonight when I have more time. Honestly, I would prefer to leave hack as it is right now since it will take some work to repair it anyway. I would not want to add another layer of (potential) complications. > > > Index: lib/libc/stdlib/rand.c > > >

Re: [vi] Remove needless (m|c)alloc aliases

2015-12-07 Thread Theo Buehler
On Mon, Dec 07, 2015 at 03:44:12PM -0500, Michael McConville wrote: > No binary change. ok? ok tb@

Re: [patch] Convert modulus to arc4random_uniform

2015-12-17 Thread Theo Buehler
I've now committed most of your diff, thanks once again. o I asked for further review on the kernel parts o I'm going to skip hack for now Here's a patch for libc, based on the previous discussion. I think this is easier to read and understand. No binary change on amd64. ok? Index:

Re: Fix csqrt(3)

2015-12-17 Thread Theo Buehler
On Thu, Nov 26, 2015 at 09:02:17PM +0500, Alexandr Shadchin wrote: > From http://en.cppreference.com/w/c/numeric/complex/csqrt : > > csqrt(conj(z)) == conj(csqrt(z)) > > Before patch > csqrt(-4.0 + -0.0i) = 0.0 + 2.0j > but should be > csqrt(-4.0 + -0.0i) = 0.0 - 2.0j This, too, looks right

Re: Fix casin(3)

2015-12-17 Thread Theo Buehler
On Fri, Nov 27, 2015 at 03:14:52PM +0500, Alexandr Shadchin wrote: > Fix wrong answer if the imaginary part is zero. > NetBSD also turn off this piece of code. > > See > http://en.cppreference.com/w/c/numeric/complex/casin > http://www.wolframalpha.com/input/?i=asin%28-2.0%29 Makes complete

Re: 2D acceleration for Nvidia

2015-12-12 Thread Theo Buehler
On Sun, Dec 13, 2015 at 01:57:02AM +0100, Juan Francisco Cantero Hurtado wrote: > On Sat, Dec 12, 2015 at 03:06:01AM +0100, Theo Buehler wrote: > > On Fri, Dec 11, 2015 at 10:09:20AM +0100, Martin Pieuchot wrote: > > > Without hardware acceleration my PowerBook G4 12'' with a NV

Re: 2D acceleration for Nvidia

2015-12-11 Thread Theo Buehler
On Fri, Dec 11, 2015 at 10:09:20AM +0100, Martin Pieuchot wrote: > Without hardware acceleration my PowerBook G4 12'' with a NVIDIA > GeForce FX Go 5200 is unusable. Since XAA is no longer supported, > here's a simple EXA backend for nv(4) based on the XAA sources and > Nouveau. It only

Re: __progname in base

2015-12-16 Thread Theo Buehler
ping. On Tue, Dec 08, 2015 at 07:15:39PM +0100, Theo Buehler wrote: > On Sat, Nov 07, 2015 at 12:20:42PM +0100, Tobias Stoeckmann wrote: > > Based on Todd's patch for at and cron, I did a grep through our base > > tree to see if there are more occurrences of self-made __progna

Re: getopt.3 / getopt_long.3: Remove NOTREACHED comment as per style(9)

2016-01-04 Thread Theo Buehler
On Mon, Jan 04, 2016 at 11:48:10AM +, Juuso Lapinlampi wrote: > Here's a revised patch that updates the $Mdocdate if seemed necessary. Thanks. I like the first version of your patch, it's a good point. There's no need to update $Mdocdate$ manually. This is taken care of when the patch is

Re: remove language catalogs from vi

2016-01-04 Thread Theo Buehler
On Mon, Jan 04, 2016 at 05:16:57PM +0100, Martijn van Duren wrote: > Slight change in that lenght wasn't always preserved in msg.c. > This revision works well for me and millert@ > The diff looks good to me and the only remark I have is that catalog/README should be updated as well. Nobody

Re: sed(1): Fix incomplete error message

2016-01-01 Thread Theo Buehler
On Fri, Jan 01, 2016 at 02:19:16PM -0500, Michael Reed wrote: > Hi, > > I noticed that when doing `sed -i` on a file you don't have > permission to read, the error message printed isn't very helpful: > > $ sed -i '/test/d' /var/log/Xorg.1.log.old > sed: /var/log/Xorg.1.log.old > > The patch

Re: sed(1): Fix incomplete error message

2016-01-01 Thread Theo Buehler
On Fri, Jan 01, 2016 at 08:47:09PM +0100, Theo Buehler wrote: > On Fri, Jan 01, 2016 at 02:19:16PM -0500, Michael Reed wrote: > > Hi, > > > > I noticed that when doing `sed -i` on a file you don't have > > permission to read, the error message printed isn't very h

uudecode(1): add missing "getpw" pledge

2016-01-02 Thread Theo Buehler
uudecode and b64decode might need "getpw" if -s or -o is given. The reason is the getpwnam(3) call on uudecode.c:238 that is reached if 'sflag == 1' and the `remote file name' triggers `tilde expansion': $ cat boom begin 644 ~/boom %8F]O;0H` ` end $ uudecode -s boom Abort trap (core dump) $

Re: remove language catalogs from vi

2016-01-06 Thread Theo Buehler
On Wed, Jan 06, 2016 at 12:57:06AM +0100, Ingo Schwarze wrote: > Hmpf, i hit "send" too early. > > Ingo Schwarze wrote on Wed, Jan 06, 2016 at 12:50:16AM +0100: > > > If millert@, bentley@, or tb@ wants to commit this, it's OK schwarze@. > > If, against all odds, anything should break, i'm

Re: ksh rename global e

2015-12-29 Thread Theo Buehler
On Tue, Dec 29, 2015 at 07:59:06PM +, Nicholas Marriott wrote: > yes please, ok nicm > also ok with me. The vi.c change would be fine with me since it fixes another shadowing issue, but please don't commit the emacs.c change. ok tb@

Re: Declare usage() as __dead on fstat(1), plus a few nitpicks

2015-12-30 Thread Theo Buehler
On Wed, Dec 30, 2015 at 06:41:32PM +, Ricardo Mestre wrote: > Declare usage() as __dead, and while here align a few variables to the rest of > the list and also ANSI one function. No functional change. > > OK? ok tb@ > > Index: fstat.c >

Re: allocation simplifications in yacc

2015-12-25 Thread Theo Buehler
On Thu, Dec 24, 2015 at 12:41:28PM -0500, Michael McConville wrote: > 1. realloc acts like malloc when ptr == NULL Why not "#endif", - "if (newsize && YY_SIZE_MAX / newsize < sizeof *newss)", - "goto bail;", - "newss = yyss ? (short *)realloc(yyss,

Re: allocation simplifications in yacc

2015-12-25 Thread Theo Buehler
On Fri, Dec 25, 2015 at 02:34:12PM +0100, Mark Kettenis wrote: > IMNSHO the code produced by OpenBSD's yacc should be portable; > reallocarray isn't portable. ok, thanks for clarifying

Re: Clarify factor(6)

2015-12-26 Thread Theo Buehler
On Sat, Dec 26, 2015 at 09:57:57PM +, Jason McIntyre wrote: > On Sat, Dec 26, 2015 at 10:01:34AM +0100, Michal Mazurek wrote: > > Index: factor.6 > > === > > RCS file: /cvs/src/games/factor/factor.6,v > > retrieving revision 1.12

Re: Clarify factor(6)

2015-12-26 Thread Theo Buehler
On Sat, Dec 26, 2015 at 11:09:35PM +0100, Theo Buehler wrote: > On Sat, Dec 26, 2015 at 09:57:57PM +, Jason McIntyre wrote: > > On Sat, Dec 26, 2015 at 10:01:34AM +0100, Michal Mazurek wrote: > > &g

Re: Fix size hints for x11-ssh-askpass

2015-12-27 Thread Theo Buehler
On Sun, Dec 27, 2015 at 08:28:36PM +0100, Alexander Hall wrote: > Hi, > > Recently, my window manager (i3) started making the ssh-askpass windows > too small to be really usable. The problem seems to be that the size > hints indicate that it provides a width and height, while those fields >

  1   2   3   4   5   6   >