Skip to content

fumiyas/linux-statfs-faker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Preloadable library to fake Linux statfs(2) information

What's this?

This is a $LD_PRELOAD-able library and a wrapper script to run a command with the special statfs(2) function for faking the type of filesystems.

Use case

How to build

Required packages: autoconf, automake, libtool, make, cc (gcc or misc)

$ sh autogen.sh
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

Usage

Run a command with $LD_PRELOAD-able library:

$ /usr/local/bin/statfs-faker
Usage: /usr/local/bin/statfs-faker [OPTIONS] COMMAND [ARGUMENT ...]

Options:
 -t, --type TYPE
    Specify the fake type value (f_type) of filesystem
    (See statfs(2) manual page for valid f_type values)
$ stat -f / |grep Type:
    ID: fe0000000000 Namelen: 255     Type: xfs
$ /usr/local/bin/statfs-faker -t 0xEF53 stat -f / |grep Type:
    ID: fe0000000000 Namelen: 255     Type: ext2/ext3
$ /usr/local/bin/statfs-faker -t 0x9123683E stat -f / |grep Type:
    ID: fe0000000000 Namelen: 255     Type: btrfs

About

Preloadable library to fake Linux statfs(2) information

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published