---
name: "trick-logopen"
section: "1"
platform: "linux"
package: "libtricks"
version: "0.2-5"
release: "Debian 2.1 (Slink)"
platforms: ["linux"]
url: "https://new.carta.tech/trick-logopen"
---

# trick-logopen(1)

## NAME

trick-logopen

## SYNOPSIS

**trick-logopen** \[ --libpath directory \] \[  --file outputfile \] \[ command \]

**trick-logopen** Generates a report of all open() calls, and writes it to a file.

## DESCRIPTION

By setting the VPATH environment variable appropiratly, and setting LD\_PRELOAD to **[libtricks(1)](/libtricks/1.md)** the mentioned library will create an environment where all open() calls are reported, and logged to a file.

Note that this is not in any way \`safe': statically linked binaries will still be able open files, without libtricks noticing it.

**trick-logopen** Note provides a lot less security than the real (kernel) chroot, but please note that root can easily break out of a real chroot shell too. Neigther this trick-chroot nor the real chroot should be considered \`safe'.

The main purpose of this script is to show an example of how to work with  **[libtricks(1)](/libtricks/1.md) .**

Note btw that, as the dynamic linker (/lib/ld.so-linux) is statically linked, it will search the libraries in the real root, not in this chroot environment. So, you don't have to populate ${CHROOT}/lib.

### OPTIONS

- *--file filename*

  The outputfile to use. Default: trick-open.log (in the directory where **trick-logopen** was started)

- *--libpath path*

  specify the path of the libtrick library. Default: /usr/lib/libtricks/

## BUGS

Using libtricks-0.2, it seems that open() calls from **[less(1)](/less/1.md)** etc are not logged. Will look into that.

## COPYING

**libtricks** is distributed under the GNU General Public License. (GPL 2.0 or greater).

## AUTHOR

joost witteveen \<joostje@debian.org\>

## SEE ALSO

**[trick-chktmp(1)](/trick-chktmp/1.md),** **[trick-chroot(1)](/trick-chroot/1.md),** **[fakeroot(1)](/fakeroot/1.md)** **/usr/doc/libtricks/README**
