Mike Frysinger 0cf04b6595 Fix decoding of sysctl() when oldval fields are NULL
If you call glibc's syscall wrapper like so:
	static int name[] = { CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE };
	int buffer[2] = { 32768, 61000 };
	size_t size = sizeof(buffer);
	sysctl(name, 3, 0, 0, buffer, size);
(note that oldval/oldlenp are NULL).

The current strace code complains like so:
_sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, process_vm_readv: Bad address
(nil), 0, 0x7fffe23c3960, 8}) = -1 EACCES (Permission denied)

Since passing NULL for the old values is valid, handle that explicitly.
This also simplifies the code a bit by splitting up the handling of the
new and old args so that we only handle the new args once.

Now the output looks like:
_sysctl({{CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE, 38}, 3, NULL, 0, 0x7fff8c0c91b0, 8) = -1 EACCES (Permission denied)

* system.c (sys_sysctl): Check if info.oldval is NULL first.  Move the
processing of oldlen/info.newval/info.newlen out so they always get
executed.  Fix the format strings so we use %lu for unsigned long rather
than a mix of %ld and %lu.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-02-09 01:39:43 +00:00
2012-05-02 12:34:56 +00:00
2011-03-14 15:32:38 +00:00
2012-05-01 21:51:38 +00:00
2012-04-16 18:16:13 +02:00
2009-07-08 21:01:21 +00:00
2012-05-01 21:51:38 +00:00
2012-02-25 15:29:21 +01:00
2012-04-18 15:27:25 +00:00
2012-12-15 14:13:05 +00:00
2013-02-05 19:07:41 +00:00
2012-05-02 23:00:34 +00:00
2012-10-26 23:43:13 +00:00
2013-02-05 17:48:33 +01:00
2012-10-26 23:43:13 +00:00
2012-02-25 15:29:21 +01:00
2012-10-26 22:45:08 +00:00
2013-02-06 13:18:42 +01:00
2012-05-02 12:34:56 +00:00
2012-05-01 21:17:51 +00:00

This is strace, a system call tracer for Linux.

strace is released under a Berkeley-style license at the request
of Paul Kranenburg; see the file COPYRIGHT for details.

See the file CREDITS for a list of authors and other contributors.

See the file INSTALL for compilation and installation instructions.

See the file NEWS for information on what has changed in recent
versions.

You can get the latest version of strace from its homepage at
http://sourceforge.net/projects/strace/ .

Please send bug reports and enhancements to the strace
mailinglist at strace-devel@lists.sourceforge.net.
Description
No description provided
Readme 17 MiB
Languages
C 92.2%
Shell 3.4%
M4 1.4%
Makefile 0.8%
Roff 0.7%
Other 1.5%