Open SCAP Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
Auxilirary functions for probes

Detailed Description

Data Structures

struct  setting_t
 
struct  rglob_t
 
struct  fsdev_t
 Filesystem device structure. More...
 

Macros

#define MTAB_PATH   "/etc/mtab"
 
#define LOCAL_FILESYSTEMS
 
#define FSDEV_H
 

Functions

int find_files (SEXP_t *spath, SEXP_t *sfilename, SEXP_t *behaviors, int(*cb)(const char *, const char *, void *), void *arg)
 Search the filesystem according to the specified path, filename and behaviors. More...
 
fsdev_tfsdev_init (const char **fs, size_t fs_cnt)
 Initialize the fsdev_t structure from an array of filesystem names.
 
fsdev_tfsdev_strinit (const char *fs_names)
 Initialize the fsdev_t structure from a string containing filesystem names.
 
void fsdev_free (fsdev_t *lfs)
 Free the fsdev_t structure.
 
int fsdev_search (fsdev_t *lfs, void *id)
 Search an id in the fsdev_t structure.
 
int fsdev_path (fsdev_t *lfs, const char *path)
 Check whether a path points points to a place on any of the devices in the fsdev_t structure. More...
 
int fsdev_fd (fsdev_t *lfs, int fd)
 Check whether a file descriptor is associated with a file that resides on any of the devices in the fsdev_t structure. More...
 

Macro Definition Documentation

#define LOCAL_FILESYSTEMS
Value:
{ "btrfs", \
"ext2", "ext3", "ext4", \
"ffs", \
"gfs", \
"hpfs", \
"jfs", \
"reiser4", "reiserfs", \
"ufs", \
"xfs", \
"zfs", NULL}

Function Documentation

int find_files ( SEXP_t spath,
SEXP_t sfilename,
SEXP_t behaviors,
int(*)(const char *, const char *, void *)  cb,
void *  arg 
)

Search the filesystem according to the specified path, filename and behaviors.

For all paths and files that satisfy these requirements call the provided callback function.

Parameters
paththe requested path in a sexp form, which may specify the matching operation or a var_ref
filenamthe requested filename in a sexp form, which may specify the matching operation or a var_ref
behaviorsthe behaviors may specify the recursion depth or direction
cbfor each match, the callback function cb is called with first argument being the matched path and the second being the matched filename
argan optional argument to the callback function
int fsdev_fd ( fsdev_t lfs,
int  fd 
)

Check whether a file descriptor is associated with a file that resides on any of the devices in the fsdev_t structure.

Parameters
lfspointer to the fsdev_t structure
fdfile descriptor
Return values
1if found
0otherwise
-1error
int fsdev_path ( fsdev_t lfs,
const char *  path 
)

Check whether a path points points to a place on any of the devices in the fsdev_t structure.

Parameters
lfspointer to the fsdev_t structure
pathpath
Return values
1if found
0otherwise
-1error