Commit Graph

114 Commits

Author SHA1 Message Date
Denys Vlasenko
b63256e69b Whitespace cleanups. no code changes.
* bjm.c: Fix tabulation (such as extra spaces before tabs),
convert punctuation where it deviates from prevalent form
elsewhere in strace code, convert sizeof and offsetof where
it deviates from from prevalent form, remove space between
function/macro/array names and (parameters) or [index],
add space between "if" and (condition), correct non-standard
or wrong indentaion.
* defs.h: Likewise
* desc.c: Likewise
* file.c: Likewise
* ipc.c: Likewise
* linux/arm/syscallent.h: Likewise
* linux/avr32/syscallent.h: Likewise
* linux/hppa/syscallent.h: Likewise
* linux/i386/syscallent.h: Likewise
* linux/ioctlsort.c: Likewise
* linux/m68k/syscallent.h: Likewise
* linux/microblaze/syscallent.h: Likewise
* linux/powerpc/syscallent.h: Likewise
* linux/s390/syscallent.h: Likewise
* linux/s390x/syscallent.h: Likewise
* linux/sh/syscallent.h: Likewise
* linux/sh64/syscallent.h: Likewise
* linux/tile/syscallent.h: Likewise
* linux/x86_64/syscallent.h: Likewise
* mem.c: Likewise
* net.c: Likewise
* pathtrace.c: Likewise
* process.c: Likewise
* signal.c: Likewise
* sock.c: Likewise
* strace.c: Likewise
* stream.c: Likewise
* sunos4/syscall.h: Likewise
* sunos4/syscallent.h: Likewise
* svr4/syscall.h: Likewise
* svr4/syscallent.h: Likewise
* syscall.c: Likewise
* system.c: Likewise
* test/childthread.c: Likewise
* test/leaderkill.c: Likewise
* test/skodic.c: Likewise
* time.c: Likewise
* util.c: Likewise

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-06-07 12:13:24 +02:00
3138213bc9 Fix decoding of file descriptors
* defs.h (printfd): New function prototype.
* util.c (printfd): New function.
* file.c (print_dirfd): Update prototype to use printfd().
(sys_openat, sys_faccessat, sys_newfstatat, sys_mkdirat, sys_linkat,
sys_unlinkat, sys_readlinkat, sys_renameat, sys_fchownat, sys_fchmodat,
sys_futimesat, sys_utimensat, sys_mknodat): Update use of print_dirfd().
(sys_lseek, sys_llseek, sys_readahead, sys_ftruncate, sys_ftruncate64,
sys_fstat, sys_fstat64, sys_oldfstat, sys_fstatfs, sys_fstatfs64,
sys_fchdir, sys_fchroot, sys_linkat, sys_fchown, sys_fchmod, sys_fsync,
sys_readdir, sys_getdents, sys_getdirentries, sys_fsetxattr,
sys_fgetxattr, sys_flistxattr, sys_fremovexattr, sys_fadvise64,
sys_fadvise64_64, sys_inotify_add_watch, sys_inotify_rm_watch,
sys_fallocate): Use printfd() for decoding of file descriptors.
* desc.c (sys_fcntl, sys_flock, sys_close, sys_dup, do_dup2,
decode_select, sys_epoll_ctl, epoll_wait_common): Use printfd() for
decoding of file descriptors.
* io.c (sys_read, sys_write, sys_readv, sys_writev, sys_pread,
sys_pwrite, sys_sendfile, sys_sendfile64, sys_pread64, sys_pwrite64,
sys_ioctl): Likewise.
* mem.c (print_mmap, sys_mmap64): Likewise.
* signal.c (do_signalfd): Likewise.
* stream.c (decode_poll): Likewise.
* time.c (sys_timerfd_settime, sys_timerfd_gettime): Likewise.
Based on patch from Grant Edwards <grant.b.edwards@gmail.com>.
2011-03-04 02:08:02 +00:00
Sebastian Pipping
1e1405a4ac Fix decoding of inotify_init1() flags
* file.c (inotify_init_flags): New xlat structure.
(sys_inotify_init1): Use it instead of open_mode_flags.
2011-03-03 17:33:25 +00:00
d475c06134 Fix struct xlat initialization bugs
* file.c (inotify_modes): Terminate with NULL entry.
* net.c (sock_type_flags): Make this array static.
(socketlayers): Add a comment that this array should remain not
NULL-terminated.
2011-03-03 01:02:41 +00:00
e9a06b7ad4 sparc: fix compilation warning
* file.c [!HAVE_LONG_LONG_OFF_T] (realprintstat): Cast st_size
to unsigned long.
2011-02-23 16:16:50 +00:00
Andreas Schwab
d69fa497f4 Add biarch support for powerpc64
* acinclude.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Use int instead of
long.
* configure.ac [$host_cpu = powerpc*]: Also define POWERPC64 if
$host_cpu = powerpc64.
* defs.h (SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE)
(PERSONALITY1_WORDSIZE) [POWERPC64]: Define.
* file.c: (struct stat_powerpc32, printstat_powerpc32) [POWERPC64]:
Define.
(printstat) [LINUX && POWERPC64]: Use printstat_powerpc32 in
32-bit personality.
(sys_newfstatat) [POWERPC64]: Handle personalities.
* signal.c (sys_sigreturn) [POWERPC64]: Likewise.
* util.c (printllval) [POWERPC64]: Likewise.
(printcall) [POWERPC64]: Use wider format for IP prefix.
* syscall.c (get_scno) [POWERPC64]: Check for 64/32 bit mode.
* linux/powerpc/errnoent1.h: New file.
* linux/powerpc/ioctlent1.h: New file.
* linux/powerpc/signalent1.h: New file.
* linux/powerpc/syscallent1.h: New file.
2010-07-13 19:13:03 +02:00
Mark Wielaard
bab8940674 Hook up inotify_init1 open mode flags printer
* file.c [LINUX] (sys_inotify_init1): New function.
* linux/syscall.h: Declare new sys_inotify_init1 handler.
* linux/bfin/syscallent.h: Hook up new handler.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
2010-03-23 01:14:03 +00:00
Bernhard Reutner-Fischer
9906e6da8b Fix handling of Linux systems without struct statfs64
* acinclude.m4 (AC_STATFS64): New macro to check for struct statfs64.
* configure.ac: Call AC_STATFS64.
* file.c (printstatfs64, sys_statfs64, sys_fstatfs64): Compile only
  if struct statfs64 is available.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-06 21:01:28 +00:00
Andreas Schwab
b5600fc3df Factor out printing of 64bit syscall argument
* defs.h (ALIGN64): Remove.
(printllval): Declare.
* util.c (printllval): Define.
* file.c (sys_readahead): Use printllval.
(sys_lseek64): Likewise.
(sys_truncate64): Likewise.
(sys_ftruncate64): Likewise.
(sys_fadvise64): Likewise.
(sys_fadvise64_64): Likewise.
(sys_fallocate): Likewise.
* io.c (sys_pread): Likewise.
(sys_pwrite): Likewise.
(sys_pread64): Likewise.
(sys_pwrite64): Likewise.
* mem.c (sys_mmap64): Likewise.
2009-11-04 17:10:25 +01:00
Andreas Schwab
d45f0a66c1 Correct decoding of readahead and fadvice64(_64) on PowerPC
* file.c (sys_readahead): Align 64bit argument.  Handle PowerPC64
like other 64bit architectures.
(sys_fadvise64): Likewise.
(sys_fadvise64_64): Handle PowerPC like ARM.
* linux/powerpc/syscallent.h (sys_readahead): Account for 64bit
argument alignment on PowerPC32.
2009-11-03 16:14:29 +01:00
ff896f7e0f * file.c (printstat64): Cleanup trailing whitespace. 2009-10-21 13:44:04 +00:00
Andreas Schwab
61b7435ca1 Fix decoding of newfstatat syscall on x86-64
* file.c (printstat64) [LINUX && X68_64]: If tracing a 64-bit
process redirect to printstat.
Fixes RH#529316 "Field values shown for "newfstatat" system
call are incorrect"
2009-10-16 11:37:13 +02:00
Mike Frysinger
229738ce4e Avoid malloc(0) in getdents parsers
On end of directory, getdents returns 0.  This return value is used to
then try and do malloc(0), but on some systems this will always return
NULL.  Since the code won't read the pointer in question if len is 0,
then don't bother calling malloc(0) and set the pointer to NULL ourself.
* file.c (sys_getdents, sys_getdents64): Avoid malloc(0) call.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-08 14:08:57 +00:00
Kirill A. Shutemov
896db21e6d Fix fadvise64 decoding on ARM
* file.c (sys_fadvise64_64) [ARM]: Fix argument ordering.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2009-09-19 00:42:51 +00:00
4bcd5ef922 * bjm.c (sys_query_module): Fix format warning reported by
gcc -Wformat-security.
* file.c (tprint_open_modes): Likewise.
* process.c (printargv): Likewise.
* signal.c (printsignal): Likewise.
2009-06-01 10:32:27 +00:00
Denys Vlasenko
4e718b5ea2 * strace.c (printstatsol, printstat_sparc64):
Remove NULL and error check for addr parameter.
(printoldstat, printstat, printoldstat64):
Move NULL and error check for addr parameter
so that it happens before printstatsol/printstat_sparc64 calls.
2009-04-20 18:30:13 +00:00
Denys Vlasenko
e740fd31d2 * file.c (print_dirfd): Use int for file descriptor, not a long.
* process.c (printwaitn): Use int for PID, not a long.
2009-04-16 12:06:16 +00:00
Denys Vlasenko
1d632468c0 * signal.c: Whitespace, comment, and style fixes, no code changes.
* file.c: Ditto.
* time.c: Ditto.
* process.c: Ditto.
* resource.c: Ditto.
2009-04-14 12:51:00 +00:00
Denys Vlasenko
eedaac768d Decode fcntl's F_{GET,SET}LEASE, F_NOTIFY, and F_DUPFD_CLOEXEC.
By Mike Frysinger (vapier AT gentoo.org)
* desc.c: Add F_SETLEASE, F_GETLEASE, F_NOTIFY,
F_DUPFD_CLOEXEC to fcntlcmds[]. Create notifyflags[] array.
(sys_fcntl): Handle new flags.

Optimize printing of open modes.
* defs.h: Declare sprint_open_modes(),
remove unused parameter in tprint_open_modes().
* desc.c (sprint_open_modes): Move fuction definition from here...
* file.c (sprint_open_modes): To here.
(tprint_open_modes): Use sprint_open_modes(), it already
generates needed string.
* ipc.c: Remove unused parameter from calls
to tprint_open_modes().
2009-03-10 20:41:58 +00:00
Denys Vlasenko
5ae2b7c601 AVR32 support by Hans-Christian Egtvedt
(hans-christian.egtvedt AT atmel.com).
* configure.ac: Make it recognize avr32.
* defs.h: Define LINUX_AVR32.
* linux/avr32/syscallent.h: New file.
* Makefile.am: Reference linux/avr32/syscallent.h.
* proc.c (change_syscall, setarg): Add support for avr32.
(struct xlat struct_user_offsets[]): Ditto.
* syscall.c (get_scno): Ditto.
(get_error, force_result, syscall_enter): Ditto.
* util.c (getpc, printcall): Ditto.
2009-02-27 20:32:52 +00:00
Denys Vlasenko
adedb51019 Fixing many instances of broken indentation with spaces instead of tabs.
No code changes.
2008-12-30 18:47:55 +00:00
Roland McGrath
c531e571fe 2008-07-31 Roland McGrath <roland@redhat.com>
* file.c [LINUX] (struct kernel_dirent): Define it locally,
	do not use <linux/dirent.h>.
	Fixes RH#457291.
2008-08-01 01:13:10 +00:00
Roland McGrath
96a9661df6 2008-05-19 Roland McGrath <roland@redhat.com>
* file.c (sys_fallocate): New function.
	* linux/syscall.h: Declare it.
	* linux/syscallent.h: Update entry.
	From Kyle McMartin <kyle@mcmartin.ca>.
2008-05-20 04:56:18 +00:00
Roland McGrath
542c2c6fe2 2007-08-26 Daniel Jacobowitz <dan@codesourcery.com>
* defs.h [MIPS]: Include <sgidefs.h>.
	(MAX_QUALS): Update for MIPS.
	(LINUX_MIPSO32, LINUX_MIPSN32, LINUX_MIPSN64, LINUX_MIPS64): Define.
	(struct tcb): Add ext_arg for MIPS N32.
	(TCB_WAITEXECVE): Define for MIPS.
	(ALIGN64): Use LINUX_MIPSO32.
	* file.c (sys_lseek): Use ext_arg for MIPS N32.
	(sys_readahead, sys_fadvise64_64): Likewise.
	* io.c (sys_pread64, sys_pwrite64): Likewise.
	* mem.c (print_mmap): Take OFFSET argument.
	(sys_old_mmap): Update call to print_mmap.
	(sys_mmap): Use ext_arg for MIPS N32.
	* process.c (struct_user_offsets): Add MIPS registers.
	* signal.c (sys_sigreturn): Handle MIPS N32 and MIPS N64.  Correct
	MIPS O32 call to sprintsigmask.
	* syscall.c (internal_syscall): Handle MIPS N32.  Check for
	TCB_WAITEXECVE on MIPS.
	(force_result): Add a comment about MIPS N32.
	(syscall_enter): Handle MIPS N32 and MIPS N64.
	* linux/syscall.h (sys_pread64, sys_pwrite64): Declare.
	* linux/mips/syscallent.h: Include "dummy.h".  Handle alternate
	MIPS ABIs.
2008-05-20 01:11:56 +00:00
153fbd69d2 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* file.c [_LFS64_LARGEFILE] (sys_getdents64): Do the same
	d_reclen check as in sys_getdents: warn if d_reclen is 0 rather
	than looping forever.
	[FREEBSD] (sys_getdirentries): Likewise.
	Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-04-19 23:49:58 +00:00
b838b1e0b9 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* file.c [LINUXSPARC] (printstatsol): Fix sprinttime()
	invocation.  The sprinttime() function takes a time_t argument,
	but timestruct_t argument was given.
	Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-04-19 23:47:47 +00:00
dc7715baad 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* file.c (sprinttime): Check localtime() return value, to avoid
	potential NULL dereference due to invalid time structures.
	Signed-off-by: Harald van Dijk <truedfx@gentoo.org>
	Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-04-19 23:45:09 +00:00
Roland McGrath
e6d0f71e6a 2007-08-06 Jan Kratochvil <jan.kratochvil@redhat.com>
* file.c [!HAVE_STAT64 && LINUX && X86_64] (struct stat64): Define it.
	[!HAVE_STAT64 && LINUX && X86_64] (HAVE_STAT64, STAT64_SIZE): Define.
	[HAVE_STAT64] (printstat64) [STAT64_SIZE]: Add compile-time assertion.
	Fixes RH#222275.
2007-08-07 01:22:49 +00:00
Roland McGrath
c7bd4d321d 2007-08-05 Jan Kratochvil <jan.kratochvil@redhat.com>
* file.c (printstat64): Test [HAVE_LONG_LONG] for st_size printing
	and cast to widest type available.
2007-08-07 01:05:19 +00:00
Roland McGrath
71d3d663ca 2007-08-03 Ulrich Drepper <drepper@redhat.com>
* file.c (open_mode_flags): Add O_CLOEXEC.
	* net.c (msg_flags): Add MSG_CMSG_CLOEXEC.
2007-08-07 01:00:26 +00:00
Roland McGrath
6afc5659ac 2007-07-23 Ulrich Drepper <drepper@redhat.com>
* defs.h: Add new parameter to printtv_bitness prototype.
	(printttv): Pass zero for the new parameter.
	(printtv_special): New macro.
	* desc.c (decode_select): Pass zero for the new parameter of
	printtv_bitness.
	* file.c (utimensatflags): New macro.
	(sys_osf_utimes): Pass zero for the new parameter of
	printtv_bitness.
	(sys_utimes): Likewise.
	(sys_futimesat): Likewise.
	(decode_utimes): Add new parameter.  Pass it to the
	printtv_bitness calls.  Fix printing of time values.
	(sys_utimensat): New function.
	* time.c (UTIME_NOW, UTIME_OMIT): Define if not already
	happened.
	(printtv_bitness): Add new parameter.  Print special UTIME_*
	values as strings if set.
	(sys_osf_gettimeofday): Pass zero for the new parameter of
	printtv_bitness.
	(sys_osf_settimeofday): Likewise.
	* linux/syscall.h: Declare sys_utimensat.
	* linux/syscallent.h: Add utimensat entry.
	* linux/x86_64/syscallent.h: Likewise.
2007-07-24 01:57:11 +00:00
Roland McGrath
7e9817c1bf 2007-07-05 Roland McGrath <roland@redhat.com>
* file.c (sys_utime): Use personality_wordsize to handle biarch.
	Fixes RH#247185.
2007-07-05 20:31:58 +00:00
Roland McGrath
359c8ed57c 2007-03-21 Andreas Schwab <schwab@suse.de>
* file.c (sys_newfstatat): Don't use printstat64 on ppc64.
2007-07-05 19:01:17 +00:00
9b5b67eb43 2007-01-11 Dmitry V. Levin <ldv@altlinux.org>
Fix open(2) flags parser.
	* defs.h (tprint_open_modes): New function.
	* desc.c (sprint_open_modes): New function.
	(sys_fcntl): Use tprint_open_modes() and sprint_open_modes().
	* file.c (openmodes): Split xlat into open_access_modes and
	open_mode_flags.
	(tprint_open_modes): New function.
	(decode_open): Use it.
	* ipc.c (sys_mq_open, printmqattr): Likewise.
	Fixes RH#222385.
2007-01-11 23:19:55 +00:00
a7945a3d4e 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>
Add biarch support for "struct timeval".
	* defs.h (bitness_t): New enum type.
	(printtv_bitness, sprinttv): New function prototypes.
	(printtv): Convert to macro wrapper around printtv_bitness().
	(printtv32): Remove.
	* desc.c (decode_select): Use printtv_bitness() and sprinttv().
	(sys_oldselect, sys_osf_select, sys_select, sys_pselect6):
	Update decode_select() use.
	* file.c [ALPHA] (sys_osf_utimes): Use printtv_bitness().
	* time.c (printtv_bitness, sprinttv): New functions.
	(printtv, printtv32): Remove.
	[ALPHA] (sys_osf_settimeofday, sys_osf_settimeofday):
	Use printtv_bitness().
	Fixes RH#171626, RH#173050.
2006-12-13 17:10:11 +00:00
b9fe011cdf 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>
Make several global variables static.
	#ifdef definitions of rarely unused functions.
	* defs.h (rflag, tflag, outfname): Remove.
	* strace.c (iflag, interactive, pflag_seen, rflag, tflag,
	outfname, username): Make static.
	* desc.c (sys_getdtablesize): Define only for
	ALPHA || FREEBSD || SUNOS4.
	* file.c (sys_fchroot): Define only for SUNOS4 || SVR4.
	(sys_mkfifo): Define only for FREEBSD.
	* mem.c (sys_sbrk): Define only for FREEBSD || SUNOS4.
	(sys_getpagesize): Define only for
	ALPHA || FREEBSD || IA64 || SUNOS4 || SVR4.
	* net.c (sys_so_socket): Define only for SVR4.
	* process.c (sys_gethostid): Define only for
	FREEBSD || SUNOS4 || SVR4.
	(sys_gethostname): Define only for
	ALPHA || FREEBSD || SUNOS4 || SVR4.
	(sys_setpgrp): Define only for ALPHA || SUNOS4 || SVR4.
	(sys_execv): Define only for SPARC || SPARC64 || SUNOS4.
	* signal.c (sys_sigblock): Define only for FREEBSD || SUNOS4.
	(sys_sighold, sys_sigwait): Define only for SVR4.
	(sys_killpg): Define only for FREEBSD || SUNOS4.
	* stream.c (sys_getmsg): Define only for
	SPARC || SPARC64 || SUNOS4 || SVR4.
	* syscall.c (sys_indir): Define only for SUNOS4.
2006-12-13 16:59:44 +00:00
1f336e59aa 2006-10-14 Dmitry V. Levin <ldv@altlinux.org>
* configure.ac(AC_CHECK_HEADERS): Add inttypes.h.
	* file.c [_LFS64_LARGEFILE && (LINUX || SVR4)]:
	Include <inttypes.h>.
	(sys_getdents64): Use PRIu64/PRId64 to avoid gcc warnings on
	64-bit platforms.
2006-10-14 20:20:46 +00:00
95ebf5abfc 2006-10-13 Ulrich Drepper <drepper@redhat.com>
Bernhard Kaindl <bk@suse.de>
	    Dmitry V. Levin  <ldv@altlinux.org>
	    Michael Holzheu <holzheu@de.ibm.com>

	Add hooks for new syscalls.  Add decoders for *at, inotify*,
	pselect6, ppoll and unshare syscalls.

	* defs.h: Declare print_sigset.
	* desc.c (sys_pselect6): New function.
	* file.c (decode_open, decode_access, decode_mkdir,
	decode_readlink, decode_chmod, decode_utimes, decode_mknod):
	New functions.
	(sys_open, sys_access, sys_mkdir, sys_readlink, sys_chmod,
	sys_utimes, sys_mknod): Use them.
	[LINUX] (fstatatflags, unlinkatflags, inotify_modes): New
	variables.
	[LINUX] (print_dirfd, sys_openat, sys_faccessat,
	sys_newfstatat, sys_mkdirat, sys_linkat, sys_unlinkat,
	sys_symlinkat, sys_readlinkat, sys_renameat, sys_fchownat,
	sys_fchmodat, sys_futimesat, sys_mknodat, sys_inotify_add_watch,
	sys_inotify_rm_watch): New functions.
	* process.c [LINUX] (sys_unshare): New function.
	* signal.c (print_sigset): New function.
	(sys_sigprocmask): Use it.
	* stream.c (decode_poll): New function.
	(sys_poll): Use it.
	[LINUX] (sys_ppoll): New function.
	* linux/syscall.h: Delcare new syscall handlers.
	* linux/syscallent.h: Hook up new syscalls.
	* linux/alpha/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	Fixes RH#178633.
2006-10-13 20:25:12 +00:00
504eb0b9c6 2006-09-01 Dmitry V. Levin <ldv@altlinux.org>
* file.c (print_xattr_val): Fix memory corruption bug reported
	by James Antill.
	Fixes RH#200621.
2006-10-11 22:58:31 +00:00
Roland McGrath
a4d4853f67 2005-06-08 Dmitry V. Levin <ldv@altlinux.org>
Minor namespace cleanup.
	* defs.h (string_quote): Remove declaration.
	* file.c (openmodessol) [LINUXSPARC]: Make static.
	(fileflags): Likewise.
	(aclcmds, aclipc) [HAVE_SYS_ACL_H]: Likewise.
	(direnttypes) [FREEBSD || LINUX]: Likewise.
	(xattrflags): Likewise.
	* process.c (unalignctl_string): Make static.
	(setarg): Disable.
	* syscall.c (subcalls_table): Make static.
	(socket_map) [!(LINUX && (ALPHA || MIPS))]: Likewise.
	(sparc_socket_decode): Make static, define for [SPARC || SPARC64] only.
	(decode_subcall): Make static.
	(syscall_fixup): Likewise.
	(get_error): Likewise.
	(syscall_enter): Likewise.
	* util.c (tv_tv): Disable.
	(getpc): Likewise.
	(string_quote): Make static.
	Fixes RH#159688.
2005-06-08 20:45:28 +00:00
Roland McGrath
0873843a24 2005-06-02 Roland McGrath <roland@redhat.com>
* file.c (printstatfs64): Cast values to unsigned long long and use
	%llu formats.
	Fixes RH#158243.
2005-06-03 02:40:39 +00:00
Roland McGrath
aa524c88c4 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
Deal with memory management issues.
	* defs.h (tprint_iov): Update prototype.
	* desc.c (sys_epoll_wait) [HAVE_SYS_EPOLL_H]: Do not allocate
	epoll_event array of arbitrary size on the stack, to avoid
	stack overflow.
	* file.c (print_xattr_val): Check for integer overflow during
	malloc size calculation, to avoid heap corruption.
	* io.c (tprint_iov) [HAVE_SYS_UIO_H]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	Change iovec array handling to avoid heap memory allocation.
	* mem.c (get_nodes) [LINUX]: Check for integer overflow during
	size calculation and do not allocate array of arbitrary size on
	the stack, to avoid stack overflow.
	* net.c (printcmsghdr) [HAVE_SENDMSG]: Do not allocate array of
	arbitrary size on the stack, to avoid stack overflow.  Do not
	trust cmsg.cmsg_len to avoid read beyond the end of allocated
	object.
	(printmsghdr) [HAVE_SENDMSG]: Update tprint_iov() usage.
	* process.c (sys_setgroups): Check for integer overflow during
	malloc size calculation, to avoid heap corruption.  Change gid_t
	array handling to avoid heap memory allocation.
	(sys_getgroups): Likewise.
	(sys_setgroups32) [LINUX]: Likewise.
	(sys_getgroups32) [LINUX]: Likewise.
	* stream.c (sys_poll) [HAVE_SYS_POLL_H]: Check for integer
	overflow during malloc size calculation, to avoid heap corruption.
	Change pollfd array handling to avoid heap memory allocation.
	* system.c (sys_sysctl) [LINUX]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	* util.c (dumpiov) [HAVE_SYS_UIO_H]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	Fixes RH#159196.
2005-06-01 19:22:06 +00:00
Roland McGrath
b2dee13345 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
* util.c (printxval): Change third argument from "char *" to
	"const char *".
	(printflags): Add third argument, "const char *", with similar
	meaning to the third argument of printxval().
	* defs.h (printxval): Change third argument from "char *" to
	"const char *".
	(printflags): Add third argument.
	* bjm.c (sys_query_module) [LINUX]: Pass third argument to
	printflags().
	* desc.c (sys_fcntl): Likewise.
	(sys_flock) [LOCK_SH]: Likewise.
	(print_epoll_event) [HAVE_SYS_EPOLL_H]: Likewise.
	* file.c (sys_open): Likewise.
	(solaris_open) [LINUXSPARC]: Likewise.
	(sys_access): Likewise.
	(sys_chflags, sys_fchflags) [FREEBSD]: Likewise.
	(realprintstat) [HAVE_LONG_LONG_OFF_T &&
	HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
	(printstat64) [HAVE_STAT64 &&
	HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
	(sys_setxattr, sys_fsetxattr): Likewise.
	* ipc.c (sys_msgget, sys_msgsnd, sys_msgrcv, sys_semget,
	sys_shmget, sys_shmat) [LINUX || SUNOS4 || FREEBSD]: Likewise.
	(sys_mq_open) [LINUX]: Likewise.
	(printmqattr) [HAVE_MQUEUE_H]: Likewise.
	* mem.c (print_mmap) [!HAVE_LONG_LONG_OFF_T]: Likewise.
	(sys_mmap64) [_LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T]: Likewise.
	(sys_mprotect): Likewise.
	(sys_mremap, sys_madvise, sys_mlockall) [LINUX]: Likewise.
	(sys_msync) [MS_ASYNC]: Likewise.
	(sys_mctl) [MC_SYNC]: Likewise.
	(sys_remap_file_pages, sys_mbind, sys_get_mempolicy) [LINUX]:
	Likewise.
	* net.c (printmsghdr) [HAVE_STRUCT_MSGHDR_MSG_CONTROL]: Likewise.
	(sys_send, sys_sendto): Likewise.
	(sys_sendmsg) [HAVE_SENDMSG]: Likewise.
	(sys_recv, sys_recvfrom): Likewise.
	(sys_recvmsg) [HAVE_SENDMSG]: Likewise.
	(printicmpfilter) [ICMP_FILTER]: Likewise.
	* proc.c (proc_ioctl) [SVR4 && !HAVE_MP_PROCFS || FREEBSD]: Likewise.
	* process.c (sys_clone) [LINUX]: Likewise.
	(printwaitn): Likewise.
	(sys_waitid) [SVR4 || LINUX]: Likewise.
	* signal.c (sys_sigvec) [SUNOS4 || FREEBSD]: Likewise.
	(sys_sigaction): Likewise.
	(printcontext) [SVR4]: Likewise.
	(print_stack_t) [LINUX) || FREEBSD]: Likewise.
	(sys_rt_sigaction) [LINUX]: Likewise.
	* sock.c (sock_ioctl) [LINUX]: Likewise.
	* stream.c (sys_putmsg, sys_getmsg): Likewise.
	(sys_putpmsg) [SYS_putpmsg]: Likewise.
	(sys_getpmsg) [SYS_getpmsg]: Likewise.
	(sys_poll): Likewise.
	(print_transport_message) [TI_BIND]: Likewise.
	(stream_ioctl): Likewise.
	* system.c (sys_mount, sys_reboot): Likewise.
	(sys_cacheflush) [LINUX && M68K]: Likewise.
	(sys_capget, sys_capset) [SYS_capget]: Likewise.
	* term.c (term_ioctl) [TIOCMGET]: Likewise.
	* time.c (sys_clock_nanosleep, sys_timer_settime) [LINUX]:
	Likewise.
	Fixes RH#159310.
2005-06-01 19:02:36 +00:00
Roland McGrath
46100d0725 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
* bjm.c (sys_query_module) [LINUX]: Unitize "out of memory"
	errors reporting style.
	* strace.c (rebuild_pollv) [USE_PROCFS]: Likewise.
	* system.c (sys_capget, sys_capset) [SYS_capget]: Likewise.
	* util.c (printstr): Likewise.
	(dumpiov) [HAVE_SYS_UIO_H]: Likewise.
	(fixvfork) [SUNOS4]: Likewise.
	* desc.c (decode_select): Continue to decode syscall arguments
	in case of OOM condition.
	* file.c (sys_getdents): Likewise.
	(sys_getdents64) [_LFS64_LARGEFILE]: Likewise.
	(sys_getdirentries) [FREEBSD]: Likewise.
	* mem.c (sys_mincore): Changed type of variables which deal with
	malloc size from int to unsigned long.
	Fixes RH#159308.
2005-06-01 18:55:42 +00:00
Roland McGrath
1025c3ed7f 2005-04-25 Anton Blanchard <anton@samba.org>
* file.c (openmodes): Add O_NOATIME flag if defined.
2005-05-09 07:40:35 +00:00
Roland McGrath
f774642aa4 2005-03-01 Roland McGrath <roland@redhat.com>
* file.c (print_xattr_val): Add a cast.
2005-03-01 23:02:32 +00:00
Roland McGrath
663a8a065c 2005-02-04 Roland McGrath <roland@redhat.com>
* file.c (O_LARGEFILE): Omit when #undef'd because it was zero.
2005-02-04 09:49:56 +00:00
Roland McGrath
fee836eb65 2005-02-02 Roland McGrath <roland@redhat.com>
* file.c (openmodes) [O_LARGEFILE] [O_LARGEFILE == 0]: Redefine to
	known values for Linux.
2005-02-02 22:11:32 +00:00
Roland McGrath
883567c1cc 2005-02-01 Roland McGrath <roland@redhat.com>
* file.c (print_xattr_val): Don't use auto array sized by syscall
	argument.  Use malloc instead, so it can fail for insane values.
	Fixes Debian bug #283704.
2005-02-02 03:38:32 +00:00
Roland McGrath
e27ed3426d 2004-10-19 Roland McGrath <roland@redhat.com>
* file.c (sys_fadvise64): Conditionalize just on [LINUX].
2004-10-20 02:24:19 +00:00