Re: [PATCH] Callback-based interface to libtls

2016-09-07 Thread tobias
On 07.09.2016, at 10:45, Tobias Pape wrote: > Hi there > > On 05.09.2016, at 15:50, bust...@gmail.com wrote: > >> Hey, the typedef came in handy :) Ok bcook@ >> >> On Sep 5, 2016, at 11:52 AM, Bob Beck wrote: >> >>> I am in agreement in princi

Re: [PATCH] Callback-based interface to libtls

2016-09-14 Thread tobias
gt;> the callbacks. >> I added this, see the diff. > > Aaand: a fix for the FLUSH BIO cntl, that happens at the end of SSL > handshakes… Next fix: put the callback on the right context for tls_accept. Updated diff at the end. Best regards -Tobias diff --git src/lib/

Re: 'int stat(...)' hides constructor for 'struct stat'

2013-11-03 Thread Tobias Ulmer
On Sun, Nov 03, 2013 at 03:06:23PM +, Stuart Henderson wrote: > cc1plus: warnings being treated as errors > In file included from > /usr/obj/squid-3.4.0.2/squid-3.4.0.2/src/DiskIO/DiskThreads/aiops.cc:43: > /usr/include/sys/stat.h:199: warning: 'int stat(const char*, stat*)' hides > construct

Re: document 'machine boot' on i386/amd64

2013-11-08 Thread Tobias Weingartner
They found it... :) -Toby. On Wed, Nov 6, 2013 at 9:08 AM, Brynet wrote: > It seems boot(8) on i386/amd64 has an undocumented feature that is > occasionally handy. This adds a small blurb to the man pages for both > so that people can find it. > > -Bryan. > > Index: i386/stand/boot/boot.8 > ==

Re: Documentation for Realtek 8188* devices

2013-11-15 Thread Tobias Ulmer
On Fri, Nov 15, 2013 at 04:55:23AM +0100, Dmitrij D. Czarkoff wrote: > Stefan Sperling said: > > I don't think there are any docs. The Linux driver is the only > > reference I could find. > > > > The linux driver has pci/usb shims around a common core, much like > > some other OpenBSD wireless dri

provide etext symbol on sparc64

2014-01-05 Thread Tobias Ulmer
Profiling on sparc64 is broken because e(nd of)text is missing. Once fixed, profiling works just fine on a Blade 1500. Am I missing something? OK? Index: arch/sparc64/conf/ld.script === RCS file: /home/vcs/cvs/openbsd/src/sys/arch/sp

boot: readline off by one

2014-01-11 Thread Tobias Stoeckmann
ix is easy to implement, keeping the behaviour. Thoughts? Okay? Tobias Index: cmd.c === RCS file: /cvs/src/sys/stand/boot/cmd.c,v retrieving revision 1.61 diff -u -p -r1.61 cmd.c --- cmd.c 23 Dec 2013 23:32:40 - 1.61

Re: boot: readline off by one

2014-01-11 Thread Tobias Stoeckmann
On Sat, Jan 11, 2014 at 12:43:33PM +0100, Tobias Stoeckmann wrote: > p[1] = *p = '\0'; If this is actually intended behaviour, it's off from read_conf, which ends cmd_buf with just one terminating \0 character.

getusershell: off by one

2014-01-16 Thread Tobias Stoeckmann
Jan 15 22:40 /etc/shells $ chpass Segmentation fault Okay? Tobias Index: getusershell.c === RCS file: /var/www/cvs/src/lib/libc/gen/getusershell.c,v retrieving revision 1.11 diff -u -p -r1.11 getusershell.c --- getusershell.c

lpd: race condition

2014-01-17 Thread Tobias Stoeckmann
ht of current lpd behaviour -- lpd will just _always_ do the file check. Also, don't assume that everything is alright if fstat() fails. Tobias Index: printjob.c === RCS file: /var/www/cvs/src/usr.sbin/lpr/lpd/printjob.c,v retrievin

libedit: retain local changes

2014-01-18 Thread Tobias Stoeckmann
1.13 Tobias Index: history.c === RCS file: /var/www/cvs/src/lib/libedit/history.c,v retrieving revision 1.16 diff -u -p -r1.16 history.c --- history.c 7 Jul 2011 05:40:42 - 1.16 +++ history.c 18 Jan 2014 12:38:38 - @@ -

Re: lpd: race condition

2014-01-19 Thread Tobias Stoeckmann
On Mon, Jan 20, 2014 at 10:11:53AM +1300, Philip Guenther wrote: > On Sun, Jan 19, 2014 at 10:48 AM, Todd C. Miller > wrote: > > Perhaps something like this? Only compile-tested. > > Looks good. We also need to fix the 'S' line parsing code in sendit() > and printit() in lpd/printjob.c to use u

Fix ia64 cross-gcc

2014-05-26 Thread Tobias Ulmer
I want to experiment with building some simple efi binaries. This diff unbreaks make -f Makefile.cross TARGET=ia64 cross-gcc OK? Index: sys/arch/ia64/Makefile === RCS file: sys/arch/ia64/Makefile diff -N sys/arch/ia64/Makefile --- /d

fix modf() on sparc

2014-06-06 Thread Tobias Ulmer
If correct, this fixes a 22 year old bug that exists since 4.4BSD alpha :) In modf, when we go down the Lbig jump, f0:f1 is never set and just contains gibberish. Usually NAN or 0.0. What we really want is just copy the input out and be done. This completely corrupts python when hashing floats fo

Re: fix modf() on sparc

2014-06-06 Thread Tobias Ulmer
est.c diff -N modf/modf_test.c --- /dev/null 1 Jan 1970 00:00:00 - +++ modf/modf_test.c6 Jun 2014 21:05:00 - @@ -0,0 +1,35 @@ +/* Public domain, 2014, Tobias Ulmer */ + +/* Test for bug introduced in 4.4BSD modf() on sparc */ + +#include + +#define BIGFLOAT (5e15) /* Number large enou

fsck_msdos: out of boundary access

2014-06-08 Thread Tobias Stoeckmann
Hi, Google's Android team uses a modified fsck_msdos version from FreeBSD, fixing issues in their local repositories. No license adjustments, so we are free to merge them into ours. One of these fixes covers an out of boundary access that can occur if filesystem points to a cluster outside of al

fsck_msdos: off by one for FAT12

2014-06-09 Thread Tobias Stoeckmann
re FATs FAT starts with odd byte sequence (00) Correct? [Fyn] y ** Phase 2 - Check Cluster Chains Segmentation fault (core dumped) # _ Tobias Index: fat.c === RCS file: /cvs/src/sbin/fsck_msdos/fat.c,v retrieving revision 1.19 diff

Re: fsck_msdos: off by one for FAT12

2014-06-09 Thread Tobias Stoeckmann
On Mon, Jun 09, 2014 at 09:16:42PM +0200, Tobias Stoeckmann wrote: > + cl++; [...] > + *p |= (u_char)(fat[cl + 1].next << 4); > + *p++ = (u_char)(fat[cl + 1].next >> 4); And here the correct diff, cl + 1 must

howmany macro: integer overflow

2014-06-14 Thread Tobias Stoeckmann
low can be prevented. But I don't know how significant this operation will be when it comes to performance. Or if howmany should not be used for these operations at all. Thoughts, anyone? Tobias Index: param.h === RCS file: /

fsck_msdos: fix possible infinite loop

2014-06-14 Thread Tobias Stoeckmann
truncated _at the offending cluster_. Tobias Index: fat.c === RCS file: /cvs/src/sbin/fsck_msdos/fat.c,v retrieving revision 1.21 diff -u -p -r1.21 fat.c --- fat.c 14 Jun 2014 12:33:07 - 1.21 +++ fat.c 14 Jun

Re: fsck_msdos: fix possible infinite loop

2014-06-14 Thread Tobias Stoeckmann
EOF in FAT 0, but continues with cluster 106 in FAT 1 Use continuation from FAT 1? [Fyn] y ** Phase 2 - Check Cluster Chains Cluster chain starting at 106 loops at cluster 110 Clear chain starting at 106? [Fyn] n Truncate? [Fyn] y ** Phase 3 - Check Directories ** Phase 4 - Check for Lost Files 2 files, 984 free (246 clusters) * FILE SYSTEM WAS MODIFIED * # vnconfig -u vnd0c # _ Tobias

valid FAT32 for newfs and fsck

2014-06-16 Thread Tobias Stoeckmann
fsck_msdos is a bit too strict about handling the valid 0x value for "next free cluster" and "free clusters" of FSinfo. It just means it is not initialized, which is per se no error that would have to be fixed

sys/msdosfs: off by one

2014-06-16 Thread Tobias Stoeckmann
esemble a resolved version of howmany macro (hint to my howmany mail ;)). Unfortunately "- 1" is missing in for-loop. This _can_ lead to out of boundary access, depending on actual pmp->pm_maxcluster value. Tobias Index: msdosfs_fat.c ===

Re: sys/msdosfs: off by one

2014-06-17 Thread Tobias Stoeckmann
e same in msdosfs_fat.c to help the next person looking at that code to see: 1) that we have the same fix as FreeBSD 2) that these values are in sync. Tobias Index: msdosfs_fat.c === RCS file: /cvs/src/sys/msdosfs/msdosfs_fat.c,v

fsck_msdos: out of boundary on file truncation

2014-06-17 Thread Tobias Stoeckmann
. The diff verifies that the length is always kept up to date after truncation. Tobias Index: dir.c === RCS file: /cvs/src/sbin/fsck_msdos/dir.c,v retrieving revision 1.22 diff -u -p -r1.22 dir.c --- dir.c 16 Jun 2014 18:3

Re: howmany macro: integer overflow

2014-06-17 Thread Tobias Stoeckmann
orth it and we come up with a better implementation. In either case, I think a smaller diff is easier to adjust or to extend. Tobias

fsck_msdos: long filename out of boundary access

2014-06-18 Thread Tobias Stoeckmann
s that entry. I don't agree on that, after all the entry _is_ wrong. Therefore, consider it erroneous and ask the user to remove the offending entry. Tobias Index: dir.c === RCS file: /cvs/src/sbin/fsck_msdos/dir.c,v retrievin

Re: exclude-list in mtree (2)

2014-06-20 Thread Tobias Stoeckmann
lbuf[len - 1] = '\0'; > + buf = lbuf; > + } What is the rational behind checking for len == 1 in '\n' case, but not for "last line without new line"? If you want to skip empty lines, you should check after the if/else-block for buf[0] == '\0', imho. Tobias

sys/msdosfs: possible kernel crash

2014-06-20 Thread Tobias Stoeckmann
st allowed sector size is 4096 bytes. A division by 512 can therefore be at worst 8. It's enough to increase SecPerClust to an unsigned 16 bit value. Also, don't accept file systems with sector sizes beyond 4096 bytes. By the way: The introduced cast is important because the header files

fsck_msdos: validate basic information

2014-06-23 Thread Tobias Stoeckmann
t not be larger than the filesystem. If that's not checked, the previously assigned value could overflow due to negative numbers. Tobias Index: boot.c === RCS file: /cvs/src/sbin/fsck_msdos/boot.c,v retrieving revision 1.20

Re: sys/msdosfs: possible kernel crash

2014-06-23 Thread Tobias Stoeckmann
duces filesystems with invalid parameters for certain types of media. Basically their version from revision 206098, adjusted to fit into our style of the if-block. Tobias Index: msdosfs_vfsops.c === RCS file: /cvs/src/sys/msdosfs/msdosfs_

newfs_msdos: proper boot signature

2014-06-24 Thread Tobias Stoeckmann
tility does not store the boot signature in the correct place on large sector disks. The boot signature should be at offset 0x1fe in the BPB; newfs_msdos currently stores it 2 bytes from the end of the sector. Taken from: NetBSD Tobias Index

boot: off-by-one

2014-06-26 Thread Tobias Stoeckmann
Hi, in boot, we have an off-by-one error in readline. When the user ends input with enter, the string will be ended twice, like: p[1] = *p = '\0'; Comparing readline with read_conf (reading commands from file), there is no need to "double end" the input line.

boot: overflow in bootarg on truncation

2014-06-26 Thread Tobias Stoeckmann
get created from main.c: - crash adds a bootarg in "perfect size" to let BOOTARG_END overflow into guard page on i386 - nocrash adds the largest allowed bootarg -- not crashing. Tobias Index: bootarg.c === RCS file: /c

boot/zboot: cmd.c merge

2014-06-29 Thread Tobias Stoeckmann
tand/zboot, too. Greatly reduces diff-Output between these files: Just "clear" command, the same way it was back then. "cc -c" works for zaurus' cmd.c. I don't have a zaurus, so it would be nice if a zaurus owner can test these changes. T

kill unused macppc system_type

2014-06-29 Thread Tobias Ulmer
grep and make agree that this stuff is unused. Index: arch/macppc/include/autoconf.h === RCS file: /home/vcs/cvs/openbsd/src/sys/arch/macppc/include/autoconf.h,v retrieving revision 1.9 diff -u -p -r1.9 autoconf.h --- arch/macppc/incl

Re: kill unused macppc system_type

2014-06-29 Thread Tobias Ulmer
While I'm at it... Index: arch/macppc/include/autoconf.h === RCS file: /home/vcs/cvs/openbsd/src/sys/arch/macppc/include/autoconf.h,v retrieving revision 1.9 diff -u -p -r1.9 autoconf.h --- arch/macppc/include/autoconf.h 22 Aug 2

Re: boot/zboot: cmd.c merge

2014-06-30 Thread Tobias Stoeckmann
On Sun, Jun 29, 2014 at 08:40:53PM +0200, Tobias Stoeckmann wrote: > Greatly reduces diff-Output between these files: Just "clear" command, > the same way it was back then. After feedback from Theo, just kill clear command and therefore use cmd.c from stand/boot in zboot. Any za

fsck_msdos: memleak merge with NetBSD

2014-06-30 Thread Tobias Stoeckmann
also free memory if root directory checks fail - I use goto's instead of rewriting the code every single time - kept our local styles (like xperror vs perr) - after free, set values to NULL; better safe than sorry and also in sync with other fu

Re: boot/zboot: cmd.c merge

2014-07-04 Thread Tobias Stoeckmann
On Sun, Jun 29, 2014 at 08:40:53PM +0200, Tobias Stoeckmann wrote: > "cc -c" works for zaurus' cmd.c. I don't have a zaurus, so it would be > nice if a zaurus owner can test these changes. Got feedback from zaurus users. The Makefile was missing another change: It

Re: fsck_msdos: memleak merge with NetBSD

2014-07-08 Thread Tobias Stoeckmann
iables static that are not used anywhere else, easier to verify that there are no side-effects. This version looks definitely simpler. Tobias Index: dir.c === RCS file: /cvs/src/sbin/fsck_msdos/dir.c,v retrieving revision 1.23 diff

Re: boot/zboot: cmd.c merge

2014-07-11 Thread Tobias Stoeckmann
Anyone? On Fri, Jul 04, 2014 at 07:41:07PM +0200, Tobias Stoeckmann wrote: > On Sun, Jun 29, 2014 at 08:40:53PM +0200, Tobias Stoeckmann wrote: > > "cc -c" works for zaurus' cmd.c. I don't have a zaurus, so it would be > > nice if a zaurus owner can test th

syslogd: patch for CVE-2014-3634

2014-10-12 Thread Tobias Stoeckmann
orithm is used while reading from /dev/klog... Although I doubt that it's a practical attack vector, let's fix it for the sake of completeness. Thoughts? Okays? Tobias Index: syslogd.c === RCS file: /cvs/src/usr.sbin/syslogd

Re: syslogd: patch for CVE-2014-3634

2014-10-12 Thread Tobias Stoeckmann
without the check... I see your change now in revision 1.126. Yeah, that one is enough. Thanks for clarifying, my diff is useless then. Tobias

patch: crash on large files

2014-11-09 Thread Tobias Stoeckmann
nter. At least not common enough for me to actually address the limitations. Instead, just make sure that we properly bail out if lines are too long. Tobias Index: inp.c === RCS file: /cvs/src/usr.bin/patch/inp.c,v retrieving revision

Re: patch: crash on large files

2014-11-14 Thread Tobias Stoeckmann
Anyone into reviewing? Or suggestions? In short, this diff verifies that we don't try to write lines into the file buffer which are longer than the longest one allowed. Tobias > Index: inp.c > === > RCS file: /c

Re: locate - change sizeof(char **) to sizeof(char *)

2014-11-15 Thread Tobias Stoeckmann
On Sat, Nov 15, 2014 at 06:42:34PM +0100, Nicolas Bedos wrote: > dbv = malloc(sizeof(char **)) > > which I believe should be > > dbv = malloc(sizeof(char *)) Correct. While at it, we should also fix the examples in the comment. Tobias

patch: check patch file size

2014-11-16 Thread Tobias Stoeckmann
Hi, p_filesize is of type long, but we assign an off_t. Before assignment, check if it will fit. Also, check if fstat was successful or not. Tobias Index: pch.c === RCS file: /cvs/src/usr.bin/patch/pch.c,v retrieving revision

Re: patch: check patch file size

2014-11-16 Thread Tobias Stoeckmann
On Sun, Nov 16, 2014 at 09:39:32PM +0100, Alexander Bluhm wrote: > Can we change p_filesize type to off_t instead? Definitely, but it takes closer looks for a review. Diff exists, I was just not sure if it's worth to support patch files which are larger than 2 GB on 32 bit systems.

Re: patch: check patch file size

2014-11-17 Thread Tobias Stoeckmann
f_t for memory operations would definitely lead to possible issues. The variables which I adjust with this patch are exclusively used for fseek(o) and ftell(o), the others are still of type long. Thinking about it, ssize_t might be an option... Tobias

Re: less strlen in bgpctl

2014-11-17 Thread Tobias Stoeckmann
On Sun, Nov 16, 2014 at 06:38:24PM -0500, Ted Unangst wrote: > Not sure how I ended up reading this file, but all the redundant > strlen calls make me twitchy. I agree, but have you considered the other parser.c files with match_token and same use of strlen(word), too? src/usr.sbin/dvmrpctl/parse

ospf6ctl: memleak in parser

2014-11-17 Thread Tobias Stoeckmann
Hi, after using the temporary buffer "ps" for parse_addr, it is not released after successful operation. Tobias Index: parser.c === RCS file: /cvs/src/usr.sbin/ospf6ctl/parser.c,v retrieving revision 1.12 diff -u

patch: always validate hunk size

2014-11-17 Thread Tobias Stoeckmann
ng realloc() again and again until enough space is available. Instead, it calculates the size once and therefore calls the realloc()s only once, too. The point of this diff is to cover the cases in which MAXHUNKSIZE is not checked. Having a slightly better performance is just an additional benefit

patch: properly check NULL return values

2014-11-17 Thread Tobias Stoeckmann
; again. If it is in "plan b", it will call fatal instead. This means that savestr can return NULL. During initialization, we should use a xstrdup() function instead. If we don't have enough memory for initialization, "plan b&qu

patch: avoid reading after end of string

2014-11-18 Thread Tobias Stoeckmann
Hi, on a diff with a missing new line, it is possible that patch will read past the terminating NUL character. Tobias Index: pch.c === RCS file: /cvs/src/usr.bin/patch/pch.c,v retrieving revision 1.42 diff -u -p -r1.42 pch.c

Re: patch: avoid reading after end of string

2014-11-18 Thread Tobias Stoeckmann
thout a \n. I've inserted a printf into the loop to verify that we get past the \0. In general, nothing much will happen, because we won't get out of buf[] due to the previous lines. But it's still a bug. Tobias

patch: introduce strtolinenum (instead of atol)

2014-11-18 Thread Tobias Stoeckmann
ue Nov 18 19:57:47 2014 +++ b Tue Nov 18 19:57:49 2014 @@ -1 +1 @@ -a +b You can adjust the @@ numbers. Remove one, make it too large, etc. Tobias Index: common.h === RCS file: /cvs/src/usr.bin/patch/common.h,v retrieving re

patch: tedu sccs support

2014-11-19 Thread Tobias Stoeckmann
Hi, as we don't even have the "get" command in base, there is no need to support SCCS files anymore. I also remember that we removed the SCCS IDs from source files so... Time to tedu sccs? Tobias Index: common.h =

Re: patch: tedu sccs support

2014-11-20 Thread Tobias Stoeckmann
So whoever reads this: Reviewing my diffs would help me to make faster progress. Will have quite some time for patch development this week and next one, so the amount of diffs will be very likely higher than reviewing can happen. But every small review helps. :) Tobias

rcs: uninitialized pointer leads to segfault

2014-11-22 Thread Tobias Stoeckmann
ne at end of file Segmentation fault (core dumped) Tobias Index: usr.bin/cvs/rcsparse.c === RCS file: /cvs/src/usr.bin/cvs/rcsparse.c,v retrieving revision 1.8 diff -u -p -u -p -r1.8 rcsparse.c --- usr.bin/cvs/rcsparse.c 16 No

Re: rcs: uninitialized pointer leads to segfault

2014-11-22 Thread Tobias Stoeckmann
On Sat, Nov 22, 2014 at 11:45:02AM +0100, Tobias Stoeckmann wrote: > as jsg@ pointed out, rcs will segfault reliably when using malloc.conf with > 'J' (the pointer in question is filled with d0's). As Theo suggested, xcalloc will take care of this pointer and other struct

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-23 Thread Tobias Stoeckmann
recommend using fgetln for the actual line parsing. Then this kinda fragile code can be avoided (fragile: fgets and its users have a hard time to properly handle '\0' chars inside a file). See also: - fgetln(3) - http://undeadly.org/cgi?action=article&sid=20061027031811 Tobias

patch: fix segfault on revision + empty file

2014-11-24 Thread Tobias Stoeckmann
q: 1 @@ -1 +1 @@ -a +b $ rm a b; touch a b; $ patch -i b.diff Hmm... Looks like a unified diff to me... The text leading up to this was: -- |--- a Mon Nov 24 16:31:24 2014 |+++ b Mon Nov 24 16:31:26 2014 |Prereq: 1 -- Segmentation fa

paste: release file descriptors earlier

2014-11-24 Thread Tobias Stoeckmann
Hi, the function parallel() should release file descriptors just like sequential() does: If we reach EOF, close it -- except we were reading stdin. Tobias Index: paste.c === RCS file: /cvs/src/usr.bin/paste/paste.c,v retrieving

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-24 Thread Tobias Stoeckmann
st if there is a missing newline. And while at it, silently ignoring lines doesn't sound like a good idea. I would even go for an err() call; or at least warn(). Tobias

patch: add regression tests

2014-11-25 Thread Tobias Stoeckmann
Hi, the regress tests for patch only cover unified diffs so far. I guess nobody minds if I add 3 tests for: - normal diff - context diff - ed diff Tobias Index: Makefile === RCS file: /cvs/src/regress/usr.bin/patch/Makefile,v

patch: integer overflows and oob memory access

2014-11-25 Thread Tobias Stoeckmann
a $ patch a arch.diff Hmm... Looks like a unified diff to me... The text leading up to this was: -- |--- a Sat Nov 15 00:25:29 2014 |+++ b Sat Nov 15 00:06:50 2014 -- Patching file a using Plan A... Segmentation fault (core dumped) $ _ Tobias

Re: patch: properly check NULL return values

2014-11-26 Thread Tobias Stoeckmann
up behaves like savestr, calling fatal in case of out of memory situation -- regardless of "plan a" or "plan b". Tobias Index: patch.c === RCS file: /cvs/src/usr.bin/patch/patch.c,v retrieving revision 1.51 diff -u -

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-26 Thread Tobias Stoeckmann
ow abort when reading a pathname > exceeding PATH_MAX bytes on stdin If somebody else agrees with this diff, I'll adjust the last style-deviations and commit it. Tobias

syslogd: properly validate config

2014-11-27 Thread Tobias Stoeckmann
quot; > my.conf # syslogd -d -f $PWD/my.conf off & running init [priv]: msg PRIV_CONFIG_MODIFIED received [priv]: msg PRIV_OPEN_CONFIG received cfline("10.debug;syslog,user.info /var/log/messages", f, "*") # _ (this one j

Re: syslogd: properly validate config

2014-11-27 Thread Tobias Stoeckmann
On Thu, Nov 27, 2014 at 01:29:48PM -0700, Todd C. Miller wrote: > I think it would be better for decode() to just return -1 in this > case. The validation looks a bit like a magic number there, but this could prevent issues of other decode()-users, too... So yeah, I think that is worth it: Index

Re: syslogd: properly validate config

2014-11-27 Thread Tobias Stoeckmann
On Thu, Nov 27, 2014 at 09:52:29PM +0100, Tobias Stoeckmann wrote: > On Thu, Nov 27, 2014 at 01:29:48PM -0700, Todd C. Miller wrote: > > I think it would be better for decode() to just return -1 in this > > case. > > I think that is worth it: Not anymore. There is just

patch: Support long lines in Plan B

2014-11-29 Thread Tobias Stoeckmann
u want to regress-test, you can supply "-x 8" in PATCHOPTIONS to enforce Plan B. Keep in mind that test5 will fail because this debug option skips a check if the input file is available. Tobias Index: inp.c === RCS file: /

Re: patch: Support long lines in Plan B

2014-12-07 Thread Tobias Stoeckmann
Anyone? On Sat, Nov 29, 2014 at 05:40:31PM +0100, Tobias Stoeckmann wrote: > Hi, > > this diff doesn't just fix the "division by zero" for input files with > lines longer than 1023 chars in Plan B mode, it actually removes this > line limit! > > Before: &g

skgpio crash on i386 (#604)

2014-12-11 Thread Tobias Stoeckmann
ss1: 2 targets, initiator 0 sd1 at scsibus2 targ 1 lun 0: SCSI0 0/direct removable sd2 at scsibus2 targ 1 lun 1: SCSI0 0/direct removable vscsi0 at root scsibus3 at vscsi0: 256 targets softraid0 at root scsibus4 at softraid0: 256 targets sd3 at scsibus4 targ 1 lun 0: SCSI2 0/direct fixed sd3: 20479MB, 512 bytes/sector, 41942512 sectors root on sd3a (0e26887df1e997e9.a) swap on sd3b dump on sd3b Tobias

Re: skgpio crash on i386 (#604)

2014-12-11 Thread Tobias Stoeckmann
On Thu, Dec 11, 2014 at 08:21:12PM +, Miod Vallat wrote: > > Hi, > > > > I'm encountering system crash during boot with latest snapshot. Turns > > out that it works fine when I disable skgpio through UKC. > > Try this. Okay tobias@, too. ;) The system boots nicely again, thanks!

chmod: range checks

2014-12-12 Thread Tobias Stoeckmann
7;s okay due to automatic casting but definitely no clean code. Tobias Index: chmod.c === RCS file: /cvs/src/bin/chmod/chmod.c,v retrieving revision 1.31 diff -u -p -u -p -r1.31 chmod.c --- chmod.c 6 Oct 2014 17:37:34 -

Re: chmod: range checks

2014-12-12 Thread Tobias Stoeckmann
such a link (even though behavior is pretty obfuscated then). $ cd ~/bin $ which x which: x: Command not found. $ ln -s /bin/chmod x $ x usage: x [-h] [-R [-H | -L | -P]] group file ... $ _ Tobias

patch: fix arbitrary ed command allowance

2014-12-13 Thread Tobias Stoeckmann
execution. Example: $ ls ed.diff $ cat ed.diff 0a some text. . 1s/.// !/usr/bin/touch file.txt $ touch a $ patch a < ed.diff Hmm... Looks like an ed script to me... 0 ! 10 done $ ls a a.orig ed.diff file.txt $ _ Tobias Index: pch.c =

Re: patch: fix arbitrary ed command allowance

2014-12-13 Thread Tobias Stoeckmann
On Sat, Dec 13, 2014 at 10:57:42AM -0500, Daniel Dickman wrote: > > - (*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i' || *t > > == 's')) { > > + strchr("acdis", *t) != NULL) { > > > doesn't this change the semantics slightly? i haven't looked at the > contex

patch: safer temp file handling

2014-12-13 Thread Tobias Stoeckmann
iff # uses TMP_PAT for stdin buffer $ patch -x 8 < my.diff # most file operations Thoughts on this? Tobias Index: Makefile === RCS file: /cvs/src/usr.bin/patch/Makefile,v retrieving revision 1.4 diff -u -p -u -p -r1.4 Ma

compress: funopen error handling

2015-01-31 Thread Tobias Stoeckmann
Hi, this diff adds error handling for funopen() failure. I have also fixed a whitespace issue for proper intendation. Tobias Index: usr.bin/compress/zopen.c === RCS file: /cvs/src/usr.bin/compress/zopen.c,v retrieving revision

df: division by zero on invalid ext2fs

2015-03-01 Thread Tobias Stoeckmann
. The results can always be weird with broken file systems, but at least df won't crash. Tobias Index: ext2fs_df.c === RCS file: /cvs/src/bin/df/ext2fs_df.c,v retrieving revision 1.12 diff -u -p -r1.12 ext2fs_df.c --- bin

Re: qsort.3 big O notation

2015-03-03 Thread Tobias Stöckmann
> On March 3, 2015 at 5:48 PM frantisek holop wrote: > > If anything, it should be "log" because that is the name of the > > mathematical function. libm is completely irrelevant in this context. > > 'lg' is also a valid name When talking about big O notation, you want to trim as many constants a

libssl: signal races in capability checks

2015-03-14 Thread Tobias Stoeckmann
be syntax errors. Yet I really need peer reviews. If somebody dares to look at signals: Now is the time! :) Tobias Index: armcap.c === RCS file: /cvs/src/lib/libssl/src/crypto/armcap.c,v retrieving revision 1.6 diff -u -p -r1.6 armcap.c --

awk: out of bounds error

2015-03-25 Thread Tobias Ulmer
ss10:~$ awk -f foo awk: can't open file foo source line number 1 source file foo context is >>> ÿ <<< Oh look, the international sign for buffer overflow. Don't print context when ebuf is empty --- lib.c.orig Wed Mar 25 17:11:49 2015 +++ lib.c Wed Mar 25 17:11:27 2015 @@ -64

tail: -r mem leak with non-regular files

2015-03-26 Thread Tobias Stoeckmann
tem (tl) or space for its content (tl->l), it won't simply err() out but tries to recover. Yet, it doesn't free tl if allocation of tl->l failed. Tobias Index: reverse.c === RCS file: /cvs/src/usr.bin/tail/reverse.c,v

Re: tail: -r mem leak with non-regular files

2015-03-27 Thread Tobias Stoeckmann
On Thu, Mar 26, 2015 at 11:41:23PM +0100, Tobias Stoeckmann wrote: > The less obvious one is in an error path. As tl->l is always of fixed size (BSZ), we can just change the struct to have a BSZ sized array in it. This removes the need to do checks in the error path completely. While

patch: safer temp file handling

2015-03-29 Thread Tobias Stoeckmann
ast file operations $ patch -x 8 -i my.diff# uses TMP_IN for plan b buffer $ patch < my.diff# uses TMP_PAT for stdin buffer $ patch -x 8 < my.diff# most file operations Thoughts on this? Tobias Index: Makefile ===

Re: sort output file permissions

2015-03-31 Thread Tobias Stoeckmann
Setting permissions without setting owner and group can have rather inconvenient results. See this example with latest code: $ touch test $ chgrp wheel test $ chmod g+w test $ ls -l test -rw-rw-r-- 1 tobias wheel 0 Mar 31 20:05 test $ ./sort -o test test $ ls -l test -rw-rw-r-- 1 tobias

sort: useless use of cat

2015-03-31 Thread Tobias Stoeckmann
I see a useless use of cat in here. Manual page: When called with the -d option, it must decompress standard input to standard output. Index: file.c === RCS file: /cvs/src/usr.bin/sort/file.c,v retrieving revision 1.4 diff -u -p -u -

sort: another mkstemp use case

2015-04-01 Thread Tobias Stoeckmann
When creating a new temporary file name, use mkstemp instead of just taking a rather predictable path, which could even be a symlink by a malicious user (granted, that is very unlikely). Index: file.c === RCS file: /cvs/src/usr.bin/so

tail: -r mem leak with non-regular files

2015-07-12 Thread Tobias Stoeckmann
ess obvious one is in an error path. As tl->l is always of fixed size (BSZ), we can just change the struct to have a BSZ sized array in it. This removes the need to do checks in the error path completely. While at it, there is no use to have a typedef in the code, so I just removed it, too.

Thinkpad active cooling

2015-07-14 Thread Tobias Ulmer
As we all know, some Thinkpads have problems with their EC fan control. EC is not spinning up the fans to maximum speed, let alone blast mode. They also do not offer ACPI methods to spin the fan up. Previous diffs doing manual fan control were always rejected because hooking into the sensors frame

Re: Thinkpad active cooling

2015-07-14 Thread Tobias Ulmer
Theo is asking for affected models, so lets compile a list. All my Thinkpads can be provoked into shutdown due to overtemp because the fan doesn't spin up: T60 T61 X201

Re: Thinkpad active cooling

2015-07-14 Thread Tobias Ulmer
On Wed, Jul 15, 2015 at 05:12:41AM +0300, Paul Irofti wrote: > I am not familiar with all the fan hack specifics so please keep that in mind > if my questions and comments seem trivial. > > > This is an attempt to solve the problem slightly differently. > > - Hook into acpitz and only speed the fa

Re: Thinkpad active cooling

2015-07-14 Thread Tobias Ulmer
On Wed, Jul 15, 2015 at 12:03:45AM -0400, Ted Unangst wrote: > Tobias Ulmer wrote: > > As we all know, some Thinkpads have problems with their EC fan control. > > EC is not spinning up the fans to maximum speed, let alone blast mode. > > They also do not offer ACPI metho

Re: Thinkpad active cooling

2015-07-19 Thread Tobias Ulmer
On Fri, Jul 17, 2015 at 08:54:26PM +0200, Mark Kettenis wrote: > Tobias Ulmer schreef op 2015-07-15 02:33: > >As we all know, some Thinkpads have problems with their EC fan control. > >EC is not spinning up the fans to maximum speed, let alone blast mode. > >They also do not

Re: mfi(4): use 64-bit frames (unconditionally?)

2011-03-14 Thread Tobias Weingartner
On Monday, March 14, Jacob Meuser wrote: > > so, the question is, is the impact on i386 enough to warrant using > 32-bit frames on 32-bit platforms? if so, should this be decided > at runtime or compile time? > > any other thoughts? IMHO, simpler is better, and i386 may have PAE so more than 4G

Re: top, systat and hw.cpuspeed

2011-03-23 Thread Tobias Weingartner
On Wednesday, March 23, David Vasek wrote: > > As majority of current hardware use some form of dynamic CPU frequency > scaling and it is frequently controlled by ampd, wouldn't it be good to > have the current hw.cpuspeed displayed somewhere in the header lines of > systat(1) and top(1)? Just

  1   2   3   4   5   6   >