Re: CVS commit: src/doc

2017-01-01 Thread Kamil Rytarowski
On 02.01.2017 04:44, David Holland wrote:
> On Sat, Dec 31, 2016 at 08:57:16PM +, Kamil Rytarowski wrote:
>  > Update TODO.ptrace
>  > 
>  > Mark exect(3) for removal, there is no use-case for it. exec() is already
>  > monitored and emits SIGTRAP when traced.
> 
> Historically exect() is used by debuggers to start debuggees. While
> it's equivalent to using PT_TRACE_ME followed by execve(), I think the
> result is that the new process first stops immediately after the exec
> finishes so that the debugger doesn't have to worry about stepping
> through the exec call in its own code.
> 
> This doesn't mean it shouldn't go away (or as much away as it can,
> that is, to COMPAT_70) but I'm not convinced there's no case for it.
> 

So, can I change exect(3) to something like:

int
exect(const char *path, char *const argv[], char *const envp[])
{
if (ptrace(PT_TRACE_ME, 0, NULL, 0) == -1)
return -1;
return execve(path, argv, envp);
}

The current implementation of exect(3) (at least philosophically)
predates SIGTRAP on exec().

Personally, I have no opinion neither preference on it either way.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/doc

2017-01-01 Thread David Holland
On Sat, Dec 31, 2016 at 08:57:16PM +, Kamil Rytarowski wrote:
 > Update TODO.ptrace
 > 
 > Mark exect(3) for removal, there is no use-case for it. exec() is already
 > monitored and emits SIGTRAP when traced.

Historically exect() is used by debuggers to start debuggees. While
it's equivalent to using PT_TRACE_ME followed by execve(), I think the
result is that the new process first stops immediately after the exec
finishes so that the debugger doesn't have to worry about stepping
through the exec call in its own code.

This doesn't mean it shouldn't go away (or as much away as it can,
that is, to COMPAT_70) but I'm not convinced there's no case for it.

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/netinet

2017-01-01 Thread bch
On 1/1/17, Christos Zoulas  wrote:
> Module Name:  src
> Committed By: christos
> Date: Mon Jan  2 01:18:42 UTC 2017
>
> Modified Files:
>   src/sys/netinet: tcp.h tcp_input.c tcp_output.c tcp_subr.c
>
> Log Message:
> Fix TCP signature code:
> 1. pack options more tightly instead of being generous with no/op
> 2. put TCP_SIGNATURE option before SACK
> 3. fix computation of options length, by deferring it
> XXX: Really we should move the options setting code in one place instead
> of having two copies one for input and one for output.
> XXX: tcp_optlen/tcp_hdrsiz need to be fixed; they were wrong before too.
>

New build failure:


[...]
--- tcp_output.o ---
/usr/src/sys/netinet/tcp_output.c: In function 'tcp_output':
/usr/src/sys/netinet/tcp_output.c:1298:4: error: label 'reset' used
but not defined
goto reset;
^
*** [tcp_output.o] Error code 1
[...]




> To generate a diff of this commit:
> cvs rdiff -u -r1.31 -r1.32 src/sys/netinet/tcp.h
> cvs rdiff -u -r1.351 -r1.352 src/sys/netinet/tcp_input.c
> cvs rdiff -u -r1.187 -r1.188 src/sys/netinet/tcp_output.c
> cvs rdiff -u -r1.268 -r1.269 src/sys/netinet/tcp_subr.c
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>
>