Re: Avoid system(3) in ikectl

2019-05-08 Thread Ted Unangst
Reyk Floeter wrote: > On Wed, May 08, 2019 at 06:44:32PM -0400, Ted Unangst wrote: > > Ted Unangst wrote: > > > Matthew Martin wrote: > > > > I did that originally [1], but Reyk preferred the varargs approach [2], > > > > so I changed the patch to match

Re: ftpd(8): rm dead code and simplifies popen clone

2019-05-08 Thread Ted Unangst
Jan Klemkow wrote: > - * Special version of popen which avoids call to shell. This ensures noone > + * Special version of popen which avoids call to shell. This ensures none If we don't like noone, the correct spelling is no one. Rest of the diff seems like a good improvement.

Re: Avoid system(3) in ikectl

2019-05-08 Thread Ted Unangst
Reyk Floeter wrote: > I meant: could you use /* */ instead of //? oh, sure. done. > Yes, it looks slightly better. > > grumble OK reyk thanks. Matthew, thanks.

less discriminatory battlestar

2019-05-08 Thread Ted Unangst
there are lists of annointed usernames in battlestar. this creates an unfair playing field! worse, there is a list of "bad" people! and i'm almost one of them! -static const char *const badguys[] = { - "wnj", - "root", - "ted", - 0 -}; Index: com1.c ==

Re: stack trace / free(0) in isascan()

2019-05-09 Thread Ted Unangst
Sebastien Marie wrote: > > So calling free() with cf->cf_attach->ca_devsize should be fine. > Diff below. ok. didn't get to this one yet.

Re: [patch] improve strptime(3) %z timezone parsing

2019-05-09 Thread Ted Unangst
Ingo Schwarze wrote: > I'm not mixing anything else into this diff. The other bugs should > be handled separately. > > OK? Works for me. (with additional comment removal)

Re: ssl(8), fix text about web browsers and SAN

2019-05-10 Thread Ted Unangst
Stuart Henderson wrote: > it's standard behaviour for web browsers to not use hostnames in > Subject at all but require SAN. current ssl(8) text suggests "some new" > and "deprecated" rather than "stopped supporting". > > comments/ok? I was trying to avoid argument "but my browser still works" :)

Re: [patch] improve strptime(3) %z timezone parsing

2019-05-10 Thread Ted Unangst
Ingo Schwarze wrote: > Now let's get to the more serious part. > Hiltjo observed that %Z and %z produce wrong results. > > First of all, neither POSIX nor XPG define tm_gmtoff nor %Z nor %z: > > https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html > https://pubs.opengroup.org

Re: [patch] improve strptime(3) %z timezone parsing

2019-05-10 Thread Ted Unangst
Ingo Schwarze wrote: > Ouch. No, it does not. Thanks for spotting the regression. > > The following patch preserves the parsing behaviour > and correctly stores the number of seconds into tm_gmtoff. oops, missed that case too. this looks correct.

cmdfile for config -ef

2019-05-11 Thread Ted Unangst
This adds a new option to config, -c cmdfile, that allows reading commands from a file instead of stdin. This makes it easier to script. Index: config.8 === RCS file: /home/cvs/src/usr.sbin/config/config.8,v retrieving revision 1.66

Re: cmdfile for config -ef

2019-05-11 Thread Ted Unangst
Benjamin Baier wrote: > On Sat, 11 May 2019 11:18:02 -0400 > "Ted Unangst" wrote: > > > This adds a new option to config, -c cmdfile, that allows reading commands > > from a file instead of stdin. This makes it easier to script. > > Interesting. Can the

Re: chroot vs su vs doas

2019-05-13 Thread Ted Unangst
Martijn van Duren wrote: > > But what would it hurt to allow root usage ? > > Specifically, > > > > doas -u ${BUILDUSER} some unquoted command > > > > as run by root. This would not open any security hole, would it ? > > I don't see any and I've been bitten by having a rootshell open and > typi

Re: chroot vs su vs doas

2019-05-13 Thread Ted Unangst
Martijn van Duren wrote: > >> Would > >> doas -c /rootdir somecmd > >> be of any use ? > > > > Not particularly opposed, but the extend of this option should be > > examined. E.g. do we want to extend it to the config to be something > > similar to -u and limit it's use for certain commands? > > >

Re: sv(4): fix free with zero size

2019-05-13 Thread Ted Unangst
Jan Klemkow wrote: > Hi, > > The following diff fixes "free with zero size" in sv(4). Builds and > stats the kernel with sv at pci and audio at sv enabled. ok

Re: add newline for tpm0: dmesg line

2019-05-13 Thread Ted Unangst
f. holop wrote: > dmesg: > > ... > acpibtn2 at acpi0: PWRB > tpm0 at acpi0: TPM_ addr 0xfed4/0x5000acpivideo0 at acpi0: GFX0 > acpivout0 at acpivideo0: DD1F > ... thanks

Re: softraid(4): fix wrong malloc size and zero sized free calls

2019-05-13 Thread Ted Unangst
Jan Klemkow wrote: > Hi, > > The diff mainly add sizes to free(9) calls. But, while here fix a > malloc(9) call with the wrong size in sr_ioctl_installboot(). > omi->omi_som is allocated with size of struct sr_meta_crypto, but used > as struct sr_meta_boot later. > > One free(9) with size zero l

Re: free() sizes for ahc(4)

2019-05-14 Thread Ted Unangst
Miod Vallat wrote: > Note ahc_set_name() gets invoked with the dv_xname field of a struct > device, so it's not a good idea to free anything, should it be invoked > more than once. nice catch.

Re: caesar(6) to accept negative argument

2019-05-15 Thread Ted Unangst
Otto Moerbeek wrote: > We're computing modulo 26 here. Negative numbers have a positive > equivalent. So you diff adds code for no benefit. I think the amount of code added is an acceptable cost for improved user experience. We could use this argument to remove subtraction from bc, but that would

Re: snake: unveil + pledge earlier

2019-05-20 Thread Ted Unangst
Jake Champlin wrote: > - readscores(1); > penalty = loot = 0; > initscr(); > + if (unveil(scorepath, "rwc") == -1) > + err(1, "unveil"); > +#ifdef LOGGING > + if (unveil(logpath, "rwc") == -1) > + err(1, "unveil"); > + logfile = fopen(logpath, "a"

use getpwuid_r in doas

2019-05-21 Thread Ted Unangst
I have a coming change which will need to access both the calling user and target users' passwd entries. In order to accomplish this, we need to switch to the reentrant flavor of getpwuid. No behaviorial change, but I think this is clearer and less error prone as well, versus reusing a pointer to s

Re: uvm_map_inentry() & KERNEL_LOCK()

2019-10-31 Thread Ted Unangst
Theo de Raadt wrote: > In uvm_map_inentry_fix(), two variables in the map are now being read > without a per-map read lock, this was previously protected by the > kernel lock > > if (addr < map->min_offset || addr >= map->max_offset) > return (FALSE); > > When I wrote this

Re: _pbuild user to have priority=5

2019-11-01 Thread Ted Unangst
Theo de Raadt wrote: > What about all the other users who aren't in staff? > > I think the approach is right. Push non-interactive down. The same then for src build user?

Re: Go vs uvm_map_inentry()

2019-11-03 Thread Ted Unangst
Martin Pieuchot wrote: > The last, now reverted change, to uvm_map_inentry() exposes a race that > is reproducible while building lang/go on amd64 which makes uvm_fault() > fail, resulting a in a SIGSEV of at least one of the processes. > Interestingly the machine cannot reproduce the race if the

Re: hexdump in boot loader

2019-11-26 Thread Ted Unangst
Alexander Bluhm wrote: > + > + for (n = 1; n < cmd.argc; n++) { > + p = cmd.argv[n]; > + if (*p == '0') { > + p++; > + if (*p == 'x' || *p == 'X') { > + p++; > + b = 16; > +

Re: [PATCH] make: implement jobserver and use it to avoid exponential behavior

2019-11-27 Thread Ted Unangst
Marc Espie wrote: > reorganizing a large part of usr.bin or usr.sbin to just be one > single variation of bsd.prog.mk with multiple progs and multiple object > files... works just fine for, say 95% of the binaries in those directories > > (considering there are lots of directories with one single

Re: uvm_mapanon() & trylock

2019-12-01 Thread Ted Unangst
Martin Pieuchot wrote: > On 08/11/19(Fri) 17:54, Martin Pieuchot wrote: > > uvm_mapanon() is called in two occasions: mmap(2) and sigaltstack(2). > > Both code paths are obviously in process context an can sleep. That > > explains why none of them set the UVM_FLAG_TRYLOCK when calling such > > fun

Re: Add -R alias to -r for scp(1)

2020-01-01 Thread Ted Unangst
Kurt Mosiejczuk wrote: > cp(1) uses -R for recursive copy. scp(1) uses -r. This diff adds -R as an > alias for -r to scp(1) for those assuming consistency with cp(1). But it doesn't implement cp -R semantics. It does the copy the way cp -r does. (For symlinks, etc.)

Re: Scrolling in top(1)

2020-01-05 Thread Ted Unangst
Vadim Zhukov wrote: > Today I get really upset and angry due limitation of top(1): it shows > only hrrm, top processes (thank you, Chromium). Now here is a diff that > allows you to scroll process list by line or by half a screen. > > I've used the '0' and '9' keys to scroll down and up, respectiv

Re: dangling vnode panic

2020-01-09 Thread Ted Unangst
Martin Pieuchot wrote: > On 09/01/20(Thu) 10:46, Alexander Bluhm wrote: > > Without this diff my regress machines became so unstable, that they > > often do not finish the test run. > > > > With this diff, they run fine. No regressions. > > Sadly this is a workaround. What is the issue? We're

Re: nfs mp vnode list remove safe

2020-01-14 Thread Ted Unangst
Alexander Bluhm wrote: > Hi, > > There is no remove and no sleep in this loop. So _SAFE is unnecessary. > > ok? sure, with one bonus note. > > bluhm > > Index: nfs/nfs_subs.c > === > RCS file: /data/mirror/openbsd/cvs/src/sys/nf

Re: [patch] signify's file name parsing broken

2020-01-20 Thread Ted Unangst
MarcusMüller wrote: > I've just stumbled across a malfunction in signify: It cannot handle > file names that contain a `)` character, when checking a list of hashes > generated by `sha256` command line utilities (`sha256sum --tags` on > Linux). This fix is unfortunately rather complicated for the

Re: key guessing for signify -C

2020-01-20 Thread Ted Unangst
Theo Buehler wrote: > Two small things for signify -C: > > Contrary to what usage suggests, the -p pubkey argument for signify -C > is optional in that signify will use the key specified in the untrusted > comment. In -V mode, the key can be tied down a little by specifying -t. > > Right now, the

Re: [patch] signify's file name parsing broken

2020-01-21 Thread Ted Unangst
Ted Unangst wrote: > MarcusMüller wrote: > > I've just stumbled across a malfunction in signify: It cannot handle > > file names that contain a `)` character, when checking a list of hashes > > generated by `sha256` command line utilities (`sha256sum --tags` on >

leave.1

2020-01-21 Thread Ted Unangst
Rewrite some of the page to avoid second person. Index: leave.1 === RCS file: /home/cvs/src/usr.bin/leave/leave.1,v retrieving revision 1.16 diff -u -p -r1.16 leave.1 --- leave.1 13 Jul 2018 16:59:46 - 1.16 +++ leave.1

check hhmm for leave

2020-01-21 Thread Ted Unangst
In testing leave, I found it accepts "12" and will alarm at 00:12, which is probably not desirable. this check thats the specified time has 4 digits so that the hour/minute math works properly. Index: leave.c === RCS file: /home/cvs/

Re: check hhmm for leave

2020-01-21 Thread Ted Unangst
Scott Cheloha wrote: > > 1) it isn't documented that + can take a smaller number > > 2) it will be hard to train people to use +0001 > > These are my concerns as well. > > An idea I had a while back was to drop support for +hhmm and just > support +minutes, like we do with shutdown(8). The invoc

Re: piixpm(4) on ATI SBx00

2020-01-21 Thread Ted Unangst
Karel Gardas wrote: > > > On 1/21/20 2:33 AM, Claudio Jeker wrote: > > Please test this since I can't test this properly at the moment. > > Would like to, but all hunks fail on today current: it's been committed.

acme-client calloc fix

2020-01-21 Thread Ted Unangst
should not size the size until the allocation succeeds, or the free path will try to deref the null array. Index: json.c === RCS file: /home/cvs/src/usr.sbin/acme-client/json.c,v retrieving revision 1.14 diff -u -p -r1.14 json.c ---

semicolon reduction

2020-01-21 Thread Ted Unangst
don't need semicolon after } in statements. Index: ifconfig/brconfig.c === RCS file: /home/cvs/src/sbin/ifconfig/brconfig.c,v retrieving revision 1.24 diff -u -p -r1.24 brconfig.c --- ifconfig/brconfig.c 24 Oct 2019 18:54:10 -

Re: acme-client calloc fix

2020-01-22 Thread Ted Unangst
Matthew Martin wrote: > On Wed, Jan 22, 2020 at 12:44:18AM -0500, Ted Unangst wrote: > > should not size the size until the allocation succeeds, or the free path > > will > > try to deref the null array. > &

Re: acpivout(4): directly call ws_[gs]et_param

2020-01-23 Thread Ted Unangst
Patrick Wildt wrote: > acpivout_[gs]et_param don't know if they are being called by itself > or by someone else. I don't need to grab it again, I just need to > have it before calling an ACPI method. But when acpivout(4) calls > itself, it already has it, so taking it again would break it, as it'

apmd poll every minute

2020-01-24 Thread Ted Unangst
Sometimes (particuarly if you are using apmd -z) the default polling interval of 10 minutes is a bit lazy and we fail to respond to low battery situations before they become no battery situations. Perhaps something smarter could be done, but the simplest change is to reduce the default polling int

Re: apmd: fix autoaction timeout

2020-01-25 Thread Ted Unangst
Jeremie Courreges-Anglas wrote: > > The diff below improves the way apmd -z/-Z may trigger. > > I think the current behavior is bogus, incrementing and checking > apmtimeout like this doesn't make much sense. this all seems reasonable to me. > - I think we want some throttling mechanism, like w

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-26 Thread Ted Unangst
Jonathan Gray wrote: > On Sun, Jan 26, 2020 at 11:59:33AM -0500, David Goerger wrote: > > This diff teaches du(1) the -m flag, report disk usage in megabytes. > > This brings us in line with implementations in the other BSDs, Linux, > > and Illumos. > > Why is it needed? -k is required by POSIX

refer to pointers as non-null

2020-01-31 Thread Ted Unangst
Noticed this in wait.2, though I imagine other occurences abound. I believe non-null is clearer when refering to a pointer than non-zero, which is a bit 80s, and less likely to be mistaken for the value pointed to. This same page also refers to non-zero values, fwiw. Index: wait.2 ==

Re: librthread sem_t opaqueness, storage & unnamed semaphore sharing

2020-02-24 Thread Ted Unangst
Martin Pieuchot wrote: > On 24/02/20(Mon) 11:29, Lauri Tirkkonen wrote: > > On Mon, Feb 24 2020 10:24:53 +0100, Martin Pieuchot wrote: > > > On 23/02/20(Sun) 14:48, Lauri Tirkkonen wrote: > > > > I was working on a make jobserver implementation that uses POSIX > > > > semaphores as job tokens inste

Re: Partition question (Was new installer disklabel question)

2009-07-09 Thread Ted Unangst
On Thu, Jul 9, 2009 at 12:55 PM, STeve Andre' wrote: > What reasons are there for not extending partitions to z? With 2T disks > out, having 14 partitions means not being able to make smaller ones. the disklabel must fit in only so much disk. if you want lots of baby partitions, you can use soft

Re: Default servers pool in ntpd.conf

2009-07-22 Thread Ted Unangst
On Wed, Jul 22, 2009 at 12:36 PM, Jean Rebiffe wrote: > To OpenNTPD developers, > > You use pool.ntp.org in the default configuration of the OpenNTPD > daemon since 2004, but that is not compliant with the web page of > the pool.ntp.org project designated to software vendors and operating > system

Re: Default servers pool in ntpd.conf

2009-07-22 Thread Ted Unangst
On Wed, Jul 22, 2009 at 1:49 PM, Martin Schrvder wrote: > 2009/7/22 Ted Unangst : >> "Open source projects >> >> Open Source projects are of course particularly welcome to use the >> pool in their default setup" > ", but we ask that you get a vendor z

netstat -c count

2009-08-19 Thread Ted Unangst
Noticed that netstat doesn't have a repeat count option like vmstat does. Index: if.c === RCS file: /cvs/src/usr.bin/netstat/if.c,v retrieving revision 1.61 diff -u -r1.61 if.c --- if.c4 Aug 2009 03:45:47 - 1.61 +++

Re: rfork procs blocking on fd_lock due to so_linger

2009-10-06 Thread Ted Unangst
On Tue, Oct 6, 2009 at 6:29 AM, Mechiel Lukkien wrote: > if the above is really what is happening, perhaps rthreads will run > into the same problem sooner or later? perhaps other close() calls can > also sleep? or other operations that hold fd_lock? Yes, very good diagnosis. We'll have to fix

vmstat tweaks

2009-11-15 Thread Ted Unangst
part1: tweak the format strings so that numbers never run together. If, for example, your blocked process count hits double digits, it smears into the next column, which then makes the rest of the output unparseable by scripts. The alignment is then a little off, but I'll take hard to read ov

netstat tweaks

2009-11-15 Thread Ted Unangst
part1 (the whole diff): add a repeat count, -c, like vmstat has. A lot of change for a little tweak. part2 (hidden in there): Don't repeat the banner if it's not a terminal. Same justification as for prevous vmstat diff. Index: if.c ===

Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Ted Unangst
On Nov 20, 2009, at 8:03 AM, Thomas Pfaff wrote: On Fri, 20 Nov 2009 15:45:31 +0100 Peter Hessler wrote: mixerctl inputs.master=[0,255] mixerctl outputs.master=[0,255] Still, is a simpler sysctl interface something people want? mixerctl can be reserved for people wanting to screw around w

Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Ted Unangst
On Nov 20, 2009, at 8:47 AM, Thomas Pfaff wrote: On Fri, 20 Nov 2009 08:28:34 -0800 Ted Unangst wrote: On Nov 20, 2009, at 8:03 AM, Thomas Pfaff wrote: On Fri, 20 Nov 2009 15:45:31 +0100 Peter Hessler wrote: mixerctl inputs.master=[0,255] mixerctl outputs.master=[0,255] Still, is a

Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Ted Unangst
On Fri, Nov 20, 2009 at 3:19 PM, Jacob Meuser wrote: >> If you don't like mixerctl, there's at least a half dozen mixers in >> ports. > > those don't help at all. cmixer is the only one with a chance of > ever being really helpful, imo. it's the only one that doesn't use > libossaudio (where the

combined xstat diff

2009-11-21 Thread Ted Unangst
As before, with iostat fix and man page for netstat. Index: usr.bin/netstat/if.c === RCS file: /home/tedu/cvs/src/usr.bin/netstat/if.c,v retrieving revision 1.61 diff -u -r1.61 if.c --- usr.bin/netstat/if.c4 Aug 2009 03:45:47

Re: Small change to rc?

2009-12-04 Thread Ted Unangst
On Fri, Dec 4, 2009 at 4:15 PM, Abel Abraham Camarillo Ojeda wrote: >> mv /etc/resolv.conf.save /etc/resolv.conf > cp "$orig" "$dest"; Not the same.

Re: diff: ifconfig tun to print opener pid

2009-12-05 Thread Ted Unangst
On Sat, Dec 5, 2009 at 6:12 PM, Vladimir Kirillov wrote: > So, is there a way (an interface) to find out from the character > device driver which struct file is it in it's current instance? > > Or am I digging into the wrong direction? Option 2. :) The way devices work, you can't reliably tell w

Re: How to express memory ordering in OpenBSD kernel?

2009-12-05 Thread Ted Unangst
Im not an expert on the ral driver, but openbsd drivers practically never map device registers into memory. The value of flags will be written to hardware later. On Dec 5, 2009, at 11:35 PM, Roland Dreier wrote: So I've been looking at the ral(4) driver a bit lately, and I notice in the

Re: How to express memory ordering in OpenBSD kernel?

2009-12-05 Thread Ted Unangst
On Sun, Dec 6, 2009 at 12:13 AM, Roland Dreier wrote: > > Im not an expert on the ral driver, but openbsd drivers practically > > never map device registers into memory. The value of flags will be > > written to hardware later. > > Unless I'm misunderstanding the driver, the TX ring is in syste

too many cpus

2009-12-06 Thread Ted Unangst
The good news is you just bought a new 32 processor machine. The bad news is now you can't afford a monitor big enough to run top. Fortunately, help is on the way. Patch below combines all cpu states into a single line, for that "classic" top look even on the most impressive of modern hardware

Re: too many cpus

2009-12-07 Thread Ted Unangst
On Mon, Dec 7, 2009 at 10:34 AM, Joerg Sonnenberger wrote: > On Mon, Dec 07, 2009 at 12:50:33AM -0500, Ted Unangst wrote: >> Fortunately, help is on the way. Patch below combines all cpu states into >> a single line, for that "classic" top look even on the most impress

Re: diff: ifconfig tun to print opener pid

2009-12-08 Thread Ted Unangst
On Tue, Dec 8, 2009 at 10:44 AM, Owain Ainsworth wrote: >> The way devices work, you can't reliably tell who has it open. open >> and close are only called for two events, the first open and the last >> close. In between, all sorts of things can happen. > > I was sure it was *every* open, and th

Re: kernel hacking

2009-12-10 Thread Ted Unangst
On Thu, Dec 10, 2009 at 12:24 PM, Robert Yuri wrote: > which the best way to learn about OpenBSD kernel ? I have mixed feelings about the need for an OpenBSD specific resource. There are man pages for the people who want to know *what* the kernel does (or is supposed to do). But if you want to

Re: Random Early Detection vs Random Early Drop

2009-12-13 Thread Ted Unangst
No, different things should have different names. On Dec 13, 2009, at 2:46 PM, Lars Nooden wrote: pf.conf(5) refers to 'Random Early Detection' sshd_config(5) refers to 'Random Early Drop' Should the same wording be used in both man pages? /Lars cvs diff -Nup sshd_config.5 Index: sshd_confi

Re: save some entropy

2009-12-14 Thread Ted Unangst
On Mon, Dec 14, 2009 at 3:58 AM, Otto Moerbeek wrote: >> apart from the random page addresses obtained form mmap(2) malloc(3) >> itself also randomizes cache en chunk operations. It uses a nibble of >> randomness per call, so optimize that to not waste half the random >> bits. >> >> Please test, s

Re: libevent version is quite old

2009-12-14 Thread Ted Unangst
2009/12/14 Jirtme Loyet : > 1- why is it based on an old version (1.3e dated on 2007-09-24) while > the last 1.4 stable is 1.4.13 from 2009-11 ? Nobody updated it. > 2- why is it not shipped as a package (like freebsd or netbsd) instead > of being in the src tree ? Because then other programs in

Re: [patch] lib/libc/yp/yp_all.c mem leak

2010-01-08 Thread Ted Unangst
On Fri, Jan 8, 2010 at 2:22 PM, patrick keshishian wrote: > On Fri, Jan 08, 2010 at 03:47:48PM +0300, Igor Zinovik wrote: >> Hello, t...@. >> >> A bit tricky code in yp_all.c `val' is not freed. It might be >> allocated but might be not freed >> when `key' allocation failed. >> >> Index: lib/li

Re: If you are one of the cool kids who cranks kern.bufcachepercent up..

2010-01-09 Thread Ted Unangst
On Sat, Jan 9, 2010 at 6:22 PM, Joerg Sonnenberger wrote: > You have analysed the situation correctly. The problem is that the > compiler does not know that the signed numvnodes is never negative, so > it creates different code. E.g. on AMD64 it is 6 instructions for the > signed division by 2 com

Re: ddb.log in sysctl.conf

2010-01-14 Thread Ted Unangst
On Thu, Jan 14, 2010 at 12:17 PM, Lars Nooden wrote: > -# This file contains a list of sysctl options the user wants set at > -# boot time. See sysctl(3) and sysctl(8) for more information on > -# the many available variables. > +# This file contains a list of the most commonly used sysctl option

Re: tcpdump privsep design

2010-01-15 Thread Ted Unangst
On Fri, Jan 15, 2010 at 1:21 PM, Denis Doroshenko wrote: > I'd like to give some colleagues possibility to analyze and dump net > traffic to files, but it seems that in order to do that I need to > allow them to run a piece of software as root, when the software has a > possibility to write to a u

more options for top

2010-01-22 Thread Ted Unangst
I find it very useful to sort by command as it usually means less bouncing around. While we're here, add sort by pid too. Also, allow string_index to shortcut on partial matches (techinically unrelated). Index: machine.c === RCS f

mg + tinyscheme

2010-01-24 Thread Ted Unangst
So one of mg's bugs is that it's not extensible. This doesn't normally bother me, because I use vi. But I decided to do something about it. A full lisp like emacs would be a little crazy, given the point is to have a small editor. But tinyscheme isn't too bad. So in it goes. Now just having a

Re: mg + tinyscheme

2010-01-25 Thread Ted Unangst
On Mon, Jan 25, 2010 at 12:35 PM, Bob Beck wrote: > While interesting - isn't one of the points of mg that is its small > and *NOT* extensible? > > I mean, if I want extensible, I'll freaking run emacs. I actually > like having and editor > that is smaller than vim and emacs to use. I think smal

Re: mg + tinyscheme

2010-01-27 Thread Ted Unangst
On Sun, Jan 24, 2010 at 5:22 AM, Ted Unangst wrote: > So one of mg's bugs is that it's not extensible. This doesn't > normally bother me, because I use vi. But I decided to do something > about it. A full lisp like emacs would be a little crazy, given the > poin

Re: mg + tinyscheme

2010-01-27 Thread Ted Unangst
On Wed, Jan 27, 2010 at 3:06 PM, Christiano F. Haesbaert wrote: > I know you've already done a lot of work on tinyscheme, but have you > considered Lua ? > > Very efficient and low memory footprint, and also more accessible for > people who don't want to dwelve in the deeps of functional > program

Re: mg + tinyscheme

2010-01-27 Thread Ted Unangst
2010/1/27 Mike Belopuhov : > Frankly, having scheme in without any support for REPL in mg is not > that awesome. What makes elisp so handy is an ability to see what > happens in realtime while programming (the usual Lisp/REPL development > way). It's not done yet. > Also, it makes more sense to

Re: UBC?

2010-02-01 Thread Ted Unangst
On Mon, Feb 1, 2010 at 9:07 AM, Owain Ainsworth wrote: > On Mon, Feb 01, 2010 at 10:08:08AM +0100, Artur Grabowski wrote: >> We could try some magic with allocating from a pool with NOWAIT and >> then fall back to kmem_map when that fails, but the logic would become >> hairy. Maybe a pool allocato

Re: UBC?

2010-02-01 Thread Ted Unangst
On Mon, Feb 1, 2010 at 4:08 AM, Artur Grabowski wrote: > caller holds lock on kernel_map. getpage pool is empty, caller wakes > up the getpage thread, goes to sleep (still holding the kernel_map > lock), getpage thread wakes up, deadlocks on the kernel_map lock. It's > not an easily detectable rec

uvm_pseg_get & uvm_pseg_lck fix

2010-02-01 Thread Ted Unangst
I think this fixes the problem with sleeping and holding pseg_lck. Index: uvm_extern.h === RCS file: /home/tedu/cvs/src/sys/uvm/uvm_extern.h,v retrieving revision 1.82 diff -u -r1.82 uvm_extern.h --- uvm_extern.h11 Aug 2009 18

iflag for sed

2010-02-01 Thread Ted Unangst
Ordinarily, extensions to standard utilities are bad, but I think it's worth considering when the flag is easily understood and provides a substantial benefit. I think case insenstive matching in sed qualifies. The diff below actually implements this behavior two different ways. Option 1 is t

Re: uvm_pseg_get & uvm_pseg_lck fix

2010-02-03 Thread Ted Unangst
On Wed, Feb 3, 2010 at 9:41 AM, Owain Ainsworth wrote: >> Index: uvm_pager.c >> === >> RCS file: /home/tedu/cvs/src/sys/uvm/uvm_pager.c,v >> retrieving revision 1.54 >> diff -u -r1.54 uvm_pager.c >> --- uvm_pager.c 22 Jul 2009 2

Re: UBC?

2010-02-04 Thread Ted Unangst
On Thu, Feb 4, 2010 at 2:21 PM, Jeff Ross wrote: > kern.shminfo.shmall=512000 > kern.shminfo.shmmax=76800 Oh, when I said it was safe to crank shmmax I didn't know you'd be setting the bufcache to huge numbers too. ;) > available memory in the server. I tried setting mine to 980MBs (4GB of

Re: [patch] httpd/src/modules/ssl/ssl_util_table.c - fd leak

2010-02-05 Thread Ted Unangst
You are correct, but the patch isn't complete. You should be calling fclose on the FILE *. Also, the table_write function has similar bugs. I spent some time consolidating the error handling, but eventually just gave up. (are these functions even used?) 2009/12/18 Igor Zinovik : >Hello

little cp diff

2010-02-05 Thread Ted Unangst
Though for a program like cp, this may qualify as a big diff. :) Continuing in my "make IO suck less" phase, cp would be a lot more efficient if it didn't bounce the disk heads around so much. Instead of using a tiny 64k buffer, use an amount based on a small fraction of RAM. Index: utils.c

Re: little cp diff

2010-02-06 Thread Ted Unangst
On Sat, Feb 6, 2010 at 8:44 AM, Mark Kettenis wrote: >> > Continuing in my "make IO suck less" phase, cp would be a lot more >> > efficient if it didn't bounce the disk heads around so much. Instead of >> > using a tiny 64k buffer, use an amount based on a small fraction of RAM. >> >> Isn't it th

Re: little cp diff

2010-02-06 Thread Ted Unangst
On Sat, Feb 6, 2010 at 9:53 AM, Otto Moerbeek wrote: > The buffer cache should ne smart enough to optmize read and writes in > such large chunks so that the seeking gets reduced. The problem with How? cp reads 64k. How much extra should the kernel read ahead? How is this determined? What if y

Re: little cp diff

2010-02-06 Thread Ted Unangst
On Sat, Feb 6, 2010 at 1:35 PM, Otto Moerbeek wrote: > Add to that that doing I/O in big chunks is also putting more pressure > on the buffer cache. The buffer cache keeps a copy of whatever goes through it regardless of size. The io is broken down into 64k chunks no matter what size cp says to

Re: little cp diff

2010-02-06 Thread Ted Unangst
On Sat, Feb 6, 2010 at 1:54 PM, Theo de Raadt wrote: >> How? cp reads 64k > > So change it to 1MB. Yeah, right, like anyone will ok a diff like that on the vax. > But using sysctl is insane. That is not portable. Why does cp need to be portable? Who's porting OpenBSD cp to other systems?

Re: little cp diff

2010-02-07 Thread Ted Unangst
On Sun, Feb 7, 2010 at 2:09 PM, Theo de Raadt wrote: >> Why does cp need to be portable? Who's porting OpenBSD cp to other systems? > > Will the same diff be added to every io generating program in /bin? > > They all generate io, of course. I was planning on something similar for tar. But that'

Re: little cp diff

2010-02-07 Thread Ted Unangst
On Sun, Feb 7, 2010 at 6:11 PM, Theo de Raadt wrote: > And in mv, for the cross-device case? I see others that do fast > reads, like sum. diff? cmp? grep? How many others? If cp(1) > is such a common operation (I bet it isn't), how soon before other > programs doing exactly the same thing wa

Re: little cp diff

2010-02-08 Thread Ted Unangst
On Sun, Feb 7, 2010 at 6:11 PM, Theo de Raadt wrote: > I think adding big chunks of sysctl code to such specific applications > is very un-unix. > > If choosing a buffer size is going to be a common operation, it should > be an API called to "ask what the buffer size should be". If that is > the

Re: [patch] httpd/src/modules/ssl/ssl_util_table.c - fd leak

2010-02-08 Thread Ted Unangst
On Sun, Feb 7, 2010 at 8:02 PM, Philip Guenther wrote: > Gah, between that and Henning's observation that those functions may > be used by modules, I withdraw the suggestion that they be removed and That'd be really weird for a module to depend on code in the ssl module, but whatever. > instead

Re: little cp diff

2010-02-08 Thread Ted Unangst
On Mon, Feb 8, 2010 at 9:48 AM, Mark Kettenis wrote: >> So how do we move forward? > > For one thing, I'd like to see some real benchmarks. Does using a > larger buffer really speed up cp? You claim moving a "head" between > reads and writes takes time, but so does moving it between reads. And

Re: uvm_pseg_get & uvm_pseg_lck fix

2010-02-08 Thread Ted Unangst
On Mon, Feb 8, 2010 at 11:11 AM, Owain Ainsworth wrote: > On Mon, Feb 01, 2010 at 11:30:06PM -0500, Ted Unangst wrote: >> I think this fixes the problem with sleeping and holding pseg_lck. > > This won't build on sparc64 (the only caller of valloc_align). If you > fix that,

Re: little cp diff

2010-02-10 Thread Ted Unangst
On Mon, Feb 8, 2010 at 9:48 AM, Mark Kettenis wrote: > For one thing, I'd like to see some real benchmarks. Does using a > larger buffer really speed up cp? You claim moving a "head" between > reads and writes takes time, but so does moving it between reads. And > modern drives have caches that

Re: mprotect(2) misbehaves when len == 0?

2010-02-11 Thread Ted Unangst
The man page is likely missing the word "no", as that makes a lot more sense than the current wording meaning positive action. 2010/2/11 Vadim Zhukov : > Hello all. > > mprotect(2) says: "If len is 0, then action will be taken on the page > that contains addr". The reality says it's not so: > > $

Re: mprotect(2) misbehaves when len == 0?

2010-02-12 Thread Ted Unangst
On Fri, Feb 12, 2010 at 10:21 AM, Jason McIntyre wrote: > On Fri, Feb 12, 2010 at 02:01:26PM +, Owain Ainsworth wrote: >> >> saying that no action is taken does imply that it is not an error. >> -is 0, then action will be taken on the page that contains >> +is 0, then no action will be taken o

Re: enhancing i386 mbr.S

2010-02-20 Thread Ted Unangst
On Sat, Feb 20, 2010 at 8:29 AM, Giuseppe Magnotta wrote: > Currently, the mbr will not check it there are many bootable partition > in the partition table. It simply start the first active partition it > found. > > I've made a small modification that will check the partition status > before going

<    1   2   3   4   5   6   7   8   9   10   >