Browse Source

fl_wrapper: implemented handle_fileat_access_before()

user/amery/test/random-cleanup
Alejandro Mery 14 years ago
committed by Alejandro Mery
parent
commit
fb8d353242
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      src/tools-source/fl_wrapper/fl_wrapper.c

+ 20
- 0
src/tools-source/fl_wrapper/fl_wrapper.c

@ -60,6 +60,7 @@ static void check_write_access(const char * , const char * );
#endif
static void handle_file_access_before(const char *, const char *, struct status_t *);
static void handle_file_access_after(const char *, const char *, struct status_t *);
static void handle_fileat_access_before(const char *, int, const char *, struct status_t *);
char filterdir[PATH_MAX], wlog[PATH_MAX], rlog[PATH_MAX], *cmdname = "unkown";
@ -245,6 +246,25 @@ static void handle_file_access_before(const char * func, const char * file,
LOG("end of handle_file_access_before(\"%s\", \"%s\", xxx)", func, file);
}
static void handle_fileat_access_before(const char * func, int dirfd, const char * file,
struct status_t * status)
{
struct stat st;
#if DEBUG != 1
(void) func;
#endif
LOG("begin of handle_fileat_access_before(\"%s\", &d, \"%s\", xxx)", func, dirfd, file);
if ( fstatat(dirfd, file, &st, AT_SYMLINK_NOFOLLOW) ) {
status->inode=0; status->size=0;
status->mtime=0; status->ctime=0;
} else {
status->inode=st.st_ino; status->size=st.st_size;
status->mtime=st.st_mtime; status->ctime=st.st_ctime;
}
LOG("end of handle_fileat_access_before(\"%s\", \"%s\", xxx)", func, file);
}
/* sort of, private realpath, mostly not readlink() */
static void sort_of_realpath (const char *file, char *absfile)
{

Loading…
Cancel
Save