doas path

2015-08-31 Thread Ted Unangst
I think we can relax the path restriction if there's no restriction on command. Index: doas.c === RCS file: /cvs/src/usr.bin/doas/doas.c,v retrieving revision 1.39 diff -u -p -r1.39 doas.c --- doas.c 27 Aug 2015 16:31:02 -

Re: Like free(), ksh's afree() is NULL-safe

2015-08-31 Thread Ted Unangst
Michael McConville wrote: > Ted Unangst wrote: > > Michael McConville wrote: > > > Also, why is fs on line 390 cast to char* when afree() takes void*? > > > > this code is older than void. and NULL apparently. please remove the casts > > too. > > Do

Re: ksh sanatizing argv redundant

2015-08-31 Thread Ted Unangst
Martijn van Duren wrote: > Hello tech@, > > I took a quick glance at ksh and one of the first things I noticed was > that it uses some sanatizing code on argv. When looking at execve(2) I > see that EINVAL or EFAULT are returned when argv isn't properly > formatted. I've also verified this quic

Re: Journaled Soft Updates

2015-09-01 Thread Ted Unangst
Walter Neto wrote: > Hi, > > Here is the first patch to bring Journaling to OpenBSD based on the McKusick > paper: https://www.bsdcan.org/2010/schedule/attachments/141_suj-slides.pd and > FreeBSD 10 > > This first patch is just for structures and definitions. > > I know is my first patch sugge

Re: Journaled Soft Updates

2015-09-02 Thread Ted Unangst
Walter Neto wrote: > Hi guys, > > Studying more about wapbl, I saw It is a little faster than SU+J and so much > more easy to implement, correct me if I’m wrong, please. > > About a diff with working code, my next would be one with it, but not with > the whole thing working, It was to be homeop

Re: Changes to network memory allocation/reporting?

2015-09-03 Thread Ted Unangst
Martin Pieuchot wrote: > On 02/09/15(Wed) 08:45, trondd wrote: > > I just noticed on my -current systems, memory reporting from netstat -m > > seems to show that memory is overcommited. > > > > $ netstat -m > > 535 mbufs in use: > > 289 mbufs allocated to data > > 8 mbufs allocated

Re: small memory leaks in localtime

2015-09-07 Thread Ted Unangst
David CARLIER wrote: > Hi all, > > Both internal state variables, lclptr and gmtptr are allocated once but > never freed so I was wondering if this little diff which avoids the > unnecessary dynamic allocations would have any use ? Looks about right. There's little cause to optimize for static sp

Re: virtualization support

2015-09-07 Thread Ted Unangst
Mike Larkin wrote: > > Is this hypervisor more similar to "micro"-hypervisor or to monolithic > > hypervisor? > > > > I don't know what those terms mean. It's a milli-hypervisor!

Re: ksh INT32 type

2015-09-10 Thread Ted Unangst
> - * NOTE: INT32 may end up being more than 32 bits. > /* Table flag type - needs > 16 and < 32 bits */ > -typedef INT32 Tflag; awkward...

Re: fix compat b64_{pton,ntop} handling in nsd

2015-09-10 Thread Ted Unangst
Stuart Henderson wrote: > Currently NSD's compat functions for b64_pton and b64_ntop are always > used. Worse, they're the old versions which abort(). This is because > the library symbols are prefixed by __ (not just in OpenBSD) and are > only accessible as b64_xx when resolv.h is included. > > F

Re: Dropping needless globals (ksh)

2015-09-10 Thread Ted Unangst
Michael McConville wrote: > Alexey Suslikov wrote: > > Michael McConville sccs.swarthmore.edu> writes: > > > > > RCS file: /cvs/src/bin/ksh/c_ksh.c,v > > > > > > > > > - shprintf(newline); > > > + shprintf("\n"); > > > > In terms of portability, are you sure ne

Re: Remove NULL checks before free()

2015-09-11 Thread Ted Unangst
Michael McConville wrote: > There will probably be more similar patches to come if this is > acceptable. The legwork was done with the following Coccinelle script: > I think it should be split up, but I'm happy to see diffs like this.

Re: Floating point #define in ksh

2015-09-14 Thread Ted Unangst
Nicholas Marriott wrote: > Here is a diff, also make %p better that looks better. sigh. why does this even exist?

Re: Remove useless NULL casts from mv(1)

2015-09-14 Thread Ted Unangst
Michael McConville wrote: > Index: mv.c > === > RCS file: /cvs/src/bin/mv/mv.c,v > retrieving revision 1.40 > diff -u -p -r1.40 mv.c > --- mv.c 24 Aug 2015 00:10:59 - 1.40 > +++ mv.c 14 Sep 2015 13:38:13 - > @@ -

Re: ksh remove Tflag

2015-09-14 Thread Ted Unangst
Nicholas Marriott wrote: > Hi > > As far as I can tell there haven't been any new bits added for almost 20 > years, so I expect we can do without the Tflag typedef. > > ok? yup

Re: [patch] if-free cleanup in sys/arch

2015-09-15 Thread Ted Unangst
Miod Vallat wrote: > > Hi, > > > > Here a first sets of "if(x) free(x)" cleanup in sys/arch/ > > > > This patch contains only trivial if(x) removal. The size argument in > > free is keep untouched (because it is already setted, or because it > > makes sens to keep it to 0). > > > > Comments ? OK

doas closefrom

2015-09-17 Thread Ted Unangst
doas doesn't need any other open files and should probably shut them all. Index: doas.c === RCS file: /cvs/src/usr.bin/doas/doas.c,v retrieving revision 1.41 diff -u -p -r1.41 doas.c --- doas.c 3 Sep 2015 20:05:58 - 1.

Re: doas closefrom

2015-09-17 Thread Ted Unangst
Sebastian Benoit wrote: > ok, but in other places we have closefrom(STDERR_FILENO + 1) is that really more clear? it only makes sense if you know stderr is 2. if you sometimes forget which is 1 and which is 2, then the macro only makes it more confusing because now you have to decide what comes a

init mode and makefile

2015-09-19 Thread Ted Unangst
I don't think there's anything special about init that requires mode 0500. if a regular user wants to run it, let them. i mean, if running init would do something evil, i've got bad news. i can build my own... also, the makefile contains (thankfully) ignored install flags. delete them too. Index

Re: [PATCH] doas: add path resolving

2015-09-19 Thread Ted Unangst
Martijn van Duren wrote: > Hello tech@, > > The following patch adds $PATH resolving to doas. This has two advantages: > 1) People are forced to configure doas with a full path, which makes > sure that applications can't be spoofed by users changing their $PATH to > a writeable location and maki

lighter sleep

2015-09-20 Thread Ted Unangst
/bin/sleep does a lot more work than you'd expect (just ktrace it). this is because it calls setlocale(). apparently so that isdigit() doesn't get confused by wacky foreigners with funny numbers. there is another solution, given that the problem of identifying digits is not particularly challengi

Re: Drop a distracting function from locate(1)

2015-09-20 Thread Ted Unangst
Michael McConville wrote: I'm late to the party, but we could tidy things up a bit by moving the function into the c file it's used in and using errx() internally. > Index: locate/fastfind.c > === > RCS file: /cvs/src/usr.bin/locate/

cpuspeed in apm info

2015-09-21 Thread Ted Unangst
The frequency of the cpu is likely to be of interest (in fact, it is to me). We can include it in the apm info. Index: arch/i386/i386/apm.c === RCS file: /cvs/src/sys/arch/i386/i386/apm.c,v retrieving revision 1.113 diff -u -p -r1.11

Re: lighter sleep

2015-09-21 Thread Ted Unangst
Stefan Sperling wrote: > > Just remove the setlocale() call to leave sleep(1) in the default "C" locale. here's a diff that does that. you're right, there's no need to rewrite ctype if it hasn't been altered. I also checked that there are no calls to err() or strerror() or whatever, and so there

poll magic for pflogd

2015-09-21 Thread Ted Unangst
I think this will help pflogd sleep better at night... My understanding of the pcap/bpf timeout is that it will always wait that long, even if packets are received, so that you don't get one read() per packet. But using this timeout doesn't mean wait forever until you get something. We can put a

Re: poll magic for pflogd

2015-09-22 Thread Ted Unangst
Todd C. Miller wrote: > On Mon, 21 Sep 2015 20:13:05 -0400, "Ted Unangst" wrote: > > > We can put a "long" poll() in front of pcap to wait until there are packets > > (maybe never if you aren't using pf logging), and then let the timeout work > > i

Re: iwm(4) rx reset fix

2015-09-22 Thread Ted Unangst
Stefan Sperling wrote: > Properly reset the RX ring by clearing RX buffer status exposed to hardware. > Found by Matthew Dillon while porting FreeBSD's iwm(4) to Dragonfly. > > ok? > > Index: if_iwm.c > === > RCS file: /cvs/src/sys/d

Re: poll magic for pflogd

2015-09-22 Thread Ted Unangst
Tobias Ulmer wrote: > On Tue, Sep 22, 2015 at 11:46:08AM -0400, Ted Unangst wrote: > > Todd C. Miller wrote: > > > On Mon, 21 Sep 2015 20:13:05 -0400, "Ted Unangst" wrote: > > > > > > > We can put a "long" poll() in front of pcap to wa

Re: [RFC] [PATCH] Implementation of POSIX message queues

2015-09-23 Thread Ted Unangst
Dimitris Papastamos wrote: > I did some very crude benchmarking on my machine and I could push > about 100k messages per second through a single message queue. > > At this point, I can start working on manpages + the necessary > userspace glue. > > Is this patch going in the right direction? I d

Re: Clarify error/warning reporting in style(9)

2015-09-23 Thread Ted Unangst
Jason McIntyre wrote: > On Mon, Sep 21, 2015 at 10:40:29PM -0400, Michael McConville wrote: > > Could also say "Use the err(3) and warn(3) family of functions." That's > > what the err(3) man page intro refers to it as. > > > > please some developer commit or reject this. thanks, i liked the wor

Re: Plug a mem-leak in dhcpd(8)

2015-09-24 Thread Ted Unangst
Michael McConville wrote: > Am I interpreting this correctly? > > This is the least invasive fix, but it's unfortunate that this function > allows the supplied buffer to be NULL. If we made it unconditionally > allocate a new buffer, we would have to change some program logic > because uses pass s

Re: arch(1): small cleanup

2015-09-24 Thread Ted Unangst
Michael Reed wrote: > Hi all, > > I test it out as both `arch' and `machine' and didn't observe > any differences. Also, I figured I might as well convert exit(3) > to return while touching this code, as was done in [1]. this is cleaner i think. Index: arch.c ==

Re: [patch] lpr style

2015-09-25 Thread Ted Unangst
Fritjof Bornebusch wrote: > Hi, > > this diff changes the following: > > - exit(3) to return at the end of main functions > - use /* NOTREACHED */ were it belongs according to style(9) I think that's obsolete. We no longer use lint. It's just noise now.

Re: Invalid HTML entities in upgrade57.html

2015-09-25 Thread Ted Unangst
Anthony J. Bentley wrote: > Kevin Zhang writes: > > Using >, & in raw text is invalid HTML. > > You're right about &, but > does not need to be escaped. Even & only needs escaping if the following letters could be interpreted as an entity... Since & is only followed by & and space, that's not the

uvm errata for 5.7 and 5.8

2015-09-28 Thread Ted Unangst
Earlier this month, kettenis identified a bug in uvm from an incompletely reverted change. Clearing the wrong bit on a page would sometimes result in the page queues being corrupted, and then eventually the system would crash or panic. This issue affects 5.7 and the forthcoming 5.8 release. Patch

rename mg file

2015-09-28 Thread Ted Unangst
there's nothing random about this file, and it upsets me whenever i see it's name go by, because i panic thinking mg has some stupid random number generator that hasn't been fixed yet. util.c is a better name. (and cvs rm/add) Index: Makefile ==

clean up old compat argv

2015-10-01 Thread Ted Unangst
Several utilities have command line parsing that predates getopt. Several of these are the old kmem grovellers, which allowed specifying the custom nlist, etc. I think this is kind of unusual and think that generally, the fewer undocumented features the better. This is as likely to trap people who

Re: tame userland diff

2015-10-04 Thread Ted Unangst
Sebastien Marie wrote: > - if an exec'ed program starts with herited TAME flags: the > initialisation of the program would be difficult as it would be > already tamed. i've been thinking about this some more. true in some cases, but i think in many cases, what we are banning should be ba

ftpd popen

2015-10-04 Thread Ted Unangst
as seen in cron, make the popen replacement nicer. this also repairs two abuses of comma operators and an unnecessary function pointer. Index: extern.h === RCS file: /cvs/src/libexec/ftpd/extern.h,v retrieving revision 1.18 diff -u -

Re: a few style examples don't comply

2015-10-05 Thread Ted Unangst
Rob Pierce wrote: > On Mon, Oct 05, 2015 at 05:38:34PM +0059, Jason McIntyre wrote: > > On Mon, Oct 05, 2015 at 11:50:49AM -0400, Rob Pierce wrote: > > > There are some offending braces. I just added leading tabs in the right > > > places to correct indentation. > > > > > > Rob > > > > > > > why

Re: a few style examples don't comply

2015-10-05 Thread Ted Unangst
Benny Lofgren wrote: > On 2015-10-05 22:21, Rob Pierce wrote: > > On Mon, Oct 05, 2015 at 05:38:34PM +0059, Jason McIntyre wrote: > >> On Mon, Oct 05, 2015 at 11:50:49AM -0400, Rob Pierce wrote: > > Is it KNF compliant to have an exit() or return() at the same indentation as > > the closing functio

tame signify

2015-10-08 Thread Ted Unangst
Without mucking about in the internals, here are some toplevel tame calls. Index: signify.c === RCS file: /cvs/src/usr.bin/signify/signify.c,v retrieving revision 1.100 diff -u -p -r1.100 signify.c --- signify.c 16 Jan 2015 06:16:1

Re: tame signify

2015-10-08 Thread Ted Unangst
Ted Unangst wrote: > Without mucking about in the internals, here are some toplevel tame calls. check return values. ok, ok. in the fairly common verify case of piping msgfile to - (as in patching), we can cut things down a bit more as well. Index: signif

fix ksh histfile owner

2015-10-08 Thread Ted Unangst
ksh does a little dance to try and gift history files to their original owner if it's somehow running as a different user. this of course only works as root, and is probably a terrible idea. ksh should simply refuse to open a history file that's owned by somebody else. Index: history.c =

locate mmap

2015-10-09 Thread Ted Unangst
i think it's idiotic for a program to offer users the choice between stdio and mmap modes. nobody knows which to pick, and it reveals some terrible incompetence somewhere else in the code. mmap is the default. it's effectively the only tested codepath. so burn down the stdio code path. pros: ever

Re: sleep: don't return errno from main()

2015-10-11 Thread Ted Unangst
Philip Guenther wrote: > > As a general rule, programs should not use errno values as an exit status. > > Compare "sleep 10001" w/ and w/o this diff. > > ok? agreed, but why not return 1? i don't want to have to slap 2>/dev/null around all my sleep calls now. > > Index: sleep.c >

Re: iwm: fix handling of large firmware commands

2015-10-11 Thread Ted Unangst
Stefan Sperling wrote: > The iwm(4) driver pre-allocates fw command payload buffers of 320 bytes. > > For some firmware commands, particularly those used when configuring > the PHY (iwm_send_phy_db_cmd) and running scans (iwm_mvm_scan_request), > the payload exceeds 320 bytes. I've seen somewhere

Re: iwm: fix handling of large firmware commands

2015-10-11 Thread Ted Unangst
Stefan Sperling wrote: > On Sun, Oct 11, 2015 at 11:31:35AM -0400, Ted Unangst wrote: > > huh? Why an mbuf? Is dma_alloc not a better choice? > > The mbuf pointer already exists to keep track of packets on the > otheor Tx queues. I guess that's why iwn (where this came f

Re: sleep: don't return errno from main()

2015-10-12 Thread Ted Unangst
Philip Guenther wrote: > On Sun, Oct 11, 2015 at 8:19 AM, Ted Unangst wrote: > > agreed, but why not return 1? i don't want to have to slap 2>/dev/null > > around > > all my sleep calls now. > > So don't. Why would you need to? doesn't err() print a message?

Re: Permitting the override of MACHINE_ARCH in amd64/param.h

2015-10-12 Thread Ted Unangst
Sevan Janiyan wrote: > > > On 12/10/2015 16:30, Theo de Raadt wrote: > > You have failed to explain the usage case; I don't believe there is > > any scenario where people benefit from more architecture divergence. > > As an example, in pkgsrc, CPUs architectures are grouped under a common > alia

less crypt in chpass

2015-10-14 Thread Ted Unangst
Remove some more of the crypt() calls in login_chpass. Index: login_chpass/Makefile === RCS file: /cvs/src/libexec/login_chpass/Makefile,v retrieving revision 1.7 diff -u -p -r1.7 Makefile --- login_chpass/Makefile 22 Apr 2014

Oct 15 OpenBSD errata and LibreSSL releases

2015-10-15 Thread Ted Unangst
The OBJ_obj2txt function in libcrypto contains a one byte buffer overrun and memory leak, as reported by Qualys Security. This can be abused by an attacker to cause a denial of service in some cases. Patches are now available for OpenBSD as well as new releases of LibreSSL portable. 5.6, 5.7, and

Re: nsd 4.1.6rc1

2015-10-15 Thread Ted Unangst
Stuart Henderson wrote: > It does not build as-is, there's an issue with "c_get_text" (a renamed > yyget_text) with our version of flex. I have two possible workarounds > so far but neither is particularly nice; > > - add a configlexer.c file generated with newer flex to the tree (e.g. > the one i

Re: Oct 15 OpenBSD errata and LibreSSL releases

2015-10-16 Thread Ted Unangst
André Schneider wrote: > Hi, > > maybe i'm overlooking something, but in the rebuild and install > instructions, > shouldn't it say >cd /usr/src/lib/libcrypto > instead of >cd src/lib/libcrypto either or. maybe somebody has their src somewhere else.

does anoybody use ul?

2015-10-23 Thread Ted Unangst
ul appears somewhat useless for its intended purpose. echo _xxx_ | ul does not result in underlined text in an xterm, so I doubt many people are using this. Unlike, say, mandoc, it can't output Greek letters. I also imagine most people have moved on to some form of markdown for their other text m

Re: does anoybody use ul?

2015-10-23 Thread Ted Unangst
Nicholas Marriott wrote: > Well, it does work: > > printf 'A\bA_\bB'|ul > > I still think it is not useful, I say kill it. Oh! Is that how you use it? The man page doesn't explain, apparently expecting that everybody just knows there's only one true way to mark up text.

Re: does anoybody use ul?

2015-10-23 Thread Ted Unangst
Christian Weisgerber wrote: > On 2015-10-23, "Ted Unangst" wrote: > > > ul appears somewhat useless for its intended purpose. > > mandoc /usr/share/man/man1/ls.1 | ul > > Works fine. Of course that functionality has been incorporated > into more/less de

Re: does anoybody use ul?

2015-10-23 Thread Ted Unangst
Stefan Sperling wrote: > On Fri, Oct 23, 2015 at 05:50:53AM -0400, Ted Unangst wrote: > > well, it doesn't work with utf-8 because it tries to underline only half the > > character. i'm aiming for the "quick fix"... > > Why not at least try a kind of bett

utf8 in rs

2015-10-23 Thread Ted Unangst
rs doesn't print nicely aligned columns with utf-8 inputs. there's a few ways to handle this; here's just one. note that the source is riddled with lots of code like: if (maxlen < p - *ep) /* update maxlen */ maxlen = p - *ep; I'm very scared to try count

utf8 hack for ls

2015-10-23 Thread Ted Unangst
So, third diff to ponder as we evaluate this approach. This one also uses a u8len() function to help get the column widths correct. (Still not dealing with combining or otherwise not 1 width glyphs.) Index: ls.c === RCS file: /cvs/sr

Re: utf8 hack for ls

2015-10-23 Thread Ted Unangst
Stefan Sperling wrote: > This removes the isprint() check entirely. Do we really want that? > > To what degree should tools like ls protect terminals from escape codes? I think this is beyond the scope of what ls should care about. du doesn't have such a check. Does the shell perform a check befo

Re: utf8 hack for ls

2015-10-23 Thread Ted Unangst
Peter Hessler wrote: > As a different approach to ls, I wrote this a while ago. This uses the > wchar_t functions, but only in putname(). This will correct the alignment of columns, but if you have a filename like pöp the columns will be super wide instead of nicely sized.

Re: utf8 hack for ls

2015-10-23 Thread Ted Unangst
Nicholas Marriott wrote: > Hi > > This doesn't account for UTF-8 double width characters, so they will > still throw the column widths off? right. maybe we will steal some code from tmux for that :). but getting u8len() into the right places is the first step. i don't think we want a isu8cont()

Re: does anoybody use ul?

2015-10-23 Thread Ted Unangst
Christian Weisgerber wrote: > Ted Unangst: > > > --- ul.c10 Oct 2015 16:15:03 - 1.19 > > +++ ul.c23 Oct 2015 10:29:43 - > > @@ -241,6 +241,8 @@ mfilter(FILE *f) > > obuf[col].c_mode |= BOLD|mode; > > e

Re: utf8 hack for ls

2015-10-23 Thread Ted Unangst
Christian Weisgerber wrote: > On 2015-10-23, "Ted Unangst" wrote: > > >> To what degree should tools like ls protect terminals from escape codes? > > > > I think this is beyond the scope of what ls should care about. du doesn't > > have > &g

Re: WAPBL implementation

2015-10-23 Thread Ted Unangst
Pablo Méndez Hernández wrote: > Hi, > > I would say that some information about the authors is missing... I would assume that would be included at the top of the new files, but that does point out they're missing. cvs add, then diff. (with -N if they still don't show up.)

diff tmpdir

2015-10-23 Thread Ted Unangst
this burns the tmpdir out of diff, so as to let pledge tmppath work a little better. Index: diff.1 === RCS file: /cvs/src/usr.bin/diff/diff.1,v retrieving revision 1.44 diff -u -p -r1.44 diff.1 --- diff.1 5 Oct 2015 20:15:00 -00

Re: WAPBL implementation

2015-10-23 Thread Ted Unangst
Walter Neto wrote: > Hi guys, sorry for the inconvenience. > > Once you only have use git at console, cvs is nightmare :( > > But I am learning :) this indeed looks a lot better. although it's quite the diff to review. some brave soul testing of this might be appreciated.

Re: pair(4) (was: connect routing domains on layer 2)

2015-10-24 Thread Ted Unangst
Reyk Floeter wrote: > Hi, > > as requested by Theo and discussed with many, the following diff moves > it into a new driver. This also allowed to improve the logic of link > states related to the connection (as discussed with Claudio). > > The new driver is called pair(4). > > # ifconfig

Re: unify errno messages

2015-10-24 Thread Ted Unangst
Alexander Bluhm wrote: > Hi, > > Before removig nls, I would like to unify all error messages in > - include comment > - libc comment > - nls C > - man page > > The EPROGUNAVAIL change is just beautification. Any objections > against that? ok

Re: pledge(2) in quiz(6)

2015-10-25 Thread Ted Unangst
Jan Stary wrote: > Any comments/OK? > > On Oct 22 13:49:28, h...@stare.cz wrote: > > games/quiz.c popen()s a PAGER to display the help message. > > Throw that away and let the use pipe into a PAGER if needed. > > Then we can just pledge "stdio rpath". yeah, works for me.

Re: utf8 hack for ls

2015-10-25 Thread Ted Unangst
Ted Unangst wrote: > Christian Weisgerber wrote: > > On 2015-10-23, "Ted Unangst" wrote: > > > > >> To what degree should tools like ls protect terminals from escape codes? > > > > > > I think this is beyond the scope of what ls should care

Re: [patch] ftp(1): change mtime for http/https links

2017-09-23 Thread Ted Unangst
Raf Czlonka wrote: > This is unrelated to your diff but what I do instead is to check > the BUILDINFO file - it's tiny and all the information you need, > is already there. While we're on the subject, I'll point out that sometimes only the base sets change, but not the x sets. If you download SHA2

Re: malloc.c: better double free check

2017-09-23 Thread Ted Unangst
Otto Moerbeek wrote: > Hi, > > Malloc maintains a list if 16 slots of chunks to be freed. On free a > chunk is put in a random slot and the existing chunk in that slot is > actually freed. Currently, the code only checks the slot selected for > a double free. > > This diff adds code to check all

Re: maxproc limits

2017-10-06 Thread Ted Unangst
Stuart Henderson wrote: > I have been bumping into maxproc limits a lot recently on my > workstation. While I do have quite a lot of processes at times, I don't > think I have quite been tripping into the limits of number of actual > processes. > > It seems that perhaps threads are counted towards

Re: faster printf

2017-11-16 Thread Ted Unangst
Ingo Schwarze wrote: > [EILSEQ] > A wide-character code that does not correspond to a valid > character has been detected. > > That means that the functions are *required* to fail ("shall fail") > if encoding errors can be detected, that -1 must be returned, and > that errno must b

Re: hide wpakey from root by default

2017-11-17 Thread Ted Unangst
Stefan Sperling wrote: > Or is modifying ifconfig sufficient? > We are more concerned about textual display rather than the > kernel/userland ioctl boundary, correct? > > The option list for ifconfig is [-AaC]. Plenty of letters available. > We could add: > >-P Show authentication details su

Re: hide wpakey from root by default

2017-11-26 Thread Ted Unangst
Jeremie Courreges-Anglas wrote: > > I don't think anything has been committed regarding this issue, right? this looks ok to me.

Re: Use ENFILE errno instead of ENOMEM in pipespace()

2017-12-18 Thread Ted Unangst
Alexander Kuleshov wrote: > pipe()/pipe2() system calls may fail now with ENOMEM error during creation in > pipe_create() -> pipespace(). The bellow diff replaces ENOMEM with ENFILE > errno which is already documented for pipe()/pipe2() to decrease amount of > possible errno(s) with similar behavio

Re: git a/ b/ diffs vs /dev/null

2017-12-20 Thread Ted Unangst
Theo Buehler wrote: > The diff below only skips 6 letters if they actually are '--- a/' or > '+++ b/' and seems to do the trick for me in various scenarios. asymptotically approaching correct, i like it.

ftpd banner

2015-10-25 Thread Ted Unangst
unifdef some foolishness. note that BSD is not currently defined when this file is built. Index: ftpcmd.y === RCS file: /cvs/src/libexec/ftpd/ftpcmd.y,v retrieving revision 1.60 diff -u -p -r1.60 ftpcmd.y --- ftpcmd.y18 Aug 2015

Re: support for malloc allocation canaries

2015-10-25 Thread Ted Unangst
Daniel Micay wrote: > This patch adds an opt-in malloc configuration option placing canaries after > small allocations to detect heap overflows on free(...). It's intended to be > used alongside guard pages for large allocations. Since it's essentially > adding extra padding to all small allocation

Re: utf8 hack for ls

2015-10-25 Thread Ted Unangst
it only gets deeper and thicker... this decodes chars and prints ? for bytes it doesn't like, as well as codepoints (128-159) it doesn't like. (this is extracted from some old utf8 code i had laying around. it's a bit simpler than the stringprep stuff but it seems to handle the case of some incor

Re: utf8 hack for ls

2015-10-26 Thread Ted Unangst
Damien Miller wrote: > rather than scattering hacks in each program that needs to > output utf8 to the console, how about making something > for libutil that they all can use? Yes, that is certainly the plan, but I think it's easier to see what's needed if we convert a few programs first to identi

uptime in top

2015-10-26 Thread Ted Unangst
when i run top, i think uptime would be interesting info to include. there's some space on the second line under the hostname and time. i tried to squeeze it on the first line, but there isn't much room with 80 columns. Index: display.c

pwcache

2015-10-26 Thread Ted Unangst
Old bug in pwcache functions. Calling setpassent(1) to keep the passwd database open is a surprising abstraction violation for the caller of user_from_uid. Now it has a file descriptor it must close before exec by calling endpwent(), but this fact is not mentioned. (find is affected by this, for ex

Re: pwcache

2015-10-26 Thread Ted Unangst
This improves the cache. Basically, it's kind of like four way associative now, with LRU replacement. Also we can cache nameless entries instead of going back to getpwuid every time. Index: gen/pwcache.c === RCS file: /cvs/src/lib/lib

Re: __predict_false for pledge

2015-10-26 Thread Ted Unangst
Michael McConville wrote: > We have a pretty strong guarantee that it can only happen once per > process... I don't think this really matters. What does it do to the assmembly, and how does that make things faster?

Re: pwcache

2015-10-26 Thread Ted Unangst
Todd C. Miller wrote: > On Mon, 26 Oct 2015 11:39:48 -0400, "Ted Unangst" wrote: > > > This improves the cache. Basically, it's kind of like four way > > associative now, with LRU replacement. Also we can cache nameless > > entries instead of going back

Re: pwcache

2015-10-26 Thread Ted Unangst
Philip Guenther wrote: > On Mon, Oct 26, 2015 at 6:47 AM, Ted Unangst wrote: > > Old bug in pwcache functions. Calling setpassent(1) to keep the passwd > > database open is a surprising abstraction violation for the caller of > > user_from_uid. Now it has a file descriptor

Re: pwcache

2015-10-26 Thread Ted Unangst
Philip Guenther wrote: > On Mon, Oct 26, 2015 at 9:05 AM, Ted Unangst wrote: > > Philip Guenther wrote: > >> On Mon, Oct 26, 2015 at 6:47 AM, Ted Unangst wrote: > >> > Old bug in pwcache functions. Calling setpassent(1) to keep the passwd > >> >

Re: __predict_false for pledge

2015-10-26 Thread Ted Unangst
Michael McConville wrote: > Ted Unangst wrote: > > Michael McConville wrote: > > > We have a pretty strong guarantee that it can only happen once per > > > process... > > > > I don't think this really matters. What does it do to the assmembly, >

Re: Oct 15 OpenBSD errata and LibreSSL releases

2015-10-27 Thread Ted Unangst
Constantine Aleksandrovich Murenin wrote: > As reported elsewhere (http://seclists.org/oss-sec/2015/q4/87 via > http://www.opennet.ru/43146), both of these errors were introduced as > part of the refactoring. > > Quick glance through > http://bxr.su/o/lib/libssl/src/crypto/objects/obj_dat.c#OBJ_ob

Re: Oct 15 OpenBSD errata and LibreSSL releases

2015-10-27 Thread Ted Unangst
Constantine Aleksandrovich Murenin wrote: > So you confirm that using block scope in such scenario is the new best > practice now? I don't think it was ever not best practice; though whether people do it or not is a separate matter.

Re: utf8 hack for ls

2015-10-27 Thread Ted Unangst
Anthony J. Bentley wrote: > Stefan Sperling writes: > > On Mon, Oct 26, 2015 at 03:58:58PM -0600, Anthony J. Bentley wrote: > > > "Ted Unangst" writes: > > > > it only gets deeper and thicker... > > > > > > Indeed. > > > &

Re: utf8 hack for ls

2015-10-27 Thread Ted Unangst
Anthony J. Bentley wrote: > "Ted Unangst" writes: > > Fixing citrus is a pretty massive effort in itself. I'd prefer to see the > > replacement code prove itself as a separate API first, then we can remove > > citrus and change the wchar functions to use t

mini utf-8 hexdump

2015-10-27 Thread Ted Unangst
This adds a quite limited understanding of utf-8 to hexdump. I've found it helpful trying to see exactly what's coming out of some utilities instead of trying to decode utf-8 by hand. Index: display.c === RCS file: /cvs/src/usr.bin/he

Re: mini utf-8 hexdump

2015-10-27 Thread Ted Unangst
Stuart Henderson wrote: > On 2015/10/27 06:51, Ted Unangst wrote: > > This adds a quite limited understanding of utf-8 to hexdump. I've found it > > helpful trying to see exactly what's coming out of some utilities instead of > > trying to decode utf-8 by hand. &g

Re: [PATCH] Use rbtree for looking up the client in rebound(8)

2015-10-27 Thread Ted Unangst
Dimitris Papastamos wrote: > There was a comment in the code that indicated that it might be worth > investigating the use of trees. I have not currently done any kind of > serious benchmarking on this but I am looking into it. nice. > +static int > +reqcmp(struct request *r1, struct request *r2

Re: [PATCH] Add a simple roundrobin load balancing feature to rebound(8)

2015-10-28 Thread Ted Unangst
Dimitris Papastamos wrote: > Hi, > > I thought it would be cool for rebound(8) to load balance on a number of > DNS servers. > > While I was working on this, I did not manage to convince myself as to > whether this should be the default behaviour. > > An alternative default would be to use the m

<    3   4   5   6   7   8   9   10   11   12   >