Re: [PATCH]: Fix unclear man page of acpidump(8)

2020-11-22 Thread Jason McIntyre
On Sun, Nov 22, 2020 at 05:24:56PM +0100, Emil Engler wrote:
> The man page of acpidump(8) says that "kern.allowkmem" must be set to 
> some value in order for the program to work properly. However it does 
> not define to what value it must be set. I am not certainly sure if 
> there are other options between 0 and 1 but if so the man page should be 
> fixed anyway with these options IMO.
> 
> Cheers,
> Emil
> 
> Index: usr.sbin/acpidump/acpidump.8
> ===
> RCS file: /cvs/src/usr.sbin/acpidump/acpidump.8,v
> retrieving revision 1.18
> diff -u -p -u -p -r1.18 acpidump.8
> --- usr.sbin/acpidump/acpidump.81 Jun 2017 12:26:14 -   1.18
> +++ usr.sbin/acpidump/acpidump.822 Nov 2020 16:21:01 -
> @@ -68,8 +68,9 @@ $ iasl -d ..
>   .Nm
>   requires the ability to open
>   .Pa /dev/kmem
> -which may be restricted based upon the value of the
> +which requires
>   .Ar kern.allowkmem
> +to be set to 1 by
>   .Xr sysctl 8 .
>   .Pp
>   .Nm
> 

hi.

there should definitely be a comma before "which". i'll fix that.

except for that, i think i prefer the text as it is now. if you play
about with sysctl, it should be fairly obvious how to set values.

nowhere does it say that
> "kern.allowkmem" must be set to 
> some value in order for the program to work properly.

it says that it requires access to /dev/mem. and then refers to the
place where you can check what the current settings are.

i think it is clear enough.

jmc



[PATCH]: Return 505 when receiving a HTTP/0.9 request

2020-11-22 Thread Emil Engler
The HTTP/1.1 specification says that we MUST implement HTTP/0.9 which we 
don't do. We also fail to provide the correct error message if we 
receive such a request. Here is a patch which will return a 505 error 
instead of a 400 error if we receive no HTTP version which is the 
indicator that this is an HTTP/0.9 request.


Cheers,
Emil

Index: usr.sbin/httpd/server_http.c
===
RCS file: /cvs/src/usr.sbin/httpd/server_http.c,v
retrieving revision 1.142
diff -u -p -u -p -r1.142 server_http.c
--- usr.sbin/httpd/server_http.c29 Oct 2020 12:30:52 - 
1.142

+++ usr.sbin/httpd/server_http.c22 Nov 2020 16:42:18 -
@@ -313,7 +313,7 @@ server_read_http(struct bufferevent *bev

desc->http_version = strchr(desc->http_path, ' ');
if (desc->http_version == NULL) {
-   server_abort_http(clt, 400, "malformed");
+   server_abort_http(clt, 505, "HTTP 
Version Not Supported");

goto abort;
}



[PATCH]: Fix unclear man page of acpidump(8)

2020-11-22 Thread Emil Engler
The man page of acpidump(8) says that "kern.allowkmem" must be set to 
some value in order for the program to work properly. However it does 
not define to what value it must be set. I am not certainly sure if 
there are other options between 0 and 1 but if so the man page should be 
fixed anyway with these options IMO.


Cheers,
Emil

Index: usr.sbin/acpidump/acpidump.8
===
RCS file: /cvs/src/usr.sbin/acpidump/acpidump.8,v
retrieving revision 1.18
diff -u -p -u -p -r1.18 acpidump.8
--- usr.sbin/acpidump/acpidump.81 Jun 2017 12:26:14 -   1.18
+++ usr.sbin/acpidump/acpidump.822 Nov 2020 16:21:01 -
@@ -68,8 +68,9 @@ $ iasl -d ..
 .Nm
 requires the ability to open
 .Pa /dev/kmem
-which may be restricted based upon the value of the
+which requires
 .Ar kern.allowkmem
+to be set to 1 by
 .Xr sysctl 8 .
 .Pp
 .Nm



Re: nm(1): fix error message typo

2020-11-22 Thread Jonathan Gray
On Fri, Nov 20, 2020 at 12:08:55PM -0500, Kris Katterjohn wrote:
> I spotted a little typo in an nm(1) error message.
> 
> Kris Katterjohn
> 

thanks, committed

> 
> Index: elf.c
> ===
> RCS file: /cvs/src/usr.bin/nm/elf.c,v
> retrieving revision 1.37
> diff -u -p -r1.37 elf.c
> --- elf.c 14 Dec 2018 19:56:02 -  1.37
> +++ elf.c 20 Nov 2020 16:55:30 -
> @@ -518,7 +518,7 @@ elf_symload(const char *name, FILE *fp, 
>   }
>  
>   if ((shstr = malloc(shstrsize)) == NULL) {
> - warn("%s: malloc shsrt", name);
> + warn("%s: malloc shstr", name);
>   return (1);
>   }
>  
> 
>