Re: signify: -z implies -q

2019-07-25 Thread Mike Burns
On 2019-07-26 03.02.43 +, Mike Burns wrote:
> Poking around signify and learned that `verifyzdata` calls `verifymsg`
> with `1` hardcoded in the `quiet` parameter.
> 
> I do appreciate that there is a distinction between case 'z' setting
> `quiet = 1` vs `verifyzdata` passing `1` as an argument, so maybe this
> diff doesn't quiet capture a truth:

Now that I've played with signify more, it's clear that mentioning -q is
quite far from from a complete statement of what -z is all about, Forget
about this diff, apologies.



signify: -z implies -q

2019-07-25 Thread Mike Burns
Poking around signify and learned that `verifyzdata` calls `verifymsg`
with `1` hardcoded in the `quiet` parameter.

I do appreciate that there is a distinction between case 'z' setting
`quiet = 1` vs `verifyzdata` passing `1` as an argument, so maybe this
diff doesn't quiet capture a truth:

Index: signify.1
===
RCS file: /cvs/src/usr.bin/signify/signify.1,v
retrieving revision 1.47
diff -u -p -r1.47 signify.1
--- signify.1   8 May 2019 17:55:41 -   1.47
+++ signify.1   26 Jul 2019 02:56:10 -
@@ -129,7 +129,8 @@ Sign and verify
 archives, where the signing data
 is embedded in the
 .Xr gzip 1
-header.
+header. Implies
+.Fl q .
 .El
 .Pp
 The key and signature files created by



Re: enable middle button scrolling by default in ws(4) ?

2018-06-17 Thread Mike Burns
On 2018-06-16 18.19.35 +0200, Matthieu Herrb wrote:
> the ws(4) mouse driver has the option of emulating the mouse wheel
> on motion + a given button is generated.
> 
> This is active by default on button 2 on recent Linux systems (those
> using libinput).
> 
> Should OpenBSD's ws(4) activate it by default too ?

It breaks alt+button2+drag to resize windows (GNOME, MATE, compiz, KDE,
others). I have to turn it off whenever I use Linux. So this is a vote
for not enabling it by default on OpenBSD.



Re: arc4random unexpected results

2018-03-24 Thread Mike Burns
On 2018-03-24 21.05.56 -0500, Edgar Pettijohn wrote:
> #include 
> #include 
> #include 
> 
> int
> main(void)
> {
> uint32_t n = arc4random();
> 
> printf("arc4random %d\n", n);
> printf("abs %d\n", abs(n));
> 
> return 0;
> }
> 
> Which is well and good. However, I get the following output.
> 
> laptop$ ./a.out
> arc4random 247165650
> abs 247165650
> laptop$ ./a.out
> arc4random 2012715611
> abs 2012715611
> laptop$ ./a.out
> arc4random 222644175
> abs 222644175
> laptop$ ./a.out
> arc4random -843593186
> abs 843593186

// -

#include   
#include  
#include
  
#include

int
main(void)
{
uint32_t n = arc4random();

printf("arc4random %"PRIu32"\n", n);
printf("arc4random with %%d %d\n", n);
printf("abs %d\n", abs(n));

return 0;
}

//

output:

~% ./a.out
arc4random 1647540484
arc4random with %d 1647540484
abs 1647540484
~% ./a.out
arc4random 3569752639
arc4random with %d -725214657
abs 725214657


More docs:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/inttypes.h.html



Re: [PATCH] usr.bin/calendar/calendars/calendar.uk - Burns' Night -> Burns Night

2018-01-12 Thread Mike Burns
On 2018-01-12 20.11.37 +, Jason McIntyre wrote:
> > Burn's Hog Weighing Method:
> 
> hilariously, i just realised the apostrophe in the quote above is in the
> wrong place! maybe it should be "Burns Hog Weighing Method" ;)

The apostrophe should come after the s in this case.

-- 
Mike Burns



Re: background scan for iwn(4)

2017-12-13 Thread Mike Burns
On 2017-12-13 17.17.41 +0100, Stefan Sperling wrote:
> Since nobody is reporting problems with iwm(4), I took some time to write the
> corresponding diff for iwn(4) as well. I hope this increases test coverage :)
> 
> Works for me on:
> iwn0 at pci3 dev 0 function 0 "Intel Centrino Advanced-N 6200" rev 0x35: msi, 
> MIMO 2T2R, MoW

Nothing is broken on:

iwn0 at pci2 dev 0 function 0 "Intel Centrino Advanced-N 6205" rev 0x96:
msi, MIMO 2T2R, MoW, address 84:3a:4b:0a:ae:8

I only have the one AP. I tried to figure out how to make my phone into
an AP but my laptop didn't want to connect to it.

-Mike

> 
> Index: if_iwn.c
> ===
> RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
> retrieving revision 1.194
> diff -u -p -r1.194 if_iwn.c
> --- if_iwn.c  26 Oct 2017 15:00:28 -  1.194
> +++ if_iwn.c  13 Dec 2017 16:07:07 -
> @@ -222,7 +222,9 @@ int   iwn_config(struct iwn_softc *);
>  uint16_t iwn_get_active_dwell_time(struct iwn_softc *, uint16_t, 
> uint8_t);
>  uint16_t iwn_limit_dwell(struct iwn_softc *, uint16_t);
>  uint16_t iwn_get_passive_dwell_time(struct iwn_softc *, uint16_t);
> -int  iwn_scan(struct iwn_softc *, uint16_t);
> +int  iwn_scan(struct iwn_softc *, uint16_t, int);
> +void iwn_scan_abort(struct iwn_softc *);
> +int  iwn_bgscan(struct ieee80211com *);
>  int  iwn_auth(struct iwn_softc *, int);
>  int  iwn_run(struct iwn_softc *);
>  int  iwn_set_key(struct ieee80211com *, struct ieee80211_node *,
> @@ -516,6 +518,7 @@ iwn_attach(struct device *parent, struct
>   if_attach(ifp);
>   ieee80211_ifattach(ifp);
>   ic->ic_node_alloc = iwn_node_alloc;
> + ic->ic_bgscan_start = iwn_bgscan;
>   ic->ic_newassoc = iwn_newassoc;
>   ic->ic_updateedca = iwn_updateedca;
>   ic->ic_set_key = iwn_set_key;
> @@ -1761,18 +1764,20 @@ iwn_newstate(struct ieee80211com *ic, en
>   struct iwn_node *wn = (void *)ni;
>   int error;
>  
> - timeout_del(>calib_to);
> -
> - if (ic->ic_state == IEEE80211_S_RUN &&
> - (ni->ni_flags & IEEE80211_NODE_HT))
> + if (ic->ic_state == IEEE80211_S_RUN) {
>   ieee80211_mira_cancel_timeouts(>mn);
> + timeout_del(>calib_to);
> + sc->calib.state = IWN_CALIB_STATE_INIT;
> + if (sc->sc_flags & IWN_FLAG_BGSCAN)
> + iwn_scan_abort(sc);
> + }
>  
>   switch (nstate) {
>   case IEEE80211_S_SCAN:
>   /* Make the link LED blink while we're scanning. */
>   iwn_set_led(sc, IWN_LED_LINK, 10, 10);
>  
> - if ((error = iwn_scan(sc, IEEE80211_CHAN_2GHZ)) != 0) {
> + if ((error = iwn_scan(sc, IEEE80211_CHAN_2GHZ, 0)) != 0) {
>   printf("%s: could not initiate scan\n",
>   sc->sc_dev.dv_xname);
>   return error;
> @@ -1971,11 +1976,13 @@ iwn_rx_done(struct iwn_softc *sc, struct
>   struct ieee80211_frame *wh;
>   struct ieee80211_rxinfo rxi;
>   struct ieee80211_node *ni;
> + struct ieee80211_channel *bss_chan = NULL;
>   struct mbuf *m, *m1;
>   struct iwn_rx_stat *stat;
>   caddr_t head;
>   uint32_t flags;
>   int error, len, rssi;
> + uint8_t chan;
>  
>   if (desc->type == IWN_MPDU_RX_DONE) {
>   /* Check for prior RX_PHY notification. */
> @@ -2131,6 +2138,16 @@ iwn_rx_done(struct iwn_softc *sc, struct
>  
>   rssi = ops->get_rssi(stat);
>  
> + chan = stat->chan;
> + if (chan > IEEE80211_CHAN_MAX)
> + chan = IEEE80211_CHAN_MAX;
> +
> + if (ni == ic->ic_bss) {
> + bss_chan = ni->ni_chan;
> + /* Fix current channel. */
> + ni->ni_chan = >ic_channels[chan];
> + }
> +
>  #if NBPFILTER > 0
>   if (sc->sc_drvbpf != NULL) {
>   struct mbuf mb;
> @@ -2140,9 +2157,8 @@ iwn_rx_done(struct iwn_softc *sc, struct
>   tap->wr_flags = 0;
>   if (stat->flags & htole16(IWN_STAT_FLAG_SHPREAMBLE))
>   tap->wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
> - tap->wr_chan_freq =
> - htole16(ic->ic_channels[stat->chan].ic_freq);
> - chan_flags = ic->ic_channels[stat->chan].ic_flags;
> + tap->wr_chan_freq = htole16(ic->ic_channels[chan].ic_freq);
> + chan_flags = ic->ic_channels[chan].ic_flags;
>   if (ic->ic_curmode != IEEE80211_MODE_11N)
>   chan_flags &= ~IEEE80211_CHAN_HT;
>   tap->wr_chan_flags = htole16(chan_flags);
> @@ -2187,6 +2203,10 @@ iwn_rx_done(struct iwn_softc *sc, struct
>   rxi.rxi_tstamp = 0; /* unused */
>   ieee80211_input(ifp, m, ni, );
>  
> + /* Restore BSS channel. */
> + if (ni == ic->ic_bss)
> + ni->ni_chan = bss_chan;
> +
>   /* Node is no longer needed. */
>   

Re: Fix Wacom Intuos S 2 descriptor and make wsmouse work

2016-09-11 Thread Mike Burns
On 2016-09-11 16.14.44 +0200, Frank Groeneveld wrote:
> I've also made some progress regarding the scaling bug. It seems the
> device is not properly detached from Xorg when it is unplugged, because
> the log starts getting spammed with loads of messages like this:
> 
> [   202.482] (EE) ws: wacom: read error Input/output error
> 
> When I create an xorg.conf that only contains the wsmouse device of the
> Wacom tablet and disabled all other wsmouse devices,  I cannot controle
> the device anymore after plugging it in again. Without the xorg.conf I
> can control it, but with the wrong scale.
> 
> I think this difference is caused by the fact that the "all containing"
> /dev/wsmouse is still passing data to Xorg for the Wacom device, but
> the tablet specific /dev/wsmouse1 device is not. Switchting to a console
> somehow forces Xorg to reopen the /dev/wsmouse1 device which results in
> a working mouse pointer (or in good scaled mouse pointer movement in the
> case of not using an xorg.conf file to disable other wsmouse devices).
> 
> Does anybody see why the ws driver start to print these errors? Am I
> missing an important call on detachment?

It is quite likely related to this discussion:

http://marc.info/?l=openbsd-misc=140529029513846=2
http://marc.info/?l=openbsd-misc=140589215905202=2
http://marc.info/?l=openbsd-misc=141676273919602=2



Re: multitouch support again

2016-03-26 Thread Mike Burns
On 2016-03-24 22.34.12 +0100, Ulf Brosziewski wrote:
> Are there any reviews, tests, OKs, or NOs pending?

I'll add on to the list of: no regressions. I do not have the applicable
harware to try the multitouch.

(My status is unchanged: the touch screen works fine until
suspend/resume, and then X treats it like a mouse instead of a touch
screen.)

-Mike



Re: wc does not count last line if no trailing newline present

2015-11-04 Thread Mike Burns
On 2015-11-04 01.05.38 -0500, dan mclaughlin wrote:
> On Tue, 3 Nov 2015 21:01:36 -0800 Philip Guenther  wrote:
> > ...but it's not a bug.  wc's line count is required by POSIX to be a
> > count of the number of newline characters in the involved input.
> 
> out of curiosity, do you know why? some historic artifact?

https://gcc.gnu.org/ml/gcc/2003-11/msg01568.html

It's not a "source file" unless it ends with a newline. Somewhere along
the way "source file" -> "text file."



Re: Another use of areallocarray() in ksh

2015-11-01 Thread Mike Burns
On 2015-11-01 10.44.45 -0500, Michael McConville wrote:
> Index: history.c
> ===
> RCS file: /cvs/src/bin/ksh/history.c,v
> retrieving revision 1.52
> diff -u -p -r1.52 history.c
> --- history.c 1 Nov 2015 15:38:53 -   1.52
> +++ history.c 1 Nov 2015 15:44:02 -
> @@ -507,7 +507,7 @@ sethistsize(int n)
>   cursize = n;
>   }
>  
> - history = (char **)aresize(history, n*sizeof(char *), APERM);
> + history = areallocarray(history, n, sizeof(char *), APERM);

Is this a memory leak? I'm thinking of the IDIOMS section of
realloc(3).



Re: tame(2) nologin(8)

2015-10-04 Thread Mike Burns
On 2015-10-04 01.33.12 +0200, Mike Burns wrote:
> I suspect that the paths argument is unused or not yet ready, but I
> include in here regardless merely so that I can ask about it.

Consolidated feedback from off-list:

The paths argument is not yet to be used. Also, it must be
NULL-terminated.



Re: tame userland diff

2015-10-04 Thread Mike Burns
On 2015-10-04 07.15.47 +0200, Sebastien Marie wrote:
> On Sat, Oct 03, 2015 at 09:52:13PM +0200, Mike Burns wrote:
> > On 2015-10-03 09.53.54 -0600, Theo de Raadt wrote:
> > > 
> > > I don't know why you added "proc".  I don't see a need for it.  Do
> > > you have a seperate test cases that prompts this?
> > 
> > This is because of the system(3) call in bcode.c, the bexec function.

To clarify: this is because system(3) uses one of the fork functions.



Re: tame userland diff

2015-10-03 Thread Mike Burns
Before, from the tame patch in snapshots:

$ dc /dev/null
Killed 
$

After the below patch:

$ dc /dev/null
$

Found via the regress tests.

Index: dc.c
===
RCS file: /cvs/src/usr.bin/dc/dc.c,v
retrieving revision 1.13
diff -u -p -r1.13 dc.c
--- dc.c26 Nov 2014 18:34:51 -  1.13
+++ dc.c3 Oct 2015 15:07:24 -
@@ -47,6 +47,8 @@ main(int argc, char *argv[])
char*buf, *p;
struct stat st;
 
+   if (tame("stdio rpath proc", NULL) == -1)
+   err(1, "tame");
 
if ((buf = strdup("")) == NULL)
err(1, NULL);



Re: tame userland diff

2015-10-03 Thread Mike Burns
On 2015-10-03 09.53.54 -0600, Theo de Raadt wrote:
> > Before, from the tame patch in snapshots:
> > 
> > $ dc /dev/null
> > Killed 
> > $
> > 
> > After the below patch:
> > 
> > $ dc /dev/null
> > $
> > 
> > Found via the regress tests.
> 
> I don't know why you added "proc".  I don't see a need for it.  Do
> you have a seperate test cases that prompts this?

Yes, here is a simple test for it:

$ echo "!echo ECHO" | dc
Killed 
$ echo "!echo ECHO" > t ; dc t
Killed
$ echo $?
137

This is because of the system(3) call in bcode.c, the bexec function.

Index: dc.c
===
RCS file: /cvs/src/usr.bin/dc/dc.c,v
retrieving revision 1.13
diff -u -p -r1.13 dc.c
--- dc.c26 Nov 2014 18:34:51 -  1.13
+++ dc.c3 Oct 2015 19:46:35 -
@@ -47,6 +47,8 @@ main(int argc, char *argv[])
char*buf, *p;
struct stat st;
 
+   if (tame("stdio rpath proc", NULL) == -1)
+   err(1, "tame");
 
if ((buf = strdup("")) == NULL)
err(1, NULL);
@@ -89,6 +91,8 @@ main(int argc, char *argv[])
file = fopen(argv[0], "r");
if (file == NULL)
err(1, "cannot open file %s", argv[0]);
+   if (tame("stdio proc", NULL) == -1)
+   err(1, "tame");
if (fstat(fileno(file), ) == -1)
err(1, "%s", argv[0]);
if (S_ISDIR(st.st_mode))
@@ -103,6 +107,8 @@ main(int argc, char *argv[])
 */
 return (0);
}
+   if (tame("stdio proc", NULL) == -1)
+   err(1, "tame");
src_setstream(, stdin);
reset_bmachine();
eval();



Re: tame userland diff

2015-10-03 Thread Mike Burns
Fix tame(2) for patch(1). To recreate:

/usr/src/regress/usr.bin/diff$ cat t2.1
Below is an example license to be used for new code in OpenBSD,
modeled after the ISC license.

It is important to specify the year of the copyright.  Additional years
should be separated by a comma, e.g.
Copyright (c) 2003, 2004

If you add extra text to the body of the license, be careful not to
add further restrictions.

/*
 * Copyright (c) CCYY YOUR NAME HERE 
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
/usr/src/regress/usr.bin/diff$ cat t2.e.patch
25a
An extra line
.
14d
6c
Copyright (c) 2003, 2004, 2005
.
/usr/src/regress/usr.bin/diff$ patch -sb t2.1 t2.e.patch
zsh: killed patch -sb t2.1 t2.e.patch



Fixed by adding "proc" to the list of valid tame(2) requests. I'm not
happy with this patch -- not sure if I'm just not happy with patch.c, or
if I'm concerned about the `for' loop.

***

Index: patch.c
===
RCS file: /cvs/src/usr.bin/patch/patch.c,v
retrieving revision 1.55
diff -u -p -r1.55 patch.c
--- patch.c 3 Oct 2015 02:35:56 -   1.55
+++ patch.c 3 Oct 2015 20:43:25 -
@@ -147,7 +147,7 @@ main(int argc, char *argv[])
const   char *tmpdir;
char*v;
 
-   if (tame("stdio rpath wpath cpath tmppath fattr", NULL) == -1)
+   if (tame("stdio rpath wpath cpath tmppath fattr proc", NULL) == -1)
perror("tame");
 
setvbuf(stdout, NULL, _IOLBF, 0);
@@ -223,6 +223,10 @@ main(int argc, char *argv[])
do_ed_script();
continue;
}
+
+   if (tame("stdio rpath wpath cpath tmppath fattr", NULL) == -1)
+   perror("tame");
+
/* initialize the patched file */
if (!skip_rest_of_patch)
init_output(TMPOUTNAME);



tame(2) nologin(8)

2015-10-03 Thread Mike Burns
- Use stdio instead of rw because of mprotect(2) in atexit.
- Pass the path to the file that can be opened.
- Switch to return instead of exit(3) in the nearby code.

I suspect that the paths argument is unused or not yet ready, but I
include in here regardless merely so that I can ask about it.

There is one line of code between the initial tame(2) and the
re-tame(2) -- this program has a tiny initialization, essentially. It
reads oddly but again: included so that I can ask about it.


Index: nologin.c
===
RCS file: /cvs/src/sbin/nologin/nologin.c,v
retrieving revision 1.5
diff -u -p -r1.5 nologin.c
--- nologin.c   10 Jul 2003 00:00:58 -  1.5
+++ nologin.c   3 Oct 2015 23:26:44 -
@@ -43,16 +43,24 @@ int main(int argc, char *argv[])
int nfd;
ssize_t nrd;
char nbuf[BUFSIZ];
+   const char  *paths[] = { _PATH_NOLOGIN_TXT };
+
+   if (tame("stdio rpath", paths) == -1)
+   perror("tame");
 
nfd = open(_PATH_NOLOGIN_TXT, O_RDONLY);
+
+   if (tame("stdio", NULL) == -1)
+   perror("tame");
+
if (nfd < 0) {
write(STDOUT_FILENO, DEFAULT_MESG, strlen(DEFAULT_MESG));
-   exit (1);
+   return 1;
}
 
while ((nrd = read(nfd, nbuf, sizeof(nbuf))) != -1 && nrd != 0)
write(STDOUT_FILENO, nbuf, nrd);
close (nfd);
 
-   exit (1);
+   return 1;
 }



Re: tame userland diff

2015-10-03 Thread Mike Burns
I see that I am too late:

http://marc.info/?l=openbsd-cvs=144388023505289=2
http://marc.info/?l=openbsd-cvs=144388037405304=2

On 2015-10-03 22.44.22 +0200, Mike Burns wrote:
> Fix tame(2) for patch(1). To recreate:
> 
> /usr/src/regress/usr.bin/diff$ cat t2.1
> Below is an example license to be used for new code in OpenBSD,
> modeled after the ISC license.
> 
> It is important to specify the year of the copyright.  Additional years
> should be separated by a comma, e.g.
> Copyright (c) 2003, 2004
> 
> If you add extra text to the body of the license, be careful not to
> add further restrictions.
> 
> /*
>  * Copyright (c) CCYY YOUR NAME HERE <u...@your.dom.ain>
>  *
>  * Permission to use, copy, modify, and distribute this software for any
>  * purpose with or without fee is hereby granted, provided that the above
>  * copyright notice and this permission notice appear in all copies.
>  *
>  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
>  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
>  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
>  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
>  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
>  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
>  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>  */
> /usr/src/regress/usr.bin/diff$ cat t2.e.patch
> 25a
> An extra line
> .
> 14d
> 6c
> Copyright (c) 2003, 2004, 2005
> .
> /usr/src/regress/usr.bin/diff$ patch -sb t2.1 t2.e.patch
> zsh: killed patch -sb t2.1 t2.e.patch
> 
> 
> 
> Fixed by adding "proc" to the list of valid tame(2) requests. I'm not
> happy with this patch -- not sure if I'm just not happy with patch.c, or
> if I'm concerned about the `for' loop.
> 
> ***
> 
> Index: patch.c
> ===
> RCS file: /cvs/src/usr.bin/patch/patch.c,v
> retrieving revision 1.55
> diff -u -p -r1.55 patch.c
> --- patch.c   3 Oct 2015 02:35:56 -   1.55
> +++ patch.c   3 Oct 2015 20:43:25 -
> @@ -147,7 +147,7 @@ main(int argc, char *argv[])
>   const   char *tmpdir;
>   char*v;
>  
> - if (tame("stdio rpath wpath cpath tmppath fattr", NULL) == -1)
> + if (tame("stdio rpath wpath cpath tmppath fattr proc", NULL) == -1)
>   perror("tame");
>  
>   setvbuf(stdout, NULL, _IOLBF, 0);
> @@ -223,6 +223,10 @@ main(int argc, char *argv[])
>   do_ed_script();
>   continue;
>   }
> +
> + if (tame("stdio rpath wpath cpath tmppath fattr", NULL) == -1)
> + perror("tame");
> +
>   /* initialize the patched file */
>   if (!skip_rest_of_patch)
>   init_output(TMPOUTNAME);
> 



Re: [Patch] New item to the Migrating to OpenBSD guide

2015-06-29 Thread Mike Burns
On 2015-06-29 09.52.19 +0100, Raf Czlonka wrote:
 That being said, FAQ is *not* an OpenBSD for former Linux users guide,

FAQ 9 is titled Migrating to OpenBSD, four of the five sections have
Linux in the title, and the one section that does not mentions Linux
twice in the first paragraph.

Are you proposing that the whole of FAQ 9 should be scrapped?

-Mike



Re: [Patch] New item to the Migrating to OpenBSD guide

2015-06-28 Thread Mike Burns
On 2015-06-29 00.03.09 +0300, li...@wrant.com wrote:
 And you consider this a service to other Linux long time users? Or a
 way to try push some notion of yours - criticise and try to lobby for
 some other entity's interests.

Do you have a patch that achieves the same goal (that is, the goal he
stated, not the one you're reading into) that is up to your standards?



Re: NTRU Open Source Project / Post-quantum era

2015-05-23 Thread Mike Burns
On 2015-05-23 05.24.30 -0400, ertetlen barmok wrote:
 https://github.com/NTRUOpenSourceProject

https://github.com/NTRUOpenSourceProject/ntru-crypto/blob/master/LICENSE.md

NTRU cryptographic IP and reference software may be used and modified
to the needs of the user as long as the user adheres to version two (2)
or higher of the GPL License

 When will LibreSSL have ciphers for the Post-quantum era? 

When you submit the patch -- with the correct license.



Re: Documentation fix for cwmrc(5)

2015-05-17 Thread Mike Burns
On 2015-05-16 23.49.34 -0500, Kent R. Spillner wrote:
 On Sat, May 16, 2015 at 05:48:24PM -0400, Okan Demirmen wrote:
  Ah, I suspect if you looked at the errors, it would show a syntax
  error with the above. Like the example in the man page, use:
  
  autogroup 4 xterm,UXTerm
  
  and see if that works.

Thanks for pointing that out, Okan; that was indeed the issue. Apologies
for the noise.

 Okan reminded me I had an old diff that fixes this so the quotes are no
 longer necessary.  If you follow -current you can checkout the latest
 xenocara and rebuild cwm to use it.

Thanks for this change, Kent; it works beautifully.

-Mike



Re: Documentation fix for cwmrc(5)

2015-05-16 Thread Mike Burns
On 2015-05-16 16.54.18 -0400, Okan Demirmen wrote:
 On Fri, May 15, 2015 at 3:11 AM, Mike Burns mike+open...@mike-burns.com 
 wrote:
  cwmrc(5) autogroup takes the windowname and windowclass in the opposite
  order than specified in the man page. Fix the man page.
 
 The man page should be accurate; how are you determining that it is wrong?

Perhaps I am misunderstanding the output from xprop(1). I see:

$ xprop | grep CLASS
WM_CLASS(STRING) = xterm, UXTerm

I added the following to my cwmrc(5):

autogroup 4 xterm,UXTerm
autogroup 5 UXTerm,xterm

I then opened a new uxterm, and when I grouponly4 I see nothing, but on
a grouponly5 I see the new uxterm.

Is that what the man page is describing?

 Take the example from cwmrc(5) and try it:
 
  # Autogroup definitions
  autogroup 3 aterm,XTerm
  autogroup 3 xterm,XTerm
 
 The current logic comes from the fact that xprop(1) displays name then
 class. That said, I do want to reverse the logic in cwm(1) along with
 other config format changes, so I prefer to do that all at once.
 
 Please let me know how/why you've come to the below conclusion.

 Thanks.
 
  Index: app/cwm/cwmrc.5
  ===
  RCS file: /cvs/xenocara/app/cwm/cwmrc.5,v
  retrieving revision 1.59
  diff -u -p -r1.59 cwmrc.5
  --- app/cwm/cwmrc.5 25 Aug 2014 12:49:19 -  1.59
  +++ app/cwm/cwmrc.5 15 May 2015 07:08:45 -
  @@ -40,7 +40,7 @@ The following options are accepted:
   .Pp
   .Bl -tag -width Ds -compact
   .It Ic autogroup Ar group windowclass
  -.It Ic autogroup Ar group windowname,windowclass
  +.It Ic autogroup Ar group windowclass,windowname
   Automatically add new windows to
   .Ar group
   if their class property matches
 



Documentation fix for cwmrc(5)

2015-05-15 Thread Mike Burns
This is essentially the opposite of this fix by Holger Mikolon, which
was never merged: http://marc.info/?l=openbsd-techm=127765978812199

cwmrc(5) autogroup takes the windowname and windowclass in the opposite
order than specified in the man page. Fix the man page.

Index: app/cwm/cwmrc.5
===
RCS file: /cvs/xenocara/app/cwm/cwmrc.5,v
retrieving revision 1.59
diff -u -p -r1.59 cwmrc.5
--- app/cwm/cwmrc.5 25 Aug 2014 12:49:19 -  1.59
+++ app/cwm/cwmrc.5 15 May 2015 07:08:45 -
@@ -40,7 +40,7 @@ The following options are accepted:
 .Pp
 .Bl -tag -width Ds -compact
 .It Ic autogroup Ar group windowclass
-.It Ic autogroup Ar group windowname,windowclass
+.It Ic autogroup Ar group windowclass,windowname
 Automatically add new windows to
 .Ar group
 if their class property matches



Re: OpenSMTPD with fewer semicolons

2015-04-06 Thread Mike Burns
On 2015-04-04 18.24.38 -0700, Philip Guenther wrote:
 the original diff is fine and should be applied.

Thanks. Any other OKs/anyone want to apply this?

-Mike



OpenSMTPD with fewer semicolons

2015-04-04 Thread Mike Burns
Running into issues with the extra semicolons in OpenSMTPD's Received
header. I see that these semicolons are now removed in -portable[1]. Any
reason not to get rid of them in base, too?

[1]: https://github.com/OpenSMTPD/OpenSMTPD/pull/520

Index: usr.sbin/smtpd/smtp_session.c
===
RCS file: /cvs/src/usr.sbin/smtpd/smtp_session.c,v
retrieving revision 1.221
diff -u -p -u -r1.221 smtp_session.c
--- usr.sbin/smtpd/smtp_session.c   17 Dec 2014 15:49:23 -  1.221
+++ usr.sbin/smtpd/smtp_session.c   5 Apr 2015 00:11:06 -
@@ -654,12 +654,12 @@ smtp_session_imsg(struct mproc *p, struc
 
fprintf(s-ofile, Received: );
if (! (s-listener-flags  F_MASK_SOURCE)) {
-   fprintf(s-ofile, from %s (%s [%s]);\n\t,
+   fprintf(s-ofile, from %s (%s [%s]),
s-evp.helo,
s-hostname,
ss_to_text(s-ss));
}
-   fprintf(s-ofile, by %s (%s) with %sSMTP%s%s id %08x;\n,
+   fprintf(s-ofile, \n\tby %s (%s) with %sSMTP%s%s id %08x,
s-smtpname,
SMTPD_NAME,
s-flags  SF_EHLO ? E : ,
@@ -670,7 +670,7 @@ smtp_session_imsg(struct mproc *p, struc
if (s-flags  SF_SECURE) {
x = SSL_get_peer_certificate(s-io.ssl);
fprintf(s-ofile,
-   \tTLS version=%s cipher=%s bits=%d verify=%s;\n,
+   \n\tTLS version=%s cipher=%s bits=%d verify=%s,
SSL_get_cipher_version(s-io.ssl),
SSL_get_cipher_name(s-io.ssl),
SSL_get_cipher_bits(s-io.ssl, NULL),
@@ -680,12 +680,12 @@ smtp_session_imsg(struct mproc *p, struc
}
 
if (s-rcptcount == 1) {
-   fprintf(s-ofile, \tfor %s@%s;\n,
+   fprintf(s-ofile, \n\tfor %s@%s,
s-evp.rcpt.user,
s-evp.rcpt.domain);
}
 
-   fprintf(s-ofile, \t%s\n, time_to_text(time(NULL)));
+   fprintf(s-ofile, ;\n\t%s\n, time_to_text(time(NULL)));
 
smtp_enter_state(s, STATE_BODY);
smtp_reply(s, 354 Enter mail, end with \.\



Re: OpenSMTPD with fewer semicolons

2015-04-04 Thread Mike Burns
On 2015-04-04 17.27.47 -0700, Philip Guenther wrote:
 On Sat, Apr 4, 2015 at 5:19 PM, Mike Burns mike+open...@mike-burns.com 
 wrote:
  Running into issues with the extra semicolons in OpenSMTPD's Received
  header. I see that these semicolons are now removed in -portable[1]. Any
  reason not to get rid of them in base, too?
 ...
  -   fprintf(s-ofile, \t%s\n, time_to_text(time(NULL)));
  +   fprintf(s-ofile, ;\n\t%s\n, time_to_text(time(NULL)));
 
 The other removals are correct, but this one is wrong.  A Received:
 header field should have exactly one (unquoted, non-comment)
 semicolon: before the date-time at the end of the line.  To quote
 rfc5321:
 
Stamp  = From-domain By-domain Opt-info [CFWS] ;
   FWS date-time
 
 ...and there are no other explicit semicolons in the syntax.

I agree with your analysis of the grammar, but I believe that is what
the code is doing. That line in question is the one that puts the bare
semicolon before the date-time. The newlines have been re-arranged so
that the semicolon occurs at the end of the line.

Or am I misunderstanding you/the RFC?

-Mike



EDNS0 and getrrsetbyname(3)

2014-10-30 Thread Mike Burns
It is my understanding of the code that ssh(1) no longer supports
DNSSEC. I say this because it calls getrrsetbyname(3) to check the
secure flag, which calls into the ASR machine. In asr.c, the `pass0'
function only parses two options, tcp and ndots:, ignoring edns0.
Indeed, the asr_run(3) man page lists a lack of EDNS0 support as a
caveat.

Until EDNS0 is supported, it would be helpful to change the documentation.

-Mike


Index: lib/libc/net/getrrsetbyname.3
===
RCS file: /cvs/src/lib/libc/net/getrrsetbyname.3,v
retrieving revision 1.19
diff -u -p -u -r1.19 getrrsetbyname.3
--- lib/libc/net/getrrsetbyname.3   23 Aug 2014 07:25:54 -  1.19
+++ lib/libc/net/getrrsetbyname.3   31 Oct 2014 02:00:29 -
@@ -115,10 +115,11 @@ is a pointer to a
 created by a call to
 .Fn getrrsetbyname .
 .Pp
-If the EDNS0 option is activated in
-.Xr resolv.conf 5 ,
+The EDNS0 option in
+.Xr resolv.conf 5
+is currently ignored, which means that
 .Fn getrrsetbyname
-will request DNSSEC authentication using the EDNS0 DNSSEC OK (DO) bit.
+will not request DNSSEC authentication using the EDNS0 DNSSEC OK (DO) bit.
 .Sh RETURN VALUES
 .Fn getrrsetbyname
 returns zero on success, and one of the following error
Index: share/man/man5/resolv.conf.5
===
RCS file: /cvs/src/share/man/man5/resolv.conf.5,v
retrieving revision 1.45
diff -u -p -u -r1.45 resolv.conf.5
--- share/man/man5/resolv.conf.523 Aug 2014 07:25:54 -  1.45
+++ share/man/man5/resolv.conf.531 Oct 2014 02:00:29 -
@@ -281,6 +281,9 @@ particularly if there is a reduced MTU,
 as is often the case with
 .Xr pppoe 4
 or with tunnels.
+.Pp
+This option is ignored on
+.Ox .
 .It Cm inet6
 Enables support for IPv6-only applications, by setting RES_USE_INET6 in
 _res.options (see