Re: ukbd(4): support apple brightness keys

2020-10-29 Thread Klemens Nanni
On Wed, Oct 28, 2020 at 12:08:25AM +0100, Tobias Heider wrote:
> > What about KS_Cmd_BrightnessUp and KS_Cmd_BrightnessDown?
> 
> Right, here's a new diff using those wskbd commands.
> I couldn't find any standardized UHID key codes for brightness keys
> so I chose 232 and 233 which are currently unused and in the RESERVED range.
> 
> I also included the regenerated ukbdmap.c in the diff below for convenience.
Looks good to me and works in combination with your ofw_machdep diff.

OK kn



Re: macppc: fix initial wsconsctl display.brighness

2020-10-29 Thread Klemens Nanni
On Wed, Oct 28, 2020 at 09:06:39PM +0100, Tobias Heider wrote:
> Hi,
> 
> playing around with the display brightness i found that the
> initial state seems to be broken.
> We initiate the value at MAX_BRIGHTNESS while in reality it is much
> lower than that after boot.
> Increasing the brightness won't work after
> booting because wscons thinks we are at 100%, while decreasing the
> brightness in wsconsctl actually makes the display brighter...
> 
> The diff below fixes the problem by setting a sane default during
> initialization.
Yes, this fixes what I reported after testing (the other diff?).

OK kn



Re: [PATCH] Fix link in Porting Guide

2020-10-29 Thread Ingo Schwarze
Hi Martin,

Martin Vahlensieck wrote on Wed, Oct 28, 2020 at 09:02:21PM +0100:

> This refers to the libc function.

Committed, thanks.

> P.S.: I noticed that e.g. sysmerge(8) is mentioned like this but not a
> link. Is this intentional?

Probably not, i added a few more links while there.

Yours,
  Ingo


> Index: faq/ports/guide.html
> ===
> RCS file: /cvs/www/faq/ports/guide.html,v
> retrieving revision 1.91
> diff -u -p -r1.91 guide.html
> --- faq/ports/guide.html  15 Jul 2020 21:52:04 -  1.91
> +++ faq/ports/guide.html  28 Oct 2020 20:01:21 -
> @@ -1320,7 +1320,7 @@ Another very common problem is the   Heed the warnings of the bsd linker about its uses.
>  These must be fixed.
>  This is not quite as simple as s/mktemp/mkstemp/g.
> -Refer to https://man.openbsd.org/mktemp;>mktemp(3) for more
> +Refer to https://man.openbsd.org/mktemp.3;>mktemp(3) for more
>  information.
>  Correct code using mkstemp includes the source to
>  ed or mail.



Re: snmpd(8) Remove old listen on syntax

2020-10-29 Thread Theo de Raadt
ok deraadt

Martijn van Duren  wrote:

> 6.8 has been released. Time to remove the old syntax.
> 
> OK?
> 
> martijn@
> 
> ? dispatcher_tm_udp.c
> Index: parse.y
> ===
> RCS file: /cvs/src/usr.sbin/snmpd/parse.y,v
> retrieving revision 1.61
> diff -u -p -r1.61 parse.y
> --- parse.y   10 Sep 2020 17:54:47 -  1.61
> +++ parse.y   29 Oct 2020 15:14:24 -
> @@ -130,7 +130,7 @@ typedef struct {
>  %token NUMBER
>  %type  hostcmn
>  %type  srcaddr port
> -%type  optwrite yesno seclevel proto
> +%type  optwrite yesno seclevel
>  %typeobjtype cmd
>  %type oid hostoid trapoid
>  %typeauth
> @@ -279,7 +279,7 @@ main  : LISTEN ON listenproto
>  
>  listenproto  : UDP listen_udp
>   | TCP listen_tcp
> - | listen_empty
> + | listen_udp
>  
>  listen_udp   : STRING port   {
>   struct sockaddr_storage ss[16];
> @@ -335,34 +335,6 @@ listen_tcp   : STRING port   {
>   }
>   }
>  
> -/* Remove after deprecation period and replace with listen_udp */
> -listen_empty : STRING port proto {
> - struct sockaddr_storage ss[16];
> - int nhosts, i;
> -
> - nhosts = host($1, $2, $3, ss, nitems(ss));
> - if (nhosts < 1) {
> - yyerror("invalid address: %s", $1);
> - free($1);
> - if ($2 != snmpd_port)
> - free($2);
> - YYERROR;
> - }
> - if (nhosts > (int)nitems(ss))
> - log_warn("%s:%s resolves to more than %zu 
> hosts",
> - $1, $2, nitems(ss));
> -
> - free($1);
> - if ($2 != snmpd_port)
> - free($2);
> - for (i = 0; i < nhosts; i++) {
> - if (listen_add(&(ss[i]), $3) == -1) {
> - yyerror("calloc");
> - YYERROR;
> - }
> - }
> - }
> -
>  port : /* empty */   {
>   $$ = snmpd_port;
>   }
> @@ -385,21 +357,6 @@ port : /* empty */   {
>   YYERROR;
>   }
>   $$ = number;
> - }
> - ;
> -
> -proto: /* empty */   {
> - $$ = SOCK_DGRAM;
> - }
> - | UDP   {
> - log_warnx("udp as last keyword on listen on line is "
> - "deprecated");
> - $$ = SOCK_DGRAM;
> - }
> - | TCP   {
> - log_warnx("tcp as last keyword on listen on line is "
> - "deprecated");
> - $$ = SOCK_STREAM;
>   }
>   ;
>  
> 



snmpd(8) Remove old listen on syntax

2020-10-29 Thread Martijn van Duren
6.8 has been released. Time to remove the old syntax.

OK?

martijn@

? dispatcher_tm_udp.c
Index: parse.y
===
RCS file: /cvs/src/usr.sbin/snmpd/parse.y,v
retrieving revision 1.61
diff -u -p -r1.61 parse.y
--- parse.y 10 Sep 2020 17:54:47 -  1.61
+++ parse.y 29 Oct 2020 15:14:24 -
@@ -130,7 +130,7 @@ typedef struct {
 %token   NUMBER
 %typehostcmn
 %typesrcaddr port
-%typeoptwrite yesno seclevel proto
+%typeoptwrite yesno seclevel
 %type  objtype cmd
 %type   oid hostoid trapoid
 %type  auth
@@ -279,7 +279,7 @@ main: LISTEN ON listenproto
 
 listenproto: UDP listen_udp
| TCP listen_tcp
-   | listen_empty
+   | listen_udp
 
 listen_udp : STRING port   {
struct sockaddr_storage ss[16];
@@ -335,34 +335,6 @@ listen_tcp : STRING port   {
}
}
 
-/* Remove after deprecation period and replace with listen_udp */
-listen_empty   : STRING port proto {
-   struct sockaddr_storage ss[16];
-   int nhosts, i;
-
-   nhosts = host($1, $2, $3, ss, nitems(ss));
-   if (nhosts < 1) {
-   yyerror("invalid address: %s", $1);
-   free($1);
-   if ($2 != snmpd_port)
-   free($2);
-   YYERROR;
-   }
-   if (nhosts > (int)nitems(ss))
-   log_warn("%s:%s resolves to more than %zu 
hosts",
-   $1, $2, nitems(ss));
-
-   free($1);
-   if ($2 != snmpd_port)
-   free($2);
-   for (i = 0; i < nhosts; i++) {
-   if (listen_add(&(ss[i]), $3) == -1) {
-   yyerror("calloc");
-   YYERROR;
-   }
-   }
-   }
-
 port   : /* empty */   {
$$ = snmpd_port;
}
@@ -385,21 +357,6 @@ port   : /* empty */   {
YYERROR;
}
$$ = number;
-   }
-   ;
-
-proto  : /* empty */   {
-   $$ = SOCK_DGRAM;
-   }
-   | UDP   {
-   log_warnx("udp as last keyword on listen on line is "
-   "deprecated");
-   $$ = SOCK_DGRAM;
-   }
-   | TCP   {
-   log_warnx("tcp as last keyword on listen on line is "
-   "deprecated");
-   $$ = SOCK_STREAM;
}
;
 



relayd(8) remove snmp keyword

2020-10-29 Thread Martijn van Duren
6.8 is out in the wild. I guess this is as good a time as any to remove
the old snmp keyword.

OK?

martijn@

Index: parse.y
===
RCS file: /cvs/src/usr.sbin/relayd/parse.y,v
retrieving revision 1.248
diff -u -p -r1.248 parse.y
--- parse.y 26 Oct 2020 16:52:06 -  1.248
+++ parse.y 29 Oct 2020 14:49:54 -
@@ -175,15 +175,15 @@ typedef struct {
 %token LOOKUP METHOD MODE NAT NO DESTINATION NODELAY NOTHING ON PARENT PATH
 %token PFTAG PORT PREFORK PRIORITY PROTO QUERYSTR REAL REDIRECT RELAY REMOVE
 %token REQUEST RESPONSE RETRY QUICK RETURN ROUNDROBIN ROUTE SACK SCRIPT SEND
-%token SESSION SNMP SOCKET SPLICE SSL STICKYADDR STYLE TABLE TAG TAGGED TCP
-%token TIMEOUT TLS TO ROUTER RTLABEL TRANSPARENT TRAP URL WITH TTL RTABLE
+%token SESSION SOCKET SPLICE SSL STICKYADDR STYLE TABLE TAG TAGGED TCP
+%token TIMEOUT TLS TO ROUTER RTLABEL TRANSPARENT URL WITH TTL RTABLE
 %token MATCH PARAMS RANDOM LEASTSTATES SRCHASH KEY CERTIFICATE PASSWORD ECDHE
 %token EDH TICKETS CONNECTION CONNECTIONS CONTEXT ERRORS STATE CHANGES CHECKS
 %token WEBSOCKETS
 %token   STRING
 %token   NUMBER
-%typecontext hostname interface table value optstring path
-%typehttp_type loglevel quick trap
+%typecontext hostname interface table value path
+%typehttp_type loglevel quick
 %typedstmode flag forwardmode retry
 %typeopttls opttlsclient
 %typeredirect_proto relay_proto match
@@ -457,23 +457,6 @@ main   : INTERVAL NUMBER   {
AGENTX_MASTER_PATH,
sizeof(conf->sc_conf.agentx_path));
}
-   | SNMP trap optstring   {
-   log_warnx("The snmp keyword is deprecated, please use 
agentx");
-   conf->sc_conf.flags |= F_AGENTX;
-   if ($3) {
-   if (strlcpy(conf->sc_conf.agentx_path,
-   $3, sizeof(conf->sc_conf.agentx_path)) >=
-   sizeof(conf->sc_conf.agentx_path)) {
-   yyerror("agentx path truncated");
-   free($3);
-   YYERROR;
-   }
-   free($3);
-   } else
-   (void)strlcpy(conf->sc_conf.agentx_path,
-   "/var/run/agentx.sock",
-   sizeof(conf->sc_conf.agentx_path));
-   }
| SOCKET STRING {
conf->sc_ps->ps_csock.cs_name = $2;
}
@@ -485,9 +468,6 @@ path: /* nothing */ { $$ = NULL; }
 context: /* nothing */ { $$ = NULL; }
| CONTEXT STRING{ $$ = $2; }
 
-trap   : /* nothing */ { $$ = 0; }
-   | TRAP  { $$ = 1; }
-
 loglevel   : STATE CHANGES { $$ = RELAYD_OPT_LOGUPDATE; }
| HOST CHECKS   { $$ = RELAYD_OPT_LOGHOSTCHECK; }
| CONNECTION{ $$ = (RELAYD_OPT_LOGCON |
@@ -2371,10 +2351,6 @@ optnl: '\n' optnl
 
 nl : '\n' optnl
;
-
-optstring  : STRING{ $$ = $1; }
-   | /* nothing */ { $$ = NULL; }
-   ;
 %%
 
 struct keywords {
@@ -2499,7 +2475,6 @@ lookup(char *s)
{ "send",   SEND },
{ "session",SESSION },
{ "set",SET },
-   { "snmp",   SNMP },
{ "socket", SOCKET },
{ "source-hash",SRCHASH },
{ "splice", SPLICE },
@@ -2516,7 +2491,6 @@ lookup(char *s)
{ "tls",TLS },
{ "to", TO },
{ "transparent",TRANSPARENT },
-   { "trap",   TRAP },
{ "ttl",TTL },
{ "url",URL },
{ "value",  VALUE },