Re: pvbus: pass M_ZERO properly

2022-12-21 Thread Michael Knudsen
On Wed, Dec 21, 2022 at 01:08:14PM +0100, Claudio Jeker wrote: > In general I think finding such errors quickly would be nice. > Is there a way to make this a compile time error? I guess that requires > some ugly macro magic. I agree a compile time check would be better but I don't have a good ide

Re: pvbus: pass M_ZERO properly

2022-12-12 Thread Michael Knudsen
We can detect this class of error by redefining the flags to use the high bits instead of the low ones. This way the malloc() KMEMSTAT value check triggers because 0x1000 is greater than the maximum type value. I tested the following, and it boots fine, and when I moved M_ZERO to the type fie

Re: Add support for hex floats to *scanf

2021-05-13 Thread Michael Forney
On 2021-04-03, Michael Forney wrote: > On 2020-01-28, Michael Forney wrote: >> On 2019-05-28, Michael Forney wrote: >>> I noticed that OpenBSD's fscanf doesn't yet support hex float strings, >>> which are standardized in C99. I am using them in my applicati

Re: Add support for hex floats to *scanf

2021-04-03 Thread Michael Forney
On 2020-01-28, Michael Forney wrote: > On 2019-05-28, Michael Forney wrote: >> I noticed that OpenBSD's fscanf doesn't yet support hex float strings, >> which are standardized in C99. I am using them in my application (which >> I would like to support OpenBSD), sin

Re: ksh tab completion bug

2020-11-10 Thread Michael Forney
ksh/edit/emacs.sh. Tricky logic like this should be covered > in my opinion. Below is a rough diff how to test file name completion. I'm using OpenBSD's ksh through oksh, which does not contain the regress tests. I think I'd have to get an OpenBSD VM up and running in order to cont

ksh tab completion bug

2020-11-09 Thread Michael Forney
I noticed some strange behavior of ksh in emacs mode when completing file names that contain spaces (or other characters that need escaping). To illustrate the problem, consider two files 'a b c test1' and 'a b c test2'. ksh will correctly complete `a` and `a\ b\ c\ ` to the common prefix `a\ b\ c

Re: ksh: Use typedef for function pointer

2020-05-08 Thread Michael Forney
On 2020-05-08, Jeremie Courreges-Anglas wrote: > Out of curiosity, do you run (o)ksh on machines where this matters? Yes, my C compiler (https://sr.ht/~mcf/cproc/) follows the standard fairly strictly. > Aside from the increased portability, the code doesn't look worse, and > fewer uses of void

ksh: Use typedef for function pointer

2020-05-07 Thread Michael Forney
I originally submitted this patch as a portability fix to Brian Callahan's oksh, but he suggested I submit it here instead. Conversion of function pointer to void pointer is not allowed in ISO C, though POSIX requires it for dlsym(). However, here we are also comparing function pointer to void poi

ntpd: prevent duplicate definitions of `conf` and `ibus_dns`

2020-04-04 Thread Michael Forney
This prevents a linking error with gcc 10, which enables -fno-common by default. ISO C requires exactly one definition of objects with external linkage throughout the entire program. `conf` is already defined in ntpd.c and declared extern in ntpd.h, so the definition in parse.y is redundant. The

acme-client: prevent duplicate definitions of global variables

2020-01-31 Thread Michael Forney
Every source file that includes extern.h will have its own definition of these variables. Since many compilers allocate the variables with .comm, they end up getting merged by the linker without error. However, ISO C requires exactly one definition of objects with external linkage. gcc 10 will ena

Re: Add support for hex floats to *scanf

2020-01-28 Thread Michael Forney
On 2019-05-28, Michael Forney wrote: > I noticed that OpenBSD's fscanf doesn't yet support hex float strings, > which are standardized in C99. I am using them in my application (which > I would like to support OpenBSD), since the "%a" format specifier is a > conv

[PATCH libssl] Fix typo in man page

2019-12-02 Thread Michael Forney
--- src/lib/libssl/man/SSL_CTX_set_cipher_list.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/libssl/man/SSL_CTX_set_cipher_list.3 b/src/lib/libssl/man/SSL_CTX_set_cipher_list.3 index 64da0092d..6f15dbaaa 100644 --- a/src/lib/libssl/man/SSL_CTX_set_cipher_list.3

Re: flex: dead code around flex_die()

2019-11-10 Thread Michael Mikonos
Ping, in case anyone would like to comment. On Thu, Oct 31, 2019 at 08:55:46AM +0800, Michael Mikonos wrote: > Hello, > > The macro flex_die(), defined in flexdef.h, never returns. > Instead it does FLEX_EXIT() which longjmp()s back to flex_main() > before exiting. > The follo

flex: dead code around flex_die()

2019-10-30 Thread Michael Mikonos
Hello, The macro flex_die(), defined in flexdef.h, never returns. Instead it does FLEX_EXIT() which longjmp()s back to flex_main() before exiting. The following patch removes some dead code, as statements after flex_die() are never reached. Does this look OK? - Michael Index: tables.c

flex HAVE_DECL___FUNC__

2019-10-28 Thread Michael Mikonos
Hello, When reviewing flex's config.h I think we could enable HAVE_DECL___FUNC__. This allows the flex_die() macro to include __func__ in its output. For example: flex: fatal internal error at main.c:146 (flex_main): spooky error Does this look OK? - Michael Index: con

Re: assert() triggered in flex

2019-09-21 Thread Michael Mikonos
On Tue, Sep 17, 2019 at 11:56:26PM +0800, Michael Mikonos wrote: > Hello, > > I was wondering why fuzz input was sometimes crashing flex(1). > Now that assert() is enabled in the build I am able to > trigger it with the following input. > > $ cat

assert() triggered in flex

2019-09-17 Thread Michael Mikonos
g in this case. It looks like this for the test file: $ lex -d - < test.l :7: ')' with no matching '(' Before assert() was enabled, calling sf_pop() would wrap the array index _sf_top_ix from 0 to 0x and a SEGV could happen later. Does this look OK? - Michael Inde

Re: assert() missing in flex

2019-09-16 Thread Michael Mikonos
On Mon, Sep 16, 2019 at 11:38:30AM +0200, Marc Espie wrote: > On Mon, Sep 16, 2019 at 05:07:21PM +0800, Michael Mikonos wrote: > > Hello, > > > > When building flex on clang 8.0.1 (i386) I noticed that assert() > > expands to nothing. This happens because of a fallbac

assert() missing in flex

2019-09-16 Thread Michael Mikonos
-DHAVE_SOMETHING. Does this look OK? - Michael Index: Makefile === RCS file: /cvs/src/usr.bin/lex/Makefile,v retrieving revision 1.17 diff -u -p -u -r1.17 Makefile --- Makefile30 Apr 2017 20:30:39 - 1.17 +++ Makefile

Re: flex {c,m}alloc() checks

2019-08-28 Thread Michael Mikonos
> I'd say go for the x* solution, > > -Otto Sure. When I looked at this again there are also realloc() return value checks missing, so I added xcalloc(), xmalloc() and xrealloc(). An old (unused) function yy_flex_xmalloc() gets removed. When building this I checked the resulting .o files us

Re: flex {c,m}alloc() checks

2019-08-27 Thread Michael Mikonos
On Sun, Aug 25, 2019 at 02:58:47PM +0200, Otto Moerbeek wrote: > On Sun, Aug 25, 2019 at 08:32:04PM +0800, Michael Mikonos wrote: > > > Hello, > > > > I noticed that flex is too trusting and assumes > > calloc/malloc will always succeed. Hopefully I > > caugh

flex {c,m}alloc() checks

2019-08-25 Thread Michael Mikonos
Hello, I noticed that flex is too trusting and assumes calloc/malloc will always succeed. Hopefully I caught all of them. I tried to follow the existing idiom of calling flexerror() and passing strings via the _() macro. OK? - Michael Index: dfa.c

ansify flex

2019-08-25 Thread Michael Mikonos
Hello, Upstream flex already updated function declarations to ANSI. The following patch applies this change to the in-tree version. Does it look OK? - Michael Index: ccl.c === RCS file: /cvs/src/usr.bin/lex/ccl.c,v retrieving

Need Help with OpenBSD VPS

2019-08-17 Thread Michael G Workman
lso trying to get help on openbsd IRC channel on freenode. I could really use some help with this issue, I want to start working with OpenBSD right away. Thank you. *Michael G. Workman* (321) 432-9295 michael.g.work...@gmail.com

Re: vxlan(4) regression

2019-07-18 Thread Michael Graves
On 2019-07-17 11:41, Martin Pieuchot wrote: Hello Michael, On 17/07/19(Wed) 08:59, Michael Graves wrote: I think I have found a possible regression introduced in if_bridge.c at version 1.323. So the bug is not present at revision 1.322? I still have the problem with revision 1.322 so I

vxlan(4) regression

2019-07-17 Thread Michael Graves
Hello I think I have found a possible regression introduced in if_bridge.c at version 1.323. Using the following setup C1 - R1 -+ (em1 - bridge0 - vxlan0 - em0 )| LAN

Add support for hex floats to *scanf

2019-05-28 Thread Michael Forney
I noticed that OpenBSD's fscanf doesn't yet support hex float strings, which are standardized in C99. I am using them in my application (which I would like to support OpenBSD), since the "%a" format specifier is a convenient way to preserve the exact floating point value. strtod already supports p

Re: rip_usrreq() style tweak

2019-02-21 Thread Michael Mikonos
On Thu, Feb 21, 2019 at 04:58:08PM +0100, Jeremie Courreges-Anglas wrote: > On Thu, Feb 21 2019, Michael Mikonos wrote: > > Hello, > > > > Is it OK to merge the PRU_CONNECT2 case into the generic > > "not supported" case in {rip,rip6}_usrreq()? > > If

rip_usrreq() style tweak

2019-02-21 Thread Michael Mikonos
Hello, Is it OK to merge the PRU_CONNECT2 case into the generic "not supported" case in {rip,rip6}_usrreq()? If anything this allows the reader to see all the unsupported requests in one place. - Michael Index: netine

installboot: explicit free() in bootstrap()

2018-11-07 Thread Michael Mikonos
sn't break anything? - Michael Index: bootstrap.c === RCS file: /cvs/src/usr.sbin/installboot/bootstrap.c,v retrieving revision 1.10 diff -u -p -u -r1.10 bootstrap.c --- bootstrap.c 1 Sep 2018 16:55:29 - 1.10 +++ bootstr

Re: parse.y: strndup() in cmdline_symset()

2018-11-06 Thread Michael Mikonos
ping? On Thu, Nov 01, 2018 at 04:14:53PM +0800, Michael Mikonos wrote: > Hello, > > When I updated cmdline_symset() in parse.y in the following commit > I missed src/sbin/{iked,ipsecctl,pfctl}/parse.y. OK to update them? > > https://marc.info/?l=openbsd-cvs&m=15363107950

Re: installboot: double free

2018-11-06 Thread Michael Mikonos
On Tue, Nov 06, 2018 at 10:20:34AM +0100, Otto Moerbeek wrote: > On Tue, Nov 06, 2018 at 04:35:05PM +0800, Michael Mikonos wrote: > > > Hello, > > > > In installboot's fileprefix() function r is the return value > > of realpath(). If snprintf() fails free(r) h

installboot: double free

2018-11-06 Thread Michael Mikonos
Hello, In installboot's fileprefix() function r is the return value of realpath(). If snprintf() fails free(r) happens twice--- the second time is at label "err". From what I see the behavior was introduced in util.c revision 1.12. Does this fix look OK? - Michael

parse.y: strndup() in cmdline_symset()

2018-11-01 Thread Michael Mikonos
Hello, When I updated cmdline_symset() in parse.y in the following commit I missed src/sbin/{iked,ipsecctl,pfctl}/parse.y. OK to update them? https://marc.info/?l=openbsd-cvs&m=153631079505256&w=2 Index: iked/parse.y === RCS file:

Re: Qcow2: Clean up logging/error handling

2018-10-24 Thread Michael Mikonos
On Tue, Oct 23, 2018 at 09:44:24PM -0700, Ori Bernstein wrote: > This patch turns most warnings into errors, and uses the > appropriate fatal/fatalx so that we don't print bogus error > strings. It also adds checks for unsupported refcount sizes > and writes that clobber the header. > > Ok? Hello

Re: Qcow2 Disk Size Fix.

2018-10-23 Thread Michael Mikonos
On Mon, Oct 22, 2018 at 11:54:34PM -0700, Ori Bernstein wrote: > On Mon, 22 Oct 2018 22:57:39 -0700, Ori Bernstein wrote: > > > While I'm at it, this patch fixes up a few nits around logging, where > > warn was used instead of warnx, leading to some bogus error strings > > being printed, and adds

smtpd.conf manpage typo

2018-10-07 Thread Michael Mikonos
OK? Index: smtpd.conf.5 === RCS file: /cvs/src/usr.sbin/smtpd/smtpd.conf.5,v retrieving revision 1.205 diff -u -p -u -r1.205 smtpd.conf.5 --- smtpd.conf.524 Sep 2018 16:14:34 - 1.205 +++ smtpd.conf.58 Oct 2018

Re: yacc + unveil

2018-10-07 Thread Michael Mikonos
Hello, Forwarding a newer patch that I came up with. This time unveil()s are done before pledge() so no subsequent pledge() is needed to remove the unveil promise. * temporary files are created & unlinked in /tmp, so unveil the directory * output_file_name is either -o PATH or the default of CWD/

Re: csh: memory leak in setDolp()

2018-10-04 Thread Michael Mikonos
BTW the leak happens when a pattern in variable modifier s/// is not found. $ set a="test" $ echo $a:s/badpattern// test Any objections if I commit this? On Thu, Sep 20, 2018 at 12:30:05PM +0800, Michael Mikonos wrote: > Hello, > > In setDolp() pointers cp and dp initiall

unveil DPRINTF()

2018-09-26 Thread Michael Mikonos
Hello, As done in other parts of the kernel, introduce DPRINTF() macro to unveil. I think this is worth doing because the code is slightly more readable. OK? - Michael Index: kern_unveil.c === RCS file: /cvs/src/sys/kern

unveil manpage tweak 2

2018-09-25 Thread Michael Mikonos
Re-reading the unveil manual I found a typo which isn't flagged by a spell checker. Does anyone prefer just doing s/paths// though? Index: unveil.2 === RCS file: /cvs/src/lib/libc/sys/unveil.2,v retrieving revision 1.10 diff -u -p -u

Re: yacc + unveil

2018-09-25 Thread Michael Mikonos
On Tue, Sep 25, 2018 at 11:42:26PM +0800, Michael Mikonos wrote: > On Tue, Sep 25, 2018 at 05:25:54PM +0200, Sebastien Marie wrote: > > On Tue, Sep 25, 2018 at 11:15:43PM +0800, Michael Mikonos wrote: > > > On Tue, Sep 25, 2018 at 03:22:38PM +0100, Ricardo Mestre wrote: > >

Re: yacc + unveil

2018-09-25 Thread Michael Mikonos
On Tue, Sep 25, 2018 at 05:25:54PM +0200, Sebastien Marie wrote: > On Tue, Sep 25, 2018 at 11:15:43PM +0800, Michael Mikonos wrote: > > On Tue, Sep 25, 2018 at 03:22:38PM +0100, Ricardo Mestre wrote: > > > This is an example of better to start at just hoisting the code that &g

Re: yacc + unveil

2018-09-25 Thread Michael Mikonos
On Tue, Sep 25, 2018 at 03:22:38PM +0100, Ricardo Mestre wrote: > This is an example of better to start at just hoisting the code that > opens the many fds and put them all inside open_files(). After that it's > just a matter of calling pledge("stdio") and we are done. > > Of course that after thi

unveil manpage tweak

2018-09-24 Thread Michael Mikonos
This patch aligns unveil.2 with pledge.2, so the unveil manual will explicitly mention errno is set. OK? Index: unveil.2 === RCS file: /cvs/src/lib/libc/sys/unveil.2,v retrieving revision 1.9 diff -u -p -u -r1.9 unveil.2 --- unveil.2

Re: yacc + unveil

2018-09-24 Thread Michael Mikonos
On Mon, Sep 24, 2018 at 10:53:47PM -0600, Theo de Raadt wrote: > Ugh. A diff which doens't check error returns. Averting my gaze > is similar to "no way". Hope you have another quarter, because you > need to try again Oops... new coin inserted. I decided to create a fatal_perror() function whic

yacc + unveil

2018-09-24 Thread Michael Mikonos
MPDIR environment variable was previously removed. OK, or any suggestions? - Michael Index: main.c === RCS file: /cvs/src/usr.bin/yacc/main.c,v retrieving revision 1.29 diff -u -p -u -r1.29 main.c --- main.c 25 May 2017 20:11:03

csh: quoted string treated as a glob in switch

2018-09-23 Thread Michael Mikonos
he string (Char *) returned by Dfix1() to lose its QUOTE flag. When Gmatch()/pmatch() sees the QUOTE flag it knows to not treat the case argument as a glob. Thanks to Prashant Satish for helping to debug this. OK? - Michael Index: func.c ===

csh: memory leak in setDolp()

2018-09-19 Thread Michael Mikonos
Hello, In setDolp() pointers cp and dp initially point to the same copied string, but later dp can become NULL if Strstr() finds no match. The copied string is not freed in this case. NetBSD added this fix in their dol.c revision 1.23 (2006). OK? - Michael Index: dol.c

Re: csh: avoid using uninitialized stat buffer

2018-09-19 Thread Michael Mikonos
On Wed, Sep 19, 2018 at 09:19:22AM -0600, Todd C. Miller wrote: > When getcwd() fails, the stat buffer 'swd' is used uninitialized > by the else clause. Since it is used in both clauses we should > perform the stat before the if(). > > However, fixing this causes 'cp' to be unitialized in some ca

smtpctl.8 typo

2018-09-17 Thread Michael Mikonos
Hello, My spell-checker found the following typo this morning. OK? - Michael Index: smtpctl.8 === RCS file: /cvs/src/usr.sbin/smtpd/smtpctl.8,v retrieving revision 1.63 diff -u -p -u -r1.63 smtpctl.8 --- smtpctl.8 14 May 2018 15

csh: remove macros xmalloc,xcalloc,xreallocarray

2018-09-17 Thread Michael Mikonos
Hello, In csh(1) the functions Malloc(), Calloc() & Reallocarray() are always called via the macros (which don't really do anything). This patch renames the functions and deletes the macros. Does this look OK? - Michael Ind

Re: csh: simplify strsave()

2018-09-17 Thread Michael Mikonos
On Mon, Sep 17, 2018 at 09:06:16AM -0600, Todd C. Miller wrote: > On Mon, 17 Sep 2018 15:53:06 +0200, Martijn van Duren wrote: > > > It should be safe. There are 5 instances where any() isn't called with > > a string literal: > > Thanks for checking. OK millert@ for the diff. > > - todd Also

Re: csh: simplify strsave()

2018-09-15 Thread Michael Mikonos
On Sat, Sep 15, 2018 at 06:16:42AM -0600, Todd C. Miller wrote: > On Sat, 15 Sep 2018 12:42:22 +0200, Martijn van Duren wrote: > > > While here, should we also remove any in favour of strchr? Only > > difference seems to be the return type (bool vs pointer). > > Note that any(NULL, ch) is safe wh

Re: csh: simplify strsave()

2018-09-14 Thread Michael Mikonos
On Sat, Sep 08, 2018 at 10:13:35AM +0200, Martijn van Duren wrote: > On 09/08/18 04:57, Michael Mikonos wrote: > > Hello, > > > > The function strsave() in csh(1) is practically strdup(3). > > The only difference is memory allocation failure results in > > cal

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-13 Thread Michael Mikonos
On Thu, Sep 13, 2018 at 11:10:50PM -0700, Ori Bernstein wrote: > On Fri, 14 Sep 2018 13:50:40 +0800, Michael Mikonos wrote: > > > On Thu, Sep 13, 2018 at 10:08:16PM -0700, Ori Bernstein wrote: > > > On Thu, 13 Sep 2018 10:30:54 +0800, Michael Mikonos wrote: > > >

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-13 Thread Michael Mikonos
On Thu, Sep 13, 2018 at 10:08:16PM -0700, Ori Bernstein wrote: > On Thu, 13 Sep 2018 10:30:54 +0800, Michael Mikonos wrote: > > > Thanks for the explanation. Overall it seems better having the > > clean-up code localised in qc2_close() so I'm happy to OK the > > pa

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-12 Thread Michael Mikonos
On Wed, Sep 12, 2018 at 11:33:11AM -0700, Ori Bernstein wrote: > On Wed, 12 Sep 2018 15:36:32 +0800 > Michael Mikonos wrote: > > > On Wed, Sep 12, 2018 at 12:13:35AM -0700, Ori Bernstein wrote: > > > On Tue, 11 Sep 2018 23:29:53 -0700, Ori Bernstein > > > wrot

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-12 Thread Michael Mikonos
On Wed, Sep 12, 2018 at 12:13:35AM -0700, Ori Bernstein wrote: > On Tue, 11 Sep 2018 23:29:53 -0700, Ori Bernstein wrote: > > > static ssize_t > > @@ -362,8 +377,9 @@ qc2_close(void *p) > > struct qcdisk *disk; > > > > disk = p; > > - pwrite(disk->fd, disk->l1, disk->l1sz, disk->l1of

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-11 Thread Michael Mikonos
On Tue, Sep 11, 2018 at 11:25:52AM -0700, Ori Bernstein wrote: > On Tue, 11 Sep 2018 15:36:49 +0800 > Michael Mikonos wrote: > > > Hello, > > > > Sometimes vmd doesn't seem to check the result of malloc/calloc. > > I tried to preserve the existing beh

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-11 Thread Michael Mikonos
On Tue, Sep 11, 2018 at 03:36:49PM +0800, Michael Mikonos wrote: > Hello, > > Sometimes vmd doesn't seem to check the result of malloc/calloc. > I tried to preserve the existing behavour w.r.t. return values > for the functions modified; some functions returned 1 on error >

vmd: add some NULL checks after {c,m}alloc()

2018-09-11 Thread Michael Mikonos
Hello, Sometimes vmd doesn't seem to check the result of malloc/calloc. I tried to preserve the existing behavour w.r.t. return values for the functions modified; some functions returned 1 on error while others return -1. Does this look correct? - Michael Index: loadfile_

Re: pfctl: introduce copy_sa()

2018-09-10 Thread Michael Mikonos
On Mon, Sep 10, 2018 at 12:16:57PM +0200, Klemens Nanni wrote: > On Mon, Sep 10, 2018 at 11:59:55AM +0200, Klemens Nanni wrote: > > Small helper to put the dance around `af' into one single location. > Wrong/bad diff, please disregard. > I was just about to reply that the size in the memcpy() migh

csh: simplify strsave()

2018-09-07 Thread Michael Mikonos
() in terms of calling stderror(). Does this look OK? - Michael Index: misc.c === RCS file: /cvs/src/bin/csh/misc.c,v retrieving revision 1.20 diff -u -p -u -r1.20 misc.c --- misc.c 20 Jun 2017 16:44:06 - 1.20 +++ misc.c

Re: csh: blkfree() usage

2018-09-07 Thread Michael Mikonos
ping. On Thu, Aug 30, 2018 at 12:20:37AM +0800, Michael Mikonos wrote: > Hello, > > In csh(1) the function blkfree() behaves like free(3) and > performs no action if its argument is NULL, so the caller > can avoid checking. > > I lightly tested the following patch on i38

umidi(4) jack count

2018-09-06 Thread Michael Mikonos
this look OK? - Michael Index: umidi.c === RCS file: /cvs/src/sys/dev/usb/umidi.c,v retrieving revision 1.47 diff -u -p -u -r1.47 umidi.c --- umidi.c 6 Sep 2018 09:48:23 - 1.47 +++ umidi.c 6 Sep 2018 16:24:22 -

umidi(4) alloc_all_endpoints_fixed_ep()

2018-09-06 Thread Michael Mikonos
Hello, In the umidi(4) driver the function alloc_all_endpoints_fixed_ep() returns USBD_NOMEM if mallocarray() fails, but the return value is always USBD_INVAL when 'goto error' happens. OK? - Michael Index: umidi.c ==

icmp6_mtudisc_clone() tweak

2018-09-04 Thread Michael Mikonos
Hello, The code executed on failure in icmp6_mtudisc_clone() is always the same so it can be declared in one place. Is anyone happy to OK this? - Michael Index: icmp6.c === RCS file: /cvs/src/sys/netinet6/icmp6.c,v retrieving

Re: smtpd: malloc+strlcpy -> strndup

2018-09-03 Thread Michael Mikonos
On Mon, Sep 03, 2018 at 02:24:49PM +0800, Michael Mikonos wrote: > On Sat, Sep 01, 2018 at 11:31:49PM +0200, Gilles Chehade wrote: > > On Sat, Sep 01, 2018 at 09:20:59PM +0800, Michael Mikonos wrote: > > > Hello, > > > > > > Replace a malloc+st

Re: smtpd: malloc+strlcpy -> strndup

2018-09-02 Thread Michael Mikonos
On Sat, Sep 01, 2018 at 11:31:49PM +0200, Gilles Chehade wrote: > On Sat, Sep 01, 2018 at 09:20:59PM +0800, Michael Mikonos wrote: > > Hello, > > > > Replace a malloc+strlcpy with strndup in cmdline_symset(). > > Parameter s is a "keyname=value" str

smtpd: malloc+strlcpy -> strndup

2018-09-01 Thread Michael Mikonos
call symset() with an empty string. Possibly it could also return -1 if len is zero. Thoughts? - Michael Index: parse.y === RCS file: /cvs/src/usr.sbin/smtpd/parse.y,v retrieving revision 1.218 diff -u -p -u -r1.218 parse.y --- par

smtpd: smtp_client_state() error message

2018-09-01 Thread Michael Mikonos
Hello, smtp_client_state() and smtp_client_response() both do switch (proto->state) ... but smtp_client_state() doesn't print the id of the bad state in the default case. This patch makes the fatalx() message the same for both. Does this look OK? - Michael Index: smtp_

Re: csh: blkfree() usage

2018-08-31 Thread Michael Mikonos
I also tested this patch on landisk, but this was mainly as an exercise to try a recent snapshot under the gxemul emulator (v0.6.0). On Thu, Aug 30, 2018 at 12:20:37AM +0800, Michael Mikonos wrote: > Hello, > > In csh(1) the function blkfree() behaves like free(3) and > performs no a

Re: [PATCH] qcow2 disk format

2018-08-30 Thread Michael Mikonos
return -1; The other error cases around it do "goto fail" which calls pthread_rwlock_unlock(). Should this do the same? - Michael

Re: update tradcpp to 0.5.2

2018-08-30 Thread Michael Mikonos
On Fri, Aug 31, 2018 at 12:57:14PM +1000, Jonathan Gray wrote: > update tradcpp to 0.5.2 > > release 0.5.2 (20160904) >- Fix typo in -U usage message, noticed by Joerg. >- Add a -debuglog option to send an execution trace to a file. > Intended to be used when debugging imake templates

csh: blkfree() usage

2018-08-29 Thread Michael Mikonos
() which seemed a bit awkward. Would anyone be willing to OK this? - Michael Index: csh.c === RCS file: /cvs/src/bin/csh/csh.c,v retrieving revision 1.43 diff -u -p -u -r1.43 csh.c --- csh.c 16 Dec 2017 10:27:21 - 1.43

move more code under UAUDIO_DEBUG

2018-08-20 Thread Michael W. Bombardieri
Hello, In uaudio_add_mixer() the number of input channels (ichs) is only used in a DPRINTF statement so the code to set its value can be excluded unless we're building a debug kernel. In my understanding uaudio_get_cluster_nchan() has no side effects. - Michael Index: uau

audio round_buffersize

2018-08-13 Thread Michael W. Bombardieri
hub.com/openbsd/src/blob/master/sys/dev/audio.c#L203 - Michael Index: auixp.c === RCS file: /cvs/src/sys/dev/pci/auixp.c,v retrieving revision 1.39 diff -u -p -u -r1.39 auixp.c --- auixp.c 8 Sep 2017 05:36:52 - 1.39 +++

uaudio(4) division by zero patch

2018-08-07 Thread Michael W. Bombardieri
ome device or by a usb fuzzer. - Michael Index: uaudio.c === RCS file: /cvs/src/sys/dev/usb/uaudio.c,v retrieving revision 1.131 diff -u -p -u -r1.131 uaudio.c --- uaudio.c30 Jul 2018 11:51:42 - 1.131 +++ uaudio.c7 A

if_mue.c: loop -> memset

2018-08-02 Thread Michael W. Bombardieri
Hello, When reading over the mue(4) code I noticed that memset() can be used for clearing hashtbl. Also the switch case for IFM_100_TX was the same code as for IFM_1000_T so it can be rolled into one. - Michael Index: if_mue.c

uaudioctl() shadow variable 'error'

2018-07-31 Thread Michael W. Bombardieri
s the same without them. Sorry if I got it wrong. - Michael Index: usb.c === RCS file: /cvs/src/sys/dev/usb/usb.c,v retrieving revision 1.119 diff -u -p -u -r1.119 usb.c --- usb.c 1 May 2018 18:14:46 - 1.119 +++ usb.c

remove uaudio_id_name()

2018-07-29 Thread Michael W. Bombardieri
Hello, The function uaudio_id_name() was used once for formatting a string and its return value was used to format a second string. By rolling the prepended letter "i" into the outer snprintf() the function can be removed entirely. Does this look correct? - Michael Index

uaudio: simplify free() usage

2018-07-22 Thread Michael W. Bombardieri
Hello, A few NULL checks before free() can be removed in uaudio. Immediately freeing the value returned by uaudio_io_terminaltype() seems a little strange but I didn't look into that further. - Michael Index: uaudio.c === RCS

xhci typo in comment

2018-07-16 Thread Michael W. Bombardieri
Hello, When studying some usb code I noticed a couple of the comments didn't read well. Does this look better? - Michael Index: xhci.c === RCS file: /cvs/src/sys/dev/usb/xhci.c,v retrieving revision 1.86 diff -u -p -u -

witness kernel - lock order reversal

2018-06-01 Thread Michael Price
Not sure where to send this. Let me know if another list is better. If this is more helpful with a snapshot kernel instead of the one I compiled let me know that as well. Michael Jun 1 16:17:10 ports /bsd: 1st 0x81d179b0 &sched_lock (&sched_lock) @ /usr/src/sys/kern/kern_syn

Re: eoip(4): MikroTik Ethernet over IP support

2018-05-28 Thread Michael W. Bombardieri
ecause it seems to set error=ENETRESET in that case (i.e. IFF_UP and IFF_RUNNING are both set). Is that difference intended? - Michael

Re: switchd: bzero -> memset

2018-04-03 Thread Michael W. Bombardieri
On Tue, Apr 03, 2018 at 10:20:42PM -0600, Theo de Raadt wrote: > Michael W. Bombardieri wrote: > > > Hello, > > > > switchd can just use memset instead of mixing memset with bzero. > > But does the util.c change need to be sync'ed with other tools? > >

switchd: bzero -> memset

2018-04-03 Thread Michael W. Bombardieri
Hello, switchd can just use memset instead of mixing memset with bzero. But does the util.c change need to be sync'ed with other tools? - Michael Index: ofp10.c === RCS file: /cvs/src/usr.sbin/switchd/ofp10.c,v retrieving rev

Re: interface queue transmit mitigation (again)

2018-03-27 Thread Michael Price
esearch on it. if they > moved to 16 there would be a reason for it. Would it be this commit? https://marc.info/?l=dragonfly-commits&m=151401707632544&w=2 Comments include test data. Michael

azalia(4) debug

2018-03-20 Thread Michael W. Bombardieri
Hello, In azalia_set_params_sub() the cmode variable is only used by DPRINTF() so we can avoid declaring it when debugging is not enabled. - Michael Index: azalia.c === RCS file: /cvs/src/sys/dev/pci/azalia.c,v retrieving revision

ksh: __func__ in warnings

2018-03-13 Thread Michael W. Bombardieri
Hello, Some errors and warnings printed by ksh have the function name prefixed. __func__ could be used here instead of hard-coding the name. The names are wrong for tty_init(), j_set_async(), j_change(), x_file_glob() and c_ulimit() afaics. - Michael Index: c_ksh.c

Re: More useful: something like doasedit (was: Utility to safely edit doas.conf)

2018-02-28 Thread Michael Price
Perhaps I am just dense, but what problem does sudoedit solve that is not easily solved with groups and chmod? Michael On Wed, Feb 28, 2018 at 12:57 PM Felix Maschek wrote: > Hi, > > to prevent privilege escalation by allowing 'sudo vi' (simple by > invoking a shell from

update ifstated parser

2018-02-26 Thread Michael Graves
Hello I use ifstated(8) to track the state of the the external interface that is configured via dhcp and based upon the state, (re)configure a VXLAN interface. The ifstated.conf currently looks like === exif="em0" vxif="vxlan0" init-state state_down state state_up { init { run "ifconf

Re: Dumping uaudio(4) frames

2018-02-20 Thread Michael W. Bombardieri
On Tue, Feb 20, 2018 at 03:05:33PM +0100, Martin Pieuchot wrote: > Diff below implements the USBPcap interface for dumping USB isochronous > frames. It can be very useful to analyze what the stack is doing. Note > that tcpdump(8)'s snaplen default is too small to capture such frames. I > used the

remove goto in rdioctl()

2018-01-28 Thread Michael W. Bombardieri
Hello, Function rdioctl() uses a goto to leave the switch statement but a break would be enough. There is no other code to jump over (avoid) as with rdstrategy() which has goto bad and goto done. - Michael Index: rd.c === RCS file

Re: Patch to libcrypto's X509_check_(host|email) functions to behave like documented

2018-01-23 Thread Michael Gmelin
On Fri, 19 Jan 2018 16:00:55 +0100 Michael Gmelin wrote: > ... > According to the X509_check_host(3) > (src/lib/libcrypto/man/X509_check_host.3), "The namelen argument must > be the number of characters in the name string or zero, in which case > the length is calculated wi

Patch to libcrypto's X509_check_(host|email) functions to behave like documented

2018-01-19 Thread Michael Gmelin
h strlen for test.example.org results in 1 After the patch (as expected): Check host without strlen for test.example.org results in 1 Check host with strlen for test.example.org results in 1 Best, Michael [0]https://github.com/libressl-portable/openbsd/pull/87 -- Michael Gmelin diff --git a/s

csh: calloc->malloc for new directory pointer

2018-01-14 Thread Michael W. Bombardieri
Hello, A fresh new 'struct directory' is allocated at three points in dir.c. This struct has four members: di_name, di_count, di_next and di_prev. For each instance all struct members are initialised immediately after the calloc(), so the new memory doesn't need to be cleared fi

Re: disabled code in ksh tree.c

2018-01-14 Thread Michael W. Bombardieri
On Sun, Jan 14, 2018 at 05:47:43PM +0100, Jeremie Courreges-Anglas wrote: > On Sun, Jan 14 2018, Anton Lindqvist wrote: > > On Thu, Jan 11, 2018 at 03:25:15PM +0800, Michael W. Bombardieri wrote: > >> Hello, > >> > >> Revision 1.9 of tree.c (from 1999) ad

ksh: unused param in print_expansions()

2018-01-11 Thread Michael W. Bombardieri
Hello, The local function print_expansions() is a wrapper for x_print_expansions(). Going back to revision 1.1 of vi.c reveals the command parameter wasn't used then either. - Michael Index: vi.c === RCS file: /cvs/src/bi

  1   2   3   4   5   6   7   >